This code transforms a .owl ontology into a .html file, showing classes with their relations and properties (this is a fork of owl-to-web, created by Matthieu GRALL).
Matthieu GRALL, as part of the DATA VISIONS collective.
Creative Commons Attribution 4.0 International (CC BY 4.0).
-
Despite the precautions taken, the result of the code depends on the quality of the ontology (fields filled in or not, qualification in one type or another, etc.).
-
The input is a .owl ontology using the RDF/XML Syntax, using the following convention:
- unique identifier (IRI): lowercase, with dashes, in English, e.g.
information-system
- classes labels (label annotation): beginning with uppercase, in French and English, e.g.
Système d'information / Information system
- classes definitions (isDefinedBy annotation): beginning with uppercase, ending with a dot and, when applicable, with acronyms and source within parenthesis on the first line, and synonyms on a last line, in French and English, e.g.
(SI, source : [ISO/IEC 27000])
Ensemble d’applications, services, actifs informationnels ou autres composants permettant de gérer l’information.
Synonyme(s) : système d'information et de communication (SIC), service numérique.
- relations (Object properties) and properties (Data properties) labels: lowercase, in French and English, e.g.
has instance
- naming rules (comment annotation): in French at least, as an explanation or between < and > to indicate a value to choose, if possible with examples, e.g.
Ex : système d'information d'importance vitale (SIIV), système d'information essentiel (SIE).
- This code uses owlready2 methods to work on an ontology, mainly the following ones:
- unique identifiers: .name ;
- classes: .classes() ;
- relations: .object_properties() ;
- properties: .data_properties() ;
- labels: .label, .label.fr et .label.en ;
- definitions: .isDefinedBy, isDefinedby.fr, .isDefinedBy.en ;
- subjects of RDF triples: .get_domain() ;
- objects of RDF triples: .get_range() ;
- owl_to_html-backlog.xlsx contains a backlog of the next features and corrections.