OWL-RL icon indicating copy to clipboard operation
OWL-RL copied to clipboard

owlrl relies on `OWL.Datatype` which does not exist in the OWL namespace in rdflib

Open jgeluk opened this issue 3 years ago • 9 comments

This line fails with rdflib 6.1.1 because the OWL namespace defined in rdflib does not support the OWL.Datatype property:

https://github.com/RDFLib/OWL-RL/blob/a77e1791b88b54aace609bc6000aac14c7add4ff/owlrl/OWLRLExtras.py#L354

jgeluk avatar Feb 23 '22 11:02 jgeluk

See also https://github.com/RDFLib/rdflib/blob/55d6622a0a7657d8d36b909add96169ba9e6553d/rdflib/namespace/_OWL.py#L79

jgeluk avatar Feb 23 '22 11:02 jgeluk

Workaround:

OWL._fail = False

jgeluk avatar Feb 23 '22 11:02 jgeluk

Renamed OWL.Datatype to OWL.DatatypeProperty in this fork: https://github.com/EKGF/OWL-RL

jgeluk avatar Sep 14 '22 09:09 jgeluk

This looks a cut and paste like a typo: OWL:Datatype should be RDFS:Datatype

jjoao avatar Oct 09 '22 14:10 jjoao

Renamed OWL.Datatype to OWL.DatatypeProperty in this fork: https://github.com/EKGF/OWL-RL

This is not ideal: you are adding "to be removes triple" like to_be_removed.add((OWL.DataRange, OWL.equivalentClass, RDFS.Datatype)) That will never happens (and fail to remove some noise) => RDFS:Datatype

jjoao avatar Oct 09 '22 15:10 jjoao

Alright, makes sense.

jgeluk avatar Oct 10 '22 12:10 jgeluk

can this be merged asap? seems like a trivial fix.

majidaldo avatar Nov 14 '22 17:11 majidaldo

I had the same issue. I agree with the assessment made by @jjoao . It looks like copy/paste typo errors in two lines in the method 'post_process(self)' of class OWLRL_Extension_Trimming. Consider these 3 lines of code:

    to_be_removed.add((RDFS.Datatype, OWL.equivalentClass, OWL.DataRange))
    to_be_removed.add((OWL.DataRange, RDFS.subClassOf, OWL.Datatype))
    to_be_removed.add((OWL.DataRange, OWL.equivalentClass, OWL.Datatype))

The first of these 3 lines refers to RDFS.Datatype, but the other two lines mistakenly refer to OWL.Datatype, which doesn't exist in the OWL namespace. So a fix involves changing OWL.Datatype to RDFS.Datatype in these two lines.

djherron avatar Jan 11 '23 10:01 djherron

bump

majidaldo avatar Nov 06 '23 23:11 majidaldo