public class XMLRendering
extends Object
From the spec:
The XML formatter creates an XML representation that is very similar to the
JSON representation. The outermost object is a element with
format and version attributes.
The resource described in the element is the entry point
into the graph, as described above (the item for an item endpoint,
the page for a list endpoint).
Resources are mapped onto XML elements as follows:
if the resource is a blank node that is the object or more
than one statement within the graph, the element is given a id
attribute that contains a unique identifier for that blank node
otherwise, if the resource is not a blank node,
the element is given an href attribute that contains the
URI of the resource
The RDF properties of a resource are mapped onto XML elements. The
name of the XML element is:
the short name for the property, as described in the property paths section,
if it has one
the rdfs:label of the property, if it is a legal short name for a property
that doesn't clash with an existing name
the local name of the property (the part after the last hash or slash),
if it is a legal short name for a property that doesn't clash with an existing name
the prefix associated with the namespace of the property (the part
before the last hash or slash), concatenated with an underscore,
concatenated with the local name of the property, if the local
name is allowable as a shortname;
[Elda special] if that name isn't allowed as an element name, then
a reversible and almost readable encoding of the URI which is.
The contents of the XML element is a sequence of - elements if the RDF
property has more than one value in the RDF graph or if the api:multiValued
property of the RDF property has the value true.
Each RDF value is mapped onto some XML content as follows:
if the value is a literal, it is mapped to a text node holding the
value itself; lang or datatype attributes on the element hold the
language code and the short name of the datatype as applicable
otherwise, if the value is a rdf:List, it is mapped to a sequence
of
- elements, one representing each of the results of mapping
the members of the list to XML
otherwise, if the value is a resource which is the subject of
a statement in the RDF graph, it is mapped onto an XML element
as described here
otherwise, if the value is a blank node with no properties
it is mapped onto an empty XML element (with an id attribute
if it it referenced more than once)
otherwise, if the value is a resource the element is given an
href attribute whose value is the URI of the resource