I have a few URLs containing square brackets like http://example.org/foo[1]bar I can create a TDB2 dataset without much problems, with warnings but no errors. I can also query these nodes "indirectly", that is if I query them by some property and not by URI. My problem is that I cannot query them directly by URI. As soon as I try to use the URIs explicitly in a query, for example "DESCRIBE <http://example.org/foo[1]bar>", I receive this error
ERROR SPARQL :: [line: 1, col: 10] Bad IRI: 'http://example.org/foo[1]bar': <http://example.org/foo[1]bar> Code: 0/ILLEGAL_CHARACTER in PATH: The character violates the grammar rules for URIs/IRIs. I tried escaping, "foo\[1\]bar" but it doesn't work. I tried converting from a string, FILTER(?id = URI("http://example.org/foo[1]bar")) but it doesn't work What else could I try?