[data-shapes] Make 'sh:class' a purely semantic condition (without seemingly unrelated syntactic strictures) (#275)

wouterbeek has just created a new issue for https://github.com/w3c/data-shapes:

== Make 'sh:class' a purely semantic condition (without seemingly unrelated syntactic strictures) ==
### Observation

Since typed literals denote instances of some member of `rdfs:Datatype`, the following should -- semantically speaking -- validate with no errors. After all, the literal `"1"^^xsd:integer` denotes an instance of class `xsd:integer`.

```turtle
[] sh:class xsd:integer; sh:path :p.
[] :p 1.
```

However, the SHACL 1.0 standard (Section 4.1.1) currently states that a validation error should be raised in case the node is syntactically expressed as a literal. This syntactic stricture is in force, regardless of whether the node denotes an instance that belongs to that class expressed with 'sh:class'.

This results in odd cases, where nodes that denote the same thing (e.g. 2 nodes that both denote the integer '1') are validated differently. For example:

```turtle
[] sh:class xsd:integer; sh:path :p.
[] :p 1. # Raises a validation error.
[] :p <one>. # Passes validation with no errors.
<one> a xsd:integer; owl:sameAs 1. # Even though both denote the same thing.
```

### Expected

The condition that is expressed by 'sh:class' is semantic in nature, and does not depend on whether a node is expressed syntactically as an IRI or a literal. (After all, there are already other properties in SHACL that allow syntactic conditions to be expressed, e.g. 'sh:nodeKind'.)


Please view or discuss this issue at https://github.com/w3c/data-shapes/issues/275 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 25 February 2025 18:59:06 UTC