Extend rdflib's TurtleSerializer and add a custom ordering of subjects
The exported output will contain triples with the following fixed ordering:
- Ontology metadata (i.e. resource that is of type owl:Ontology)
- Classes (i.e. classes that are of type owl:Class)
- Deprecated Classes (i.e. classes that have an annotation property of owl:deprecated)
- Annotation Properties (i.e. resources that are of type owl:AnnotationProperty)
- Object Properties (i.e. resources that are of type owl:ObjectProperty)
- Datatype Properties (i.e. resources that are of type owl:DatatypeProperty and rdfs:Datatype)
- Named Individuals (i.e. resources that are of type owl:NamedIndividual)
- Root nodes from terminologies (i.e. classes that are rdfs:subClassOf sphn:Terminology, and its subclasses)
- Other (all remaining resources)
TODO:
-
Order restrictions -
Order values in owl:someValuesFrom restriction
Edited by Deepak Unni