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.
https://w3c.github.io/shacl/shacl-af/#rules-examples Cheers, David > On 18 May 2022, at 10:31, Kai Liu <[email protected]> wrote: > > 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. > > > > -- > 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/eca2320e-9089-491a-8774-1c7348a72434n%40googlegroups.com > > <https://groups.google.com/d/msgid/topbraid-users/eca2320e-9089-491a-8774-1c7348a72434n%40googlegroups.com?utm_medium=email&utm_source=footer>. UK +44 (0) 7788 561308 US +1 (336) 283-0808 -- 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/7F076030-5792-4A15-9FB0-A045B2C4671C%40topquadrant.com.
