qudt / qudt-public-repo

QUDT -Quantities, Units, Dimensions and dataTypes - public repository
Other
109 stars 69 forks source link

Errors opening unit ontology with Protégé #62

Open yoavnash opened 4 years ago

yoavnash commented 4 years ago

When I try to open the unit ontology with Protégé 5.5, I get the following errors:

...
   INFO  16:15:32  Usage of rdf vocabulary: http://www.linkedmodel.org/schema/dtype#value -> http://www.w3.org/1999/02/22-rdf-syntax-ns#type -> http://www.w3.org/1999/02/22-rdf-syntax-ns#Property
   INFO  16:15:32  Usage of rdf vocabulary: http://www.linkedmodel.org/schema/dtype#value -> http://www.w3.org/1999/02/22-rdf-syntax-ns#type -> http://www.w3.org/1999/02/22-rdf-syntax-ns#Property
   INFO  16:15:32  Usage of rdf vocabulary: http://www.linkedmodel.org/schema/dtype#defaultValue -> http://www.w3.org/1999/02/22-rdf-syntax-ns#type -> http://www.w3.org/1999/02/22-rdf-syntax-ns#Property
  ERROR  16:15:32  Entity not properly recognized, missing triples in input? http://org.semanticweb.owlapi/error#Error1 for type Class
  ERROR  16:15:32  Entity not properly recognized, missing triples in input? http://org.semanticweb.owlapi/error#Error2 for type Class
   INFO  16:15:32  Unparsed triple: _:genid2147483682 -> http://www.w3.org/2002/07/owl#onProperty -> http://www.linkedmodel.org/schema/dtype#defaultValue
   INFO  16:15:32  Unparsed triple: _:genid2147483685 -> http://www.w3.org/2002/07/owl#onProperty -> http://www.linkedmodel.org/schema/dtype#value
   INFO  16:15:32  Finished loading imported ontology at http://www.linkedmodel.org/schema/dtype
...
   INFO  16:11:07  Usage of rdf vocabulary: http://www.w3.org/2004/02/skos/core#exactMatch -> http://www.w3.org/1999/02/22-rdf-syntax-ns#type -> http://www.w3.org/1999/02/22-rdf-syntax-ns#Property
   INFO  16:11:07  Usage of rdf vocabulary: http://www.w3.org/2004/02/skos/core#closeMatch -> http://www.w3.org/1999/02/22-rdf-syntax-ns#type -> http://www.w3.org/1999/02/22-rdf-syntax-ns#Property
   INFO  16:11:07  Finished loading imported ontology at http://www.w3.org/2004/02/skos/core
  ERROR  16:11:07  Entity not properly recognized, missing triples in input? http://org.semanticweb.owlapi/error#Error3 for type Class
  ERROR  16:11:07  Entity not properly recognized, missing triples in input? http://org.semanticweb.owlapi/error#Error4 for type Class
  ERROR  16:11:07  Entity not properly recognized, missing triples in input? http://org.semanticweb.owlapi/error#Error5 for type Class
  ERROR  16:11:07  Entity not properly recognized, missing triples in input? http://org.semanticweb.owlapi/error#Error6 for type Class
