Thanks Eric,
I testet it with your ShEx demo and
both {3,} and {0,5} work perfectly fine.
For me, e.g. {3,*} would be more intuitive as min cardinality, but {3,} is also ok.
Thomas
> Hi Eric,
>
> how can I express min and max carinality using ShEx?
>
> In the ShEx primer I only found
>
> exact cardinality:
> foaf:givenName xsd:string{3}
>
> and the combination of min and max cardinality:
> foaf:givenName xsd:string{3,5}
>
> but not the usage of either min or max cardinality.
IIRC, "{3,}" means min: 3, max: ∞.
I don't believe that the corresponding "{,5}" works; you have to write
"{0,5}", but it wouldn't be hard to add that to the grammar.
> I would like to express the same in ShEx as I would express in OWL like this:
>
> Having2Daughters
> a owl:Restriction ;
> owl:minQualifiedCardinality "2"^^xsd:nonNegativeInteger ;
> owl:onProperty :hasChild ;
> owl:onClass :Woman .
>
> Here a sample schema and data using ShEx (I inserted 10 as I was not able to define infinite max cardinality):
>
> schema
> # -----
>
> <Having2Daughters> {
> :hasChild @<Woman>{2,10}
> }
>
> <Woman> {
> rdf:type (:Woman)
> }
>
> # data
> # -----
>
> <Marge>
> rdf:type :Woman ;
> :hasChild <Maggie> , <Lisa> .
>
> <Maggie>
> rdf:type :Woman .
>
> <Lisa>
> rdf:type :Woman .
>
>
> Thank you very much Eric.
>
>
> Best,
> Thomas
>
> --
> Thomas Bosch, M.Sc. (TUM)
> PhD Student
> GESIS - Leibniz Institute for the Social Sciences
> Social Science Metadata Standards
> Visitors Address: B2,1, D-68159 Mannheim
> Postal Address: P.O.Box 12 21 55, D-68072 Mannheim
> Tel: + 49 (0) 621 / 1246-271
> Fax: + 49 (0) 621 / 1246-100
> Web: http://www.gesis.org
> Website: http://boschthomas.blogspot.com/
> GitHub: https://github.com/boschthomas/PhD
>
--
-ericP
office: +1.617.599.3509
mobile: +33.6.80.80.35.59
([log in to unmask])
Feel free to forward this message to any list for any purpose other than
email address distribution.
There are subtle nuances encoded in font variation and clever layout
which can only be seen by printing this message on high-clay paper.
|