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

example of recursive shapes

From: Peter F. Patel-Schneider <pfpschneider@gmail.com>
Date: Sat, 24 Jan 2015 09:18:41 -0800
Message-ID: <54C3D3F1.4030905@gmail.com>
To: RDF Data Shapes Working Group <public-data-shapes-wg@w3.org>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Here is an example of recursive shapes and constraints based on them.  I
have purposefully removed typing information and domains and ranges from the
RDF graph given at the beginning.  A version of the RDF graph that is more
likely to actually occur is given at the end.  The extra information does
not change anything.


Reduced RDF Graph

ex:Enrico ex:livesIn ex:NorthernItaly .
ex:Diego ex:livesIn  ex:NorthernItaly .
ex:Alessandro ex:livesIn ex:NorthernItaly .
ex:Sergio ex:livesIn ex:NorthernItaly .
ex:John ex:livesIn ex:NorthernItaly .
ex:Maurizio ex:livesIn ex:SouthernItaly .

ex:Enrico ex:knows ex:John .
ex:John ex:knows ex:Maurizio .
ex:Diego ex:knows ex:Alessandro .
ex:Alessandro ex:knows ex:Diego .
ex:Alessandro ex:knows ex:Sergio


Shapes and Constraints (informal)

Polentoni are those who live in Northern Italy and who only know those who
are Polentoni.  Enrico is not Polentoni.  Diego is Polentoni.


Shapes and Constraints (in OWL Constraints with Closed-World Recognition)

Polentoni = (ex:livesIn : ex:NorthernItaly) & (all ex:knows Polentoni)
ex:Enrico not in Polentoni
ex:Diego in Polentoni


Shapes and Constraints (in ShExC plus OSLC controls)

<Polentoni> {
   ex:livesIn ( ex:NorthernItaly ),
   ex:knows @<Polentoni>*
}

ex:Diego oslc:instanceShape <Polentoni> .

I don't believe that this setup can require that Enrico is not Polentoni.


Natural RDF Graph

ex:Person rdf:type rdfs:Class .
ex:Region rdf:type rdfs:Class .
ex:livesIn rdf:type rdf:Property .
ex:knows rdf:type rdf:Property .
ex:livesIn rdfs:domain ex:Person .
ex:livesIn rdfs:range ex:Region .
ex:knows rdfs:domain ex:Person .
ex:knows rdfs:range ex:Person .

ex:NorthernItaly rdf:type ex:Region .
ex:SouthernItaly rdf:type ex:Region .

ex:Enrico rdf:type ex:Person .
ex:Diego rdf:type ex:Person .
ex:Alessandro rdf:type ex:Person .
ex:Sergio rdf:type ex:Person .
ex:John rdf:type ex:Person .
ex:Maurizio rdf:type ex:Person .

ex:Enrico ex:livesIn ex:NorthernItaly .
ex:Diego ex:livesIn  ex:NorthernItaly .
ex:Alessandro ex:livesIn ex:NorthernItaly .
ex:Sergio ex:livesIn ex:NorthernItaly .
ex:John ex:livesIn ex:NorthernItaly .
ex:Maurizio ex:livesIn ex:SouthernItaly .

ex:Enrico ex:knows ex:John .
ex:John ex:knows ex:Maurizio .
ex:Diego ex:knows ex:Alessandro .
ex:Alessandro ex:knows ex:Diego .
ex:Alessandro ex:knows ex:Sergio
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQEcBAEBAgAGBQJUw9PxAAoJECjN6+QThfjzY8sH/0muw9K1qvzlYK5BUbiqKErm
gP7+lcMmwHvNUhbsUQzoiI2bvcM3VMKJSOB7E3xfflC1W3GY1JBqz2NvQzsnIpjF
Bw+axcbYcRxHG+zvoQcHuEAJUlT1n0U/iTTS/DxnzEEBhaBL2qXsB5UrQnTwpW/W
MfoFX6ZC+ZhSpuI0NL0IbrJ2Hw+f3T5f+apTfGTUvvIFfurURSVjukNPXYhKN6KQ
X/CjL4CJDYFhVPuQE9JFUyB3vSKZUCSfZKL2RNMLdu1cKh3wcUrO+qGYyCoC3JB1
lC2Am0NB0sk+Fdw1P2AO9cjuk/tURx8yF1qK3YHp+amZYvySJZ6wHCL5ijcBnyI=
=MSHG
-----END PGP SIGNATURE-----
Received on Saturday, 24 January 2015 17:19:14 UTC

This archive was generated by hypermail 2.3.1 : Saturday, 24 January 2015 17:19:15 UTC