modules/rdf/serializer/rdfxml.zzm

rdf-0.0.3 documentation

NAME

rdf/serializer/rdfxml - Pretty RDF/XML serializer.

SYNOPSIS

  from rdf/serializer/rdfxml import RdfXmlSerializer;

  let xml := (new RdfXmlSerializer()).serialize(quads);

DESCRIPTION

RdfXmlSerializer serializes default-graph RDF quads as RDF/XML. It uses the shared RDF serializer plan so subject ordering, predicate ordering, safe blank-node nesting, and RDF collection detection match the other human-oriented serializers.

The serializer emits typed node elements when a subject has an IRI rdf:type, nests blank nodes which are only the object of one triple, uses rdf:parseType="Collection" for resource-only RDF lists, and falls back to explicit blank-node identifiers where nesting would be unsafe.

EXPORTS

Classes

  • RdfXmlSerializer
    • serialize(Array quads)

      Returns RDF/XML for the default graph in quads.

    • serialize_each(Array quads, Function emit)

      Calls emit with the serialized RDF/XML text when there is output. Returns the serializer.

COPYRIGHT AND LICENCE

rdf/serializer/rdfxml is copyright Toby Inkster.

It is free software; you may redistribute it and/or modify it under the terms of either the Artistic License 1.0 or the GNU General Public License version 2.