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

Re: Shapes vs Classes (in LDOM)

From: Holger Knublauch <holger@topquadrant.com>
Date: Sat, 24 Jan 2015 19:12:05 +1000
Message-ID: <54C361E5.4060305@topquadrant.com>
CC: RDF Data Shapes Working Group <public-data-shapes-wg@w3.org>

On 1/24/15, 3:53 PM, Jose Emilio Labra Gayo wrote:
> 4.- Does it handle/distinguish open/closed shapes? Open Shapes means 
> that you can allow remaining triples, while closed shapes means that 
> you are only allowed to have the properties specified by the shape. 
> For example, with a shape like:
>
> <Course> {
>    rdfs:label xsd:string
>  , :student @<Student>*
>  }
>
> the nodes that have that shape contain one property rdfs:label with 
> value string and zero or more properties with shape <Student>. With 
> open shapes you could allow more properties that those, while with 
> closed shapes you could only allow those properties.

This currently requires SPARQL (although we may be able to create a more 
built-in solution if closed shapes are an important requirement):

ex:Course
     a rdfs:Class ;
     rdfs:subClassOf rdfs:Resource ;
     ldom:property [
         ldom:predicate rdfs:label ;
         ldom:valueType xsd:string ;
         ldom:maxCount 1 ;
     ] ;
     ldom:property [
         ldom:predicate ex:student ;
         ldom:valueType ex:Student ;
     ] ;
     ldom:constraint [
         ldom:message "No other property than label or student allowed" ;
         ldom:sparql """
                 ASK {
                     ?this ?p ?o .
                     FILTER (?p NOT IN (rdfs:label, ex:student))
                 }
             """
     ] .

Holger
Received on Saturday, 24 January 2015 09:12:36 UTC

This archive was generated by hypermail 2.3.1 : Saturday, 24 January 2015 09:12:37 UTC