Thanks! I've never learned to read the algebra, should do that. Haven't heard of LATERAL too. Our oldish version of Jena seems not to understand it so maybe it's a newer feature...

On 06/11/2024 14:30, Lorenz Buehmann wrote:
if you use LATERAL keyword it might work:

SELECT * WHERE
{
        VALUES ?g { <https://example.com/a> }
        LATERAL {
          GRAPH ?g
          {
                 ?s a :blah .
                BIND(CONCAT(STR(?g), "/b") AS ?gb )
           }
        }
}

On 06.11.24 13:25, Lorenz Buehmann wrote:
Hi,

according to the algebra

(base <http://example/base/>
  (prefix ((: <http://purl.org/dc/elements/1.1/>)
           (rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>)
           )
    (join
      (table (vars ?g)
        (row [?g <https://example.com/a>])
      )
      (graph ?g
        (extend ((?gb (concat (str ?g) "/b")))
          (bgp (triple ?s rdf:type :blah)))))))

I guess ?g is not in scope of the graph pattern during evaluation, thus, STR fails, thus CONCAT fails, thus ?gb is unbound


Lorenz

On 06.11.24 13:05, Mikael Pesonen wrote:

Hi, why is this bind not working? This returns an empty column for ?ga. What is the correct way to add ?gb?

SELECT * WHERE
{
        VALUES ?g { <https://example.com/a> }
        GRAPH ?g
        {
                 ?s a :blah .
                BIND(CONCAT(STR(?g), "/b") AS ?gb )
        }
}

--
Lingsoft - 30 years of Leading Language Management

www.lingsoft.fi

Speech Applications - Language Management - Translation - Reader's and Writer's 
Tools - Text Tools - E-books and M-books

Mikael Pesonen
Semantic Technologies

e-mail: [email protected]
Tel. +358 2 279 3300

Time zone: GMT+2

Helsinki Office
Eteläranta 10
FI-00130 Helsinki
FINLAND

Turku Office
Kauppiaskatu 5 A
FI-20100 Turku
FINLAND

Reply via email to