- From: Holger Knublauch <holger@topquadrant.com>
- Date: Wed, 1 Jan 2025 14:28:39 +0100
- To: "Harvey, Philip" <philip.harvey@jpmorgan.com>
- Cc: "public-shacl@w3.org" <public-shacl@w3.org>
- Message-Id: <BC3BFB82-7DF9-40F4-9960-35789F5EBF3A@topquadrant.com>
Hi Philip, note that the SHACL CG has been closed and new work on SHACL will happen here https://www.w3.org/2024/12/data-shapes.html One of the planned deliverable of that WG is a dedicated spec for inferencing rules. Your requirements would be useful input for that. Until the work on that document is ramping up, I remain curious why you don't just use SPARQL-based rules, as the expressiveness of SPARQL seems to cover your use case already. If you are looking for an RDF syntax to represent such rules, then one option would be to introduce an RDF syntax for SPARQL. This is what was done in the (now obsolete) SPIN RDF syntax. The alternative would be to reinvent another rule language that again would then need to be implemented while SPARQL is already widely implemented. Holger > On 17 Dec 2024, at 12:12 PM, Harvey, Philip <philip.harvey@jpmorgan.com> wrote: > > Hi, > > I’m new to this group and am looking for some help. I also just joined the SHACL Community Group. > > We want to use SHACL to validate data and to infer new triples. We think we need to implement a custom sh:rule type. > > We want to find out whether there’s already been any work in this area, get some advice on designing the rule structure & semantics, and explore whether this could be included in a future version of the SHACL-AF spec. > > This is what the rule type needs to do: > Generate new IRIs, e.g. based on a random UUID. > Generate chains of triples, e.g. :ExistingTerm :x :NewTerm1 . :NewTerm1 :y :NewTerm2 … > Generate triples whose object is a node at some arbitrary other path in the data graph, or even a term that was generated by another rule. > We think the most convenient way to do this is for the rule to refer to a shape that matched that path. > > Here’s an example. > > Initial data graph: > > :Event1 > a :incomingEvent ; > :destinationClass :Class1 . > > Desired inferred triples: > > :Event1 :triggersChange :Change-abc-123-def . # this ‘change’ has a UUID-based IRI > :Change-abc-123-def :happenedTo :Process-ghi-456-jkl . # we generate a chain of triples > > # the object of the triple below is the destinationClass from the initial data graph. > # We’d like to write an sh:rule that achieves this by referring to the Shape that validates the destinationClass, > # to save us repeating the same property path in our shapes and in our rules. > :Process-ghi-456-jkl :isOfClass :Class1 . > > Notes: > We are happy to write our own engine or extend an existing one. > Ideally we’ll write our inference logic in pure RDF without resorting to SPARQL. > The trickiest part seems to be expressing the ‘long range bind’ in a rule, e.g. to reference :Class1 in the example above. > > Sorry this is a rather long message. I can split this into separate threads, or individual GitHub issues, depending on where this discussion goes. > > Thanks, > Phil > > > This message is confidential and subject to terms at: https://www.jpmorgan.com/emaildisclaimer including on confidential, privileged or legal entity information, malicious content and monitoring of electronic messages. If you are not the intended recipient, please delete this message and notify the sender immediately. Any unauthorized use is strictly prohibited.
Attachments
- text/html attachment: stored
- image/vnd.microsoft.icon attachment: favicon.ico
Received on Wednesday, 1 January 2025 13:28:56 UTC