Storing and retrieving ontologies
Ontologies are being stored by using rest APIs defined in Ontology store service, which itself uses Neo4j Neosemantics plugin based solution. For storing ontologies Ontology store requires only
- The ontology id
- The content uploaded as a text(multipart/form-data)
- The format (
Turtle
orRDF+XML
)
to be provided by client.
Challenge:
The Neo4j Neosemantics doesn't provide any built in support for identifying new stored ontologies.
Solution:
- Begin a
transaction
- Read all
individuals
from provided content. - Add
ontologyId
temporary data property to providedindividuals
- Add imported
ontology
node - Add
belongsToOntology
relation betweenontology
node and providedindividuals
by usingontologyId
property - Remove
ontologyId
property - Commit the
transaction
Challenge: The Neo4j Neosemantics doesn't provide any built in support for importing ontologies directly from text/binary data.
Solution:
The Neo4j Neosemantics has built in support for importing ontologies from url, so
we can use different kind of File stores which provide pre-signed http/s urls.
AWS provides such functionality as well. Switching to local solution also is not so complex, for instance
implementing service for storing and retrieving blobs
could be easily done based on MongoDB GridFS.
Challenge:
Retrieving ontology by passing id of Ontology
Solution:
As we already are storing corresponding ontologyId
data property
which we can easily use it for querying ontology nodes.
Note:
Ontology store itself is not tenant(user) aware
so any access to particular ontology
should be guarded by Platform API.