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

imports conflicts with namespace declarations #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

arademaker
Copy link

  1. remove the unavailable url https://raw.githubusercontent.com/ISO-TC211/GOM/master/isotc211_GOM_harmonizedOntology/19108/2006/iso19108TemporalReferenceSystem.rdf

  2. remove the imports that conflict with the namespace declarations.

@dr-shorthair
Copy link
Collaborator

dr-shorthair commented Sep 7, 2019

@dr-shorthair
Copy link
Collaborator

  1. The other imports that you propose to remove refer to resources that contain definitions used in this data. While they are not strictly necessary, they enable inspection of the ontologies alongside the data in some environments (e.g. TopBraid Composer).

@arademaker
Copy link
Author

Protege gives the error

Ontology already exists. OntologyID(OntologyIRI(<http://resource.geosciml.org/ontology/timescale/gts/w3c>) VersionIRI(<null>))


Full Stack Trace
-----------------------------------------------------------------------------------------

org.semanticweb.owlapi.model.OWLOntologyAlreadyExistsException: Ontology already exists. OntologyID(OntologyIRI(<http://resource.geosciml.org/ontology/timescale/gts/w3c>) VersionIRI(<null>))
	at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntology(OWLOntologyManagerImpl.java:1065)
	at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntologyFromOntologyDocument(OWLOntologyManagerImpl.java:1011)
	at org.protege.editor.owl.model.io.OntologyLoader.loadOntologyInternal(OntologyLoader.java:101)
	at org.protege.editor.owl.model.io.OntologyLoader.lambda$loadOntologyInOtherThread$210(OntologyLoader.java:60)
	at org.protege.editor.owl.model.io.OntologyLoader$$Lambda$99/1446864633.call(Unknown Source)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: org.semanticweb.owlapi.model.OWLOntologyRenameException: Could not rename ontology. An ontology with this ID already exists: OntologyID(OntologyIRI(<http://resource.geosciml.org/ontology/timescale/gts/w3c>) VersionIRI(<null>))
	at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.checkForOntologyIDChange(OWLOntologyManagerImpl.java:728)
	at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.enactChangeApplication(OWLOntologyManagerImpl.java:561)
	at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.applyChanges(OWLOntologyManagerImpl.java:589)
	at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.applyChange(OWLOntologyManagerImpl.java:678)
	at org.semanticweb.owlapi.rdf.rdfxml.parser.OWLRDFConsumer.applyChange(OWLRDFConsumer.java:663)
	at org.semanticweb.owlapi.rdf.rdfxml.parser.OWLRDFConsumer.chooseAndSetOntologyIRI(OWLRDFConsumer.java:1471)
	at org.semanticweb.owlapi.rdf.rdfxml.parser.OWLRDFConsumer.endModel(OWLRDFConsumer.java:1380)
	at org.semanticweb.owlapi.rio.RioOWLRDFConsumerAdapter.endRDF(RioOWLRDFConsumerAdapter.java:81)
	at org.semanticweb.owlapi.rio.RioParserImpl$RioParserRDFHandler.endRDF(RioParserImpl.java:296)
	at org.openrdf.rio.turtle.TurtleParser.parse(TurtleParser.java:224)
	at org.openrdf.rio.turtle.TurtleParser.parse(TurtleParser.java:159)
	at org.semanticweb.owlapi.rio.RioParserImpl.parseDocumentSource(RioParserImpl.java:257)
	at org.semanticweb.owlapi.rio.RioParserImpl.parse(RioParserImpl.java:191)
	at uk.ac.manchester.cs.owl.owlapi.OWLOntologyFactoryImpl.loadOWLOntology(OWLOntologyFactoryImpl.java:197)
	at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.actualParse(OWLOntologyManagerImpl.java:1099)
	at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntology(OWLOntologyManagerImpl.java:1055)
	... 8 more

It looks like the namespace declaration already have the effect of importing the ontologies.

@arademaker
Copy link
Author

arademaker commented Sep 7, 2019

In particular, this ontology is the only one that we can't dereference!

@prefix iso-trs: <http://def.isotc211.org/iso19108/2006/TemporalReferenceSystem#> .

To bad to have to depend on such unstable URL:


https://raw.githubusercontent.com/ISO-TC211/GOM/master/isotc211_GOM_harmonizedOntology/iso19108/2006/TemporalReferenceSystem.rdf

For the other ontologies, I found that using the following declarations, using the previous defined namespaces, we avoid the Protege error:

  owl:imports gts: ;
  owl:imports geo: ;

@dr-shorthair
Copy link
Collaborator

To bad to have to depend on such unstable URL:

Indeed. ISO have been very difficult on this matter - they didn't grok the need for stable URIs and properly hosted RDF resources for a long time. I just found this https://def.isotc211.org/ which appears to say that the situation has largely been resolved, though the pattern shown is not quite right (the partnmuber) and also it seems that both http and https versions work.

http://def.isotc211.org/iso19108/2006/TemporalReferenceSystem.rdf
https://def.isotc211.org/iso19108/2006/TemporalReferenceSystem.rdf

@arademaker
Copy link
Author

This PR now cant be automatically merged. Does all the proposed changes were already incorporated? Maybe @alexandretessarollo can help here?

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