[redland-dev] Some issues running redland-virtuoso-test
Dave Beckett
dave at dajobe.org
Thu Jan 26 00:38:35 EST 2012
On 1/25/12 4:23 AM, lorena wrote:
> Hi
>
> After installing Redland I wanted to check it's integration with Open Source
> Virtuoso.
>
> I've configured the ODBC connection and run utils/redland-virtuoso-test but
> the last 3 tests failed.
> After inspecting the source code I found that the problem was in the query
> declaration
What was the problem? What was the test failure error?
> query=librdf_new_query(world, (char *)"vsparql", NULL, (const unsigned char
> *)query_cmd, NULL);
>
> By replacing these lines by the following I was able to successfully run
> tests 19, 20, 21
>
> query=librdf_new_query(world, "vsparql", NULL, (const unsigned char
> *)query_cmd, NULL);
I don't see the difference here, adding/removing casts would just affect
compiler warnings, the generated code would be identical (for C).
> In particular I want to perform SPARQL GROUP BY queries over Virtuoso, so I
> decided to modify the tests in order to run this query:
>
> SELECT ?s (sum(?o) AS ?sumO)
> WHERE {graph <http://red> { ?s ?p ?o }}
> GROUP BY ?s
>
> Consider a graph <http://red> that only contains the following triples
> (otherwise the sum operator can not be applied since ?o may bind to some non
> numeric values):
>
> rc |= add_triple_typed(world, context_node, model, "oo", "pp",
> "10^^<http://www.w3.org/2001/XMLSchema#int>");
> rc |= add_triple_typed(world, context_node, model, "oo", "pp",
> "12^^<http://www.w3.org/2001/XMLSchema#int>");
> rc |= add_triple_typed(world, context_node, model, "oo", "pp",
> "15^^<http://www.w3.org/2001/XMLSchema#int>");
The add_triple_typed() must be something you coded, hard to tell what it's
doing here.
> Surprisingly the query still raises an error, since VIrtuoso can not parse
> this object values as integers.
>
> My workaround was to re define the add_triple_typed function, and now I
> actually pass type URLs as parameters, using
> /librdf_new_node_from_typed_literal/ instead of
> /librdf_new_node_from_uri_string/ to create the nodes.
>
>
> I just wanted to know if this is ok or am I missing something?
I don't know the set of datatypes that virtuoso supports but it might be
that it uses one of the other XSD integer types.
xsd:int is rather rarely seen. mostly xsd:integer is used.
yes they are different!
See http://www.w3.org/TR/xmlschema-2/#built-in-datatypes
Dave
More information about the redland-dev
mailing list