Re: shapes-ISSUE-105 (defined prefixes): SHACL SPARQL constraints depend on namespaces in a graph, which is not defined [SHACL Spec]

On 10/30/15 7:16 AM, Arthur Ryman wrote:
> Holger,
>
> Why a fatal showstopper?

This assessment is based on many years of experience with SPIN. I 
believe if people are forced to enter queries with full URIs then 
SHACL's SPARQL extension mechanism will fail on the marketplace.

> It is not even clear that all the prefixes
> used in the SPARQL are required or defined in the shape Turtle file.
> There should be a mechanism to allow users to be explicit about the
> prefixes used in the SPARQL.

This already exists - they can put the PREFIX statements into the SPARQL 
query.

>
> Thinking about this more, a simpler approach is to let them define the
> PREFIXes in the SPARQL using SPARQL syntax. That way the queries are
> self-contained and can be tested outside the shape and can be
> immediately parsed without doing any fixups to the SPARQL source.

Yes, people can make this choice, but they should not be forced to do that.

Holger


>
> -- Arthur
>
> On Thu, Oct 29, 2015 at 4:58 PM, Holger Knublauch
> <holger@topquadrant.com> wrote:
>> Does anyone know of an API that doesn't have a Graph-level function to query
>> prefixes? Relying on users of SHACL to spell out every full URI in their
>> SPARQL queries, or requiring explicit triples to duplicate prefix
>> declarations are fatal show-stoppers in terms of useability.
>>
>> As a resolution, we may need to improve wording in the spec to clarify what
>> our assumptions are, e.g. to assume that a SHACL processor must preserve
>> prefixes from files so that they can be added into the SPARQL query
>> fragments before parsing. This is IMHO an editorial matter.
>>
>> Holger
>>
>>
>> On 10/30/15 6:46 AM, Arthur Ryman wrote:
>>> Peter,
>>>
>>> I am not sure this really makes sense since PREFIX is not an RDF
>>> concept. It is a syntactical concept in most RDF serializations,
>>> including Turtle of course. However, I believe that even in Turtle,
>>> you can redefine a PREFIX within the file so there is not necessarily
>>> a unique meaning for a prefix.
>>>
>>> To make prefixes explicit, the shapes graph could include triples to
>>> explicitly declare the prefixes used in SPARQL code. OSLC defined
>>> terms for this purpose, e.g. in [1]
>>>
>>> @prefix process: <http://jazz.net/ns/process#> .
>>>
>>> # prefixes for terms used in the vocabulary
>>>
>>> <#process-prefix> a oslc:PrefixDefinition ;
>>> oslc:prefix "process" ;
>>> oslc:prefixBase process: .
>>>
>>> [1]
>>> https://jazz.net/wiki/pub/LinkedData/JazzProcessVocabulary/process-vocabulary.ttl
>>>
>>> -- Arthur
>>>
>>> On Wed, Oct 28, 2015 at 10:23 PM, RDF Data Shapes Working Group Issue
>>> Tracker <sysbot+tracker@w3.org> wrote:
>>>> shapes-ISSUE-105 (defined prefixes): SHACL SPARQL constraints depend on
>>>> namespaces in a graph, which is not defined [SHACL Spec]
>>>>
>>>> http://www.w3.org/2014/data-shapes/track/issues/105
>>>>
>>>> Raised by: Peter Patel-Schneider
>>>> On product: SHACL Spec
>>>>
>>>> >From Section 6.2:
>>>>
>>>> Before parsing, a SHACL processor must prepend PREFIX statements for all
>>>> namespace prefixes defined in the current shapes graph.
>>>>
>>>> Namespace prefixes are not defined in an RDF graph, so this cannot be
>>>> done.
>>>>
>>>>
>>>>
>>

Received on Thursday, 29 October 2015 22:05:39 UTC