W3C home > Mailing lists > Public > public-data-shapes-wg@w3.org > January 2015

Re: Property groups and Combinations (was: Shapes vs Classes (in LDOM))

From: Jose Emilio Labra Gayo <jelabra@gmail.com>
Date: Sat, 24 Jan 2015 11:36:10 +0100
Message-ID: <CAJadXXJJFU=rzpZr4meSOSkMT8cEsu3EZ1UnyVP0C039trEaww@mail.gmail.com>
To: Holger Knublauch <holger@topquadrant.com>
Cc: RDF Data Shapes Working Group <public-data-shapes-wg@w3.org>
On Sat, Jan 24, 2015 at 10:04 AM, Holger Knublauch <holger@topquadrant.com>
wrote:

> On 1/24/15, 3:53 PM, Jose Emilio Labra Gayo wrote:
>
>> 2.- I noticed that you support "orConstraint" which is a step towards
>> ShEx. I wonder if you support cardinalities over different groups and
>> combinations of "orConstraints". The prototypical example is the Person
>> shape which can have: either a foaf:name or a combination of several
>> foaf:givenNames and one foaf:lastName.
>>
>
> (All untested):
>
> ex:Person
>     a rdfs:Class ;
>     rdfs:subClassOf rdfs:Resource ;
>     ldom:constraint [
>         a ldom:OrConstraint ;
>         ldom:shape1 [
>             ldom:property [
>                 ldom:predicate foaf:name ;
>                 ldom:minCount 1 ;
>                 ldom:maxCount 1 ;
>             ]
>         ] ;
>         ldom:shape2 [
>             ldom:property [
>                 ldom:predicate foaf:givenName ;
>                 ldom:minCount 1 ; # ?
>             ] ;
>             ldom:property [
>                 ldom:predicate foaf:lastName ;
>                 ldom:minCount 1 ;
>                 ldom:maxCount 1 ;
>             ]
>         ]
>     ] .
>
> (If you need XOr, create a new template similar to ldom:OrConstraint).
>
> Or in SPARQL:
>
> ex:Person
>     rdfs:subClassOf rdfs:Resource ;
>     ldom:constraint [
>         ldom:message """A person must either have a name or a
>                 combination of given and last names""" ;
>         ldom:sparql """
>                 ASK {
>                     FILTER !(ldom:valueCount(?this, foaf:name) = 1 ||
>                          (ldom:valueCount(?this, foaf:givenName) > 0 &&
>                          ldom:valueCount(?this, foaf:lastName) = 1))
>                 }
>             """
>     ] .
>
> Does this cover your scenario?


And how would you combine it with closed shapes? Should you add another
SPARQL query negating all the definition?

Anyway, it is nice to see that the LDOM is going in a direction that is
very close to ShEx...once you separate shapes from classes and add
recursive shapes, ShEx with semantic actions represented in SPARQL seems
almost the same as LDOM, isn't it? What I am missing now is why should we
need a different technology if we could use and improve ShEx...

Maybe, the other missing feature would be the addition of semantic actions,
which could interact with the validation process in a lot of interesting
ways. If the semantic actions contain SPARQL queries, then, they look
similar to LDOM, but allowing the semantic actions to contain other kinds
of languages would provide future extensibility of the language, which
would allow some nice applications like the examples provided in Eric's
demos.

Best regards, Jose Labra

>
>
> Holger
>
>
>


-- 
Saludos, Labra
Received on Saturday, 24 January 2015 10:36:57 UTC

This archive was generated by hypermail 2.3.1 : Saturday, 24 January 2015 10:36:58 UTC