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

RE: order of semantic actions

From: Eric Prud'hommeaux <eric@w3.org>
Date: Thu, 20 Feb 2014 04:29:43 -0500
To: "Dam, Jesse van" <jesse.vandam@wur.nl>
Cc: "public-rdf-shapes@w3.org" <public-rdf-shapes@w3.org>
Message-ID: <20140220092940.GA7503@w3.org>
* Dam, Jesse van <jesse.vandam@wur.nl> [2014-02-18 12:14+0000]
> Hi,
> 
> I looked at erics evalution logic, the associated javascript was very usefull for me. After thinking about it and combining it with the discussion of last week and the things that were not clear for me did I put together a pseudo code for matching RDF subject against Shapes. For this pseudo code did I also create a simplified version that is based on characters. Like as done by Eric. However i changed the behavior to be completely independent of the character order, because triples in RDF are also unordered.

The triples in a graph are unordered but that needn't limit the traversal of the graph to be unordered.
Schema:
  start = { <a> . , <b> . }
Data:
  <s> <b> "There" .
  <s> <a> "Hi" .
can be *validated* by testing for <a> and <b> in either order but if we add order we enable many useful extensions, e.g. GenX:
Schema:
  %GenX{ Root %}
  start = {
    <a> . %GenX{ T1 %},
    <b> . %GenX{ T2 %}
  }
ResultS:
  <Root>
    <T1>Hi</T1>
    <T2>There</T2>
  </Root>
(hit [Popop] or <link> in <http://www.w3.org/2013/ShEx/FancyShExDemo?schema=%25GenX%7B%20Root%20%25%7D%0Astart%20%3D%20%7B%0A%3Ca%3E%20.%20%25GenX%7B%20Hi%20%25%7D%2C%0A%3Cb%3E%20.%20%25GenX%7B%20There%20%25%7D%0A%7D&data=%3Cs%3E%20%3Cb%3E%202%20%3B%20%3Ca%3E%201%20.>)

GenX itself is a fairly boring extension but is meant to evoke the possibilities that arrise from using ShEx in for transformers, parser generators, etc. Providing an ordered semantics enables these extensions but still permits implementations to use an unordered algorithm when no extensions have no side effects. Such subsets of ShEx can be optimized while still providing the same results as if they were executed with the ordered semantics.


> I put the full description here(https://www.w3.org/2001/sw/wiki/ValidationPseudoCode) on the wiki. Please look at the NODE and DISCUSSION points.
> 
> I think it would be nice if you look at so we can discuss about as this form the basis of SHEX. Let me know if something is not clear. If you like it then we can update erics example/test javascript, which allows us to define and test the basic processing/matching of shapes expressions against RDF subjects.

It looks like your pseudocode is actually executable javascript. Do you have it running somewhere or can you send what one needs to execute it?


> Greetz,
> Jesse van Dam
> 
> 
> ________________________________________
> Van: Eric Prud'hommeaux [ericw3c@gmail.com] namens Eric Prud'hommeaux [eric@w3.org]
> Verzonden: zondag 16 februari 2014 17:44
> Aan: public-rdf-shapes@w3.org
> Onderwerp: order of semantic actions
> 
> I put together a little demo of ShEx as regular expressions. Clicking either of the [test] buttons shows the semantic actions performed for various tests.
> <http://www.w3.org/2013/ShEx/EvaluationLogic#tests>
> --
> -ericP
> 
> office: +1.617.599.3509
> mobile: +33.6.80.80.35.59
> 
> (eric@w3.org)
> Feel free to forward this message to any list for any purpose other than
> email address distribution.
> 
> There are subtle nuances encoded in font variation and clever layout
> which can only be seen by printing this message on high-clay paper.
> 
> 
> 

-- 
-ericP

office: +1.617.599.3509
mobile: +33.6.80.80.35.59

(eric@w3.org)
Feel free to forward this message to any list for any purpose other than
email address distribution.

There are subtle nuances encoded in font variation and clever layout
which can only be seen by printing this message on high-clay paper.
Received on Thursday, 20 February 2014 09:30:15 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 20 February 2014 09:30:16 UTC