Problem using SPARQLGraph's "subjects" method

29 views
Skip to first unread message

Tatiana Al-Chueyr

unread,
Jun 21, 2012, 3:29:45 PM6/21/12
to rdfalch...@googlegroups.com
Hello guys!

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

[1] https://github.com/gjhiggins/RDFAlchemy

Tatiana Al-Chueyr Martins

unread,
Jun 21, 2012, 4:40:21 PM6/21/12
to rdfalch...@googlegroups.com
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))

Thanks!

Tatiana
> --
> You received this message because you are subscribed to the Google Groups "rdfalchemy-dev" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/rdfalchemy-dev/-/8xds_gSzCEgJ.
> To post to this group, send email to rdfalch...@googlegroups.com.
> To unsubscribe from this group, send email to rdfalchemy-de...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/rdfalchemy-dev?hl=en.
>



--
Tatiana Al-Chueyr

Philip Cooper

unread,
Jun 21, 2012, 4:45:09 PM6/21/12
to rdfalch...@googlegroups.com

On 6/21/12 2:40 PM, Tatiana Al-Chueyr Martins wrote:
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))

Great


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.

--
Phil

Tatiana Al-Chueyr

unread,
Jun 22, 2012, 2:52:59 PM6/22/12
to rdfalch...@googlegroups.com

On Thursday, June 21, 2012 5:45:09 PM UTC-3, Philip Cooper wrote:

[CUT] 
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.


Perfect, Phil, thanks!
Reply all
Reply to author
Forward
0 new messages