Inverse Path ?

16 views
Skip to first unread message

Maatary Okouya

unread,
Mar 25, 2024, 7:33:14 PMMar 25
to TopBraid Suite Users
Hi, 

I have a model as follow

Relation have 1 or more Evidence i.e. min 1
An Evidence must support 1 Relation i.e. min 1 max 1

I would like to express the the fact that "A Relation has as Evidence, An Evidence that support it" 
In other words, if a Relation point to an evidence, that evidence must point to that relation. 

What is the correct to model that in SHACL. 

I obviously looked into inverse path, but could not figure out how to do it with it. 

Any suggestion


David Price

unread,
Mar 26, 2024, 3:39:02 AMMar 26
to 'Felix Sasaki' via TopBraid Suite Users
It you use inverses, there is no actual reverse triple … so it is not possible for the inverse to not “point" to the correct source instance.

EDG has a Modify action that will make an inverse of an existing relationship property for you ,and you just name it and set the cardinality as needed.


--
The topics of this mailing list include TopBraid EDG and related technologies such as SHACL.
To post to this group, send email to topbrai...@googlegroups.com
---
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/66aa40e6-305f-4192-975c-e485a2aed1b5n%40googlegroups.com.

Maatary Okouya

unread,
Apr 13, 2024, 4:53:40 AMApr 13
to TopBraid Suite Users
Thank you for this.
Just for comparison, 
would you please be able to send me the file generated by the above. I would like to see how the shacl look like behind the scene, making sure i am doing exactly the same. 

thanks.

Maatary Okouya

unread,
Apr 13, 2024, 5:09:33 AMApr 13
to TopBraid Suite Users
If i may i just want to make sure that I understand your statement in full.

>> It you use inverses, there is no actual reverse triple … so it is not possible for the inverse to not “point" to the correct source instance.
When you say if you use "inverses", do you mean https://www.w3.org/TR/shacl/#property-path-inverse the shacl construct, or the owl construct owl:inverseOf or owl:inverseFunctional ?

In our current model there is a property from Relation to Evidence called supportedBy and a property from Evidence to Relation called Support
We have not used any owl construct to connect them so far.


On Tuesday, March 26, 2024 at 7:39:02 AM UTC David Price wrote:

Maatary Okouya

unread,
Apr 13, 2024, 5:48:48 AMApr 13
to TopBraid Suite Users
What we are trying to say is: 

If Relation1 is supportedBy Evidence1
Then
Evidence 1 must support Relation1

With the additional constraint that a Relation can be supportedBy multiple Evidence, and an Evidence can only support 1 Relation

David Price

unread,
Apr 13, 2024, 5:49:19 AMApr 13
to 'Felix Sasaki' via TopBraid Suite Users
# baseURI: urn:x-evn-master:inverse_example_schema

@prefix metadata: <http://topbraid.org/metadata#> .
@prefix teamwork: <http://topbraid.org/teamwork#> .

ex:Evidence
  a owl:Class ;
  a sh:NodeShape ;
  rdfs:label "Evidence" ;
  rdfs:subClassOf owl:Thing ;
  sh:property ex:Evidence-description ;
  sh:property ex:Evidence-isSupportedBy-inverse ;
.
ex:Evidence-description
  a sh:PropertyShape ;
  sh:path ex:description ;
  sh:datatype xsd:string ;
  sh:maxCount 1 ;
  sh:name "description" ;
.
ex:Evidence-isSupportedBy-inverse
  a sh:PropertyShape ;
  sh:path [
      sh:inversePath ex:isSupportedBy ;
    ] ;
  sh:class ex:ProposedRelationships ;
  sh:name "supports" ;
.
ex:ProposedRelationships
  a owl:Class ;
  a sh:NodeShape ;
  rdfs:label "Proposed Relationships" ;
  rdfs:subClassOf owl:Thing ;
  sh:property ex:ProposedRelationships-description ;
  sh:property ex:ProposedRelationships-isSupportedBy ;
.
ex:ProposedRelationships-description
  a sh:PropertyShape ;
  sh:path ex:description ;
  sh:datatype xsd:string ;
  sh:maxCount 1 ;
  sh:name "description" ;
.
ex:ProposedRelationships-isSupportedBy
  a sh:PropertyShape ;
  sh:path ex:isSupportedBy ;
  sh:class ex:Evidence ;
  sh:name "is supported by" ;
.
<urn:x-evn-master:inverse_example_schema>
  a owl:Ontology ;
  metadata:status metadata:UnderDevelopmentStatus ;
  rdfs:label "Inverse Example Schema" ;
.

David Price

unread,
Apr 13, 2024, 5:51:52 AMApr 13
to 'Felix Sasaki' via TopBraid Suite Users

On 13 Apr 2024, at 11:48, Maatary Okouya <maatar...@gmail.com> wrote:

What we are trying to say is: 

If Relation1 is supportedBy Evidence1
Then
Evidence 1 must support Relation1

With the additional constraint that a Relation can be supportedBy multiple Evidence, and an Evidence can only support 1 Relation

Just a sh:minCount and sh:maxCount to any property shape (including inverses) involved to set the cardinality to whatever you need.
Reply all
Reply to author
Forward
0 new messages