I am looking for an RDF/OWL based Domain Driven Development (DDD) framework.
I have an OWL ontology used as a TBox model and I want to build forms upon my RDF/OWL classes, properties and owl restrictions defined in the TBox. First, I want to load the schema of my ontology and then navigate through the classes and retrieve the associated properties and restrictions.
My question is what is the difference between OWLReady2 and RDFLib libraries. (the advantages and disadvantage of using them?)
As the main author of Owlready, I am obviously not impartial. But here are some points:
Advantages of Owlready :
* Work at the OWL level, and thus it has specific methods and classes for most OWL features (e.g. for some/only restrictions, etc)
* Reasoning support, via the integrated reasoners
* Faster quadstore and parser (espescially interesting if you are working on big ontologies)
Advantages of RDFlib :
* Work at the RDF level, which might be interesting if you OWL ontologies are linked with non-OWL data
* More widely spread
If you are working on big ontologies, the quadstore of Owlready is much better optimized, so you should go for Owlready. If you need complex OWL structure, such as combination of restriction with intersection etc, Owlready has also better support for that -- with RDFlib, you need to manage OWL construct as plain RDF triples.
On the contrary, if your ontologies are small and you just need to access them as RDF triples, RDFlib may be sufficient.
Besides Jiba's explanation, RDFLib also allows you to:
* work with Python 2.6 and above (if you're working with IronPython, for instance, you're limited to Python 2.7)
* deal with different formats (RDF/XML, N3, NTriples, N-Quads, Turtle, TriX, RDFa and Microdata)
* work with Jupyter Notebooks (trying to install owlready2 raises an error)
For reasoning, you can use EYE (requires N3 format).
On the other hand, Owlready2 is AWESOME and has been improving quickly!
(Thanks Jiba ;)
Jiba, you mentioned that Owlready has specific methods and classes for most OWL features. regarding to documentation of Owlready I can use these methods to create the ontology but for navigating and accessing the content of the ontology like all hasvalues restrictions on a specific class I should use SPARQL queries. Is it correct?
No, Owlready has also simplified ways to access restrictions.
You can either access them as object in Class.is_a, or (for simple restriction) access them as class attributes with the following syntax : Class.property (by default, "some" restrictions are returned; this can be confidured on a per property basis for using "only").