Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[question] Why are classes with square brackets in IRI fragments allowable in OWL/XML syntax #1131

Open
jvendetti opened this issue Apr 2, 2024 · 0 comments

Comments

@jvendetti
Copy link

We're trying to get the attached ontology file loaded into BioPortal (we're using version 4.5.18 of the OWL API). The OWL API loads the ontology without errors, e.g.:

@Test
public void testLoadHoomOrphanetOntology() throws Exception {
  String path = "src/test/resources/hoom_orphanet.owl";
  FileDocumentSource fileDocumentSource = new FileDocumentSource(new File(path));

  OWLOntologyLoaderConfiguration config = new OWLOntologyLoaderConfiguration();
  config.setStrict(true);
  config.setBannedParsers("org.semanticweb.owlapi.rio.RioTrixParserFactory");

  OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
  OWLOntology ontology = manager.loadOntologyFromOntologyDocument(fileDocumentSource, config);
  assertNotNull(ontology);
}

When we try to load the ontology into our RDF database (AllegroGraph), it's rejected due to square bracket characters in the fragment portion of some of the class IRIs. The OWL API reports the format of this ontology as OWL/XML Syntax, and doesn't seem bothered by square brackets in class IRI fragments. Continuing from the above code snippet, there's no issue with classes like this one with a square bracket character at the end of the fragment:

OWLDataFactory dataFactory = manager.getOWLDataFactory();
IRI iri = IRI.create("http://www.semanticweb.org/ontology/HOOM#20574610(PMID]");
OWLClass owlClass = dataFactory.getOWLClass(iri);
assertNotNull(owlClass);

I thought that square brackets are considered reserved characters that are only allowed in the host portion of an IRI, and am wondering why an ontology like this isn't rejected by the OWL API as invalid?

hoom_orphanet.owl.zip

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

No branches or pull requests

1 participant