Re: From syntactic to interpreted triple

On fredag 22 januari 2021 kl. 14:19:43 CET Pierre-Antoine Champin wrote:
> On 22/01/2021 12:59, thomas lörtsch wrote:
> >> On 21. Jan 2021, at 16:43, Pierre-Antoine Champin
> >> <pierre-antoine.champin@ercim.eu> wrote:
> >> 
> >> +1 to what Olaf wrote below.
> >> 
> >> As an example, I used Jos' implementation of RDF* in EYE, and William Van 
Woensel super-nice N3 editor, to illustrate this with a small example:
> >>      http://ppr.cs.dal.ca:3002/n3/editor/s/j7yBphsy
> >> 
> >> In this example, I have two predicates that link files to triples:
> >> 
> >> * :contains keeps referential opacity (nothing to do)
> >> 
> >> * :entailsForMe has some form of referential transparency (implemented
> >> through N3 rules: any triple with the same meaning as one contained in
> >> the file is also entailed for me by that file)>> 
> >> By running it in EYE (click "execute"), you can see that the conclusions 
contain:
> >>    :report :contains <<:superman :can :fly>>.
> >>    :report :entailsForMe <<:superman :can :fly>>.
> >>    :report :entailsForMe <<:clark :can :fly>>.
> >> 
> >> but NOT
> >> 
> >>    :report :contains <<:clark :can :fly>>.
> > 
> > Paraphrasing James’ question to Olaf: how would you do that in SPARQL?
> 
> AFAIK, you can not write recursive queries in SPARQL, which makes it a
> limited rule langue compared to N3. But a simplified version of my N3
> example would be
> 
> CONSTRUCT {
>      ?file :entailsForMe <<?s2 ?p2 ?o2>>.
> } WHERE {
>      ?file :contains <<?s ?p ?o>>.
>      ?s owl:sameAs ?s2.
>      ?p owl:sameAs ?p2.
>      ?o owl:sameAs ?o2.
> }

I assume you wanted to write the following query instead, right?

CONSTRUCT {
     ?file :entailsForMe <<?s2 ?p2 ?o2>>.
} WHERE {
     ?file :entailsForMe <<?s ?p ?o>>.
     ?s owl:sameAs ?s2.
     ?p owl:sameAs ?p2.
     ?o owl:sameAs ?o2.
}


Olaf

Received on Friday, 22 January 2021 13:49:11 UTC