Re: SELECTing s properties in the same query

Sat, 15 Apr 2017 02:41:15 -0700

In a trivial way, perhaps you can specify something like:

SELECT * WHERE {
  <subject-1> ?property ?object
  OPTIONAL {
    ?object ?subProperty ?subObject .
    FILTER (isBlank(?object))
  }
}

This assumes nothing about structure and may perform badly.


On Fri, Apr 14, 2017 at 4:17 PM, Laura Morales <[email protected]> wrote:

> If I have these nquands (in Turtle syntax)
>
>
>     <subject-1>
>         ns:name "My name" ;
>         ns:address [
>             ns:street "Street name" ;
>             ns:number "42" .
>         ] .
>
>     <subject-2>
>         ns:name "Another name" ;
>         ns:address [
>             ns:street "Another street" ;
>             ns:number "24" .
>         ] .
>
>     etc....
>
>
> here, ns:address links to blank nodes. What I'd like to do is "SELECT
> everything about <subject-1>", but if I do a SELECT on <subject-1> what I
> get in return is something like
>
> {
>   {
>     "s": <subject-1>
>     "p": ns:name
>     "o": "My name"
>   }
>   {
>     "s": <subject-1>
>     "p": ns:address
>     "o": "name-of-the-blank-node"
>   }
> }
>
> so I have to perform another query to retrieve the properties of
> "name-of-the-blank-node". How can I retrieve all information in one single
> query instead (= subject's name + full address instead of a blank node id)?
>

Reply via email to