How to escape brackets in sparql string?

Member

by rollin , in category: MySQL , 5 months ago

How to escape brackets in sparql string?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by muriel.schmidt , 5 months 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.

Related Threads:

How to convert to string search in sparql?
How to bind a string with a variable in sparql?
How to add a string variable to the sparql query?
How to get the classes matching for a string in sparql?
How to delete brackets after a special letter in regex?
How to replace strings in brackets with <span> tags in mysql?