Surf as Django ORM

137 views
Skip to first unread message

Laurens

unread,
May 23, 2012, 6:33:54 AM5/23/12
to surfrdf
Are there any known good practices on how to use Surf as the ORM in
Django?

Right know I'm using sqlite3 for administration and metadata about
users, and manually handling all the 'real' content into Allegrograph
using SurF.

The intent is to build a demo application that integrates data/
resources users refer to in different social media (like
Twitter,Mendeley, Facebook...).

Christoph Burgmer

unread,
May 23, 2012, 1:10:07 PM5/23/12
to sur...@googlegroups.com
Did you read my blog post where I tried to compare the Django ORM with Surf?

We tried to implement a local solution for Surf as an ORM replacement for django. This included writing our own model layer. We did not pull through with this. That was for other reasons however.

Laurens <laur...@gmail.com> wrote:

>--
>You received this message because you are subscribed to the Google Groups "surfrdf" group.
>To post to this group, send email to sur...@googlegroups.com.
>To unsubscribe from this group, send email to surfrdf+u...@googlegroups.com.
>For more options, visit this group at http://groups.google.com/group/surfrdf?hl=en.
>

Dominique Guardiola Falco

unread,
May 24, 2012, 7:04:14 AM5/24/12
to sur...@googlegroups.com
If you want to try something else than SuRF, we started an integration of RDFAlchemy + Django using the Sesame HTTP API (we use OpenRDF but allegrograph should work)
https://github.com/quinode/django-rdfalchemy
The module allows you to define Django models with some Django fields + Resources defined with RDFAlchemy model, the link between them being a uri field stored in Django SQL part...

This is rough and without documentation right now, but it works
We also work on the FormAlchemy RDF extension

RDFAlchemy repository to use :  https://github.com/gjhiggins/RDFAlchemy

Laurens

unread,
Jun 15, 2012, 10:15:02 AM6/15/12
to sur...@googlegroups.com
Yes I read it and for now it works quite well in combination. Thanks

Dominique Guardiola Falco

unread,
Jun 15, 2012, 10:28:08 AM6/15/12
to sur...@googlegroups.com
Do you use only RDFAlchemy or django-rdfalchemy ?
Your reviews or bug reports are welcome !

Laurens

unread,
Jun 21, 2012, 4:25:41 AM6/21/12
to sur...@googlegroups.com
Both RDFAlchemy and SuRF work quite well with a SPARQL endpoint. The only limitation speed seems to be the HTTP latency. Djano RDFAlchemy is a bit confusing, as I still want to use SQLite at the same time as well to store user authentication data etc.

However when consequently storing / retrieving data on a store (my case Allegrograph) as such that the Allegrograph Server load is 100%, the threads on my django dev server consume a lot of memory. I'm not sure if this due to the use of too much load() / save() operations when storing the objects or due to the naive use of Python's built in queue, mb switching to celery or pika would be better.

Also I have not been able to get either of them working probably with RDFLib + Postgres or in memory. I can not seem to get the configuration right.

Though I have been using Spira with RDF.rb in ruby and I must say that RDFAlchemy and SuRFare far more superior. I haven't tested if RDFAlchemy or SuRF also have the same problem as spira -> exponential use of memory vs. the number of loaded objects.

Dominique Guardiola Falco

unread,
Jun 23, 2012, 4:21:17 AM6/23/12
to sur...@googlegroups.com


On Thursday, June 21, 2012 10:25:41 AM UTC+2, Laurens wrote:
Both RDFAlchemy and SuRF work quite well with a SPARQL endpoint. The only limitation speed seems to be the HTTP latency. Djano RDFAlchemy is a bit confusing, as I still want to use SQLite at the same time as well to store user authentication data etc.

Yes, this is also our use case : for each RDF resource having an URI and a rdf:type corresponding to one of your models, you can save a django model instance which will have an ID, custom django fields if you want, and that will bring up all its rdf properties when you call it.
Reply all
Reply to author
Forward
0 new messages