Skip to content

Add support for Labels and new Indexing methods #82

Closed
versae opened this Issue Apr 10, 2013 · 8 comments

3 participants

@versae
Owner
versae commented Apr 10, 2013

According to Neo4j 2.0.0-M01, Labels will be introduce as a kind of light type annotation for nodes.

@versae versae was assigned Apr 10, 2013
@papachoco

Just wonder when this feature will be released.?

Thanks

Carlos

@versae
Owner
versae commented Sep 17, 2013

I am glad to announce that I will working with the Neo4j guys in a hackathon by the beginning of October, so hopefully, all those features will be ready on October 7th.

But sorry for the huge delay.

@mhluongo
mhluongo commented Oct 3, 2013

@versae let me know if there's anywhere I can lend a hand.

@versae
Owner
versae commented Oct 3, 2013

Sure @mhluongo. Let's discuss the API

  • Add a label no a node:
node.labels.add("Label")
  • Add multiple labels
node.labels.add(["Label1", "Label2"])
  • Replaceing lables
node.labels = ["New label1", "New label2"]
  • Removing a label from a node
node.labels.remove("Label")
  • Listing labels
node.labels
  • Get all nodes with a label
gdb.labels["Label"]
gdb.labels.get("Label")
  • Get all nodes with a label and a property
gdb.labels.get("Label", name="Bob Ross")
  • List all labels
gdb.labels

And I think that'd be all. WDYT?

@versae
Owner
versae commented Oct 4, 2013

Almost done. But in the process I realized that the for a long time deprecated syntax for creating relationships is not compatible with the new labels property. So I decided to remove completely from from the new version.

Instead of::

n1.Know(n2)

We will have to do:

n1.relationships.create(n2)
@mhluongo
mhluongo commented Oct 4, 2013

Good work!

@versae
Owner
versae commented Dec 28, 2013

Done and documented: https://neo4j-rest-client.readthedocs.org/en/latest/labels.html I finally changed a bit the syntax, but for the best I hope.

@versae versae closed this Dec 28, 2013
@mhluongo

I'm excited about using this downstream, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.