hsolbrig / PyShEx

ShEx interpreter for ShEx 2.0
Creative Commons Zero v1.0 Universal
25 stars 10 forks source link

Embedded `EachOf` or `OneOf` can cause inordinately long resolution times #21

Closed hsolbrig closed 6 years ago

hsolbrig commented 6 years ago

An expression of the form:

<BloodPressureMeasurementShape> {
  rdfs:label  xsd:string ;
  :subject @<PatientShape> ;
  :hasmeasurementDate  @<BPDateShape> ;
  :valueSBP @<SBPvalueShape> ;
  :valueDBP @<DBPvalueShape> ;
  :valueABP @<ABPvalueShape>? ;
  (:hasMethod  @<BPMeasurementInvasiveMethodShape> |
   :hasMethod @<BPMeasurementNoninvasiveMethodShape> ) ;
  :hasLocation @<BPMeasurementLocationShape>? ;
  :hasType @<DEPShape>? ;
  :isAffectedBy @<BodyPositionShape>?
}

Goes away for a long time.

(Reported by Ronald Cornet, University of Amsterdam)

hsolbrig commented 6 years ago

Fixed in https://github.com/hsolbrig/PyShEx/commit/392e1bf4fac95705772e1c36ea6e8c6372d5cb13

Restructured the EachOf processor to include exactly the set of triples needed for evaluation