1

The SPARQL spec has two notions of URIs, namely URIs and IRIs. IRIs are a subset of URIs that do not contain apostrophes and other assorted crap (Appendix A2: http://www.w3.org/TR/rdf-sparql-query/).

For better or worse I have created nodes in my graph with apostrophe in the URIs. How do I go about querying those? I cannot find any descriptions of escaping rules for IRIs...?

flag
"IRIs are a subset of URIs" -- no, they're a generalisation. I guess you're referring to "IRIs, a subset of RDF URI References" from the sparql spec. "URI Ref" was used in the RDF specs to anticipate what IRIs would be (they were developed in parallel). When you see "URI Ref" read "IRI", although they're slightly different. – Comment Bot Jun 6 at 16:51
@Comment_Bot thanks for the clarification! – friism Jun 6 at 19:46

1 Answer

1

Not 100% sure, but I'd think you need to URLencode those characters. So an apostrophe should be encoded as %27. I often use this handy tool to quickly do this kind of stuff.

link|flag
No dice. Say we want to find this guy: dbpedia.org/page/Landry_N'Guémo This query returns no results: dbpedia.org/snorql/?query=SELECT+%3Ftype+WHERE+{%0D%0A%3Chttp://dbpedia.org/ressource/Landry_N%2527Gu%25C3%25A9mo%3E+a+%3Ftype%0D%0A} – friism Jun 6 at 19:44
@friism you got all the encoding right! But “resource” is spelled with a single “s” in English. Fix that and your query will work. – cygri Jun 6 at 20:24
got-it, thanks! – friism Jun 7 at 7:47

Your Answer

Get an OpenID
or

Not the answer you're looking for? Browse other questions tagged or ask your own question.