Skip to main content

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

  1. The ontology id
  2. The content uploaded as a text(multipart/form-data)
  3. The format (Turtle or RDF+XML)

to be provided by client.

Challenge:

The Neo4j Neosemantics doesn't provide any built in support for identifying new stored ontologies.

Solution:

  1. Begin a transaction
  2. Read all individuals from provided content.
  3. Add ontologyId temporary data property to provided individuals
  4. Add imported ontology node
  5. Add belongsToOntology relation between ontology node and provided individuals by using ontologyId property
  6. Remove ontologyId property
  7. 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.

Endpoints

  1. Saving an ontology
  2. Retrieving an ontology