Reasoning about Neo4j

1,090 views
Skip to first unread message

Niels Hoogeveen

unread,
Mar 12, 2012, 6:53:05 PM3/12/12
to Neo4j
I am currently looking into reasoning facilities to enhance my Neo4j
application.

Since this is not my expertise, I am looking for some pointers.

Has anyone used Neo4j in conjunction with a reasoning engine?

It seems to me there is some intersection between graph traversals and
logical deduction.

Furthermore, when looking at OWL reasoners, predicates are defined
upon triples, but Neo4j has relationship properties which don't
immediately translate to triples.

Niels

Axel Morgner

unread,
Mar 12, 2012, 7:21:49 PM3/12/12
to ne...@googlegroups.com
Not sure, but could this be something in that direction?

http://animotron.org/

Niels Hoogeveen

unread,
Mar 12, 2012, 8:20:23 PM3/12/12
to Neo4j
Hi Axel,

I checked out the link you sent me, but get the impression this is
very much tight to the exist xml-database. I am actually looking for
something more native to Neo4j, or if that doesn't exist for a way to
set up a project to create something for Neo4j.

It seems to me that there are some parallels between depth-first-
search and back-tracking, and with that between logic inference and
graph traversals.

Michael Hunger

unread,
Mar 12, 2012, 8:23:14 PM3/12/12
to ne...@googlegroups.com
I just had great chat last week with Joe "Erlang" Armstrong about graph databases and he said, that it should be pretty
simple (after talking about cypher) to put prolog fact databases in a graphdb like Neo4j and run prolog queries on top of that.

What he told me about prolog (and what I remembered darkly from University) those fact-triples fit actually nicely into node-rel->node

HTH,

Michael

Marko Rodriguez

unread,
Mar 12, 2012, 10:40:30 PM3/12/12
to ne...@googlegroups.com
Hi,

AllegroGraph makes use of Prolog as its query language. SPARQL is based on Prolog.

Next, deduction, induction, abduction, and exemplification can be all be represented as graph traversals.

Take care,
Marko.

Niels Hoogeveen

unread,
Mar 13, 2012, 7:15:39 AM3/13/12
to Neo4j
Hi Michael,

What you describe is actually in the direction I was thinking about.
Instead of Prolog, I was actually more inclined to try out something
like Datalog, because it is decidable.

The one thing that doesn't seem to neatly fit Datalog and with that
Prolog, is Neo4j's relationship properties.

Let me give you an example of what I would like to achieve.

Suppose we have a database with persons and organizations, where both
can have a start and end date, and we have relationships between those
persons and organizations denoting the position that person held
within that organization, also potentially with a start and an end
date.

Now we want the following rules to apply.

If an end date for the position (a relationhip property) is given then
the end date of that position is the value of that property.
If no end date for the position is given then the minimum of the end
date of the organization and the end date of the person is to be
returned.
If neither the position nor the organization, nor the person has an
end date, no value should be returned.

So instead of reasoning about node-rel-node we actualyy reason about:

node-property
node-rel-property
node-rel-node-property

So where a naive Prolog/Datalog implementation would assume our
variables bind to nodes, we need to bind variables to either nodes or
relationships.

On Mar 13, 1:23 am, Michael Hunger <michael.hun...@neotechnology.com>
wrote:

Niels Hoogeveen

unread,
Mar 13, 2012, 7:15:59 AM3/13/12
to Neo4j
Thanks for the links Marko.

Niels Hoogeveen

unread,
Mar 13, 2012, 7:20:07 AM3/13/12
to Neo4j
Correction:

If no end date for the position is given then the minimum of the end
date of the organization and the end date of the person should be
taken and the return value should say that the end date of the
position lies before that given date.

Evgeny

unread,
Mar 16, 2012, 3:10:49 PM3/16/12
to ne...@googlegroups.com
Hi, Niels!

Yes, first prototype of Animo was on XQuery (eXist).
Current version use neo4j. This is draft of concept:
https://docs.google.com/document/d/18LXSdSmuRnAyUwZc39gezE67zCiohQiVi8TRybg4uug/edit

Code you can find here:
https://github.com/animotron
https://github.com/animotron/core

--
Evgeny

Niels Hoogeveen

unread,
Mar 20, 2012, 9:29:31 AM3/20/12
to Neo4j
Thank you for the response, Evgeny.

What I am trying to find is some internal DSL for my Scala-based
application. I guess I will have to roll it myself, since there is
probably nothing out there that fits the needs I have. Any pointers to
graph-based reasoning theory is very welcome, though,.

Kind regards,
Niels

On Mar 16, 8:10 pm, Evgeny <gazdov...@gmail.com> wrote:
> Hi, Niels!
>
> Yes, first prototype of Animo was on XQuery (eXist).
> Current version use neo4j. This is draft of concept:https://docs.google.com/document/d/18LXSdSmuRnAyUwZc39gezE67zCiohQiVi...
Reply all
Reply to author
Forward
0 new messages