Inference rule to generate a relationship between two instances

37 views
Skip to first unread message

Kai Liu

unread,
May 18, 2022, 5:31:53 AM5/18/22
to TopBraid Suite Users
I have two classes ClassA and ClassB, with each having an ID attribute. ClassA has an additional relationship hasB, which should point to an instance of ClassB, only if the IDs of both instances are equal. Is it possible to define a SHACL inference rule to auto-generate this relationship? The pseudo-code is as follows:

Input:
InstanceA a ClassA.
InstanceA :id "1234".
InstanceB a ClassB.
InstanceB :id "1234".

Expected output:
InstanceA :hasB InstanceB.

Any suggestions are much appreciated. Thanks.


David Price

unread,
May 18, 2022, 5:36:14 AM5/18/22
to topbrai...@googlegroups.com
Please see examples in the following spec of how to use SPARQL CONSTRUCT for the most general case of how to infer any triples. There are also built-in SHACL features you might use.


Cheers,
David 

--
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/eca2320e-9089-491a-8774-1c7348a72434n%40googlegroups.com.


Kai Liu

unread,
May 18, 2022, 5:08:23 PM5/18/22
to TopBraid Suite Users
Yes, these examples helped. I have been able to figure out how to do it. Thanks a lot, David.

Best regards, Kai

Reply all
Reply to author
Forward
0 new messages