Re: shapes-ISSUE-193 (Focus nodes): Targets can be refined; focus nodes do not change

On 11/2/16 6:31 PM, Holger Knublauch wrote:
>
>
> On 28/10/2016 2:50, RDF Data Shapes Working Group Issue Tracker wrote:
>> shapes-ISSUE-193 (Focus nodes): Targets can be refined; focus nodes do
>> not change
>>
>> http://www.w3.org/2014/data-shapes/track/issues/193
>>
>> Raised by: Karen Coyle
>> On product:
>>
>> Focus nodes are defined as "A node in the data graph that is validated
>> against a shape is called a focus node."
>>
>> Section 2. further defines focus nodes like this:
>>
>> "The set of focus nodes for a shape may be identified as follows:
>>
>> *specified in a shape using targets and filters,
>> *specified in any constraint that references a shape in parameters of
>> shape-based constraint components (i.e. sh:shape) or logical
>> constraint components (i.e. sh:or),
>> *specified as input to the SHACL processor for validating specific
>> nodes from the data graph against the shape, or
>>
>> Shapes can also provide non-validating information, such as labels and
>> comments."
>>
>> (That last sentence is a non sequitur because the section is about
>> focus nodes only.)
>>
>> Section 2.1 says:
>>
>> "2.1 Targets
>>
>> A target provides one way to specify potential focus nodes for a shape."
>>
>> and
>>
>> "Not all target nodes become focus nodes. When a shape includes
>> filters, filters can remove nodes specified by targets from the set of
>> the shape’s focus nodes."
>>
>> This seems to state that the nodes specified by targets ARE focus
>> nodes. I would end this after "targets" in the second sentence.
>
> Done:
> https://github.com/w3c/data-shapes/commit/c1855ed19630c9262bbe058e7880887e86dc56dd
>
>
>>
>> Then, section 2.2 says:
>>
>> "2.2 Filter Shapes
>>
>> A filter is a shape in the shapes graph that further refines the focus
>> nodes in the data graph that are validated against a constraint or all
>> the constraints of a shape."
>>
>> Again, this says that there are focus nodes that are refined - but
>> above it seems to say that only the actual nodes that are validated
>> are focus nodes. Instead, filters act on targets, not focus nodes.
>
> No, filter shapes *do* act on focus nodes, not (only) on targets.
> Filters are *always* evaluated, even if a shape is "directly"
> referenced, e.g. by ShEx-style targetless invocation or when they are a
> result of sh:shape only.

This is what contradicts the definition of focus nodes. On the one hand, 
only nodes that are actually validated are focus nodes. On the other, 
focus nodes exist before filters are applied, since filters can act on 
them. So the question is: when is a focus node "born"? If a focus node 
is something that can be further refined with a filter, then the 
original definition is not correct because there are focus nodes that 
are not the final validation node, since filters (which I assume are not 
validations) can further refine them.

Again, the statement in 2. is:
"A node in the data graph that is validated against a shape is called a 
focus node."

That defines focus nodes as "those that are validated against a shape."

Then the definition for targets says:
"Not all target nodes become focus nodes. When a shape includes filters, 
filters can remove nodes specified by targets." This doesn't mention 
focus nodes, and seems to me to be correct.

This was my original question, and it goes something like this:

Possibility A:

Apply a target = focusNode1
Apply a filter to focusNode1 = focusNode2
Apply a constraint to focusNode2 = focusNode3

Possibility B:

Apply a target = targetResult
Apply a filter to targetResult = filterResult
Apply a constrain to filterResult = focusNode

In other words which of these are focus nodes? From the definition, it 
seems like only the final nodes, after targets, filters, and constraints 
are applied, are focus nodes. But you seem to be referring to an 
"intermediate" focus node. I think that focus node should be reserved 
for the final selected node that is validated.

kc

>
> Can we close this ticket?
>
> Thanks
> Holger
>
>
>> This could be changed to:
>>
>> "A filter is a shape in the shapes graph that further refines the
>> definition of targets."
>>
>> This type of editing should be continued throughout wherever targets
>> and focus nodes are mentioned.
>>
>> My reading of the intended sense of focus nodes is that focus nodes
>> are not defined until all targets, shapes and constraints are applied.
>> In this case, the constraints are only those that can further define
>> the targeted nodes, but I'm not sure which constraints are under
>> consideration for this - some of them? all of them?
>>
>>
>>
>>
>
>
>

-- 
Karen Coyle
kcoyle@kcoyle.net http://kcoyle.net
m: 1-510-435-8234
skype: kcoylenet/+1-510-984-3600

Received on Thursday, 3 November 2016 04:34:41 UTC