-
Notifications
You must be signed in to change notification settings - Fork 30
sh:pattern does not allow testing IRIs #230
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
Comments
Per discussion on Issues 228 and 230. References: * #228 * #230 Signed-off-by: Alex Nelson <[email protected]>
PR #231 opened for group review and discussion. |
Like @tfrancart I was always certain that But a clarification is needed about the first argument
|
This is surely not a good idea. Blank node labels are almost certain to change any time a graph is parsed or transfered. IMO, the only meaningful improvement appears to be the addition of explicit handling of IRIs. I would represent this in SPARQL as BIN(REGEX(IF(ISIRI(?input), STR(?input), ?input), ?pattern) as ?five) |
On the other hand, I could see some use cases involving documentation quality control where this would be desirable. I'm not sure if supporting that just makes a huge foot-cannon, though. |
If Core is being unlinked from SPARQL, it will be odd to continue to rely on (I hope there will continue to be a WG-approved (non-normative) list of constraint as SPARQL. An appendix?) |
The intention was always to allow sh:pattern to be used on value nodes that are IRIs. I see nothing wrong with the spec. It states that the values of sh:pattern must be strings (which they are) and that the value nodes need to be converted to their STR. What specifically needs to be changed in the spec? (We can of course always add a non-normative clarification to explain that IRIs are fine). I think it's fine to continue to reference definitions from SPARQL in Core, if that makes the contracts clear, easier to implement and avoids having to reinvent things. |
Its the "1.1" effect! What was fine in a 1.0 needs refining as it becomes successful. Imagine implementing the core profile on its own.
https://www.w3.org/TR/xpath-functions/#func-matches Clarity and implementation help are non-normative (as are tests as far as definitions are concerned). Footnotes
|
Yes. But you can fix the name in CONSTRUCT or UPDATE.
So do you want to FORBID it for numbers and dates? |
Not sure, really. Matching the plain literal value can just work is most cases. Dates are indeed in a bit better position because you're less likely to have malformed value, or something that isn't ISO at all. With plain |
I don't see why we should exclude blank nodes. Generally, I would also consider it bad practice to match against blank nodes, but there could be specific cases where that may make sense. If we don't support blank nodes, the expected behavior would be that any attempt to match against a blank node should generate a failed validation result. That means any implementation that adds support for it would be no longer according to the specification. I propose to add comment that one may run into issues trying to do pattern match against blank nodes. And if one wants to match only against specific node types, the |
It would be a change in behavior from SHACL 1.0 - i.e. a SHACL 1.0 processor would behave differently to a SHACL 1.2 processor for the same input so if blank nodes are now allowed, it needs to be noted in the spec. Personally, I think support should at most be optional. If a SHACL processor can't support it/chooses not to support it, then that should not mean it can be described as "non conformant". In spec speak "MAY", not "MUST". To support it in Jena would require data graphs to be read with special label preserving. Blank node labels are only valid during parsing and not normally kept. To store additional label-as-seen information would be a database format change. (ShEx has blank node label matching. Jena does not run the tests for that feature.) |
Blank Node identifiers/labels are often misunderstood to be part of the blank node – they’re not, they are only a way to talk about a given blank node within a concrete serialization. The only way to reference/talk about a blank node within another graph is indirectly by describing it in relation to nodes that can be remotely identified. I think it’s a mistake for a spec to pretend that blank node identifiers are stable. |
I thought this discussion popped up as people have different interpretations of what is currently written in the spec, and therefore, a new definition will be created. I'm OK with keeping it like it is now. I think it's very clear.
If there should be a new definition, I would be for opening it for blank nodes. Optional is OK for me. But we should face reality, and blank nodes are not always used as intended. At some point, I may have to deal with a PR that either makes
I don't know the current situation, but about 2 years ago, the default config of Stardog kept the blank node identifiers of the parser in the store. That led to name clashes very quickly when importing two or more N-Triples files. I think that's clearly wrong, and if they want to support it, it should not be the default, but that's the reality of how blank nodes are used in some cases. |
Yes, but we’re writing specifications, not documenting implementation behavior. In RDF Concepts, blank nodes do not have persistent labels. RDF.rb also retains labels, but needs to do more work when graphs merge to avoid identifier collisions. A Note, or similar, on how implementations might extend the spec to handle persistent identifiers would be reasonable, but I don’t think the spec should call it an optional feature; that’s just promoting bad practice. |
OK, it looks like there was a lot of noise, but maybe that's because we mixed the topics of the definition of Can we vote on the topic |
Regarding the uniform formatting of numbers or dates, I would propose the usage of Node Expressions: [
sh:path [
xsd:dateTime [
sh:path ex:date
]
];
sh:pattern "..."
]. |
|
Originally posted by @tpluscode in #228
Originally posted by @ajnelson-nist in #228
The text was updated successfully, but these errors were encountered: