String manipulation ambiguous return type in SPARQL query

Hi I’m trying to build a SPARQL query using String Manipulation (Variable) Node.
In input it gets flow variable data from a table, it should replace item column with the desired query, but I get only ‘ambiguous return type’ error

Hi,
in your expression you need to wrap string literals in double quotes. Additionally you need to use the join() function for concatenating literals and variables. Like this:

join("select ?name where { ?instance bf2:title ", $${Sitem}$$, " . ?instance schema:name ?name }")

You can also insert line breaks with the escape sequence “\n”.
Kind regards
Alexander

3 Likes

Thank you. It worked.
The final query at the end was:
join("PREFIX bf2: <http://id.loc.gov/ontologies/bibframe/> \n prefix schema:<http://schema.org/> \n select ?name where { \n ?instance bf2:title <http://dati.cobis.to.it/instance/title/", $${Sitem}$$, "> .\n ?instance schema:name ?name \n}")

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.