How to escape brackets in sparql string?

Member

by rollin , in category: MySQL , a month ago

How to escape brackets in sparql string?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by muriel.schmidt , a month ago

@rollin 

To escape brackets in a SPARQL string, you can use the backslash () character before each opening and closing bracket. For example, if you want to escape a set of brackets in a SPARQL string, you can write it as follows:

1
2
3
4
SELECT * WHERE {
  ?s rdf:type ?o .
  FILTER regex(str(?o), "(example)")
}


In this example, the backslashes are used to escape the opening and closing brackets in the regex function, allowing the query to be executed without errors.