-
Notifications
You must be signed in to change notification settings - Fork 30
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
Support for the {n,m} form for property paths #195
Comments
Yes I think this was requested by others too, and would potentially make sense for SHACL 1.2 for symmetry reasons with SPARQL alone. |
Note that the |
@jerdebsp Can you list some realistic use cases that use such a feature? |
Would these boundaries be implemented with extra predicates on the node that is the subject of |
@VladimirAlexiev sorry I missed this notification! We used it to get a particular sub-graph starting from a node and we only wanted to traverse up to a particular number of hops. A simple example could be a family tree - I want to get only up to 2nd generation of people from this particular node. @ajnelson-nist I think it should be Other possibility could be that instead of having functionality and predicates, we can have some abstract property that would need to have it's implementation plugged in the SHACL engine - similar to Jena's Abstract Functions. @HolgerKnublauch what do you think? That would ensure that the specs will only have what's commonly used, but on the other hand we can have additional predicates and functionality that can be shared (DASH comes into my mind - DASH + engine specific implementation?) |
See 3. on #215 I suggest to generalize sh:path to allow any Node Expression. Then see if the existing node expression types are sufficient to express what you need here, otherwise add a new expression type. |
I'm willing to think out loud about the alternative to @HolgerKnublauch 's generalization-of- @jerdebsp : I see a single predicate
I would prefer a pair of properties, with at least one being required to be provided. I'm not attached to these suggested property names. ex:SomePropertyShape
a sh:PropertyShape ;
sh:path (
[
sh:zeroOrMorePath ex:a ;
sh:atLeastPath 4 ;
sh:atMostPath 7 ;
]
[
sh:oneOrMorePath ex:b ;
sh:atLeastPath 0 ;
sh:atMostPath 3 ;
]
) ;
. We hadn't explicitly dived into it, but if this design were adopted, there's an argument for SHACL-SHACL being updated to flag that path component about Meanwhile, kind of a side note, I just thought of it while sketching the string examples - would the range of these properties need to be bounded to non-negative integers? I followed @TallTed 's link a bit, but didn't see number bounds specifically, unless they were bundled into the discussion on counting alluded to in SEP-0003 (current state linked). |
Yes I agree. Holger's suggestion is neat and less ambiguous |
@jerdebsp , I'm not as read up on the node expressions Holger had linked. Are you able to have a try at using that solution to model that weird property shape I'd done? I.e., adapting this SPARQL (purposefully avoiding SELECT ?focus
WHERE {
# 1 2 3 4 5? 6? 7? 1? 2? 3?
$this ex:a/ex:a/ex:a/ex:a/ex:a?/ex:a?/ex:a?/ex:b?/ex:b?/ex:b? ?focus .
} |
In SPARQL you can have a complex property path with the {n,m} form e.g
?otherClass (sh:property/sh:class){2,3} ?nodeShape .
or the {n} form?otherClass (sh:property/sh:class){2} ?nodeShape .
.Is it possible to add this to the SHACL property path for property shapes?
Thanks,
Jer
The text was updated successfully, but these errors were encountered: