简体   繁体   中英

Internationalized QNames/CURIs

Are non Latin characters allowed in the local part of QNames/CURIs? I have the following prefix definition: @prefix namespace <http://example.org/namespace/> .

And the following URIs:

<http://example.org/namespace/Sense_en_aircraft>
<http://example.org/namespace/Sense_ru_аэроплан>

are both QNames correct?: namespace:Sense_en_aircraft and namespace:Sense_ru_аэроплан

This is not very clear to me. Possible source: https://www.w3.org/2001/tag/doc/qnameids , https://www.w3.org/TR/xml/ , https://www.w3.org/TR/curie/ and RFC3987

The rules for QNames and CURIEs are quite unrelated to each other, so this is really two separate questions.

The term QName has several different meanings depending on which spec you are referring to, but it is essentially a triple comprising prefix, local part, and namespace. The prefix and local part are both defined as NCNames, and can most definitely contain non-Latin characters; the exact set of characters depends on which version/edition of the XML specification you reference.

The question of what is allowed in the namespace part is a little ambiguous. In the Namespaces 1.0 specification, a namespace name was defined to be a URI reference (as defined in RFC 3986); in Namespaces 1.1 is was defined to be an IRI (as defined in RFC 3987). IRIs of course can include non-Latin letters, but URIs cannot. However, the Conformance statement of both documents states the conditions for a document to be conformant, and these conditions do NOT include a requirement that the namespace name be a valid URI or IRI. I understand that this omission was deliberate. Most software handling QNames therefore accepts any string of characters as a legitimate namespace name.

And yet, many RDF validators or parsers in my experience will not accept non-Latin characters, complaining about them not being valid QNames. Example I saw today was via https://www.w3.org/2015/03/ShExValidata/ , which liked the first two examples but not the third.

dct:source <http://test.org/simple>;
dct:source <http://example.org/namespace/Sense_en_aircraft>;
dct:source <<http://example.org/namespace/Sense_ru_аэроплан>;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM