- From: Holger Knublauch <holger@topquadrant.com>
- Date: Wed, 8 Jun 2016 14:04:02 +1000
- To: "public-data-shapes-wg@w3.org" <public-data-shapes-wg@w3.org>
Again on the topic of having to repeat the same SPARQL logic in multiple places, potentially raising development costs. SHACL (like SPIN) includes a concept of user-defined SPARQL functions, see section 9 of the spec [1]. The whole point of having these functions is to encapsulate reusable business logic so that it can reused in multiple queries. So even if you have a complex constraint condition to check, there is a good chance that you can delegate that condition into a helper function, and then wrap it with different (trivial) boilerplate code for each case. This also allows users to write efficient unit tests, against the key function. User-defined functions are one of the most widely used features of SPIN, and have saved countless hours of writing queries. Holger [1] http://w3c.github.io/data-shapes/shacl/#functions
Received on Wednesday, 8 June 2016 04:04:37 UTC