hsolbrig / PyShEx

ShEx interpreter for ShEx 2.0
Creative Commons Zero v1.0 Universal
24 stars 9 forks source link

shexeval seems to hang for some simple shape and rdf node #58

Closed dougli1sqrd closed 5 years ago

dougli1sqrd commented 5 years ago

I am toying around with test data and shapes using shexeval or pyshex within a python script. I found that the evaluation of a shape with a particular rdf node seems to cause the process to hang. In the example given I'm using minimal dummy data that duplicates the issue.

In just-bio-process.shex I have defined the BiologicalProcessClass shape. Then, in q13252.ttl I have defined a class <http://identifiers.org/uniprot/Q13253> representing a protein. This should definitely not validate as BiologicalProcessClass.

When I run: shexeval -s 'http://purl.obolibrary.org/obo/go/shapes/BiologicalProcessClass' --focus 'http://identifiers.org/uniprot/Q13253' ../python/q13252.ttl ../shapes/just-bio-process.shex the process seems to never complete.

Expected is that this would fail to validate to the give shape.

I wondered if the self subclass would cause issues, so I removed the rdfs:subClassOf <http://identifiers.org/uniprot/Q13253> line. This still caused the command to seemingly hang.

hsolbrig commented 5 years ago

The issue was a sub-optimal (to say the least) evaluation of permutations of extras and matching triple expressions. Added a hint to the cardinality matching function so that it could be a bit more proactive.