Invalid Line

11 views
Skip to first unread message

Chris

unread,
Jul 31, 2010, 4:51:00 AM7/31/10
to rdfalchemy-dev
I'm trying to use RDFAlchemy to get a list of all triples in a
PostgreSQL backed Sesame Store. I'm using the example from the
website, but I'm getting an "invalid line" error for what appears to
be a valid line. What am I doing wrong?

from rdfalchemy.sesame2 import SesameGraph,Literal
from rdflib import Namespace
doap = Namespace('http://www.w3.org/1999/02/22-rdf-syntax-ns#doap')
rdf = Namespace('http://www.w3.org/1999/02/22-rdf-syntax-ns#')
db = SesameGraph('http://localhost:9090/openrdf-sesame/repositories/
test')
project = db.value(None,doap.name,Literal('rdflib'))
for p,o in db.predicate_objects(project):
print '%-30s = %s'%(db.qname(p),o)

This is the sample RDF I loaded into Sesame:

<?xml version="1.0"?>

<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cd="http://www.recshop.fake/cd#">

<rdf:Description
rdf:about="http://www.recshop.fake/cd/Empire Burlesque">
<cd:artist>Bob Dylan</cd:artist>
<cd:country>USA</cd:country>
<cd:company>Columbia</cd:company>
<cd:price>10.90</cd:price>
<cd:year>1985</cd:year>
</rdf:Description>

<rdf:Description
rdf:about="http://www.recshop.fake/cd/Hide your heart">
<cd:artist>Bonnie Tyler</cd:artist>
<cd:country>UK</cd:country>
<cd:company>CBS Records</cd:company>
<cd:price>9.90</cd:price>
<cd:year>1988</cd:year>
</rdf:Description>

</rdf:RDF>
Reply all
Reply to author
Forward
0 new messages