[redland-dev] fix and proposed patch for rdfproc --results

Leigh L. Klotz, Jr. klotz at graflex.org
Wed Apr 25 17:36:01 EDT 2012


I found that 'rdfproc --results' always fails, no matter what result type
is given:

It fails with these packages:
 http://download.librdf.org/source/raptor2-2.0.7.tar.gz
 http://download.librdf.org/source/rasqal-0.9.28.tar.gz
 http://download.librdf.org/source/redland-1.0.15.tar.gz
 http://download.librdf.org/source/redland-bindings-1.0.14.1.tar.gz

The same bug appears in the earlier versions currently in the Ubuntu
Oneiric repository.

Here is how it fails:

    $ rdfproc -s postgresql -t
"host='localhost',database='red',user='red',password='*'" test query
sparql - 'select ?s,?p,?o where { ?s ?p ?o}'  --results rdfxml
    rdfproc: invalid argument `rdfxml' for `-r / --results'
    Try 'rdfproc -r / --results help' for a list of valid query result
formats
    Try `rdfproc -h / --help' for more information.


If you ask for the list it gives an OK list:

    $ rdfproc -s postgresql --results help
    rdfproc: Valid query result formats are:
      xml                   SPARQL XML Query Results
      json                  SPARQL JSON Query Results
      table                 Table
      csv                   Comma Separated Values (CSV)
      tsv                   Tab Separated Values (TSV)
      html                  HTML Table
      turtle                Turtle Query Results
      rdfxml                RDF/XML Query Results


I believe the problem is in redland-1.0.15/src/rdf_query_results.c, where
it specifies READER rather than WRITER flags for format:

    $ diff redland-1.0.15/src/rdf_query_results.c
redland-1.0.15.new/src/rdf_query_results.c
    960c960
    <   int flags = RASQAL_QUERY_RESULTS_FORMAT_FLAG_READER;
    ---
    >   int flags = RASQAL_QUERY_RESULTS_FORMAT_FLAG_WRITER;



With this patch I am able to get rdfproc to accept the --results argument
and produce results for
  json, table, csv, tsv, and html.
It still won't produce results in xml, turtle, or rdfxml, but perhaps
those serializers are unimplemented.

Leigh.







More information about the redland-dev mailing list