hsolbrig / PyShEx

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

Max cardinality of 0 not processing correctly #20

Closed hsolbrig closed 6 years ago

hsolbrig commented 6 years ago
BASE <http://example.org/ex/>
PREFIX ex: <example.org/ex/>
PREFIX : <http://hl7.org/fhir/>

start = @<BloodPressureMeasurementShape>

<BloodPressureMeasurementShape>  {
    (
        (:hasMethod [<invasive>] ;
         :hasLocation IRI{0})?
    |
        (:hasMethod [<non-invasive>]  ;
        | :hasLocation IRI)*
    )
} 

Passes:

BASE <http://example.org/ex/>
PREFIX ex: <http://example.org/ex/>
PREFIX : <http://hl7.org/fhir/>

<BPM1>
  :hasMethod <invasive> ;
  :hasLocation <BPMLocation1> .

This should fail because the hasLocation node is not consistent with the hasMethod type. (Reported by Ronald Cornet, University of Amsterdam)