do IRIs in RDF graphs need to be URL encoded?

309 Views Asked by At

I am creating RDF triples/statements and I wonder if the IRIs which I use as subject, predicate, or object need to be URL encoded.

For example should the following IRI be

  • <http://example.org/instant/2015-08-12T16%3A44%3A00>

    or

  • <http://example.org/instant/2015-08-12T16:44:00>

This is basically a question about best practice. Thanks.

1

There are 1 best solutions below

1
On BEST ANSWER

They don't need to be URL encoded, except of course for characters that are invalid in certain positions - e.g., spaces.

However different formats will have different requirements. For example, your example IRI is not valid as a property IRI for RDF/XML: property IRIS are used as XML tags and need to be able to be written as ns:ncname, where ncname is a string starting with a letter or an underscore and not containing / or #. Your example has only numbers and dashes after the last /, so you may get a problem using it for a property.