nie-ine / e-editiones

Ontology website
https://nie-ine.github.io/e-editiones/
1 stars 1 forks source link

Order of classes, etc. in html version of ontologies #2

Closed cyrill-martin closed 4 years ago

cyrill-martin commented 4 years ago

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.

cyrill-martin commented 4 years ago

When converting RDF/XML to HTML, I can:

  1. Take the owl:Ontology element first and use it as the header
  2. Then take all rdfs:Class elements, order them alphabetically (rdfs:about) and show them under the title "Classes"
  3. 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.

hanscools commented 4 years ago

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)?

hanscools commented 4 years ago

Sorry, I should have done a preview for the effect of the hash :).

cyrill-martin commented 4 years ago

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)?:

  1. Header

    • The owl:Ontology element
  2. Classes

    • all rdfs:Class elements
  3. Properties

    • all owl:*Property elements (do we know all?)
  4. Terminology and Code Systems

    • all tcs:* elements (?)
  5. Datatype Instances

    • all rdfs:Datatype elements
  6. Instances

    • all owl:DatatypeProperty elements

...something like this!

hanscools commented 4 years ago

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

cyrill-martin commented 4 years ago

That's ok, thanks!

cyrill-martin commented 4 years ago

@hanscools The calendar ontology (calendar.ttl) doesn't have "a owl:Ontology;". Is this intentional?

hanscools commented 4 years ago

Tx. A mistake. I added it.

cyrill-martin commented 4 years ago

I have to check the presence of any elements before writing any titles!

cyrill-martin commented 4 years ago

Done