How to delete labels in neo4j?

There isn't at the moment (Neo4j 2.0.1) a way to explicitly delete a label once it has been created. Neo4j Browser will display all labels which are reported by the REST endpoint at:

http://localhost:7474/db/data/labels

Separately, the Neo4j Browser sidebar which displays labels doesn't properly refresh the listing when it loses connection with Neo4j. A web browser reload should work.

Lastly, there was a bug in Neo4j Browser's visualization which would display all labels for which a style had been created. If using a version of Neo4j which has the bug, you can clear the styling by clicking on "View Stylesheet" in the property inspector, then clicking the fire extinguisher icon. All of that needs usability improvement, admittedly.

Cheers, Andreas


This seems to be worked out by version 2.3.0.

As an example, suppose we had created a movie in the data browser such as:

CREATE(m:Movie:Cinema:Film:Picture{title:"The Matrix"})

We could query it with

MATCH(m:Movie)
WHERE m.title = "The Matrix"
RETURN m

It would have 4 labels: Movie, Cinema, Film, and Picture

To remove the Picture label from all movies:

MATCH(m:Movie)
REMOVE m:Picture
RETURN m

To remove the Picture label from only that one movie:

MATCH(m:Movie)
WHERE m.title = "The Matrix"
REMOVE m:Picture
RETURN m

Tags:

Neo4J