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

Add IRI mapper for SKOS Core Vocabulary to prevent missing import errors #22

Closed
jvendetti opened this issue Oct 27, 2023 · 4 comments
Closed
Assignees

Comments

@jvendetti
Copy link
Member

As of recently, the W3C started rate limiting requests to http://www.w3.org/2004/02/skos/core:

We recently adjusted our abuse prevention systems to address an excessive volume of requests from automated systems, adding up to tens of millions of requests per day.

As a side effect of this, attempting to load ontologies in BioPortal that import SKOS Core, e.g.:

<owl:imports rdf:resource="http://www.w3.org/2004/02/skos/core"/>

.... result in missing import errors in the logs:

++++++++++++++++++++++++++++++++++++++++++++++++++
Error: OWL_IMPORT_MISSING
Message: http://www.w3.org/2004/02/skos/core
++++++++++++++++++++++++++++++++++++++++++++++++++

... and intermittently failing metrics-related unit tests in the ontologies_linked_data project. See this issue: ontoportal/ontologies_linked_data#6.

Since this is an oft-imported vocabulary, I propose an initial solution of using an IRI mapper that maps to a copy of the file that we host somewhere.

@jvendetti jvendetti self-assigned this Oct 27, 2023
@jvendetti
Copy link
Member Author

@alexskr - any opinion on where our copy of skos.rdf should live?

@alexskr
Copy link
Member

alexskr commented Oct 28, 2023

do you know if there a way to specify local file system path instead of a web address? If thats possible then embedding it with owlapi_wrapper would be my first choice.
Or maybe we can host skos core in BioPortal?

Alternatively we can create a purl for it and host file on ontoportal or www.bioontology.org site.

@jvendetti
Copy link
Member Author

The example code provided by the OWL API shows that you can use a local file system path. I tested it and it seems to work - at least in a simple unit test scenario:

@Test
public void testSimpleIRIMapper() throws Exception {
  IRI skosCoreIRI = IRI.create("http://www.w3.org/2004/02/skos/core");
  IRI skosCoreDocumentIRI = IRI.create("file:/Users/vendetti/Downloads/skos.rdf");
  SimpleIRIMapper mapper = new SimpleIRIMapper(skosCoreIRI, skosCoreDocumentIRI);

  OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
  manager.getIRIMappers().add(mapper);

  File broFile = new File("src/test/resources/BRO_v3.2.owl");
  FileDocumentSource fileDocumentSource = new FileDocumentSource(broFile);
  OWLOntology ontology = manager.loadOntologyFromOntologyDocument(fileDocumentSource);
  assertNotNull(ontology);
}

So I take it that means you'd prefer to have it embedded?

@alexskr
Copy link
Member

alexskr commented Oct 28, 2023

embedding file should reduce overall complexity and improve resiliency against external resource connectivity issues.

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

2 participants