On 11/25/2020 8:48 AM, Steve Ray wrote:
I agree with you. Is there no way to have "variable" predicates in native SHACL? Or is my only option here to use the embedded SPARQL?

Exactly. SHACL node expressions do not have a notion of variables. It is intentionally limited to be easier, but then doesn't offer all features that SPARQL does. There is nothing wrong with using SPARQL node expressions as a fallback.

Holger



Steve




On Tue, Nov 24, 2020 at 12:51 PM Irene Polikoff <[email protected] <mailto:[email protected]>> wrote:

    There is no path in your example that could get from ?this to
    ?prop. A path specifies predicates. You do not have predicates to
    specify - you are finding out your predicates in the first WHERE
    statement. This is why you need to have 2 statements in the WHERE
    clause and can’t boil them down to a path expression in a single
    statement.

    On Nov 24, 2020, at 12:39 PM, Steve Ray <[email protected]
    <mailto:[email protected]>> wrote:

    I'm trying to get comfortable with using SHACL code and wean
    myself from embedded SPARQL. However, I'm having some trouble
    mapping certain common SPARQL patterns into the
    SHACL counterpart. Specifically, here's an example. I'm trying to
    find all the values of any property that is a subPropertyOf a
    parent property (c223:hasProperty).
    The SPARQL should (I think) be something like this:

    c223:PropertiesShape
      rdf:type sh:PropertyShape ;
      sh:path c223:hasProperty ;
      sh:name "PropertiesShape" ;
      sh:values [
          sh:sparql [
              sh:prefixes <http://www.w3.org/2000/01/rdf-schema
    <http://www.w3.org/2000/01/rdf-schema>> ;
              sh:select """SELECT DISTINCT ?prop
                                 WHERE {
                                 ?property rdfs:subPropertyOf*
    c223:hasProperty .
                                 $this ?property ?prop .
    }""" ;
            ] ;
        ] ;
    .

    I know the following is wrong, but not sure what sh: calls I
    should be using:

    c223:PropertiesShape
      rdf:type sh:PropertyShape ;
      sh:path c223:hasProperty ;
      sh:name "PropertiesShape" ;
      sh:values [
          sh:distinct [
              sh:nodes [
                  sh:path (
                      [
                        sh:zeroOrMorePath rdfs:subPropertyOf ;
                      ]
                      c223:hasProperty
                    ) ;
                ] ;
            ] ;
        ] ;
    .

    This gives me a "malformed SHACL expression", so there are
    definitely problems.

    My real question is, how does one duplicate this pattern in SHACL?:

    WHERE {
                                 ?property rdfs:subPropertyOf*
    <parentProperty> .
                                 $this ?property ?result .
    }




    Steve



-- 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]
    <mailto:[email protected]>.
    To view this discussion on the web visit
    
https://groups.google.com/d/msgid/topbraid-users/CAGUep87nmSVo5eziHPh6ExbPD1%3DD%3DWrfTNOwNtK0PBww21%3DpgA%40mail.gmail.com
    
<https://groups.google.com/d/msgid/topbraid-users/CAGUep87nmSVo5eziHPh6ExbPD1%3DD%3DWrfTNOwNtK0PBww21%3DpgA%40mail.gmail.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]
    <mailto:[email protected]>.
    To view this discussion on the web visit
    
https://groups.google.com/d/msgid/topbraid-users/11EA64E3-07D1-4DAF-A609-21C84A739254%40topquadrant.com
    
<https://groups.google.com/d/msgid/topbraid-users/11EA64E3-07D1-4DAF-A609-21C84A739254%40topquadrant.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] <mailto:[email protected]>. To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/CAGUep87Hq%3DPv7rCT0f3aQPU%2BzYo27dA1eodYyGe9ZOoh4D9opA%40mail.gmail.com <https://groups.google.com/d/msgid/topbraid-users/CAGUep87Hq%3DPv7rCT0f3aQPU%2BzYo27dA1eodYyGe9ZOoh4D9opA%40mail.gmail.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/41fa8018-8314-3e9b-b854-7fbc1e70f87a%40topquadrant.com.

Reply via email to