Small performance note, you should use a union in the where clause to
prevent a Cartesian product:

CONSTRUCT {
  <MY_NS://knowledge/my_resource> ?p1 ?o1 .
  ?s2 ?p2 <MY_NS://knowledge/my_resource> .
}
WHERE {
  { <MY_NS://knowledge/my_resource> ?p1 ?o1 . }
  union
  { ?s2 ?p2 <MY_NS://knowledge/my_resource>  . }
}

-Stephen

On Mon, Jun 23, 2014 at 8:45 AM, Bob DuCharme <[email protected]> wrote:

> The SPARQL spec is a bit vague on what DESCRIBE should return ("The RDF
> returned is determined by the information publisher"), which is why some
> endpoints return only the triples that have that resource as a subject, and
> others also return triples that have that as a subject. The simplest way to
> get exactly the triples you want is to specify them with a CONSTRUCT query
> like this:
>
> CONSTRUCT {
>   <MY_NS://knowledge/my_resource> ?p1 ?o1 .
>   ?s2 ?p2 <MY_NS://knowledge/my_resource>  .
> }
> WHERE {
>   <MY_NS://knowledge/my_resource> ?p1 ?o1 .
>   ?s2 ?p2 <MY_NS://knowledge/my_resource>  .
> }
>
> Bob DuCharme
> learningsparql.com
>
>
> On 6/23/2014 8:11 AM, Thorben Wallmeyer wrote:
>
>> Hi all,
>>
>> I've got a model/graph that I would like to query. All I do is executing
>> the query "DESCRIBE <MY_NS://knowledge/my_resource>". This returns me
>> all statements that use the named resource as subject. What do I have to
>> do, to get all statements that use this resource as object, too? How does
>> the query has to look like? Everything i tried did not have the expected
>> effect.
>>
>>
>> Can you give me a hint?
>>
>>
>> Thanks in advance,
>>
>> Thorben
>>
>>
>

Reply via email to