This seems to work. If I make a data graph then instances of Person only show a 
“Car” instances of Vehicle when setting ownsVehicle. 

@prefix ex: <http://example.org/ontologies/davd#> .
@prefix graphql: <http://datashapes.org/graphql#> .
@prefix metadata: <http://topbraid.org/metadata#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix teamwork: <http://topbraid.org/teamwork#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

ex:Car
  a sh:NodeShape ;
  rdfs:label "Car" ;
  sh:property ex:Car-kind ;
  sh:targetObjectsOf ex:vehicleKind ;
.
ex:Car-kind
  a sh:PropertyShape ;
  sh:path ex:vehicleKind ;
  sh:datatype xsd:string ;
  sh:in (
      "Car"
    ) ;
.
ex:Person
  a owl:Class ;
  a sh:NodeShape ;
  rdfs:label "Person" ;
  rdfs:subClassOf owl:Thing ;
  sh:property ex:Person-name ;
  sh:property ex:Person-ownsVehicle ;
.
ex:Person-name
  a sh:PropertyShape ;
  sh:path ex:name ;
  sh:datatype xsd:string ;
  sh:name "name" ;
.
ex:Person-ownsVehicle
  a sh:PropertyShape ;
  sh:path ex:ownsVehicle ;
  sh:class ex:Vehicle ;
  sh:name "owns vehicle" ;
  sh:node ex:Car ;
.
ex:Vehicle
  a owl:Class ;
  a sh:NodeShape ;
  rdfs:label "Vehicle" ;
  rdfs:subClassOf owl:Thing ;
  sh:property ex:Vehicle-tag ;
  sh:property ex:Vehicle-vehicleKind ;
.
ex:Vehicle-tag
  a sh:PropertyShape ;
  sh:path ex:tag ;
  sh:datatype xsd:string ;
  sh:maxCount 1 ;
  sh:name "tag" ;
.
ex:Vehicle-vehicleKind
  a sh:PropertyShape ;
  sh:path ex:vehicleKind ;
  sh:datatype xsd:string ;
  sh:in (
      "Car"
      "Train"
    ) ;
  sh:maxCount 1 ;
  sh:name "vehicle kind" ;
.

Cheers,
David

> On 22 Jun 2023, at 18:22, [email protected] <[email protected]> 
> wrote:
> 
> Let's say I have a sh:NodeShape and an accompanying sh:PropertyShape -- call 
> it ex:NodeShape-myProperty. I want to specify that all targets of this 
> property shape must conform to particular pattern -- namely, they must have a 
> particular value for a particular property; i.e., the triple
> 
> ex:MyResource ex:requiredProperty ex:RequiredValue
> 
> must exist for each object of ex:myProperty. Ideally, I'd want EDG to only 
> display resources that met this pattern as possible objects to be selected in 
> the Editor for ex:myProperty -- not just use the pattern for validation when 
> saving the data.
> 
> How do I represent this? Can I do this using just sh:property, or do I need 
> to create another sh:NodeShape to represent the targets of 
> ex:NodeShape-myProperty? What would that look like?
> 
> It's a basic enough pattern that I was sure some examples would exist in the 
> TQ SHACL documentation, but I can't find any. Can anyone help? Thanks.
> 
> -- 
> The topics of this mailing list include TopBraid EDG and related technologies 
> such as SHACL.
> To post to this group, send email to [email protected]
> --- 
> 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/81724a8d-7694-44a2-84eb-1e40f7f7aa27n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/topbraid-users/81724a8d-7694-44a2-84eb-1e40f7f7aa27n%40googlegroups.com?utm_medium=email&utm_source=footer>.

UK +44 (0) 7788 561308
US +1 (336) 283-0808‬

-- 
The topics of this mailing list include TopBraid EDG and related technologies 
such as SHACL.
To post to this group, send email to [email protected]
--- 
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/40E9DD49-06DE-47C5-940D-9A503360FDEE%40topquadrant.com.

Reply via email to