Reputation: 9
I have a pretty specific question relating to anyone who has built an ontology and brought it into Neo4j:
I am building an ontology and knowledge graph for a web application and wanting to store both of them in Neo4j for ease of use on the user end.
I am working on making the relationships in my ontology with object properties, however, I realized that many of my object properties can be reused. For example, let's say I have Class A, Class B, Class C, and Class D. Class A relates to Class C with an object property called "informs", and Class B relates to Class D also with an "informs" object property.
Class A
-informs-> Class C
,
Class B
-informs-> Class D
,
In OWL you are not allowed to map object properties on the class level i.e. you can only make a general object property and define its DOMAIN and RANGE. Thus, in my example, the "informs" object property would have a DOMAIN of Class A and Class B, and a RANGE of Class C and Class D. However, I'm running into the problem where I would like it so the "informs" object property has the aforementioned relationships but Class A does NOT inform Class D and similarly Class B does NOT inform Class C which is not possible to represent with regular object properties.
Class A
-informs-> Class C
,
Class B
-informs-> Class D
,
Class A
-does NOT inform-> Class D
,
Class B
-does NOT inform-> Class C
,
Now to the actual question. My current ontology gets around this issue by using a subClass axiom with existential restrictions where you would map the relationships as such:
Class A subClassOf "informs" some Class C,
Class B subClassOf "informs" some Class D,
This allows the "informs" relationship to be used multiple times, however, it effectively changes the relationship from an object property to a subclassof and because of this, when I bring it into Neo4j it does NOT get represented as a node with a DOMAIN and RANGE but rather an edge between class nodes. Does anyone know of a way to make these relationships representable as classic object property nodes with a DOMAIN and RANGE? The other alternative I looked into is to create sub object properties where you would have a general "informs" object property and you would have two sub properties like "AinformsC" and "BinformsD" such that:
Class A
-AinformsC-> Class C
,
Class B
-BinformsD-> Class D
,
this would allow for the more classic representation in Neo4j, but it would also mean we have to make specific relationships between each and every class which feels redundant if we have already made general form object properties. Furthermore, I'm not sure what method is preferred among other ontologies and thus, if we went with the second method and wanted to import an ontology that followed the first method, I'm not sure how well they would interact.
Anyways, sorry for the long question, hopefully some of you or someone has some insight into how to move forward, any advice is much appreciated!!
Upvotes: 0
Views: 32