General question from a person who just found out about HyperGraphDB
and who has been watching that seems almost like hype around neo4j:
How does HyperGraphDB compare to neo4j, technically speaking?
Thanks,
Otis
P.S.
Nice Wiki documentation!
On Thu, Feb 11, 2010 at 5:33 PM, OG <otis.gos...@gmail.com> wrote:
> Hello,
>
> General question from a person who just found out about HyperGraphDB
> and who has been watching that seems almost like hype around neo4j:
>
> How does HyperGraphDB compare to neo4j, technically speaking?
I can't really comment on the technical merits of neo4j since I
haven't used it. Conceptually/architecturally I think the two are
quite different: neo4j handles standard property graphs and
HyperGraphDB has some generalizations that you don't see in any other
graph database (ability of edges to point n > 0 nodes, ability of
edges to point to other edges, the notion of types and type
constructors integrated at the core of the system). That doesn't make
HyperGraphDB necessarily better, because the extra generality
translates into different storage layout on disk which has
consequences for how you represent and query things. So I would assume
that neo4j would perform better when all you need is classical
property graphs. And I would assume that a more complicated model
would benefit from a direct hypergraph representation, but I can't
back those assumptions with any actual experiments.
HyperGraphDB was originally designed for an AI project (see
http://www.opencog.org) where this sort of generality is warranted.
That said, to me the system doesn't seem complicated to use, but I'm
the last person that can judge that! :) I just posted a blog entry to
show how it qualifies as an OO database
(http://kobrix.blogspot.com/2010/02/is-hypergraphdb-object-oriented.html)
and I would be more curious to play in depth with db4o and see
HyperGraphDB compares to it. I would be also curious to implement a
document-oriented layer and see how it compares to CouchDB/MongoDB.
Should take a couple of days, but I don't have them right now. If
anybody here is willing to take the challenge, I can provide guidance
and support though :)
The only other DB I've heard of that's close to HyperGraphDB's
architecture is the db behind http://www.freebase.com/, also a graph
database and a description is going to be published soon, I'm told.
> Thanks,
> Otis
> P.S.
> Nice Wiki documentation!
>
Thanks! A lot of it is incomplete though...unfortunately for now :(
Best,
Boris
The query are similar. I mean that the syntax is the same.
However, I have something annoying when I make my comparison.
Borislav, is it normal that when I create a graph with +/- 20.000
nodes, It take about 6000 secondes? At each time that I add a node, I
make a graph.getTransactionManager().commit(); . Maybe It's not
optimal but in the futur I'll use HyperGraphDD like this...
I f i do the same with Neo4j, it take about 40 secondes..
Could you tell me if this time is normal?
Thanks
Here is my test code :
graph.getTransactionManager().beginTransaction();
String name = "philippe";
HGHandle handleName = graph.add(name);
for (int i = 0; i < 100;i++) {
String current = "currrent" + i;
HGHandle currhandle = graph.add(current);
HGValueLink link = new HGValueLink("rel",handleName);
graph.add(link);
graph.getTransactionManager().commit();
graph.getTransactionManager().beginTransaction();
}
graph.getTransactionManager().commit();
On Feb 12, 3:51 am, Borislav Iordanov <borislav.iorda...@gmail.com>
wrote:
> Hi Otis,
>
> On Thu, Feb 11, 2010 at 5:33 PM, OG <otis.gospodne...@gmail.com> wrote:
> > Hello,
>
> > General question from a person who just found out about HyperGraphDB
> > and who has been watching that seems almost like hype around neo4j:
>
> > How does HyperGraphDB compare to neo4j, technically speaking?
>
> I can't really comment on the technical merits of neo4j since I
> haven't used it. Conceptually/architecturally I think the two are
> quite different: neo4j handles standard property graphs and
> HyperGraphDB has some generalizations that you don't see in any other
> graph database (ability of edges to point n > 0 nodes, ability of
> edges to point to other edges, the notion of types and type
> constructors integrated at the core of the system). That doesn't make
> HyperGraphDB necessarily better, because the extra generality
> translates into different storage layout on disk which has
> consequences for how you represent and query things. So I would assume
> that neo4j would perform better when all you need is classical
> property graphs. And I would assume that a more complicated model
> would benefit from a direct hypergraph representation, but I can't
> back those assumptions with any actual experiments.
>
> HyperGraphDB was originally designed for an AI project (seehttp://www.opencog.org) where this sort of generality is warranted.
> That said, to me the system doesn't seem complicated to use, but I'm
> the last person that can judge that! :) I just posted a blog entry to
> show how it qualifies as an OO database
> (http://kobrix.blogspot.com/2010/02/is-hypergraphdb-object-oriented.html)
> and I would be more curious to play in depth with db4o and see
> HyperGraphDB compares to it. I would be also curious to implement a
> document-oriented layer and see how it compares to CouchDB/MongoDB.
> Should take a couple of days, but I don't have them right now. If
> anybody here is willing to take the challenge, I can provide guidance
> and support though :)
>
> The only other DB I've heard of that's close to HyperGraphDB's
> architecture is the db behindhttp://www.freebase.com/, also a graph
It don't seem because berkley DB supports unicode...
in
for (int i = 0; i < 20000;i++) {
Yeah, it seems HyperGraphDB has a much reacher API. I found this as
the Neo4J API:
Really neat in simplicity, but it doesn't seem like it offers a lot.
In HyperGraphDB we can make any Java object into an atom (node or
link) and you have much more going on in term of querying, access to
low-level storage, ability to plug at nearly any level into the
system. Perhaps this is simply because they decided not to expose some
APIs that they have internally, and wait until people ask for
them....a perfectly valid choice.
> The query are similar. I mean that the syntax is the same.
How do you do queries in neo4j? There is a layer that does indexing
with a Lucene engine, and you can manually create indices and then
query them (get(key) for a single key), but that's not integrated with
the "kernel".., e.g. I don't see from the API how you can do an
intersection (a join) b/w two indices for example, a very common DB
operation.
In HGDB you have indexing and the graph structure fully integrated and
a relatively extensive query API that will automatically use indices
when available like a regular database. Indexing in HGDB is also
automatic - you don't have to manually add stuff to your index, you
just declare it and associate it with an atom type. Also, in HGDB you
can index arbitrary stuff: from one link target to another, from a
target to a parent link, or you can create custom indexers and add
them to the system. The indexers in HGDB are in fact also HyperGraphDB
atoms so you could associate meta data with them via regular HGDB
links, reason about them etc.!
Perhaps I must be missing some APIs in neo4j I think...
> However, I have something annoying when I make my comparison.
> Borislav, is it normal that when I create a graph with +/- 20.000
> nodes, It take about 6000 secondes? At each time that I add a node, I
> make a graph.getTransactionManager().commit(); . Maybe It's not
> optimal but in the futur I'll use HyperGraphDD like this...
>
> I f i do the same with Neo4j, it take about 40 secondes..
Can you send me yuor Neo4J code, I will download and try it. The HGDB
your code takes about 25seconds on my machine (64bit Vista, dual 2.66
GHZ CPU). If you group the transactions in batches of 100 (i.e. you do
your loop 100 iterations in one transaction instead of one
transaction per iteration), it takes about 20s - a performance gain
due to a reduce number of opening and closing of transactions (which
is expensive).
> Could you tell me if this time is normal?
Absolutely not :) But I still want to try your neo4j code here
locally. Neo4J must be faster here because I suspect it has less work
to do as HGDB maintains incidence sets as link indices automatically
and it also never stores duplicate values of primitive types (so every
in graph.add of a String atom, it will first check that this
particular string value is already stored and reuse it if so - this
behavior is customizable, of course, like pretty much everything).
Best,
Boris
--
http://www.kobrix.com - HGDB graph database, Java Scripting IDE, NLP
http://kobrix.blogspot.com - news and rants
"Frozen brains tell no tales."
-- Buckethead
> --
> You received this message because you are subscribed to the Google Groups "HyperGraphDB" group.
> To post to this group, send email to hyperg...@googlegroups.com.
> To unsubscribe from this group, send email to hypergraphdb...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/hypergraphdb?hl=en.
How do you do queries in neo4j?
Can you send me yuor Neo4J code,
Oh, but that's a different thing. Similar sorts of traversals are
supported in HGDB. But traversing the graph is a rather slow an
unnatural way to query for a subset of the nodes.
> Can you send me yuor Neo4J code,
>
> I've joined my code...
> Thank
Thanks
Thanks again,
boris
> --
> You received this message because you are subscribed to the Google Groups
> "HyperGraphDB" group.
> To post to this group, send email to hyperg...@googlegroups.com.
> To unsubscribe from this group, send email to
> hypergraphdb...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/hypergraphdb?hl=en.
>
>
>
>
--
>
> Absolutely not :) But I still want to try your neo4j code here
> locally. Neo4J must be faster here because I suspect it has less work
> to do as HGDB maintains incidence sets as link indices automatically
> and it also never stores duplicate values of primitive types (so every
> in graph.add of a String atom, it will first check that this
> particular string value is already stored and reuse it if so - this
> behavior is customizable, of course, like pretty much everything).
>
> Best,
> Boris
--
Ian Holsman
I...@Holsman.net
Well, you can actually change the value of a string, but you have to
do write directly at the storage level. And atoms in the cache won't
see the change.
> --
> You received this message because you are subscribed to the Google Groups "HyperGraphDB" group.
> To post to this group, send email to hyperg...@googlegroups.com.
> To unsubscribe from this group, send email to hypergraphdb...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/hypergraphdb?hl=en.
>
>
--
regards
Ian
--
Ian Holsman
I...@Holsman.net
HGHandle x = graph.add("hello");
HGHandle y = graph.add("hello");
you will have two different atoms that share the same value of type
string. If you do a query:
hg.findAll(graph, hg.eq("hello"))
you will get a list [x,y]. Even though both x and y share the same
underlying value, there's no official API to change it. It may be a
good idea to add such an API, but I'm not sure.
If you want to enforce the property that only 1 atom with the value
"hello" is stored, you have to add your atoms like this:
hg.addUnique(graph, "hello", hg.eq("hello"));
Cheers,
Boris
Otis
On Feb 11, 9:51 pm, Borislav Iordanov <borislav.iorda...@gmail.com>
wrote:
> Hi Otis,
>
> On Thu, Feb 11, 2010 at 5:33 PM, OG <otis.gospodne...@gmail.com> wrote:
> > Hello,
>
> > General question from a person who just found out about HyperGraphDB
> > and who has been watching that seems almost like hype around neo4j:
>
> > How does HyperGraphDB compare to neo4j, technically speaking?
>
> I can't really comment on the technical merits of neo4j since I
> haven't used it. Conceptually/architecturally I think the two are
> quite different: neo4j handles standard property graphs and
> HyperGraphDB has some generalizations that you don't see in any other
> graph database (ability of edges to point n > 0 nodes, ability of
> edges to point to other edges, the notion of types and type
> constructors integrated at the core of the system). That doesn't make
> HyperGraphDB necessarily better, because the extra generality
> translates into different storage layout on disk which has
> consequences for how you represent and query things. So I would assume
> that neo4j would perform better when all you need is classical
> property graphs. And I would assume that a more complicated model
> would benefit from a direct hypergraph representation, but I can't
> back those assumptions with any actual experiments.
>
> HyperGraphDB was originally designed for an AI project (seehttp://www.opencog.org) where this sort of generality is warranted.
> That said, to me the system doesn't seem complicated to use, but I'm
> the last person that can judge that! :) I just posted a blog entry to
> show how it qualifies as an OO database
> (http://kobrix.blogspot.com/2010/02/is-hypergraphdb-object-oriented.html)
> and I would be more curious to play in depth with db4o and see
> HyperGraphDB compares to it. I would be also curious to implement a
> document-oriented layer and see how it compares to CouchDB/MongoDB.
> Should take a couple of days, but I don't have them right now. If
> anybody here is willing to take the challenge, I can provide guidance
> and support though :)
>
> The only other DB I've heard of that's close to HyperGraphDB's
> architecture is the db behindhttp://www.freebase.com/, also a graph