You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by Claude Warren <cl...@xenei.com> on 2021/04/15 09:25:42 UTC

SPARQL question

Is there a difference between

CONSTRUCT
  {
    ?s ?p ?o .
  }
WHERE
  { { WHERE
        { ?s  ?p  ?o}
    }
    ?s2  ?p2  ?o2
  }

and
CONSTRUCT
  {
    ?s ?p ?o .
  }
WHERE
  { { SELECT  *
      WHERE
        { ?s  ?p  ?o}
    }
    ?s2  ?p2  ?o2
  }

-- 
I like: Like Like - The likeliest place on the web
<http://like-like.xenei.com>
LinkedIn: http://www.linkedin.com/in/claudewarren

Re: SPARQL question

Posted by Andy Seaborne <an...@apache.org>.

On 15/04/2021 10:38, Martynas Jusevičius wrote:
> I guess the first one was meant to be
> 
> CONSTRUCT
>    {
>      ?s ?p ?o .
>    }
> WHERE
>    { { { ?s  ?p  ?o } }
>      ?s2  ?p2  ?o2
>    }

When building by code there may sometimes be modifiers on the sub-query 
and sometimes not. It might be easier to always put in the sub-query - 
the algebra doesn't contain anything for plain SELECT * {}.

     Andy

https://lists.apache.org/thread.html/r055920a11abc812c804945f660bed9fa091cb62c17d246f42e4810b7%40%3Cusers.jena.apache.org%3E

> 
> On Thu, Apr 15, 2021 at 11:31 AM Rob Vesse <rv...@dotnetrdf.org> wrote:
>>
>> Well the first is invalid syntax...?
>>
>> Rob
>>
>> On 15/04/2021, 10:26, "Claude Warren" <cl...@xenei.com> wrote:
>>
>>      Is there a difference between
>>
>>      CONSTRUCT
>>        {
>>          ?s ?p ?o .
>>        }
>>      WHERE
>>        { { WHERE
>>              { ?s  ?p  ?o}
>>          }
>>          ?s2  ?p2  ?o2
>>        }
>>
>>      and
>>      CONSTRUCT
>>        {
>>          ?s ?p ?o .
>>        }
>>      WHERE
>>        { { SELECT  *
>>            WHERE
>>              { ?s  ?p  ?o}
>>          }
>>          ?s2  ?p2  ?o2
>>        }
>>
>>      --
>>      I like: Like Like - The likeliest place on the web
>>      <http://like-like.xenei.com>
>>      LinkedIn: http://www.linkedin.com/in/claudewarren
>>
>>
>>
>>

Re: SPARQL question

Posted by Martynas Jusevičius <ma...@atomgraph.com>.
I guess the first one was meant to be

CONSTRUCT
  {
    ?s ?p ?o .
  }
WHERE
  { { { ?s  ?p  ?o } }
    ?s2  ?p2  ?o2
  }

On Thu, Apr 15, 2021 at 11:31 AM Rob Vesse <rv...@dotnetrdf.org> wrote:
>
> Well the first is invalid syntax...?
>
> Rob
>
> On 15/04/2021, 10:26, "Claude Warren" <cl...@xenei.com> wrote:
>
>     Is there a difference between
>
>     CONSTRUCT
>       {
>         ?s ?p ?o .
>       }
>     WHERE
>       { { WHERE
>             { ?s  ?p  ?o}
>         }
>         ?s2  ?p2  ?o2
>       }
>
>     and
>     CONSTRUCT
>       {
>         ?s ?p ?o .
>       }
>     WHERE
>       { { SELECT  *
>           WHERE
>             { ?s  ?p  ?o}
>         }
>         ?s2  ?p2  ?o2
>       }
>
>     --
>     I like: Like Like - The likeliest place on the web
>     <http://like-like.xenei.com>
>     LinkedIn: http://www.linkedin.com/in/claudewarren
>
>
>
>

Re: SPARQL question

Posted by Rob Vesse <rv...@dotnetrdf.org>.
Well the first is invalid syntax...?

Rob

On 15/04/2021, 10:26, "Claude Warren" <cl...@xenei.com> wrote:

    Is there a difference between

    CONSTRUCT
      {
        ?s ?p ?o .
      }
    WHERE
      { { WHERE
            { ?s  ?p  ?o}
        }
        ?s2  ?p2  ?o2
      }

    and
    CONSTRUCT
      {
        ?s ?p ?o .
      }
    WHERE
      { { SELECT  *
          WHERE
            { ?s  ?p  ?o}
        }
        ?s2  ?p2  ?o2
      }

    -- 
    I like: Like Like - The likeliest place on the web
    <http://like-like.xenei.com>
    LinkedIn: http://www.linkedin.com/in/claudewarren