RDFLib / OWL-RL

A simple implementation of the OWL2 RL Profile on top of RDFLib: it expands the graph with all possible triples that OWL RL defines. It can be used together with RDFLib to expand an RDFLib Graph object, or as a stand alone service with its own serialization.
http://www.ivan-herman.net/Misc/2008/owlrl/
Other
139 stars 30 forks source link

Test fails: test_cls_maxqc1 #41

Open Aniket-Pradhan opened 3 years ago

Aniket-Pradhan commented 3 years ago

Hey all! I am trying to package OWL-RL for the Fedora OS and am struggling through one of the test cases that is failing (even in a virtual environment).

The test case is: test_cls_maxqc1 from test/test_classes.py. Below is the error log for the same.

def test_cls_maxqc1():
        """
        Test cls-maxqc1 rule for OWL 2 RL.

        If::

            T(?x, owl:maxQualifiedCardinality, "0"^^xsd:nonNegativeInteger)
            T(?x, owl:onProperty, ?p)
            T(?x, owl:onClass, ?c)
            T(?u, rdf:type, ?x)
            T(?u, ?p, ?y)
            T(?y, rdf:type, ?c)

        then::

            false
        """
        g = Graph()

        x = T.x
        p = T.p
        c = T.C
        u = T.u
        y = T.y

        g.add((x, OWL.maxQualifiedCardinality, Literal(0)))
        g.add((x, OWL.onProperty, p))
        g.add((x, OWL.onClass, c))
        g.add((u, p, y))
        g.add((y, RDF.type, c))

        owlrl.DeductiveClosure(owlrl.OWLRL_Semantics).expand(g)
>       result = next(g.objects(predicate=DAML.error))
E       StopIteration

test/test_classes.py:123: StopIteration

Now, from what I know, the variable g should be a generator object but it is apparently empty/exhausted. I am pretty sure that it should not be like that but am unable to figure out the root problem here.

I will be happy to help if needed. :D

My Python version is 3.9.1 and below are the versions of the installed deps.

attrs==20.3.0
iniconfig==1.1.1
isodate==0.6.0
owlrl==5.2.1
packaging==20.9
pluggy==0.13.1
py==1.10.0
pyparsing==3.0.0b2
pytest==6.2.2
rdflib==5.0.0
rdflib-jsonld==0.5.0
six==1.15.0
toml==0.10.2