[redland-dev] Redland 1.0.1 Segfault
Danny Ayers
danny.ayers at gmail.com
Tue May 31 08:57:23 BST 2005
Ok, I tried the same kind of thing as Christopher (on the new releases
of Redland, Bindings), which worked for me, as did a SPARQLy
equivalent. But I still got a segfault on my longer query, details:
import RDF
from store import Store
# gets the default MySQL-backed model
m = Store().get_model()
for i in m.find_statements(RDF.Statement(None, None, RDF.Node("Asemantics"))):
print i
It worked :
{(r1116410374r1), [http://xmlns.com/foaf/0.1/name], "Asemantics"}
My query form is still segfaulting, so next I tried this:
query_string="""select * where { ?s ?p "Asemantics" }"""
query = RDF.Query(query_string, None,"sparql", None)
print query.execute(m)
That worked too:
<?xml version="1.0"?>
<sparql xmlns="http://www.w3.org/2001/sw/DataAccess/rf1/result">
<head>
<variable name="s"/>
<variable name="p"/>
</head>
<results>
<result>
<s bnodeid="r1116410374r1"/>
<p uri="http://xmlns.com/foaf/0.1/name"/>
</result>
</results>
</sparql>
However, trying the query I'd got in my form:
query_string="""PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX rss: <http://purl.org/rss/1.0/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX sqs: <http://purl.org/stuff/sqs/>
SELECT ?title, ?content WHERE
{ ?item rdf:type rss:item .
?item rss:title ?title .
?item sqs:content ?content .
?item dc:date ?date .
FILTER ?date > "2005-05-13T00:00:00+00:00"
}
ORDER BY DESC[?date]
LIMIT 10"""
query = RDF.Query(query_string, None,"sparql", None)
print query.execute(m)
produced this:
rasqal_graph_pattern.c:265:rasqal_graph_pattern_init: Graph pattern
0x82353c0 Triple 0 has parts 1
rasqal_graph_pattern.c:265:rasqal_graph_pattern_init: Graph pattern
0x82353c0 Triple 1 has parts 4
rasqal_graph_pattern.c:265:rasqal_graph_pattern_init: Graph pattern
0x82353c0 Triple 2 has parts 4
rasqal_graph_pattern.c:265:rasqal_graph_pattern_init: Graph pattern
0x82353c0 Triple 3 has parts 4
rasqal_engine.c:1184:rasqal_engine_get_next_result: Handling graph_pattern 0
rdf_query_rasqal.c:515:rasqal_redland_init_triples_match:
rasqal_init_triples_match done
rasqal_engine.c:667:rasqal_graph_pattern_get_next_match: made new
triplesMatch for column 0
rasqal_engine.c:677:rasqal_graph_pattern_get_next_match: end of
triplesMatch for column 0
Segmentation fault
Cheers,
Danny.
More information about the redland-dev
mailing list