Hi Scott,

I may not fully understand your scenario, but I don't think this can be expressed in SHACL Core. The problem is not so much in the matching pattern (with the types etc) but in the subPropertyOf link. The last line would need to become something with sh:qualifiedMinCount 1 but you would need a sh:path and the sh:path cannot be computed dynamically, i.e. you cannot use a variable that gets computed using subPropertyOf. It would only work if you can know the sub-properties in advance, when you write the constraint.

You have it formulated in SPARQL already, so why not stay in SHACL-SPARQL? Does your target platform only support SHACL Core?

Holger


On 2021-09-03 4:01 pm, Scott Henninger wrote:
Another SHACL question for the topbraid-users group:

This one is a bit hard to explain, but the general idea is to create a shape that requires two target classes, and the hierarchical parent must be one of three classes, and the target cannot have any properties are a sub-property of a property.

Working it out a bit I believe the following is the equivalent query in SPARQL:

SELECT *
WHERE {
   $this a ex:Cls1, ex:Cls2  .
   { $this ex:parent/rdf:type ex:Cls3 . }
   UNION
   { $this ex:parent/rdf:type ex:Cls4 . }
   UNION
   { $this ex:parent/rdf:type ex:Cls5. }
   ?prop rdfs:subPropertyOf ex:assoc .
   $this ?prop ?x
}

Any $this found by this query would be a violation, based on the last triple pattern - i.e. the rest are requirements,that are taken up by other shapes.  But what I want here is to report if the target class combination, with appropriate parents, has one of the ex:assoc sub-properties.  To paraphrase: "Instances of Cls1 and Cls2 ... cannot have any ex:assoc properties.

Any hints or direction on this would be useful.  I've tried a few things but have so far failed to make much headway.

Appreciate it and TIA.
-- Scott
--
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/3a55f966-d99d-4d32-875e-3e32a1f643c4n%40googlegroups.com <https://groups.google.com/d/msgid/topbraid-users/3a55f966-d99d-4d32-875e-3e32a1f643c4n%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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/topbraid-users/cca816bc-26db-4af4-2881-4ee80ff7866e%40topquadrant.com.

Reply via email to