Order of classes, etc. in html version of ontologies
cyrill-martin opened this issue · 10 comments
The html version is generated bases on the rdf/xml version. The rdf/xml version is converted using the python rdflib package and rdflib doesn't preserve the order of elements when converting turtle files. Since it's triples, they just don't care about the order.
When converting RDF/XML to HTML, I can:
- Take the owl:Ontology element first and use it as the header
- Then take all rdfs:Class elements, order them alphabetically (rdfs:about) and show them under the title "Classes"
- Then take all other elements, order them the same way and show them under the title "Properties"
@hanscools Would that make sense?
I could also hard code the order of the properties and go for owl:ObjectProperty, owl:DatatypeProperty, owl:FunctionalProperty, etc. individually but I'm afraid that I will eventually miss some elements.
Yes.
Besides classes and properties there are other titles and elements.
In the terminology-code-systems ontology:
TERMINOLOGY AND CODE SYSTEMS
and
DATATYPE INSTANCES
In the calendar ontology:
INSTANCES
In the languages ontology:
LANGUAGE CODING SYSTEM AND DATATYPE INSTANCES
and
INSTANCES
In the drcs ontology:
CODE SYSTEM AND DATATYPE INSTANCE
@cyrill-martin : Can you keep the sequence of all the titles (and order their elements alphabetically)?
Sorry, I should have done a preview for the effect of the hash :).
Yes, I think I can. I just need to know for each title what to look for in the RDF/XML.
Can we somehow define the order of things here (without missing anything)?:
-
Header
- The owl:Ontology element
-
Classes
- all rdfs:Class elements
-
Properties
- all owl:*Property elements (do we know all?)
-
Terminology and Code Systems
- all tcs:* elements (?)
-
Datatype Instances
- all rdfs:Datatype elements
-
Instances
- all owl:DatatypeProperty elements
...something like this!
I reduced the commented section titles and in this order:
classes: all rdfs:Class elements
instances: rest (absence of rdfs:Class and owl:*Property): OK?
properties: all owl:*Property elements: OK
That's ok, thanks!
@hanscools The calendar ontology (calendar.ttl) doesn't have "a owl:Ontology;". Is this intentional?
Tx. A mistake. I added it.
I have to check the presence of any elements before writing any titles!
Done