- From: Holger Knublauch <holger@topquadrant.com>
- Date: Fri, 03 Apr 2015 08:45:17 +1000
- To: public-data-shapes-wg@w3.org
I would prefer the design as currently proposed in my draft, using a built-in function sh:hasShape. While this is sometimes portrayed as an extension to the SPARQL language, it is in fact just exploiting an official extension point of SPARQL that many platforms already use, with all kinds of new functions. If a SPARQL database or RDF API has SHACL support then turning its http://w3c.github.io/data-shapes/shacl/#operation-validateNodeAgainstShape operation into a SPARQL function is a trivial step - the functionality is already there it just needs to be wrapped by a function. The benefit of this design is greatly improved flexibility. In addition to the built-ins sh:valueShape and sh:OrConstraint that currently use sh:hasShape, anyone is free to add other high-level operands such as AND, NOT or whatever. Furthermore, sh:hasShape can serve as a simple form of classification engine, testing whether a given resource *could* be an instance of a given class or shape. The alternative to this function is to hard-code the behavior of sh:valueShape and sh:OrConstraint into the outer loop, which is not problem either, but why hard-code something that can also be easily soft-coded, and which has the above mentioned benefits... HTH Holger On 4/3/2015 6:24, Richard Cyganiak wrote: >> On 2 Apr 2015, at 20:48, Arthur Ryman <arthur.ryman@gmail.com> wrote: >> >> Richard, >> >> Seems like a useful idea. In the case that the extension language is >> SPARQL this requirement is implicitly satisfied since we are defining >> the semantics of 1) using SPARQL. However, even in SPARQL, the only >> way to reuse a query is to copy it, maybe as a subquery of a larger >> query. Are you proposing a way to package SPARQL queries so they are >> callable from SPARQL? > In Holger’s draft, there’s a facility to invoke SHACL evaluation as a SPARQL function. So you can ask in a SPARQL function if a certain node validates against a certain shape. This function is central to the way sh:valueShape is handled in Holger’s draft. This function would have to be implemented as a custom user function in the SPARQL engine. (This should be trivial in any SPARQL engine that supports user-defined functions.) > > In Peter’s draft, there’s no such facility, and sh:valueShape would instead be handled by syntactically expanding the query. > > I raised the issue hoping that somebody will say something that can inform discussion of the differences between these two proposals. > > Best, > Richard > > >> -- Arthur >> >> On Sat, Mar 28, 2015 at 4:17 PM, RDF Data Shapes Working Group Issue >> Tracker <sysbot+tracker@w3.org> wrote: >>> shapes-ISSUE-26 (invoke-highlevel): Can extensions invoke the high-level language? [SHACL Spec] >>> >>> http://www.w3.org/2014/data-shapes/track/issues/26 >>> >>> Raised by: Richard Cyganiak >>> On product: SHACL Spec >>> >>> It looks like SHACL will be split into two parts: >>> >>> 1) A high-level “Core/Lite” language consisting of things like cardinality constraints, datatype constraints, conjunctions and disjunctions >>> 2) An extension mechanism that relies on embedded expressions in a more expressive language >>> >>> Can the embedded expressions in 2) invoke named expressions defined using 1)? >>> >>> >>> >
Received on Thursday, 2 April 2015 22:46:37 UTC