maybe not the problem but:

1. i don't think sparql has commas (yet!) between items you're retrieving
2. URIs should be in <> like <http://example.org/ann-page.html>

hope this helps,

thomas

On 6/26/07, whit <[EMAIL PROTECTED]> wrote:

I'd like to update some queries to use the new bison based sparql stuff,
but I'm having  a bit of trouble getting the syntax right. From all I've
read in rdflibs test and on the w3c, this seems like it should work.
Does anybody see something I'm missing?

>>> pkg_resources.get_distribution('rdflib')
rdflib 2.4.0 (/Users/whit/dev/env/tag2/src/rdflib.2.4)

>>> print tests.q2
PREFIX annotea: <http://www.w3.org/2000/10/annotation-ns#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

SELECT ?author_uri, ?author_name, ?mbox
WHERE {
       ?author_uri foaf:name ?author_name .
       ?author_uri foaf:mbox ?mbox .
       ?annotation annotea:annotates http://example.org/ann-page.html .
       ?annotation annotea:author ?author_uri .
       }
>>> gr.quer(tests.q2)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
AttributeError: 'Graph' object has no attribute 'quer'
>>> gr.query(tests.q2)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/Users/whit/dev/env/tag2/src/rdflib.2.4/rdflib/Graph.py", line
679, in query
    return
plugin.get('SPARQLQueryResult',QueryResult)(p.query(strOrQuery,
initBindings, initNs, DEBUG))
  File "rdflib/sparql/bison/Processor.py", line 28, in query
    strOrQuery = Parse(strOrQuery, DEBUG)
  File "rdflib/sparql/bison/Processor.py", line 18, in Parse
    return p.parse(query)
SyntaxError: parse error at line 10, column 9: reached end-of-input,
expecting 'FROM' or 'WHERE' or 'LEFT_CURLY'



--

------ d. whit morriss ------
- senior engineer, opencore -
- http://www.openplans.org  -
- m: 415-710-8975           -

"If you don't know where you are,
you don't know anything at all"

Dr. Edgar Spencer, Ph.D., 1995

_______________________________________________
Dev mailing list
Dev@rdflib.net
http://rdflib.net/mailman/listinfo/dev

_______________________________________________
Dev mailing list
Dev@rdflib.net
http://rdflib.net/mailman/listinfo/dev

Reply via email to