[redland-dev] [Rasqal RDF Query Library 0000414]: Type of operation->insert_templates depends on Update syntax

Mantis Bug Tracker mantis-bug-sender at librdf.org
Sun Jan 23 15:00:44 CET 2011


The following issue has been SUBMITTED. 
====================================================================== 
http://bugs.librdf.org/mantis/view.php?id=414 
====================================================================== 
Reported By:                swh
Assigned To:                
====================================================================== 
Project:                    Rasqal RDF Query Library
Issue ID:                   414
Category:                   api
Reproducibility:            always
Severity:                   crash
Priority:                   high
Status:                     new
Query Language:             sparql11-update 
====================================================================== 
Date Submitted:             2011-01-23 14:00
Last Modified:              2011-01-23 14:00
====================================================================== 
Summary:                    Type of operation->insert_templates depends on
Update syntax
Description: 
The code below works fine, but if you uncomment the prepare line, and comment
out the one above it segfaults.

It seems that if the operation includes a WHERE clause then you get rasqal graph
patterns in insert_templates, and if it doesn't you get rasqal triples.

It seems like it would be more convienient to always get rasqal triples, as only
GRAPH is allowed in the template slots anyway.

Steps to Reproduce: 
#include <raptor2/raptor.h>
#include <rasqal/rasqal.h>

int main()
{
    rasqal_world *rasworld = rasqal_new_world();
    raptor_world *rapworld = raptor_new_world();

    rasqal_query *q = rasqal_new_query(rasworld, "sparql11-update", NULL);
    raptor_uri *bu = raptor_new_uri(rapworld, (unsigned char *)"local:local");
    rasqal_query_prepare(q, (unsigned char *)"INSERT { <a> <b> <c> } WHERE { ?x
?y ?z }", bu);
    //rasqal_query_prepare(q, (unsigned char *)"INSERT DATA { <a> <b> <c> }",
bu);
    rasqal_update_operation *op = rasqal_query_get_update_operation(q, 0);
    rasqal_graph_pattern *gp = raptor_sequence_get_at(op->insert_templates, 0);
    rasqal_query_print(q, stdout);
    rasqal_graph_pattern_print(gp, stdout);

    return 0;
}


====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-01-23 14:00 swh            New Issue                                    
======================================================================



More information about the redland-dev mailing list