OSLC-Core (@open-services.net),

FYI, I thought this would be of interest to this group.  This is being 
done within the charter discussion [1] for a new W3C WG around RDF Shapes 
[2].

[1]: lists.w3.org/Archives/Public/public-rdf-shapes/
[2]: http://www.w3.org/2014/data-shapes/charter

Thanks,
Steve Speicher
IBM Rational Software
OSLC - Lifecycle integration inspired by the web -> 
http://open-services.net

---------- Forwarded message ----------
From: Holger Knublauch <[email protected]>
Date: Fri, Jul 25, 2014 at 2:49 AM
Subject: OSLC Resource Shapes implemented with SPIN
To: "[email protected]" <[email protected]>
Cc: [email protected]


Dear RDF Shapes list,

as a proof-of-concept, I have taken the OSLC Resource Shapes submission 
[1] and implemented it using SPIN. I believe this demonstrates nicely that 
SPIN and Resource Shapes are *complementary* technologies, and that Shapes 
can be implemented as one "instance" of the SPIN constraint language. This 
combines the beauty of a high-level vocabulary with the flexibility of a 
SPARQL-based fall-back mechanism. It works today, and the Shapes have 
proper executable semantics.

The actual OSLC vocabulary and its SPIN constraint templates can be found 
at [2]. I took the little bug database example from the spec and 
implemented it using two different approaches:


1) [3] is syntactically almost identical to the OSLC example from [5] 
(only that it uses spin:constraint instead of oslc:property). For this 
version I had to tweak the current SPIN engine a bit so that it also 
executes "inherited" spin:body queries. I plan to add this tweak to future 
SPIN API (and TopBraid) versions. Here is an example snippet in Turtle:

oslc_cm:ChangeRequest
  spin:constraint 
<http://example.com/shape/oslc-change-request#dcterms-title> ;
  spin:constraint 
<http://example.com/shape/oslc-change-request#oslc_cm-status> .

<http://example.com/shape/oslc-change-request#dcterms-title>
  rdf:type oslc:Property ;
  oslc:name "title"^^xsd:string ;
  oslc:occurs oslc:Exactly-one ;
  oslc:propertyDefinition dcterms:title .

<http://example.com/shape/oslc-change-request#oslc_cm-status>
  rdf:type oslc:Property ;
  oslc:allowedValues oslc_cm:status-allowed-values ;
  oslc:name "status"^^xsd:string ;
  oslc:occurs oslc:Zero-or-one ;
  oslc:propertyDefinition oslc_cm:status .


2) [4] is using individual bnode constraints instead of the "bundle" 
oslc:Property. You can load that version into the current SPIN API 
version, or into TopBraid Composer Free Edition 4.4. Navigate to 
<http://example.com/bugs/2> and press the "Display constraint violation 
warnings" button in the toolbar. It will display a small warning symbol 
with information on the actual violation. You can make edits and see the 
violations updated in real time. It "just works".



Other shape libraries beside the specific OSLC version can be implemented 
in a similar manner.

Regards,
Holger

[1] http://www.w3.org/Submission/2014/SUBM-shapes-20140211/
[2] http://knublauch.com/oslc/oslc.spin.ttl
[3] http://knublauch.com/oslc/oslc_cm1.ttl
[4] http://knublauch.com/oslc/oslc_cm2.ttl
[5] http://www.w3.org/Submission/2014/SUBM-shapes-20140211/#examples

Reply via email to