RDFLib and Neo4J

400 views
Skip to first unread message

Ivan

unread,
Apr 1, 2013, 12:27:54 PM4/1/13
to rdfli...@googlegroups.com
I tried to look in google and elsewhere, and I found mostly garbage...

Is there a back-end to RDFLib on top of Neo4j? Neo4j being a graph database, it sounds like an obvious thing to do...

If there isn't, is there a good documentation on what one has to do to create one? 

Thanks

Ivan

Thomas Winningham

unread,
Apr 1, 2013, 12:40:37 PM4/1/13
to rdfli...@googlegroups.com
I looked into making a store plugin at some point for some reason, and I don't think I wound up doing it as I think I got away with just treating my RDFLib project as another step in a longer batch process instead of always being online. Anyway...

Check out:
and

You basically want to gut memory.py, call it neo4j.py, and then implement all the methods such that they call the service or whatever neo4j exposes.

I think this a way to go, but people more up to speed with the project probably have better ideas I don't know :D 

Thanks,

Thomas



Ivan

--
You received this message because you are subscribed to the Google Groups "rdflib-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rdflib-dev+...@googlegroups.com.
To post to this group, send email to rdfli...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/rdflib-dev/-/sKv02aP6UZoJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Gunnar Aastrand Grimnes

unread,
Apr 2, 2013, 3:17:47 AM4/2/13
to rdfli...@googlegroups.com
On 1 April 2013 18:27, Ivan <ivan....@gmail.com> wrote:
>
> Is there a back-end to RDFLib on top of Neo4j? Neo4j being a graph database,
> it sounds like an obvious thing to do...

Not that I am aware - perhaps ask William Waites, he has written
adaptors for every combination of language/library/store known to man
:)

>
> If there isn't, is there a good documentation on what one has to do to
> create one?

You must be new here ;)

In theory it is simple enough, implement the Store "interface" from
https://github.com/RDFLib/rdflib/blob/master/rdflib/store.py#L109

An implementation needs to implement at least add, remove, triples, __len__
For a context-aware store you'll need ```contexts``` as well.

For better performance, query, addN, triple_choices could also be
pushed to the store.

- Gunnar





--
http://gromgull.net

Ivan Herman

unread,
Apr 3, 2013, 4:40:26 AM4/3/13
to rdfli...@googlegroups.com
Thanks. I now see what I have to do from the RDFLib side, I have to figure out how to use Neo4j. It is not entirely obvious... (and the Python interface definition for Neo4j is, shall we say, sketchy).

Do not expect something production quality soon:-)

Ivan
> --
> You received this message because you are subscribed to the Google Groups "rdflib-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rdflib-dev+...@googlegroups.com.
> To post to this group, send email to rdfli...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>


----
Ivan Herman
4, rue Beauvallon, clos St Joseph
13090 Aix-en-Provence
France
http://about.me/ivan_herman

Marc-Antoine Parent

unread,
Apr 3, 2013, 8:35:51 AM4/3/13
to rdfli...@googlegroups.com
Hmmm...
What about going through Tinkerpop Blueprints?
It has a Neo4J interface, and can expose a neo4j graph as a sesame sail.
Would that serve your purpose?
I think that a tinkerpop-rdflib connector would be useful in general, allowing rdflib to talk to other graph databases.

Another thing: which python-neo4j bridge did you look at? Did you look at bulbs?

Cheers,
Marc-Antoine Parent

Ivan herman

unread,
Apr 3, 2013, 1:22:27 PM4/3/13
to rdfli...@googlegroups.com, rdfli...@googlegroups.com


On 3 Apr 2013, at 14:35, Marc-Antoine Parent <mapa...@gmail.com> wrote:

> Hmmm...
> What about going through Tinkerpop Blueprints?
> It has a Neo4J interface, and can expose a neo4j graph as a sesame sail.
> Would that serve your purpose?

I am not sure. I am a neo4j newby, so I do not know that one...

> I think that a tinkerpop-rdflib connector would be useful in general, allowing rdflib to talk to other graph databases.
>
> Another thing: which python-neo4j bridge did you look at? Did you look at bulbs?

There is an embedded neo4j interface to Python that comes alongside the standard distribution. I do not know bulbs... I would appreciate a reference!

Thanks

Ivan

Marc-Antoine Parent

unread,
Apr 3, 2013, 1:27:27 PM4/3/13
to rdfli...@googlegroups.com
Sorry, should have done so at once.

Ivan Herman

unread,
Apr 4, 2013, 3:58:20 AM4/4/13
to rdfli...@googlegroups.com
Thank you, I will have to look at that.

What bothers me a little bit is that it seems to require downloading quite a lot of things so, if at some point we want this to be part of RDFLib (distant future!) then this may create difficulties. If we try to stick to the core neo4j distribution (which is not THAT easy to install either, to be honest, because it needs an additional Python-Java bridge), this may be beneficial.

Also: bulbflow seems to rely on neo4j as a server. The distribution with neo4j is for an embedded database. Ie, we may have to have both...

To be seen!

Thanks a lot, Marc-Antoine!

Ivan

Marc-Antoine Parent

