Hi Carl,
hard to say without seeing the exact example that you have. I have
created a simple example with the same pattern that seems to work in
principle. Attached, look at ex:InstanceA.
If you need further help on this, please send me the exact data that you
have tried so far.
Thanks
Holger
On 2022-04-07 5:30 am, Carl Burnett wrote:
That approach produces a diagram that “looks right,” but it doesn’t
return any data.
Are property shapes that produce inferred values allowed to be reused
in that way? I’m still fuzzy as to exactly when the SHACL engine
allows reuse of inferred values and when it doesn’t.
*From:* [email protected]
<[email protected]> *On Behalf Of *Holger Knublauch
*Sent:* Thursday, March 31, 2022 3:40 PM
*To:* [email protected]
*Subject:* Re: [topbraid-users] Re-using inferred sh:values (again)
*** External email: use caution ***
On 2022-04-01 4:13 am, [email protected] wrote:
I've been digging back into some SHACL work that I discussed with
Holger
<https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fg%2Ftopbraid-users%2Fc%2Fb4pARn09t3s%2Fm%2F986x35OmAgAJ&data=04%7C01%7Ccburnett%40healthwise.org%7C17a6d1601c0c4b450b1308da13675a72%7Ccee5d4e942e548c28a033406fd5b9242%7C0%7C0%7C637843631883047062%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=2crOjQuTD0YL5UbamAQJbrQ75niC8LWkmSMMHw79cb0%3D&reserved=0>
a couple months ago. I'm still bumping up against what seems to be
a limitation in the expressivity of sh:values when it comes to
re-using inferred values, but I'm probably just doing it wrong.
Let's assume that ex:inferredValueProp is a property shape that
produces inferred values for my dataset via its own sh:values
rules, defined elsewhere. Expressions like this one are accepted
as valid by EDG:
sh:values [
sh:filterShape [
sh:property [
sh:path ex:prop ;
sh:hasValue ex:Value ;
] ;
] ;
sh:nodes [
sh:path (
ex:inferredValueProp ex:prop2
) ;
] ;
]
But this produces no values. Holger has said this is because
inferred values cannot be reused in complex path expressions like
this. Instead, he suggests to use nested path expressions like this:
sh:values [
sh:path ex:prop2 ;
sh:nodes [
sh:path ex:inferredValueProp ;
]
]
But if I do this, where would I put my sh:filterShape?
Have you tried
sh:values [
sh:filterShape [
sh:property [
sh:path ex:prop ;
sh:hasValue ex:Value ;
] ;
] ;
sh:nodes [
sh:path ex:prop2 ;
sh:nodes [
sh:path ex:inferredValueProp ;
]
]
]
which would first evaluate the "path" expression ex:inferredValueProp
/ ex:prop2 and then keep those values of prop2 that have ex:prop ex:Value.
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/topbraid-users/3cda939c-d235-4db5-a6ce-bac67f1cdee3n%40googlegroups.com
<https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Ftopbraid-users%2F3cda939c-d235-4db5-a6ce-bac67f1cdee3n%2540googlegroups.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=04%7C01%7Ccburnett%40healthwise.org%7C17a6d1601c0c4b450b1308da13675a72%7Ccee5d4e942e548c28a033406fd5b9242%7C0%7C0%7C637843631883047062%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=QT%2BmuKMUGcbJfbxl0eafng%2B%2Fkj3r2v9qVtHSuYuMeLA%3D&reserved=0>.
--
You received this message because you are subscribed to a topic in the
Google Groups "TopBraid Suite Users" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/topbraid-users/Nr0g5xaOtVg/unsubscribe
<https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Ftopic%2Ftopbraid-users%2FNr0g5xaOtVg%2Funsubscribe&data=04%7C01%7Ccburnett%40healthwise.org%7C17a6d1601c0c4b450b1308da13675a72%7Ccee5d4e942e548c28a033406fd5b9242%7C0%7C0%7C637843631883047062%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=TgQXxN63YUVcJ9IqHaAzJkbSUOsQfqMLLquS5TxCX4o%3D&reserved=0>.
To unsubscribe from this group and all its topics, send an email to
[email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/topbraid-users/78b2f249-c1fa-d356-a1bb-796ec7a8177d%40topquadrant.com
<https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Ftopbraid-users%2F78b2f249-c1fa-d356-a1bb-796ec7a8177d%2540topquadrant.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=04%7C01%7Ccburnett%40healthwise.org%7C17a6d1601c0c4b450b1308da13675a72%7Ccee5d4e942e548c28a033406fd5b9242%7C0%7C0%7C637843631883047062%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=8BPi5S0Wl%2FH1F2TqbOruVQNJT6s%2Bv1sA7IHBVYpg4NI%3D&reserved=0>.
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/topbraid-users/MWHPR19MB1598AC7796B95CA2AC34C61BB7E79%40MWHPR19MB1598.namprd19.prod.outlook.com
<https://groups.google.com/d/msgid/topbraid-users/MWHPR19MB1598AC7796B95CA2AC34C61BB7E79%40MWHPR19MB1598.namprd19.prod.outlook.com?utm_medium=email&utm_source=footer>.
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/topbraid-users/60f4792c-6657-151c-0c62-6bedaf0a92ea%40topquadrant.com.
# baseURI: http://example.org/nestedinf
# imports: http://datashapes.org/dash
# prefix: ex
@prefix dash: <http://datashapes.org/dash#> .
@prefix ex: <http://example.org/nestedinf#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
<http://example.org/nestedinf>
a owl:Ontology ;
<http://topbraid.org/swa#defaultNamespace> "http://example.org/nestedinf#" ;
rdfs:label "New File (nestedinf.ttl)" ;
owl:imports <http://datashapes.org/dash> ;
.
ex:ClassA
a owl:Class ;
a sh:NodeShape ;
rdfs:label "Class A" ;
rdfs:subClassOf owl:Thing ;
sh:property ex:ClassA-inferredProp1 ;
sh:property ex:ClassA-inferredProp2 ;
sh:property ex:ClassA-self ;
.
ex:ClassA-inferredProp1
a sh:PropertyShape ;
sh:path ex:inferredProp1 ;
sh:description "returns all instances of color" ;
sh:name "inferred prop 1" ;
sh:nodeKind sh:IRI ;
sh:values [
sh:path [
sh:inversePath rdf:type ;
] ;
sh:nodes ex:Color ;
] ;
.
ex:ClassA-inferredProp2
a sh:PropertyShape ;
sh:path ex:inferredProp2 ;
sh:name "inferred prop 2" ;
sh:nodeKind sh:IRI ;
sh:values [
sh:filterShape [
sh:property [
sh:path ex:stop ;
sh:hasValue true ;
] ;
] ;
sh:nodes [
sh:path ex:inferredProp1 ;
sh:nodes [
sh:path ex:self ;
] ;
] ;
] ;
.
ex:ClassA-self
a sh:PropertyShape ;
sh:path ex:self ;
sh:description "Simple inference pointing at itself." ;
sh:name "self" ;
sh:nodeKind sh:IRI ;
sh:values sh:this ;
.
ex:Color
a owl:Class ;
a sh:NodeShape ;
rdfs:label "Color" ;
rdfs:subClassOf owl:Thing ;
sh:property ex:Color-stop ;
.
ex:Color-stop
a sh:PropertyShape ;
sh:path ex:stop ;
sh:datatype xsd:boolean ;
sh:maxCount 1 ;
sh:name "stop" ;
.
ex:InstanceA
a ex:ClassA ;
rdfs:label "Instance A" ;
.
ex:green
a ex:Color ;
rdfs:label "green" ;
.
ex:red
a ex:Color ;
ex:stop true ;
rdfs:label "red" ;
.
ex:yellow
a ex:Color ;
rdfs:label "yellow" ;
.