Skip to content

Added functionality to display ontology classes and properties #240

Merged
jamiefeiss merged 23 commits intomainfrom
tdn/ontology-display
Jan 16, 2026
Merged

Added functionality to display ontology classes and properties #240
jamiefeiss merged 23 commits intomainfrom
tdn/ontology-display

Conversation

@tdn
Copy link
Copy Markdown
Collaborator

@tdn tdn commented Dec 2, 2025

Similar to concept schemes, ontologies (when properly served with isDefinedBy relations by a Prez Profile) will now display classes and properties on the ItemPage.

To achieve this, the following was added to prez-lib:

  • SYSTEM_PREDICATES.owlOntology
  • types PrezOntologyNodeand PrezConceptSchemeOntologyNode (for backwards compatibility when an ontology is both a skos:ConceptScheme and a owl:Ontology)
  • functions getOntologyClasses and getOntologyProperties that leverage the isDefinedBy relation to get the necessary data
  • added this functionality to getItem() so it's included in the data returned by prez-lib

To prez-ui:

  • Listing of the classes and properties if the item is an ontology

To test this, include an owl:Ontology in your data, as well as a profile that serves the isDefinedBy relation. For example, use this config:

<https://prez.dev/profile/ontology-object>
    a prof:Profile, prez:ObjectProfile ;
    dcterms:identifier "ontology-object"^^xsd:token ;
    dcterms:description "An ontology." ;
    dcterms:title "Ontology profile" ;
    altr-ext:constrainsClass owl:Ontology ;
    altr-ext:hasDefaultResourceFormat "text/anot+turtle" ;
    altr-ext:hasResourceFormat
        "application/ld+json",
        "application/rdf+xml",
        "text/anot+turtle",
        "text/turtle" ;
    sh:property
    [
          sh:path
              [
                  sh:union (
                               [ shext:bNodeDepth "2" ]
                               shext:allPredicateValues
                               [
                                  sh:path [ sh:inversePath rdfs:isDefinedBy ] ;
                               ]
                               [
                                  sh:path ([ sh:inversePath rdfs:isDefinedBy ] rdf:type) ;
                               ]
                           )
              ]
      ] ;
.

(see https://github.com/Kurrawong/ogc-test-catalogue )

@tdn tdn requested a review from jamiefeiss December 9, 2025 08:16
jamiefeiss
jamiefeiss previously approved these changes Dec 23, 2025
Copy link
Copy Markdown
Collaborator

@jamiefeiss jamiefeiss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks

@tdn tdn mentioned this pull request Jan 14, 2026
@jamiefeiss jamiefeiss merged commit 330222f into main Jan 16, 2026
4 checks passed
@jamiefeiss jamiefeiss deleted the tdn/ontology-display branch January 16, 2026 05:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants