On 2022-01-26 3:13 am, cbur...@healthwise.org wrote:
Holger,

I am able to create a second property shape, ex:shape2, that uses the values from my ex:shape1 in a very simple, non-transformative way and successfully returns the values of ex:shape1 for ex:shape2:

ex:Class-shape2
  a sh:PropertyShape ;
  sh:path ex:shape2 ;
  sh:class ex:Class
  sh:values [
      sh:path ex:shape1 ;
    ] ;
.

But the moment I try to introduce any more complexity, my sh:values statement stops returning any results. For example, I tried:

  sh:values [
    sh:path ( ex:shape1 skos:broader ) ;
    ]

Right, complex path expressions don't work in that case. This would have required a much more complex implementation that would hook into the SPARQL-like path execution. Doable in principle, just not implemented yet.

The alternative to the above is to use nested sh:path expressions, try something like

sh:values [
    sh:path skos:broader ;
    sh:nodes [
        sh:path ex:shape1 ;
    ]
]

This is based on the optional second argument (sh:nodes) that https://w3c.github.io/shacl/shacl-af/#node-expressions-path takes and would first get all values of ex:shape1 and then get the broader values of those. I believe this corresponds to your chained path expression.

Hope this works, didn't test... :)

Holger



and got back no values for ex:shape2. (All of the values returned for ex:shape1 have broader concepts, although they are defined in a different EDG asset collection.)

What am I doing wrong?

thanks,
Carl
On Thursday, January 20, 2022 at 5:01:18 PM UTC-8 Holger Knublauch wrote:


    On 2022-01-21 10:54 am, cbur...@healthwise.org wrote:
    Thanks, Holger. My need in this case isn't to query inferred data
    using SPARQL or GraphQL, but rather to reuse the inferred data as
    an input for another EDG property shape with another sh:values
    rule in it. I think I'm hearing that that's not possible.

    That scenario IS possible. You just need to use a path node
    expression, see

    https://w3c.github.io/shacl/shacl-af/#node-expressions-path

    So if ex:prop1 is inferred then you can reference it in the
    sh:values rule of another property using [ sh:path ex:prop1 ] and
    it will compute that inference on the fly. This assumes that the
    receiving property using a sh:values rule using SHACL node
    expressions, not SPARQL.

    Holger



    Can you point me to where I can read more about the
    materialization option and decide whether there's a way to make
    that work for this use case? Thanks.

    On Tuesday, January 18, 2022 at 4:03:32 PM UTC-8 Holger Knublauch
    wrote:


        On 2022-01-19 9:44 am, cbur...@healthwise.org wrote:
        I have defined a property shape and am successfully
        inferring its objects using a sh:values rule.

        Can you remind me whether it is possible to use this
        property and its inferred data in the sh:values rule for a
        different property shape? If so, is there a special way that
        it needs to be done -- like, does the data I inferred in the
        first property shape need to be materialized in some way
        before I can make use of it?  --

        In general, the RDF graphs that TopBraid operates on do not
        automatically "see" the extra inferred triples, so they are
        not computed as RDF triples on the fly. However, our higher
        level query languages GraphQL and JavaScript/ADS do see them
        whenever they are requested. The user interface goes through
        GraphQL and will therefore display these values as if they
        were materialized.

        Now, within SHACL itself it depends on what you want to do.
        If you have SHACL-AF inference rules including other
        sh:values rules you can safely use path expressions
        https://w3c.github.io/shacl/shacl-af/#node-expressions-path
        and the values will be computed on the fly. For SHACL
        constraints there is no such mechanism unless you are
        expressing the constraints in SPARQL. There you can use the
        magic property

            (?focusNode ?predicate) tosh:values ?result

        to query the inferred values.

        The other option, of course, is to materialize the
        inferences, e.g. using the Inferences panel or the Transform tab.

        Does this help?

        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/d1fc11f5-f4a3-4d23-84b7-4a72666e6c3fn%40googlegroups.com
        
<https://groups.google.com/d/msgid/topbraid-users/d1fc11f5-f4a3-4d23-84b7-4a72666e6c3fn%40googlegroups.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 topbraid-user...@googlegroups.com.
    To view this discussion on the web visit
    
https://groups.google.com/d/msgid/topbraid-users/3d423d68-4f62-4180-a44a-3143e6a1128fn%40googlegroups.com
    
<https://groups.google.com/d/msgid/topbraid-users/3d423d68-4f62-4180-a44a-3143e6a1128fn%40googlegroups.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 topbraid-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/6cd4990a-f08d-4461-b0bf-a15468f8d948n%40googlegroups.com <https://groups.google.com/d/msgid/topbraid-users/6cd4990a-f08d-4461-b0bf-a15468f8d948n%40googlegroups.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 topbraid-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/topbraid-users/38344e6d-c2b1-bf0f-e5df-3f77435cdedc%40topquadrant.com.

Reply via email to