Ontospy
Ontospy is a lightweight Python library and command line tool for inspecting and visualizing vocabularies encoded using W3C Semantic Web standards, that is, RDF or any of its dialects (RDFS, OWL, SKOS).
The basic workflow is simple: load a graph by instantiating the Ontospy class with a file containing RDFS, OWL or SKOS definitions. You get back a object that lets you interrogate the ontology. That's all!
The same functionalities are accessible also via a command line application. This is an interactive environment (like a REPL) that allows to load ontologies from a local repository, interrogate them and cache them so that they can be quickly reloaded for inspection later on.
Generating ontology documentation
Ontospy can be used to generate HTML documentation for an ontology pretty much out-of-the-box.
See the website Examples of ontology documentation generated via Ontospy, or jump straight to the sample CIDOC-CRM or FOAF documentation pages.
Note
Originally this was developed as a way to familiarize with Python's RDFLib library. The blog post Inspecting an ontology with rdflib contains some early reflections about that experience.
Technology
- Python
- RDFLib and SPARQLWrapper
- Click for the command line interface
- Jinja2 templates for the HTML documentation
- Role
- Design and development
- Date
- Sep 2014 – present
- Links
- https://github.com/lambdamusic/Ontospy