On 16/09/2020 06:13, cbur...@healthwise.org wrote:

                    2. *A different property pair constraint:* This
                    case is nearly the opposite of the above. Suppose
                    I wish to specify that any value of ex:property4
                    (which has sh:maxCount 1) *must be* one of the
                    values of ex:property5 (which has no sh:maxCount).
                    How would I express that? (I don't see a way to do
                    it using sh:equals.)

                SPARQL-based constraint

            Yes or dash:subSetOf already implements this SPARQL
            constraint:

            http://datashapes.org/constraints.html#SubSetOfConstraintComponent
            
<https://nam02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdatashapes.org%2Fconstraints.html%23SubSetOfConstraintComponent&data=02%7C01%7Ccburnett%40healthwise.org%7C29db85d271374b14b53808d859a6129d%7Ccee5d4e942e548c28a033406fd5b9242%7C0%7C0%7C637357917099406940&sdata=cj1sbmpSxLsMip%2Fog3p5%2Fh8zEoT3TSNCczd58mT9FI8%3D&reserved=0>

            Holger


Holger, when using dash:subSetOf, is there a way to put an *or *in there? Like, a property's value must be a subset of property_1 OR property_2?

One option is to surround it with an outer sh:or, e.g.

ex:TestShape
    a sh:NodeShape ;
    sh:or (
        [
            sh:property [
                sh:path ex:property1 ;
                dash:subSetOf ex:other ;
            ]
        ]
        [
            sh:property [
                sh:path ex:property2 ;
                dash:subSetOf ex:other ;
            ]
        ]
    ) .

Depending on your desired semantics, you may also use a | path expression:

ex:TestShape
    a sh:NodeShape ;
    sh:property [
        sh:path [
            sh:alternativePath ( ex:property1 ex:property2 )
        ] ;
        dash:subSetOf ex:other ;
    ] .

The meaning of the latter is that the combined values of prop1 and prop2 must be a subset, so this may not be the exact semantics that you need.

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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/topbraid-users/aa2dd3d8-8247-e9a7-6499-992c588686f4%40topquadrant.com.

Reply via email to