First of all, well done for implementing RDFAlchemy! It is awesome to be able to use ORM to access RDF triplestores.
I'm using RDFAlchemy to access a SPARQL endpoint (DBPedia), and the "query" method worked fine. However, I didn't succeed using SPARQLGraph's "subjects" method. It is returning an empty list while it was supposed to find 43 instances - just as the query.
I've pasted the code here (both the working version with query, and the unsuccessful version using subjects):
https://gist.github.com/2967837
Am I doing something wrong?
These are the versions I'm using:
- Python 2.7.3
- RDFAlchemy==0.3
- rdflib==3.2.1
I had problems installing RDFAlchemy via pip, so I downloaded from GitHub [1] and installed (master) via setup.py.
I'd really appreciate your feedback.
Regards,
Tatiana
Just found out, the problem was using the namespaces! My mistake ;) Line 28: metal_guys2 = list(graph.subjects(predicate=DB.genre, object=DBONTO.Metal)) Should be: metal_guys2 = list(graph.subjects(predicate=DBONTO.genre, object=DB.Metal))
On 21 June 2012 16:29, Tatiana Al-Chueyr <tatiana....@gmail.com> wrote: These are the versions I'm using: - Python 2.7.3 - RDFAlchemy==0.3 - rdflib==3.2.1
I had problems installing RDFAlchemy via pip, so I downloaded from GitHub [1] and installed (master) via setup.py.
current Pypi version is 0.2.9 which works with pip.
The 0.3 is a fork where Graham Higgins has helped push the ball forward, especially for py3k. I'll try to merge those branches and post an update.