JAVA集中营Java技术控

Neo4j基础(详细)

2019-05-31  本文已影响0人  柳清檀

web界面基本操作

针对Neo4j的第三方软件

图数据库实例仿照练习(反欺诈)

  1. 创建3个联系人和三个账号
  2. 创建一个地址,将三个联系人关联到一个地址
  3. 创建两个电话号,将三个联系人针对两个电话号进行关联
  4. 创建两个SSN(社区安全账号),与三个联系人进行关联
  5. 三个账号各自申请信用卡或者无抵押借款
  6. 进行实体关联分析:查找共享多个合法联系信息的账户持有人,并计算可能的金融风险
    下面是实现的结果,具体代码附在结尾处了


    image.png

    然后针对这个模型进行一些实体联系的分析

  7. 分析共享多个合法联系信息的账户持有人


    image.png
    image.png
    image.png
  8. 计算可能的金融风险


    image.png
    image.png
    image.png
    image.png
create
(accountOwner1:AccountOwner{FirstName:"Sylvia",LastName:"Song",UniqueID:"SylviaSong"}),
(accountOwner2:AccountOwner{FirstName:"Angle",LastName:"Hao",UniqueID:"AngleHao"}),
(accountOwner3:AccountOwner{FirstName:"Jacky",LastName:"Song",UniqueID:"JackySong"}),
(address1:Address{Street:"123 NW1st Street",City:"Beijing"}),
(accountOwner1)-[:HAS_ADDRESS]->(address1),
(accountOwner2)-[:HAS_ADDRESS]->(address1),
(accountOwner3)-[:HAS_ADDRESS]->(address1),
(phoneNumber1:PhoneNumber{PhoneNumber:"111-111-11111"}),
(phoneNumber2:PhoneNumber{PhoneNumber:"222-222-22222"})
                                <-[:HAS_PHONENUMBER]-(accountOwner3),
(accountOwner1)-[:HAS_PHONENUMBER]->(phoneNumber1),
(accountOwner2)-[:HAS_PHONENUMBER]->(phoneNumber1),
(SSN1:SSN{SSN:"241-23-1234"}),
(accountOwner2)-[:HAS_SSN]->(SSN1),
(accountOwner3)-[:HAS_SSN]->(SSN1),
(SSN2:SSN{SSN:"241-23-5678"}),
(accountOwner1)-[:HAS_SSN]->(SSN2),
(creditCard1:CreditCard{AccountNumber:"1234567890123456",
                        Limit:5000,
                        Balance:1442.23,
                        ExpirarionDate:"01-20",
                        SecurityCode:"123"})<-[:HAS_CREDITCARD]-(accountOwner1),
(creditCard2:CreditCard{AccountNumber:"1234567890123456",
                        Limit:4000,
                        Balance:2345.56,
                        ExpirarionDate:"02-20",
                        SecurityCode:"456"})<-[:HAS_CREDITCARD]-(accountOwner2),
(bankAccount1:BankAccount{AccountNumber:"2345678901234567",
                          Balance:7054.43})<-[:HAS_BANKACCOUNT]-(accountOwner1),
(bankAccount2:BankAccount{AccountNumber:"3456789012345678",
                          Balance:4231.12})<-[:HAS_BANKACCOUNT]-(accountOwner2),
(bankAccount3:BankAccount{AccountNumber:"4567890123456789",
                          Balance:12345.45})<-[:HAS_BANKACCOUNT]-(accountOwner3),
(unsecuredLoan1:UnsecuredLoan{AccountNumber:"4567890123456789-0",
                              Balance:9045.53,
                              APR:.0541,
                             LoanAmount:12000.00})<-[:HAS_UNSECUREDLOAN]-(accountOwner2),
(unsecuredLoan2:UnsecuredLoan{AccountNumber:"5678901234567890-0",
                              Balance:16341.95,
                              APR:.0341,
                              LoanAmount:22000.00})<-[:HAS_UNSECUREDLOAN]-(accountOwner3)
上一篇下一篇

猜你喜欢

热点阅读