Showing results for 
Search instead for 
Did you mean: 

neo4j inference

Node Link

Hi Folks, currently, I want to use the ontology function of the NEO4j. According to the tutorials,   I can use this to do reasoning. 

MATCH (cat:LCSHTopic { authoritativeLabel: "Crystallography"}) CALL n10s.inference.nodesInCategory(cat, { inCatRel: "HAS_SUBJECT", subCatRel: "NARROWER_THAN"}) yield node return node.title as work;


But in my case, there are two paths of reaching the entity I want. Red color is the ontology, blue color is the instances. How do I inference with from 'Pressing' in red color to PressToolFunction in blue color?



The tutorials from the internet only show one path in the ontology side. But in my case, I have two paths in the onlogy side, how do I do this? My following code doesn't work. 

call n10s.graphconfig.init({ handleVocabUris: "IGNORE", classLabel: "Concept", subClassOfRel: "SCO"});

MATCH (x:Concept { name: "Pressing"})

CALL n10s.inference.nodesInCategory(x, { inCatRel: "InstanceCapability", subCatRel: "SCO" ,"SCO_RESTRICTION"}) yield node AS capability

WITH capability, d MATCH (capability)-[:isTheCapabilityOf]->(dev:Devices)




Besides, when I firstly define the relationship in ontology, all of the relationship will be called either 'SCO' or 'SCO_RESTRICTION', is there any specific command to choose part of the relationship? For example, I only want to choose the 'SCO_RESTRICTION‘ with the 'onPropertyName' hasInputCapability