SPARQL query error

My query in SPARQL is the following:
stardog query PruebaOntologia “SELECT ?z
WHERE { ?x :nombre ?z.
FILTER (REGEX(?z, “^Alb”)).
}”
According to the W3C documentation, the syntax is correct. I should recover the triplet that has the name Alberto, for example.
But I have the following error:
Encountered " “^” "^ “” at line 3, column 29.
Was expecting one of:
“(” …
“!” …
“+” …
“-” …
“if” …
“tz” …
“md5” …
“str” …
“sum” …
“min” …
“max” …
“avg” …
“abs” …
“day” …
“now” …
“IRI” …
“URI” …
“ceil” …
“year” …
“sha1” …
“uuid” …
“lang” …
“true” …
“rand” …



I will appreciate if you can help me. Regards!
Atte: Gabriel Dehner

Hi Gabriel,

The query looks fine in general. It looks like you might have a “smart quote” if your query text. Can you try re-typing the double quotes around the regex string in Stardog Studio when you execute the query?

Jess

Excuse me but I do not know how to do that. How do I do it?

In the query editor, you will need to position the cursor immediately following the quote. Then press backspace and type the quote character. Do this for each of the quotes surrounding the regular expression.

Jess

Try to copy and replace your query with this one
SELECT ?z WHERE { ?x :nombre ?z.
FILTER (REGEX(?z, “^Alb”)).
}
The problem is probably this ’ “ ’ before ^Alb.
HTH

Many thanks. Greetings.

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