-
Notifications
You must be signed in to change notification settings - Fork 30
feat: #407 add support for sh:TripleTerm to sh:nodeKind and allow lists #410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: gh-pages
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is good to have sh:TripleTerm added, but I really don't think we should support rdf:Lists here as values. The common combinations are already covered with sh:BlankNodeOrIRI etc, and the use case for a combination of TripleTerm with others is very very rare. And in those corner cases, people can already use sh:or. But introducing list syntax here is yet another option that then needs to be supported by editing tools and any algorithm that walks shape structures, for example to determine whether a property is literal-typed. There is a lot of flow-on cost from such seemingly little tweaks to the spec.
Symmetry suggests that I think the use of a list makes sense and |
I also see pros and cons: Cons:
Pros:
I favor making this change mainly because of the last point about node expressions. |
I am not blocking this but I think at we should deprecate the OR variations when the lists get allowed. Best to be put on the agenda for the next meeting. |
Could you explain that please? |
@afs The OR values must be translated before they can be processed with a generic list or set function. The following example uses a generic [
sh:nodeKind [
ex:intersection(ex:funcThatReturnsNodeKinds() (sh:BlankNode sh:Literal))
]
].
[
sh:nodeKind [
ex:intersection(ex:funcThatReturnsNodeKinds() (sh:BlankNodeOrLiteral))
]
].
[
sh:nodeKind [
ex:intersection(ex:funcThatReturnsNodeKinds() ([ex:nodeKindToList(sh:BlankNodeOrLiteral)]))
]
]. |
I remain worried about the complexity of having to support too many combinations of expressing the same thing. Right now it is easy, for example, for an ontology editing UI to offer a drop-down list of the (6) options. What would happen if there are now different internal options for the same thing, how would the user chose between the URIs and an rdf:List. Also, lists could then potentially be like ( sh:BlankNodeOrIRI sh:Literal ) which is redundant to ( sh:BlankNode sh:IRI sh:Literal ). These little things make static analysis of ontologies harder for downstream algorithms. |
I can see the concerns regarding backward compatibility, especially lists mixed with single-value elements and multi-value elements. We can't eliminate the problem, but we can provide tools to simplify the usage with inconsistent value elements: A node expression function could be defined as part of the SHACL specification that accepts an IRI or a list of node-kind elements, single-value and multi-value, as an argument. That function will return a list of single-value elements. One can expect that environments with SPARQL engines will expose node expression functions also as SPARQL functions. The function would also be available as a SPARQL function in that case. Example: [
sh:toNodeKindList ( sh:BlankNodeOrIRI sh:Literal )
] ...would return the following list: ( sh:BlankNode sh:IRI sh:Literal ) |
If we decide to allow lists-as-nodeKinds, we could mandate that only the 4 primitive values are permitted, not the Or IRIs. Otherwise: malformed shapes graph. |
Closes #407