RDFLib/rdflib — Issue #61: graph.serialize() generates incorrect SQL when format kwarg is omitted or bound to "xml"
Author: gjhiggins
Created: 2012-02-20 08:31:43+00:00
State: closed

gjhigg...@gmail.com, 2009-05-20T17:42:57.000Z

What steps will reproduce the problem?
1. This simple-minded read/write test:

import rdflib
from rdflib.graph import ConjunctiveGraph as Graph
from rdflib import plugin
from rdflib.store import Store
from rdflib.namespace import Namespace
from rdflib.term import Literal, URIRef
default_graph_uri = "http://rdflib.net/rdfstore"
configString = "host=localhost,user=foo,password=foo,db=rdflib"
store = plugin.get('PostgreSQL', Store)('rdfstore')
store.destroy(configString)
store.open(configString,create=True)
graph = Graph(store, identifier = URIRef(default_graph_uri))
print "Triples in graph before add: ", len(graph)
rdflibNS = Namespace('http://rdflib.net/test/')
graph.add((rdflibNS['pic:1'], rdflibNS['name'], Literal('Jane & Bob')))
graph.add((rdflibNS['pic:2'], rdflibNS['name'], Literal('Squirrel in Tree')))
graph.commit()
print "Triples in graph after add: ", len(graph)
print graph.serialize()

What is the expected output?

The graph serialized as RDF/XML

What do you see instead?

ProgrammingError: argument of WHERE must be type boolean, not type integer

module body	in foo.py at line 21
function serialize	in graph.py at line 685
function serialize	in XMLSerializer.py at line 50
function __bindings	in XMLSerializer.py at line 26
function compute_qname	in NamespaceManager.py at line 65
function namespaces	in MySQL.py at line 1406
function executeSQL	in MySQL.py at line 682

(see attached file for debug=True trace)

Error not seen when format='nt'.

Comment 1 by eik...@gmail.com

Comment 2 by eik...@gmail.com
These issues involve bits that have been moved out of rdflib proper for now. We will re-open them
or move them to rdfextas as appropriate.