modules/rdf/sparql/results.zzm

rdf-0.0.3 documentation

NAME

rdf/sparql/results - SPARQL result serializers.

SYNOPSIS

  from rdf/sparql/results import sparql_results_serialize;

  let json := sparql_results_serialize(result, "json");

DESCRIPTION

This module serializes SPARQL SELECT and ASK result dictionaries to the W3C JSON, XML, CSV, and TSV result formats. Graph query results should be serialized with RDF graph serializers such as N-Triples or N-Quads.

EXPORTS

Functions

  • sparql_results_json(Dict result)

    Returns SPARQL Results JSON.

  • sparql_results_xml(Dict result)

    Returns SPARQL Results XML.

  • sparql_results_csv(Dict result)

    Returns SPARQL Results CSV.

  • sparql_results_tsv(Dict result)

    Returns SPARQL Results TSV.

  • sparql_results_serialize(Dict result, String format)

    Dispatches to one of the serializers. format may be json, xml, csv, or tsv. Throws for unsupported formats.

COPYRIGHT AND LICENCE

rdf/sparql/results 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.