unread,
Apr 5, 2013, 10:48:44 AM4/5/13
to rdfli...@googlegroups.com
Hello, Ivan!
Just for the record:
I did mention bulbs second, after blueprints.
I still think blueprints is the simplest approach.
You can wrap a neo4j graph in a Sesame sail, and even give access to it through Sparql.
(Not without some issues, but it seems that they have workarounds.)
Thus, you could use the sparql endpoint and be done.
That's the short way.

Now, that does not mean that working through bulbs is not worthwhile:
Bulbs seems to have a more direct interface to Neo4J.
(And a generic graph database interface through rexster, which is among other things a server over blueprints.)
But that means defining your own RDF to graph mapping model.
I do find this interesting, and I may contribute at some point, but it would have to be after this month.

Cheers,
Marc-Antoine

mpe...@gmail.com

unread,
Jun 5, 2013, 11:54:25 AM6/5/13
to rdfli...@googlegroups.com
Hello guys,

I would like to ask what is the current status for that, because i have a similar implementation and i just found out about this topic!
So, should i continue with that, or is it already there?
Thank you very much,
Michael.

Marc-Antoine Parent

unread,
Jun 5, 2013, 11:59:27 AM6/5/13
to rdfli...@googlegroups.com
Heh... I mentioned quite a few options in my mail, not sure which you have worked on. Bulbs-RDF mapping?
But no, I have not personally spent time on it yet.
Cheers,
Marc-Antoine

mpe...@gmail.com

unread,
Jun 5, 2013, 1:10:51 PM6/5/13
to rdfli...@googlegroups.com
I am using neomodel with rdflib.

When i finish with that i will share it.

Thank you very much,
Michael.

Ivan Herman

unread,
Jun 5, 2013, 4:55:15 PM6/5/13
to rdfli...@googlegroups.com
To be honest, I had to put this aside. My motivation was as much to understand
Neo4J as anything else; I have a crude version running on my machine which
relies on Neo4J running on my machine directly (ie, not via a server).

My experience are mixed, b.t.w. The documentation of Neo4J, mainly its Python
interface, is not that good, I had to find out some things via trial and error.
Also, the main issue is the matter of identity. RDF is a set of triples; ie,
whenever I add a new triple to the store I have to check whether a relationship
with similar names already exist or not. The only way I could do that was to set
up separate indexing structures, because Neo4J does not seem to offer a facility
for such unicity directly. It works, but it was surprisingly complicated to do
(mainly due to the documentation issues and some, in my view, unnatural Python
interface designs). And the result is slow: I had a larger RDF file that I tried
to put into the database and I stopped because it took too much time on my
laptop. Of course, I may be a lousy programmer...

I have not looked at bulbs yet. Unfortunately, some other priorities in my day
job took my time...

Cheers

Ivan

Marc-Antoine Parent wrote:
> Heh... I mentioned quite a few options in my mail, not sure which you have worked on. Bulbs-RDF mapping?
> But no, I have not personally spent time on it yet.
> Cheers,
> Marc-Antoine
>
> Le 2013-06-05 � 11:54, mpe...@gmail.com a �crit :

mpe...@gmail.com

unread,
Jun 6, 2013, 3:20:42 AM6/6/13
to rdfli...@googlegroups.com, ivan....@me.com
Hello Ivan,

Actually most of the official documentation provided by neo4j is really useless and difficult to use.
But libraries such as bulbs, py2neo and neomodel are more pythonic in a way!
Still the issues you mentioned are still there, but i will give it a try.

Thank you very much!

Cheers,
Michael.


On Wednesday, June 5, 2013 11:55:15 PM UTC+3, Ivan wrote:
> To be honest, I had to put this aside. My motivation was as much to understand
>
> Neo4J as anything else; I have a crude version running on my machine which
>
> relies on Neo4J running on my machine directly (ie, not via a server).
>
>
>
> My experience are mixed, b.t.w. The documentation of Neo4J, mainly its Python
>
> interface, is not that good, I had to find out some things via trial and error.
>
> Also, the main issue is the matter of identity. RDF is a set of triples; ie,
>
> whenever I add a new triple to the store I have to check whether a relationship
>
> with similar names already exist or not. The only way I could do that was to set
>
> up separate indexing structures, because Neo4J does not seem to offer a facility
>
> for such unicity directly. It works, but it was surprisingly complicated to do
>
> (mainly due to the documentation issues and some, in my view, unnatural Python
>
> interface designs). And the result is slow: I had a larger RDF file that I tried
>
> to put into the database and I stopped because it took too much time on my
>
> laptop. Of course, I may be a lousy programmer...
>
>
>
> I have not looked at bulbs yet. Unfortunately, some other priorities in my day
>
> job took my time...
>
>
>
> Cheers
>
>
>
> Ivan
>
>
>
> Marc-Antoine Parent wrote:
>
> > Heh... I mentioned quite a few options in my mail, not sure which you have worked on. Bulbs-RDF mapping?
>
> > But no, I have not personally spent time on it yet.
>
> > Cheers,
>
> > Marc-Antoine
>
> >
>
>
> >
>

Reply all
Reply to author
Forward
0 new messages