jo4neo and neo4j suitable solution?

7 views
Skip to first unread message

heapifyman

unread,
Jun 2, 2010, 1:16:46 PM6/2/10
to jo4neo
Hello,

currently we have a project which is supposed to use Jena, Jena SDB
and Jenabean to persist and query ontology instance data in a
relational database and perform the mapping between RDF triples and
Java Beans.

Would neo4j and jo4neo be a suitable substitute for this kind of
setup?
How far are jo4neo's querying capabilities evolved. I've seen the
examples with find().where() etc. But there doesn't seem to be any way
of building more complex queries with AND and OR, am I right? Does
jo4neo offer other ways to query the data stored in neo4j?

Thanks in advance for any hints.

Peter Neubauer

unread,
Jun 3, 2010, 4:20:21 AM6/3/10
to jo4...@googlegroups.com
Hi there,
as far as I know jo4neo provides some built-in capabilities for
querying, like find. However, you can always implement your own
Traverser, see for example the example
http://code.google.com/p/jo4neo/source/browse/trunk/patterns/userroles/src/main/java/example/RoleMembers.java
which is backing the
http://code.google.com/p/jo4neo/source/browse/trunk/patterns/userroles/src/main/java/example/Role.java#14
the

@neo(traverser=RoleMembers.class) public Collection<User> members;

construct in Role.java. There, you can basically provide any traversal
that fits the bill. Would that be applicable?

Cheers,

/peter neubauer

COO and Sales, Neo Technology

GTalk: neubauer.peter
Skype peter.neubauer
Phone +46 704 106975
LinkedIn http://www.linkedin.com/in/neubauer
Twitter http://twitter.com/peterneubauer

http://www.neo4j.org - Your high performance graph database.
http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.

Taylor Cowan

unread,
Jun 12, 2010, 9:05:30 AM6/12/10
to jo4...@googlegroups.com
Yes, Peter is correct. jo4neo does not provide extensive search
capabilities beyond neo4j outside the find.where pattern, however, it
does work nicely with regular neo4j traversers. In a nutshell, you
can "find" on a single index using a pattern. jo4neo simplifies some
of the boilerplate you'd normally write to create the index and search
it (based on your annotations).

I normally used a simple index to get a starting node, and then
traversers to get to the data I need. When I found queries that were
difficult, I modified the graph to make them easy...putting edges
where none existed before to allow for simpler traversal. I've been
trying to come up with a more articulate way of describing this, but
essentially queries can be "precomputed" by anticipating traversal
patterns and placing edges where needed. For some people this is
uncomfortable because we are creating more data than what would be
necessary with RDBMS, however, that's typical for nosql data
scenarios.

If you have some ticklers or types of queries you think jo4neo should
add let us know. I can imagine some kind of bridge to creating
complex Lucene queries might be useful.

Taylor

Reply all
Reply to author
Forward
0 new messages