I think a path of ratingCount|reviewCount with sh:minCount 1 is the cleanest approach. So if the blank node isn't very meaningful yet, maybe you'd need to adjust the results display accordingly? You could also specify a nice sh:message to explain what's really going on at the property shape.
ex:AggregateRatingShape
a sh:NodeShape ;
sh:targetClass schema:AggregateRating ;
sh:property [
sh:path [ sh:alternativePath ( schema:ratingCount
schema:reviewCount ) ] ;
sh:minCount 1 ;
sh:message "AggregateRating can have either or both of
ratingCount and reviewCount" ;
] .
Of course you'd also need the individual property shapes for the
two properties, with no sh:minCount.
Alternatively, use sh:or at the node shape, yet that might even be more complicating.
Holger
--
You received this message because you are subscribed to the Google Groups "TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to topbraid-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/CADnyxpsmyhQ7j7-qYDdu87iPvQ6Fo09je97%3DStwqzK3cj5N55Q%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/a015277b-e436-b190-1893-fa5507b6f820%40topquadrant.com.
Just to follow up on that last example, which even I don't think should ever work, here's another that I was nearly certain would do something:
ex:AggregateRatingShape
a sh:NodeShape ;
sh:property [
sh:path schema:reviewCount ;
sh:or (
[ sh:minCount 1 ]
[ sh:node [
sh:property [
sh:path (
[ sh:inversePath schema:reviewCount ]
schema:ratingCount );
sh:minCount 1 ;
] ;
];
]
) ;
];
sh:targetClass schema:AggregateRating ;
.
And this is where I'd like to ask some naive questions about sh:inversePath
in the parent/child example, the schema:children triple doesn't actually exist however the value is inferred, given sh:values by tracing an incoming sh:inversePath schema:parent. Is it fair to say that a sh:property (or PropertyShape) uses sh:path to "place the context pointer" at the Object value? (ie ?s ?path ?Object) and so we test datatype, class etc of that graph node, and sh:node would place us also at that Object? I had hoped that from sh:node I could draw a sh:inversePath back to give me the ?s of this triple, ie the instance of the class that the NodeShape lists as sh:targetClass, and so, from there, I had hoped to draw a new sh:path out to that alternate schema:ratingCount value to test for a minCount. I get confused just describing it.
if I use sh:inversePath at the sh:NodeShape level (outside of sh:property blocks) does this make the context now some subject ?s that links to this sh:targetClass instance via the property provided as the 'argument' to sh:inversePath, while using it within sh:PropertyShape it is referring to ?Object indicated by the shape's sh:path?
I'm thinking that what I really want to do is use sh:sparql or sh:ask ...
Yes, I agree with the latter statement. That's what SHACL-SPARQL was added for, and you don't need to artificially try to get inferences, path expressions and target statements right. Note that sh:values rules are not applied by default during validation.
Holger
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/CADnyxpvwrsxjT9PVx%3DEV0SD%2BVc%3D9xZ%2B91%2B9e1BrXpxZ6br_Vcg%40mail.gmail.com.