python - How to reference a page that contains parenthesis in SPARQL -


i trying lookup information regarding on dbpedia name contains parenthesis in case ending _(musician) leads error.

select ?birthplace {   dbpedia:tom_johnston_(musician) dbpprop:birthplace ?birthplace    } 

parentheses aren't legal in prefixed names, can use full uri instead:

select ?birthplace {     <http://dbpedia.org/resource/tom_johnston_(musician)> dbpprop:birthplace ?birthplace    } 

it's possible escape them using \:

sparql local names allow non-alphanumeric characters allowed in iris via backslash character escapes (e.g. ns:id\=123).

select ?birthplace {     dbpedia:tom_johnston_\(musician\) dbpprop:birthplace ?birthplace    } 

Comments