Re: Help SPARQL

Bob was mostly right, but I suspect he needed coffee when he responded:

# set the appropriate prefix declarations
SELECT ?s ?p ?o WHERE {
  ?s owl:sameAs ?other .
  ?s ?p ?o
}


You don't want the ?other variable to be the same as the ?o variable,
or else you'll only see the statements between a subject and object
where those two resources are declared as the sameAs each other (most
of the time that will be just the one sameAs triple).

Regards,
Paul

On Thu, Apr 26, 2012 at 3:16 PM, Bob DuCharme <bob@snee.com> wrote:
> # assuming that the right namespaces are declared properly
> SELECT ?s ?p ?o WHERE {
>   ?s sameAs ?o .
>   ?s ?p ?o .
> }
>
> Bob
>
>
> On 4/22/2012 2:02 AM, reza ramezani wrote:
>
> Dear SPARQL Developers
> I need to a SPARQL comment that with it I extract Subjects along with their
> Predicates and Objects which the Subject at least
> have one sameAs Predicate.
> for example suppose I have below triples:
>
> A   knows   X1
> A   friendof   X2
> A   sameAs   X3
> B   knows   X4
> B   familarBy   X5
>
> I need to a SPARQL comment that extract bellow triples, because A has sameAs
> predicate
> A   knows   X1
> A   friendof   X2
> A   sameAs   X3
>
> How can I write such SPARQL
> Best Wishes
> Reza

Received on Thursday, 26 April 2012 20:58:30 UTC