How to source statments with neoj4 graph database?

130 views Asked by At

I'm looking forward to use NeoJ4 for some researchs. However I have to check if it can do what I want first.

I would like to build a graph that says :

StatementID1 = Cannabidiol hasPositiveEffectOn ChronicPain
    StatementID1 isSupportedBy Study1
    StatementID1 isSupportedBy Study2
    StatementID1 isNotSupportedBy Study3

This is easy to add key:Value properties to a relationship in NeoJ4.

The difficulty is that I want Study1,2,3 to be nodes. So that these can have them own set of properties.

This can be done in a triplestore where each triple has an ID like "Statment1" here. This is a matter of adding triples where the object is another triple ID.

url:TripleID1 = url:Cannabidiol url:hasPositiveEffectOn url:ChronicPain
url:TripleID2 = url:TripleID1 url:isSupportedBy url:Study1
url:TripleID3 = url:TripleID1 url:isSupportedBy url:Study2
url:TripleID4 = url:TripleID1 url:isNotSupportedBy url:Study3

For the moment I can't find how to do it simplely in NeoJ4.

I could add the DOI of the study as a property :

Study 1 :
    DOI:123/123

Then add the same DOI in the link :

isSupportedBy:
    DOI:123/123

Since the DOI is unique it could be possible to make some searchs. However this will make things much more complex.

Is there a simpler method to achieve that?

2

There are 2 answers

4
rickhg12hs On

I suppose this is a database design issue.

Would a node/relationship model something like the following fit your data and make your queries easy?

Graph Database Model

0
cygri On

Neo4j doesn’t support edges going from an edge to a node. Edges are always between nodes. So you’ll have to convert your positiveEffect edge to a node (as proposed in rickhg12hs’s answer) or model the positiveEffect as a non-edge (as you yourself proposed).