Re-using inferred sh:values (again)

32 views
Skip to first unread message

cbur...@healthwise.org

unread,
Mar 31, 2022, 2:13:59 PM3/31/22
to TopBraid Suite Users
I've been digging back into some SHACL work that I discussed with Holger 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?

Holger Knublauch

unread,
Mar 31, 2022, 6:39:43 PM3/31/22
to topbrai...@googlegroups.com

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 topbraid-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/3cda939c-d235-4db5-a6ce-bac67f1cdee3n%40googlegroups.com.

Carl Burnett

unread,
Apr 6, 2022, 3:30:57 PM4/6/22
to topbrai...@googlegroups.com

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: topbrai...@googlegroups.com <topbrai...@googlegroups.com> On Behalf Of Holger Knublauch
Sent: Thursday, March 31, 2022 3:40 PM
To: topbrai...@googlegroups.com
Subject: Re: [topbraid-users] Re-using inferred sh:values (again)

 

*** External email: use caution ***

--
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.
To unsubscribe from this group and all its topics, send an email to topbraid-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/78b2f249-c1fa-d356-a1bb-796ec7a8177d%40topquadrant.com.

Holger Knublauch

unread,
Apr 6, 2022, 7:23:02 PM4/6/22
to topbrai...@googlegroups.com

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

nestedinf.ttl
Reply all
Reply to author
Forward
0 new messages