Re: question about ShEx

* Peter F. Patel-Schneider <pfpschneider@gmail.com> [2015-12-17 22:20-0800]
> It appears to me that ShEx allows embeddings of cardinalities, as in
> 
> twofoureight {
>   { { p @ a [2,2] } [2,2] } [2,2]
>  }
> 
> or
> 
> lots {
>   { p @a [2,4], p @b [1,3] } [6,7]
> }
> 
> is this correct?

In principle, yes, but apart from optional groups, it's rare that one
wants to make sure that there are as many a's as there are b's. Optional
is quite reasonable, e.g.

  <X> {
    :submitter @<UserShape>, :submissionDate xsd:dateTime,
    (:resolvedBy @<HackerShape>, :resolutionDate xsd:dateTime)?
  }

The other place this frequently comes up is in repetitions of choices:

  <Y> { (:observation .|:analysis .|:diagnosis .)+ }

which can be compiled to

  <Y> {
    (:observation .|:analysis .|:diagnosis .),
    :observation .*,
    :analysis .*,
    :diagnosis .*
  }

with either a partion or a greedy semantics.


> peter
> 
> 
> 

-- 
-ericP

office: +1.617.599.3509
mobile: +33.6.80.80.35.59

(eric@w3.org)
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.

Received on Friday, 18 December 2015 09:13:01 UTC