On Thu, 31 Aug 2017 09:48:51 +0200, Dave Reynolds <dave.e.reyno...@gmail.com> wrote:

1c. If your rules can't be stratified, i.e. one rule can indirectly trigger itself, then it's more complex. In that case you would have to e.g. run the set of SPARQL Updates repeatedly until nothing new is deduced. Depending on the specifics of the rules and the data that may be quite expensive and you would be better off with something Jena rules. However, in some cases you may be able to use things like SPARQL property paths to achieve the desired effect without have to recurse.

On 31/08/17 14:23, baran...@gmail.com wrote:

As a simple example to close this with a concrete thing:

@prefix skos: <http://www.w3.org/2004/02/skos/core#> .

[myrules5: (?x skos:subject ?y), (?y skos:broader ?z) -> (?x skos:subject ?z)]

What would you give as the equivalent SPARQL Update?

So that's an example of a rule which affects itself so, as explained, it's not necessary a single SPARQL update. However, that falls into the "sometimes you can use path expressions" get out. So it would be something like (untested):

PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
INSERT {
    ?x skos:subject ?z
} WHERE {
    ?x skos:subject/skos:broader+ ?z
};

Dave

Reply via email to