The OWL2 spec OWL 2 Web Ontology Language Structural Specification and Functional-Style Syntax (Second Edition) has the following in section 3.2:
If O contains an ontology IRI OI and a version IRI VI, then the ontology document of O should be accessible via the IRI VI;
....
In contrast, an ontology document of an ontology that contains an ontology IRI http://www.example.com/my and a version IRI http://www.example.com/my/2.0 should be accessible via the IRI http://www.example.com/my/2.0. In both cases, the ontology document should be accessible via the respective IRIs using the HTTP protocol.
<<<
However Stardog does not seem to implement this. If I have the followign trivial ontology:
<owl:Ontology rdf:about="https://spec.edmcouncil.org/fibo/ontology/BE/Corporations/Corporations/">
rdfs:labelCorporations Ontology</rdfs:label>
<owl:versionIRI rdf:resource="https://spec.edmcouncil.org/fibo/ontology/master/latest/BE/Corporations/Corporations/"/>
</owl:Ontology>
Then the following SPARQL fails to return a value for ?v or ?name.
SELECT *
WHERE {
BIND( https://spec.edmcouncil.org/fibo/ontology/master/latest/BE/Corporations/Corporations/ as ?id).
OPTIONAL {?id owl:versionIRI ?v}
OPTIONAL {?id rdfs:label ?name}.
}
Not sure if this would be considered a bug but I could not find any Stardog documentation on this topic which I think should be remedied.
Is there any way to obtain the behavior implied by the OWL spec (or did I misunderstand it)? A more practical use is a query to return the label of any imported ontology, where the import may or may not use a version IRI.
What about the use of versionIRI imports for reasoning - will the right version be used?