W3C home > Mailing lists > Public > public-rdf-shapes@w3.org > July 2014

Re: A view from outside

From: Jerven Tjalling Bolleman <jerven.bolleman@isb-sib.ch>
Date: Fri, 25 Jul 2014 11:39:16 +0200
Message-ID: <53D225C4.8080909@isb-sib.ch>
To: public-rdf-shapes@w3.org
Hi Lars,

I put your example in ShEx, SPIN and OWL. Just to show that for the 
simple cases the sytax in compact form and manchester are not that 
different. As well as showing that the RDF versions are quite close as 
well. And in the end the why of _my_ preference.

On 25/07/14 10:24, Lars Marius Garshol wrote:> Hi all,
 > I'd kind of promised myself not to get involved in standardization 
again, but unfortunately my employer really needs an RDF constraint 
language, and the direction of this group looks really worrying. At 
first glance, anyway.
I know how you feel ;)
 > First of all: I'm glad there seems to be rough consensus that the use 
cases and requirements are going to be written first. The initial list 
in the charter looks like a good start to me.
 > There is one thing that confuses me, though. If I want to make a 
schema for my web service, wherein I declare that all resources 
submitted to it must be of type foaf:Person, must have a foaf:name and a 
foo:email, and possibly one or more foo:phone ... then shouldn't the 
spec allow me to simply say that?
 > That is, something like
 >    foaf:Person class,
 >      foaf:name 1 1,
 >      foo:email 1 1,
 >      foo:phone 0 * .

In Shex Compact (corrections welcome),

<WebServicePersonShape> {
  rdf:type foad:Person ,
  foaf:name xsd:string ,
  foo:email xsd:string ,
  foo:phone xsd:string *

<WebServicePersonShape> a rs:ResourceShape ;
     rs:property  [ rs:name                "one name" ;
                    rs:occurs              rs:Exactly-one .  ;
                    rs:propertyDefinition  foaf:name ;
                    rs:valueShape          foaf:Person
                   [ rs:name                "one e mail" ;
                    rs:occurs              rs:Exactly-one ;
                    rs:propertyDefinition  foo:email ;
                    rs:valueShape          foaf:Person
                   ] ,
                   [ rs:name                "some number of phone numbers" ;
                    rs:occurs              rs:Zero-or-many ;
                    rs:propertyDefinition  foo:phone ;
                    rs:valueShape          foaf:Person
                   ] ;

In spin turtle

foaf:person a owl:Class;
  spin:constraint [ rdfs:label "one name" ;
                    a spl:Attribute ;
                    spl:predicate foaf:name ;
                    spl:count 1 ] ,
                  [ rdfs:label "one e-mail" ;
                    a spl:Attribute ;
                    spl:predicate foo:email ;
                    spl:count 1 ] ,
                  [ rdfs:label "some number of phone numbers"
                    a spl:Attribute ;
                    spl:predicate foo:phone ;
                    spl:minCount 0 ] .

In Closed world owl rdf turtle serialisation

foaf:person a owl:Class;
  rdfs:subClassOf [ a       owl:Restriction ;
                    owl:cardinality "1"^^xsd:nonNegativeInteger ;
                    owl:onProperty foaf:name ;
                    rdfs:label "one name"
                  ] ,
                  [ a       owl:Restriction ;
                    owl:cardinality "1"^^xsd:nonNegativeInteger ;
                    owl:onProperty foo:email ;
                    rdfs:label "one email"
                  ] ,
                  [ a       owl:Restriction ;
                    owl:minCardinality "0"^^xsd:nonNegativeInteger ;
                    owl:onProperty foo:phone ;
                    rdfs:label "some number of phone numbers"
                  ] ,

Some Manchester syntax (again corrections welcome)

Class: foaf:person
   foaf:name exactly 1
   foo:email exactly 1
   foo:phone min 0

 > (Please don't get hung up on the syntax of this example. I just 
invented it off the top of my head in 2 seconds to ask this question. 
It's *not* a proposal.)
 > I'm confused as to why people seem to prefer solutions that are 
vastly more complicated. Could someone explain? Are the proposals less 
complicated than they seem, or is there something else going on?

I think I can state my preference as wanting something with more 
stretch. i.e. your example should be simple. But when I have complicated 
validation or documentation then want to keep using the same thing as 
long as possbille. Before I need to go and break out using e.g. semantic 

Part of the discussion is not about what should be achieved, but about 
which existing technology should be used as guide. As well as showing 
what the technologies in the field can do already.

Jerven Bolleman
 > Best,
 > --Lars M.
 > http://www.garshol.priv.no/tmphoto/
 > http://www.garshol.priv.no/blog/
Received on Friday, 25 July 2014 09:39:46 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:02:39 UTC