?s2 is undefined in the second GRAPH.

On Fri, Feb 21, 2020 at 10:12 AM Mikael Pesonen
<[email protected]> wrote:
>
> Hi,
>
> I've got this query that first selects some resources (into ?s2), then
> gets all the resource triplets. BIND clause below is more complicated
> and i need to have the BIND there, but problem occurs with this
> simplified version too. So I'm expecting only the triplets for 5
> resources ?s2 but below query is returning all the triplets in graph
> https://resource.lingsoft.fi/graph/7641fe5e-f4af-4863-a1fa-484c77fa6df0.
> I must have error somewhere but could not find any help googling. Any
> ideas? It has something to do with bind inside the graph.
>
> CONSTRUCT { ?s ?p ?o }
> WHERE
> {
>          {
>                  SELECT DISTINCT ?s2 WHERE
>                  {
>                          GRAPH
> <https://resource.lingsoft.fi/graph/7641fe5e-f4af-4863-a1fa-484c77fa6df0>
>                          {
>                                  ?s2
> <http://www.w3.org/2006/vcard/ns#fn> "Some Body" .
>                          }
>                  }
>                  OFFSET 0 LIMIT 5
>          }
>
>          GRAPH
> <https://resource.lingsoft.fi/graph/7641fe5e-f4af-4863-a1fa-484c77fa6df0>
>          {
>              BIND (?s2 as ?s) ?s ?p ?o
>          }
> }
>
>
>
> Moving bind outside graph works as intended:
>
> CONSTRUCT { ?s ?p ?o }
> WHERE
> {
>          {
>                  SELECT DISTINCT ?s2 WHERE
>                  {
>                          GRAPH
> <https://resource.lingsoft.fi/graph/7641fe5e-f4af-4863-a1fa-484c77fa6df0>
>                          {
>                                  ?s2
> <http://www.w3.org/2006/vcard/ns#fn> "Some Body" .
>                          }
>                  }
>                  OFFSET 0 LIMIT 5
>          }
> BIND (?s2 as ?s)
>          GRAPH
> <https://resource.lingsoft.fi/graph/7641fe5e-f4af-4863-a1fa-484c77fa6df0>
>          {
>               ?s ?p ?o
>          }
> }
>
> Thanks,
> Mikael
>

Reply via email to