...
   INFO  16:15:34  Imported ontology document http://qudt.org/2.1/vocab/quantitykind was not resolved to any documents defined in the ontology catalog.
   INFO  16:15:35  Imported ontology document http://qudt.org/2.1/vocab/dimensionvector was not resolved to any documents defined in the ontology catalog.
  ERROR  16:15:37  Attempt to transform an axiom to correct misuse of properties failed. Property replacement: {<http://www.linkedmodel.org/schema/vaem#hasDomain>=<http://www.linkedmodel.org/schema/vaem#hasDomain>, <http://qudt.org/schema/qudt/ucumCaseSensitiveCode>=<http://qudt.org/schema/qudt/ucumCaseSensitiveCode>, <http://qudt.org/schema/qudt/rationale>=<http://qudt.org/schema/qudt/rationale>, <http://qudt.org/schema/qudt/ucumCaseInsensitiveCode>=<http://qudt.org/schema/qudt/ucumCaseInsensitiveCode>, <http://qudt.org/schema/qudt/vectorMagnitude>=<http://qudt.org/schema/qudt/vectorMagnitude>}, axiom: AnnotationAssertion(<http://www.linkedmodel.org/schema/vaem#hasDomain> <http://www.linkedmodel.org/schema/vaem#GMD_QUDT-DIMENSION-VECTORS> "dimensionVector"), error: uk.ac.manchester.cs.owl.owlapi.OWLLiteralImplNoCompression cannot be cast to org.semanticweb.owlapi.model.IRI
   INFO  16:15:37  Finished loading imported ontology at http://qudt.org/2.1/vocab/dimensionvector
   INFO  16:15:37  Imported ontology document http://qudt.org/2.1/vocab/unit was not resolved to any documents defined in the ontology catalog.
  ERROR  16:15:39  Attempt to transform an axiom to correct misuse of properties failed. Property replacement: {<http://www.linkedmodel.org/schema/vaem#hasDomain>=<http://www.linkedmodel.org/schema/vaem#hasDomain>, <http://qudt.org/schema/qudt/ucumCaseSensitiveCode>=<http://qudt.org/schema/qudt/ucumCaseSensitiveCode>, <http://qudt.org/schema/qudt/rationale>=<http://qudt.org/schema/qudt/rationale>, <http://qudt.org/schema/qudt/ucumCaseInsensitiveCode>=<http://qudt.org/schema/qudt/ucumCaseInsensitiveCode>, <http://qudt.org/schema/qudt/vectorMagnitude>=<http://qudt.org/schema/qudt/vectorMagnitude>}, axiom: AnnotationAssertion(<http://www.linkedmodel.org/schema/vaem#hasDomain> <http://www.linkedmodel.org/schema/vaem#GMD_QUDT-DIMENSION-VECTORS> "dimensionVector"), error: uk.ac.manchester.cs.owl.owlapi.OWLLiteralImplNoCompression cannot be cast to org.semanticweb.owlapi.model.IRI
   INFO  16:15:39  Finished loading imported ontology at http://qudt.org/2.1/vocab/unit
  ERROR  16:15:39  Attempt to transform an axiom to correct misuse of properties failed. Property replacement: {<http://www.linkedmodel.org/schema/vaem#hasDomain>=<http://www.linkedmodel.org/schema/vaem#hasDomain>, <http://qudt.org/schema/qudt/ucumCaseSensitiveCode>=<http://qudt.org/schema/qudt/ucumCaseSensitiveCode>, <http://qudt.org/schema/qudt/rationale>=<http://qudt.org/schema/qudt/rationale>, <http://qudt.org/schema/qudt/ucumCaseInsensitiveCode>=<http://qudt.org/schema/qudt/ucumCaseInsensitiveCode>, <http://qudt.org/schema/qudt/vectorMagnitude>=<http://qudt.org/schema/qudt/vectorMagnitude>}, axiom: AnnotationAssertion(<http://www.linkedmodel.org/schema/vaem#hasDomain> <http://www.linkedmodel.org/schema/vaem#GMD_QUDT-QUANTITY-KINDS-ALL> "quantitykind"), error: uk.ac.manchester.cs.owl.owlapi.OWLLiteralImplNoCompression cannot be cast to org.semanticweb.owlapi.model.IRI
  ERROR  16:15:39  Attempt to transform an axiom to correct misuse of properties failed. Property replacement: {<http://www.linkedmodel.org/schema/vaem#hasDomain>=<http://www.linkedmodel.org/schema/vaem#hasDomain>, <http://qudt.org/schema/qudt/ucumCaseSensitiveCode>=<http://qudt.org/schema/qudt/ucumCaseSensitiveCode>, <http://qudt.org/schema/qudt/rationale>=<http://qudt.org/schema/qudt/rationale>, <http://qudt.org/schema/qudt/ucumCaseInsensitiveCode>=<http://qudt.org/schema/qudt/ucumCaseInsensitiveCode>, <http://qudt.org/schema/qudt/vectorMagnitude>=<http://qudt.org/schema/qudt/vectorMagnitude>}, axiom: AnnotationAssertion(<http://www.linkedmodel.org/schema/vaem#hasDomain> <http://www.linkedmodel.org/schema/vaem#GMD_QUDT-DIMENSION-VECTORS> "dimensionVector"), error: uk.ac.manchester.cs.owl.owlapi.OWLLiteralImplNoCompression cannot be cast to org.semanticweb.owlapi.model.IRI
   INFO  16:15:39  Finished loading imported ontology at http://qudt.org/2.1/vocab/quantitykind
  ERROR  16:15:39  Attempt to transform an axiom to correct misuse of properties failed. Property replacement: {<http://www.linkedmodel.org/schema/vaem#hasDomain>=<http://www.linkedmodel.org/schema/vaem#hasDomain>, <http://qudt.org/schema/qudt/ucumCaseSensitiveCode>=<http://qudt.org/schema/qudt/ucumCaseSensitiveCode>, <http://qudt.org/schema/qudt/rationale>=<http://qudt.org/schema/qudt/rationale>, <http://qudt.org/schema/qudt/ucumCaseInsensitiveCode>=<http://qudt.org/schema/qudt/ucumCaseInsensitiveCode>, <http://qudt.org/schema/qudt/vectorMagnitude>=<http://qudt.org/schema/qudt/vectorMagnitude>}, axiom: AnnotationAssertion(<http://www.linkedmodel.org/schema/vaem#hasDomain> <http://www.linkedmodel.org/schema/vaem#GMD_QUDT-QUANTITY-KINDS-ALL> "quantitykind"), error: uk.ac.manchester.cs.owl.owlapi.OWLLiteralImplNoCompression cannot be cast to org.semanticweb.owlapi.model.IRI
  ERROR  16:15:39  Attempt to transform an axiom to correct misuse of properties failed. Property replacement: {<http://www.linkedmodel.org/schema/vaem#hasDomain>=<http://www.linkedmodel.org/schema/vaem#hasDomain>, <http://qudt.org/schema/qudt/ucumCaseSensitiveCode>=<http://qudt.org/schema/qudt/ucumCaseSensitiveCode>, <http://qudt.org/schema/qudt/rationale>=<http://qudt.org/schema/qudt/rationale>, <http://qudt.org/schema/qudt/ucumCaseInsensitiveCode>=<http://qudt.org/schema/qudt/ucumCaseInsensitiveCode>, <http://qudt.org/schema/qudt/vectorMagnitude>=<http://qudt.org/schema/qudt/vectorMagnitude>}, axiom: AnnotationAssertion(<http://www.linkedmodel.org/schema/vaem#hasDomain> <http://www.linkedmodel.org/schema/vaem#GMD_QUDT-DIMENSION-VECTORS> "dimensionVector"), error: uk.ac.manchester.cs.owl.owlapi.OWLLiteralImplNoCompression cannot be cast to org.semanticweb.owlapi.model.IRI
   INFO  16:15:39  Finished loading file:/C:/Users/Yoav/Downloads/qudt/unit
   INFO  16:15:39  Loading for ontology and imports closure successfully completed in 10067 ms
   INFO  16:15:39  Updated document format class from: org.semanticweb.owlapi.formats.RioTurtleDocumentFormat to: org.semanticweb.owlapi.formats.TurtleDocumentFormat
   INFO  16:15:39  
...

Am I doing something wrong?

steveraysteveray commented 4 years ago

Thanks for the error messages. QUDT has been developed using the TopQuadrant suite of ontology editing tools. However, you aren't the first person to note that Protege gives errors when loading QUDT. I will try to spend a little time to better understand what it is that Protege is complaining about.

smrgeoinfo commented 3 years ago

related: https://github.com/ESIPFed/sweet/issues/84, https://github.com/owlcs/owlapi/issues/571

I got the QUDT ttl files to load in Protege without all the bogus error classes by :

  1. download local copies of http://www.linkedmodel.org/schema/dtype and http://www.linkedmodel.org/schema/vaem
  2. checking out the qudt/qudt-public-repo repository from github
  3. creating oasis catalog files in the schema and vocab directories and subdirectories to use local copies of all the ontology imports; have to generate catalog files in directories and subdirectories until all the imports except shex, shacl, spin are local.
  4. in protege manually delete the Error classes when I load one of the files, then save. I did this for vaem, imports, dtype, qudt, data, datatype, units, quantity-kind. After saving, the ontology will reopen without the Error classes.

Since protege rewrites all the triples in different order, I can't tell what if any changes were actually made in the .ttl files when saved... - git diff shows the whole file being different.

steveraysteveray commented 3 years ago

Thanks so much for diagnosing the problem here! It's good to know the root cause. Interesting that the imports must be local... We will discuss.

jhodgesatmb commented 3 years ago

When I load the unit ontology into Protege 5.5 I get many errors but I don't know how to interpret them in terms of cause. I see that the offending QUDT class, property, or instance is subclassed off a Protege Error Class. The scant Protege documentation says to look at the usage of the Error Class to find out what the problem is but I am not finding any help there.

In order to fix these errors I need to be able to understand what these errors really mean. When @smrgeoinfo says he downlopaded the dtype and vaem graphs, how was it that he decided this was necessary when the downloaded version would have the same content as the networked version? When he says he created catalog files in the schema and vocab directories, what was the reasoning behind that and what errors did this action resolve? It seems that he had issues with non-local imports, and I have run into this kind of problem in the past but I would like to hear what the problem was perhaps more than the solution.

By the way, how long did it take to perform step #3? I could see this taking quite some time. Once I find out what the problems are we can discuss whether and how to resolve them.

dr-shorthair commented 3 years ago

My experience is that Protégé throws these a lot for (a) owl:Restriction classes, where (b) Dublin Core is involved, which is 'RDF' and not very good OWL. Protégé is very much an OWL tool, and requires OWL consistency, while TopBraid is more RDF/RDFS oriented.

dr-shorthair commented 3 years ago

And as @smrgeoinfo points out, the RDF serialiser in TopBraid writes the file in a different order to OWL-API which is used by Protege so it is difficult to run diffs. If you want to use GitHub diffs, then you need to choose one of these as the local standard, and rewrite the file using the locally preferred tool first. It could probably be automated with a pre-receive hook, but I don't have the skill to do that.

GeorgFerdinandSchneider commented 3 years ago

Hi I have a potentially related or similar error from opening qudt-s: http://qudt.org/schema/qudt/ in Protege 5.5 from the url and then trying to execute HermiT reasoner on it:

 ERROR  17:24:34  An error occurred during reasoning: Non-simple property '<http://qudt.org/schema/qudt/isScalingOf>' or its inverse appears in the cardinality restriction 'ObjectMaxCardinality(1 <http://qudt.org/schema/qudt/isScalingOf> owl:Thing)'..
java.lang.IllegalArgumentException: Non-simple property '<http://qudt.org/schema/qudt/isScalingOf>' or its inverse appears in the cardinality restriction 'ObjectMaxCardinality(1 <http://qudt.org/schema/qudt/isScalingOf> owl:Thing)'.
    at org.semanticweb.HermiT.structural.ObjectPropertyInclusionManager.rewriteAxioms(ObjectPropertyInclusionManager.java:125) ~[na:na]
    at org.semanticweb.HermiT.structural.OWLClausification.preprocessAndClausify(OWLClausification.java:161) ~[na:na]
    at org.semanticweb.HermiT.Reasoner.loadOntology(Reasoner.java:211) ~[na:na]
    at org.semanticweb.HermiT.Reasoner.<init>(Reasoner.java:202) ~[na:na]
    at org.semanticweb.HermiT.Reasoner.<init>(Reasoner.java:176) ~[na:na]
    at org.semanticweb.HermiT.ReasonerFactory.createHermiTOWLReasoner(ReasonerFactory.java:51) ~[na:na]
    at org.semanticweb.HermiT.ReasonerFactory.createReasoner(ReasonerFactory.java:19) ~[na:na]
    at org.protege.editor.owl.model.inference.ReasonerUtilities.createReasoner(ReasonerUtilities.java:20) ~[na:na]
    at org.protege.editor.owl.model.inference.OWLReasonerManagerImpl$ClassificationRunner.ensureRunningReasonerInitialized(OWLReasonerManagerImpl.java:428) ~[na:na]
    at org.protege.editor.owl.model.inference.OWLReasonerManagerImpl$ClassificationRunner.run(OWLReasonerManagerImpl.java:386) ~[na:na]
    at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_121]

Basically I like to evaluate which OWL profile QUDT is belonging to. @steveraysteveray did you play around with different OWL-DL reasoners so far?

steveraysteveray commented 3 years ago

As it happens, I'm using the SHACL version of QUDT in another project where we use the OWL2 RL profile. I'm currently working through some issues that came up regarding the implications of owl:sameAs that seems to be replicating what I thought were annotation properties, and thus violating some cardinality constraints of 1. Having said that, QUDT doesn't "belong" to any OWL profile, at least not intentionally!

vChavezB commented 10 months ago

Another protege user here. I tried opening the QuantityKind vocabulary but got these errors when reasoning with Pellet:

rdf:html data type parsing

Reason for inconsistency: Literal value "QUDT Dimension Vectors is a vocabulary that extends QUDT Quantity Kinds with properties that support dimensional analysis. There is one dimension vector for each of the system\'s base quantity kinds. The vector\'s magnitude determines the exponent of the base dimension for the referenced quantity kind"^^HTML does not belong to datatype string

What I did is deleted the rdf:html data type and this error was removed.

quantityKind:SoundExposureLevel restrictions

Reason for inconsistency: Individual http://qudt.org/vocab/quantitykind/SoundExposureLevel has more than 1 values for property http://qudt.org/schema/qudt/latexDefinition violating the cardinality restriction

I deleted from the the SoundExposureLevel individual the data property latexDefinition but I still got the error. So I also deleted its other data property symbol and now it works.

Do you have any other suggestion on how the vocabulary could be loaded correctly for reasoning?

I tried only loading the qudt schema directly over the URL http://qudt.org/2.1/schema/qudt with protege and reasoning works but with the vocabulary QuantityKinds Im having these problems.

steveraysteveray commented 10 months ago

We are looking into this. Thanks for pointing this out.

vChavezB commented 9 months ago

So far the problem I mentioned in the previous https://github.com/qudt/qudt-public-repo/issues/62#issuecomment-1781813198 now works fine with Pellet in Protege 5.50 :)