Storing ontology in graph database

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Storing ontology in graph database

Bob van 't Padje
I'm creating an application which should be able to CRUD ontologies, but I'm not really sure how I should save my ontologies. I always thought it would be best to just save the ontologies in a graph database. What is the best way to achieve this? I might want to do some data analyses on the ontologies in the future so just saving the RDF files somewhere on the server isn't really an option.

What would be your advice on saving my ontologies? An graph database? Or is it possible to use a document store (like mongoDB)? And how would I to implement this in my python/owlready2 project?
Reply | Threaded
Open this post in threaded view
|

Re: Storing ontology in graph database

Jiba
Administrator
Currently, Owlready support only ontology files (Ntriples or RDF) and database (SQLite or PostgresQL). The database option creates an SQL "graph" in a quad table. In my experience, SQLite is the fastest database.

Other backend could be implemented by adding driver module, but require some implementation.
Reply | Threaded
Open this post in threaded view
|

Re: Storing ontology in graph database

Bob van 't Padje
I checked the documentation on how to setup the SQLite database but I can't seem to get it working. Lets say I don't have any ontologies yet, how would setup my project to create a new ontology add some classes and then save this in my SQLite file?
Reply | Threaded
Open this post in threaded view
|

Re: Storing ontology in graph database

Jiba
Administrator
The documentation is there:

http://owlready2.readthedocs.io/en/latest/world.html#persistent-world-storing-the-quadstore-in-an-sqlite3-file

Just do:

default_world.set_backend(filename = "/path/to/your/file.sqlite3")

And the quadstore will be stored in the given SQLite3 file (a new file is created if needed).

Then, call default_world.save() to save the quadstore on disk.