English 中文(简体)
RDF 有效特性
原标题:RDF valid characters
  • 时间:2011-11-23 14:52:35
  •  标签:
  • xml
  • rdf

Are all XML valid characters considred valid in RDF?

我发现,在维基佩亚,XML具有有效特性:

    U+0009, U+000A, U+000D: these are the only C0 controls accepted in XML 1.0;
U+0020–U+D7FF, U+E000–U+FFFD: this excludes some (not all) non-characters in the BMP (all surrogates, U+FFFE and U+FFFF are forbidden);
U+10000–U+10FFFF: this includes all code points in supplementary planes, including non-characters.
最佳回答

RDF 但是,在你写上某些辛加税的字面字面时,如果是统法协会的话,那么你必须谨慎地遵守 s的规则。 RDF/XML是XML syntax (I edited it in 2004),因此限制了统法协会的密码特征,并且有自己的编码规则,使你能够逃脱诸如>、<、>

You also have to use a Unicode encoding to turn the characters into sequences of bytes, UTF-8 and UTF-16 are common. These don t restrict the characters you can write down.

答案确实取决于你的含义。 在实践中,你不大可能希望使用统法协会的编码特性,这种特性不能在XML或RDF/XML中合法写成,因为它包括大量的统法协会编码。

问题回答

人们应当更好地利用Wikipedia的原始规格。 allowed natures in XML 1.0:

Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]
/* any Unicode character, excluding the surrogate blocks, FFFE, and FFFF. */

The set of allowed characters in XML tag names is even more restricted.

The set of allowed character sequences in RDF literals is defined as "being a Unicode [UNICODE] string, which SHOULD be in Normal Form C [NFC]". The set of Unicode characters is codepoint U+0000 to U+10FFFF (minus 66 non-characters depending on your point of view).

Anyway, the set of allowed Unicode characters includes characters explicitly forbidden in XML. See also the SO question Why are "control" characters illegal in XML 1.0?. In XML 1.1 the set of characters was broadened to

Char ::= [#x1-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]
/* any Unicode character, excluding the surrogate blocks, FFFE, and FFFF. */

举例来说,在《刑法》中仍然不能表达特征(U+0000)。





相关问题
how to represent it in dtd?

I have two element action and guid. guid is a required field when action is add. but when action is del it will not appear in file. How to represent this in dtd ?

.Net application configuration add xml-data

I need to add xml-content to my application configuration file. Is there a way to add it directly to the appSettings section or do I need to implement a configSection? Is it possible to add the xml ...

XStream serializing collections

I have a class structure that I would like to serialize with Xstream. The root class contains a collection of other objects (of varying types). I would like to only serialize part of the objects that ...

MS Word splits words in its XML format

I have a Word 2003 document saved as a XML in WordProcessingML format. It contains few placeholders which will be dynamically replaced by an appropriate content. But, the problem is that Word ...

Merging an XML file with a list of changes

I have two XML files that are generated by another application I have no control over. The first is a settings file, and the second is a list of changes that should be applied to the first. Main ...

How do I check if a node has no siblings?

I have a org.w3c.dom.Node object. I would like to see if it has any other siblings. Here s what I have tried: Node sibling = node.getNextSibling(); if(sibling == null) return true; else ...

Ordering a hash to xml: Rails

I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml