Hello all, I'm fairly new to developing ontologies and implementing them in knowledge graphs which is why I'm coming here to look for answers!
I've been developing an ontology and knowledge graph in Neo4j but a few questions have arisen and I would love to get some input from others as to how they've implemented their own ontologies. I have 4 broad questions, hopefully some people have insight into any or all of them!
A bit of background with regards to the project I'm building. It's an application where users can learn more about genomic science and see how different concepts and resources are connected.
#1 I'm choosing to create the ontology in Neo4j because I believe CYPHER is much more powerful for querying graph data structures (which RDF ontologies basically are) than SPARQL. I am also building the knowledge graph in Neo4j as well, so I figured if I could implement both the ontology and the knowledge graph in a single database that would ease development and make the system more powerful in general. Have other people followed a similar method of integration? Or would you recommend just keeping the ontology in OWL/RDF and implementing the knowledge graph in Neo4j?
#2 For those who actually have implemented ontologies in Neo4j I'm curious about the specifics of your implementation. I have been following a blog post written by Jesús Barrasa to guide my ontology development. The methodology in this post seems to make sense to me since it follows a classic RDF style where each RDF predicate is represented as a node. However, this doesn't seem to translate well if you're importing other ontologies into Neo4j through neosemantics since neosemantics imports predicates as relationships. Is the model in Jesús's blog post outdated, or is there still value in keeping that structure?
#3 How would you get around nested properties in ontologies? I was trying to import an ontology that had the following structure:
{
"@context": {
"schema": "http://schema.org/",
"dcterms": "http://purl.org/dc/terms/",
"ex": "http://example.org/"
},
"@id": "ex:node1",
"@type": "schema:Thing",
"schema:name": "Example Node",
"ex:textSnippet": {
"@type": "schema:Text",
"schema:text": "This is a sample text snippet.",
"dcterms:source": "https://example.org/source"
}
}
In the above case we see that an entity had a text snippet as a property, and that text snippet had a source associated to it. Since Neo4j doesn't allow nested properties, what have people done to get around this problem? My current solution is to simply express textSnippets as separate nodes, but maybe people have come up with more creative solutions?
#4 Fourth and final problem which is similar to problem #3 is how have people dealt with properties that use the same keys. For example:
{
"@context": {
"schema": "http://schema.org/",
"dcterms": "http://purl.org/dc/terms/",
},
"@id": "ex:node1",
"@type": "schema:Thing",
"schema:name": "Example Node",
"dcterms:source":"http://example1.com",
"dcterms:source":"http://example2.com"
}
In the above example there are two dcterms:source
keys which point to different values. I've considered using arrays to store them. However, when using neosemantics to import ontologies it seems to import the first instance of a key value pair, and not include and subsequent ones. In the case of the above example it would only bring in "dcterms:source":http://example1.com"
.
I know this is a lot of questions but I hope to get some answers! Also, if anyone has ontologies they have developed in Neo4j I would love to take a peak at how they work, and hopefully I can draw inspiration while developing my own ontology and knowledge graph!
All the best,
Mako!