- From: Simon Steyskal <simon.steyskal@wu.ac.at>
- Date: Thu, 13 Aug 2015 08:25:58 +0200
- To: Holger Knublauch <holger@topquadrant.com>
- Cc: RDF Data Shapes Working Group <public-data-shapes-wg@w3.org>
Hi!
> Yes correct. A naive implementation would auto-generate a query such as
>
> SELECT ?this ?subject ?predicate (?value AS ?object) ?datatype
> WHERE {
> ?this ?predicate ?value .
> FILTER (!sh:hasDatatype(?value, ?datatype)) .
> }
>
> based on the sh:validationFunction=sh:hasDatatype triple. It walks
> through the result set and for each row produces one violation, using
> the sh:message attached to the template. If the sh:message = "Your
> literal must have datatype {?datatype}" then the engine can determine
> that ?datatype is needed to populate the message, and therefore needs
> to be projected out from the SELECT. The same applies to ?this or the
> other variables. (I have implemented this today to confirm that it
> works).
Ahh ok.. If we agree on this approach, those implications should be
explicitly mentioned in the respective sections of the spec, though.
thanks,
simon
---
DDipl.-Ing. Simon Steyskal
Institute for Information Business, WU Vienna
www: http://www.steyskal.info/ twitter: @simonsteys
Am 2015-08-13 08:15, schrieb Holger Knublauch:
> On 8/13/2015 16:09, Simon Steyskal wrote:
>> Hi!
>>
>>> The message is defined by the surrounding template, using sh:message.
>>> I cannot think of other important information that could not be
>>> generalized.
>>
>> I thought that the results of the SELECT query were responsible for
>> "populating" the sh:message.
>> In the sense that, if e.g. one wants to specify the node that has
>> violated a constraint in the message too, ?this (retrieved from the
>> query results) would have to be used.
>
> Yes correct. A naive implementation would auto-generate a query such as
>
> SELECT ?this ?subject ?predicate (?value AS ?object) ?datatype
> WHERE {
> ?this ?predicate ?value .
> FILTER (!sh:hasDatatype(?value, ?datatype)) .
> }
>
> based on the sh:validationFunction=sh:hasDatatype triple. It walks
> through the result set and for each row produces one violation, using
> the sh:message attached to the template. If the sh:message = "Your
> literal must have datatype {?datatype}" then the engine can determine
> that ?datatype is needed to populate the message, and therefore needs
> to be projected out from the SELECT. The same applies to ?this or the
> other variables. (I have implemented this today to confirm that it
> works).
>
> HTH
> Holger
Received on Thursday, 13 August 2015 06:28:37 UTC