Oh yes, it's definitely possible, permitted, and conforms to
specification to reference an ontology document with a file-based IRI
as your example does.  I was reading the thread in the wrong sequence
and thought the question was regarding the semantics of "Ontology ID"
versus the "Ontology IRI" mapping to actual ontology documents.

In looking at the code (for example
https://github.com/owlcs/owlapi/blob/version5/api/src/main/java/org/semanticweb/owlapi/model/OWLOntologyID.java#L234)
of OWLAPI, I was thinking about how the "default document IRI"
conditionally maps to the either the Version IRI or the Ontology IRI
which is only relevant when resolving which document the Ontology Id
refers to.  It just sticks in my mind due to the inordinate number of
bugs in code I've bumped into over the years (decades) with code using
OWLAPI to manager ontology documents but not relying on the OWLAPI
resolution of the default document IRI to the proper version or
ontology IRI nor bothering to read how the specification prescribes
resolving it 😁

I've yet to try jena-ontapi myself, but are you saying that it doesn't
support ontology or version IRIs that are file-based ?


On Thu, Aug 8, 2024 at 11:22 AM Sergei Zuev <ssz...@apache.org> wrote:
>
> in owlcs/owlapi, it is also possible to reference to the document IRI itself:
> `<a> owl:import <file://docuemnt.owl>`.
> it is allowed by specification.
>
> but in jena-ontapi the import closure can only contain the version IRI or the 
> ontology IRI, not document IRI.
>
> On 2024/08/08 14:06:29 Phillip Ross wrote:
> > For reference, the owlcs owlapi models an ontology identifier as a
> > composite of ontology IRI and version IRI, the latter of which may be
> > null.  And the document IRI is either the version IRI if it has been
> > specified, or the ontology IRI if there is no version IRI.
> >
> > On Thu, Aug 8, 2024 at 3:08 AM Sergei Zuev <ssz...@apache.org> wrote:
> > >
> > > In the new API, the ontology identifier is either the version IRI or the 
> > > ontology IRI. The document IRI is not an identifier.
> > > Perhaps this is a flaw - document support was added at the last moment, 
> > > and for managing imports closure no document-manager is needed.
> > >
> > > Typical work with documents can be like this:
> > > ```
> > >         DocumentGraphRepository repository = 
> > > GraphRepository.createGraphDocumentRepositoryMem();
> > >         repository.addMapping(
> > >                 "http://www.co-ode.org/ontologies/pizza/pizza.owl";,
> > >                 documentPath);
> > >         OntModel m = OntModelFactory.getModelOrNull(
> > >                 "http://www.co-ode.org/ontologies/pizza/pizza.owl";,
> > >                 OntSpecification.OWL2_DL_MEM_BUILTIN_RDFS_INF,
> > >                 repository);
> > >         m.write(System.out, "ttl");
> > > ```
> > >
> > > Here, `http://www.co-ode.org/ontologies/pizza/pizza.owl` is an ontology 
> > > IRI. `DocumentGraphRepository` manages mappings between documents and 
> > > ontologies.
> > >
> > > If you think that some functionality is missing, please open a github 
> > > issue.
> > >
> > > By the way, the external library owlcs/ontapi, which works on top of 
> > > apache-ontapi, has its own full-fledged ontology manager, which works 
> > > according to the specification, i.e. the ontology identifier can also be 
> > > a document IRI.
> > >
> > > On 2024/08/07 11:15:58 Steve Vestal wrote:
> > > > I have some questions about doing an OWL import closure.  My
> > > > understanding is that an Import for an owl:Ontology can use any of a
> > > > URL, an ontology IRI, or a version IRI to access an OWL document.
> > > > Different documents that have the same ontology IRI may be accessed
> > > > using different URLs, either identical copies or with different version
> > > > IRIs.
> > > >
> > > > The link given on the page
> > > > https://jena.apache.org/documentation/ontology/#graphrepository
> > > > (https://jena.apache.org/documentation/javadoc/jena/org.apache.jena.ontapi/org/apache/jena/ontapi/GraphRepository.html)
> > > > gets a "URL was not found" error.  A search didn't turn it up. What
> > > > package contains this class?
> > > >
> > > > That page says "By default, when an ontology model reads an ontology
> > > > document, it will/not/locate and load the document’s imports."  A search
> > > > of this page did not find OntDocumentManager, which I have been using.
> > > > FileManager seems to be deprecated in favor of RDFDataMgr.  Will
> > > > OntDocumentManager be deprecated or modified?
> > > >
> > > > What is the recommended way to accumulate a set of URLs, ontology IRIs,
> > > > and version IRIs, and use that set to do an import closure?
> > > >
> >

Reply via email to