modules/rdf/sparql/w3cresults.zzm

rdf-0.0.3 documentation

NAME

rdf/sparql/w3cresults - W3C SPARQL result-set comparison helpers.

SYNOPSIS

  from rdf/sparql/w3cresults import sparql_w3c_results_match_file;

  ok(sparql_w3c_results_match_file(actual, result_path));

DESCRIPTION

This module contains test-support helpers for comparing SPARQL results against W3C result-set fixtures. It handles SELECT/ASK result files, graph-result files, blank node matching, XML literals, optional bindings, and unordered result bags.

EXPORTS

Functions

  • sparql_w3c_graph_match(Array actual, Array expected)

    Returns true if two graph-result quad arrays match, including blank node isomorphism.

  • sparql_w3c_graph_match_file(actual, path)

    Parses the expected graph result from path and compares it with actual.

  • sparql_w3c_read_results(path)

    Reads a W3C SPARQL result-set XML or JSON fixture and returns a result dictionary.

  • sparql_w3c_results_match(actual, expected)

    Compares two SPARQL SELECT or ASK result dictionaries.

  • sparql_w3c_results_match_file(actual, path)

    Reads the expected W3C result fixture and compares it with actual.

COPYRIGHT AND LICENCE

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