Home:ALL Converter>SPARQL select labels with special characters

SPARQL select labels with special characters

Ask Time:2017-01-30T21:05:07         Author:Xaju

Json Formatter

I have a question concerning SPARQL. I´m automaticially generating SPARQL queries in Javascript. I have a Dropdown Menu with strings that can be searched for. When generating the Query this works fine, as long as my "String" doesn't contain special characters:

select ?coin ?place where {
   ?coin nmo:hasObjectType nm:coin.
   ?coin nmo:hasFindspot ?findspotid. 
   ?findspotid rdfs:label ?place.
   FILTER regex(?place, "String", "i") .
} LIMIT 10

If I put something like "Köln" or "Chmielów", I don´t get a result even though there should be a lot. Instead the Query transforms the String to "Köln" and "Chmielów". If I query this, I don´t get a result either.

Is there a way of automaticially escaping Special Characters? I don´t know the String before.

Author:Xaju,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/41936657/sparql-select-labels-with-special-characters
yy