Creating a reference node through REST API

127 views
Skip to first unread message

Javier de la Rosa

unread,
Jul 26, 2012, 9:46:07 AM7/26/12
to ne...@googlegroups.com
Hi all,

Is there any way to create a reference node using the REST API?

Regards.

--
Javier de la Rosa
http://versae.es

Michael Hunger

unread,
Jul 26, 2012, 5:05:27 PM7/26/12
to ne...@googlegroups.com
Not that I know of. Feel free to raise an issue about this.

Sorry :(

Michael

Jim Webber

unread,
Jul 27, 2012, 5:26:50 AM7/27/12
to ne...@googlegroups.com
Seriously, don't create an issue about this.

The reference node is a historical anachronism, and shouldn't be considered special. It's *your* nodes that are special. The reference node needs to die, die, die.

Jim

Peter Neubauer

unread,
Jul 27, 2012, 5:30:30 AM7/27/12
to ne...@googlegroups.com
If it is going to die, we should deprecate it ASAP since we maintain 2
releases compatibility. WDYT?

Cheers,

/peter neubauer

G: neubauer.peter
S: peter.neubauer
P: +46 704 106975
L: http://www.linkedin.com/in/neubauer
T: @peterneubauer

Wanna learn something new? Come to @graphconnect.

Jim Webber

unread,
Jul 27, 2012, 5:35:33 AM7/27/12
to ne...@googlegroups.com
Folks,

I've always disliked the reference node. It seemed both presumptuous and unnecessary to me. It's not like a relational store comes with a reference table, or a document store comes pre-populated with one reference document is it?

I'd like to kill off the reference node in future releases of Neo4j. However I want to make sure this doesn't impact you guys. Some of you might well have scripts or other infrastructure that relies on the reference node.

If you think you are going to be affected by the removal of the reference node, please yell very loudly on this list.

Many thanks,

Jim

Peter Neubauer

unread,
Jul 27, 2012, 5:39:28 AM7/27/12
to ne...@googlegroups.com
I think the biggest problem is libraries and drivers and example
relying on that node being there. However, we could deal with that
after deprecation?

Cheers,

/peter neubauer

G: neubauer.peter
S: peter.neubauer
P: +46 704 106975
L: http://www.linkedin.com/in/neubauer
T: @peterneubauer

Wanna learn something new? Come to @graphconnect.


Nigel Small

unread,
Jul 27, 2012, 5:48:22 AM7/27/12
to ne...@googlegroups.com
Removal of the reference node would cause no significant problems for py2neo.

Nige

Axel Morgner

unread,
Jul 27, 2012, 6:13:17 AM7/27/12
to ne...@googlegroups.com
We're not using the reference node in structr, so go for it!
--

Axel Morgner � ax...@morgner.de � @amorgner

c/o Morgner UG � Hanauer Landstr. 291a � 60314 Frankfurt � Germany
phone: +49 151 40522060 � skype: axel.morgner

http://structr.org
http://www.meetup.com/graphdb-frankfurt
https://splink.de

Tero Paananen

unread,
Jul 27, 2012, 7:15:47 AM7/27/12
to ne...@googlegroups.com
I'm using the reference node as a container for a group of nodes that do
not otherwise have a natural "owner". It makes it easier to access those
nodes. I can do a node(0).getRelationships(Direction.OUTGOING, "type"),
rather than a Lucene search on the node properties.

I could, of course, create the container node of my own in the absence
of the reference node.

-TPP

James Thornton

unread,
Jul 27, 2012, 7:46:22 AM7/27/12
to ne...@googlegroups.com
Bulbs has no notion of a reference node.

- James

Niels Hoogeveen

unread,
Jul 27, 2012, 9:48:14 AM7/27/12
to Neo4j
multispective.com makes use of the reference node since it represents
the store itself, but since no new databases will be created it's not
a big deal when the reference node is removed from the API. It is
already in the database with id == 0.

Josh Adell

unread,
Jul 27, 2012, 10:33:34 AM7/27/12
to ne...@googlegroups.com
Neo4jPHP allows users to retrieve the reference node (assumed node(0)) but it doesn't use it for anything itself.

I say kill it.

-- Josh

Marko Rodriguez

unread,
Jul 27, 2012, 10:38:39 AM7/27/12
to ne...@googlegroups.com
Neither does TinkerPop.

Marko.

Javier de la Rosa

unread,
Jul 27, 2012, 10:45:51 AM7/27/12
to ne...@googlegroups.com
On Fri, Jul 27, 2012 at 5:26 AM, Jim Webber <j...@neotechnology.com> wrote:
> The reference node needs to die, die, die.

+1. Die, die my darling [1].



[1] http://www.youtube.com/watch?v=JoolQUDWq-k

Christophe Willemsen

unread,
Jul 27, 2012, 4:37:04 PM7/27/12
to ne...@googlegroups.com
For my POV, when coming from relational databases, the Reference is a real blocker to start graph models understanding. 

The first reflex of people coming from rdbms is to relate all their parent nodes to the reference node. 

S B

unread,
Jul 30, 2012, 12:50:05 AM7/30/12
to ne...@googlegroups.com
As a newbie I try to exactly understand what the reference node is. Is it simply the node of Id 0 or does it have special properties that makes it special in the database?
If there is no reference node, indexes should be used right? (I already asked that question several days ago but try to get as many advice as possible).

Stefan

ya...@umt.edu.my

unread,
Jul 30, 2012, 2:47:57 AM7/30/12
to ne...@googlegroups.com

Assalamualaikum & Salam Sejahtera S B
~Yazid
Prof Md Yazid Mohd Saman PhD
http://yazid.blog.umt.edu.my
+609-668-3316

Jim Webber

unread,
Jul 30, 2012, 4:25:30 AM7/30/12
to ne...@googlegroups.com
Hi Stefan,

The reference not is not special. It just happens to be a node that exists when the database is started. That it happens to have ID 0 should be unimportant*.

Ignore it. Delete it. Whatever. Your nodes are important, your indexes are important. The reference node is not.

Jim

* Unfortunately some tools like Neoclipse get upset if you delete the node with ID 0. That's a poor design decision. If there needs to be some well-known starting point for a tool then, just like any query, it should be looked up in an index.

S B

unread,
Jul 31, 2012, 5:03:47 AM7/31/12
to ne...@googlegroups.com
I always feel a bit confused by your answers on that issue, you say that this node should not exist because a database should be empty when created. I understand that but that is a different issue from bad design practice.
Is the node reference unwanted AND bad practice? Hence one should use indices instead of a reference node.

Also, if the reference node is not special why is the REST API returning special information about it? This leads me to think that there is a way to identify any node as the reference node.
Will this disappear as well?

 $ curl http://localhost:7474/db/data/
{
  "neo4j_version" : "jenkins-community-1418",
  "extensions_info" : "http://localhost:7474/db/data/ext",
  "reference_node" : "http://localhost:7474/db/data/node/0",
  "extensions" : {
    "CypherPlugin" : {
    },
    "GremlinPlugin" : {
    }
  }
}

Thanks for your patience on this issue, I feel like it's obvious to people using graph databases.

Stefan

Peter Neubauer

unread,
Jul 31, 2012, 5:09:29 AM7/31/12
to ne...@googlegroups.com
Stefan,
the reference node is the first node with the ID 0, created
automatically by Neo4j. It has been there from the beginning of time
and probably will be there for some more months. However, going
forward there is a sentiment that

1. no data should be created without the users consent
2. relying on a node with a given ID and hard-coding functionality to
that knowledge is not good practice (but convenient)
3. If 1 and 2 are agreed upon, then the logical conclusion is to
remove the reference node in future versions.

That's all, so for the time being the reference node is there and can
be used (just don't rely on it too much).

Cheers,

/peter neubauer

G: neubauer.peter
S: peter.neubauer
P: +46 704 106975
L: http://www.linkedin.com/in/neubauer
T: @peterneubauer

Wanna learn something new? Come to @graphconnect.


Reply all
Reply to author
Forward
0 new messages