Re: ShEx relation to SPIN/OWL

On 7/4/2014 0:58, Arthur Ryman wrote:
> Ideally, we'd have a high-level, human-friendly language for constraining
> RDF and it would be easily translatable to SPARQL to make its semantics
> clear and to give us a standard way to automatically check the
> constraints. The high-level language should have an RDF representation,
> but could also have other serializations that are easier to author. IMHO,
> Turtle is easy to author, but other syntaxes could be more compact. A
> complete solution would also provide a way to drop down into SPARQL syntax
> so you can describe arbitrary constraints.
I agree, and believe SPIN ticks most of these boxes already. When you 
instantiate SPIN templates you basically end up with the same syntax as 
the RDF representation of ShEX. And assuming that a standard library of 
templates exists (including templates to represent cardinality and other 
frequently needed concepts) then SPIN is also a *declarative* model that 
can be queried without even knowing SPARQL. The declarative triples of 
the SPIN template calls can be queried just like any other ontological 
data to drive user interfaces (selection of widgets) etc.

Just to re-iterate here is how an example SPIN template call looks like 
in Turtle

:Issue
   spin:constraint [
       rdf:type spl:ObjectCountPropertyConstraint ;
       arg:maxCount 1 ;
       arg:property :reportedBy ;
     ] ;

It would be trivial to define a template just for that use case, and 
reformat it so that it becomes

:Issue
   spin:constraint [ a ex:Maximum-one ;  ex:property :reportedBy  ] ;

which is hopefully easy enough to edit. In the snippet above, 
ex:Exactly-one would be a SPIN template that defines the actual SPARQL 
query to execute via spin:body. I believe this mechanism combines the 
flexibility of SPARQL with the simple declarative syntax of RDF triples. 
SPIN is self-describing and therefore extensible to any constraint 
patterns needed in the future, and it grows with the evolution and 
adoption of SPARQL.

I do wonder what this working group would do if SPIN had already been a 
W3C standard (and not just a member submission). Would this have changed 
anything?

FWIW I would strongly recommend to encourage an RDF-based representation 
over yet another custom syntax. This information "belongs" into the 
ontology together with the class and property definitions, and should be 
shared as such. Other languages also require new parsers and just add up 
to the learning curve. A good example of what *not* to do with a W3C 
standard has been the OWL/XML syntax introduced in OWL 2 - it only leads 
to fragmentation and additional implementation costs (even Jena doesn't 
support OWL/XML).

Holger

Received on Monday, 7 July 2014 05:02:14 UTC