Search in sources :

Example 96 with RelationshipType

use of org.neo4j.graphdb.RelationshipType in project neo4j by neo4j.

the class DatabaseMetadataService method getRelationshipTypes.

@GET
@Produces(MediaType.APPLICATION_JSON)
public Response getRelationshipTypes(@QueryParam("in_use") @DefaultValue("true") boolean inUse) {
    try {
        GraphDatabaseAPI db = database.getGraph();
        Iterable<RelationshipType> relationshipTypes = inUse ? db.getAllRelationshipTypesInUse() : db.getAllRelationshipTypes();
        return Response.ok().type(MediaType.APPLICATION_JSON).entity(generateJsonRepresentation(relationshipTypes)).build();
    } finally {
        representationWriteHandler.onRepresentationFinal();
    }
}
Also used : GraphDatabaseAPI(org.neo4j.kernel.internal.GraphDatabaseAPI) RelationshipType(org.neo4j.graphdb.RelationshipType) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET)

Aggregations

RelationshipType (org.neo4j.graphdb.RelationshipType)96 Node (org.neo4j.graphdb.Node)52 Test (org.junit.Test)45 Relationship (org.neo4j.graphdb.Relationship)37 Transaction (org.neo4j.graphdb.Transaction)18 Direction (org.neo4j.graphdb.Direction)14 Traverser (org.neo4j.graphdb.Traverser)10 NotFoundException (org.neo4j.graphdb.NotFoundException)9 DynamicRelationshipType (org.neo4j.graphdb.DynamicRelationshipType)7 Label (org.neo4j.graphdb.Label)7 RelationshipRecord (org.neo4j.kernel.impl.nioneo.store.RelationshipRecord)7 Collection (java.util.Collection)6 HashSet (java.util.HashSet)6 GraphDatabaseService (org.neo4j.graphdb.GraphDatabaseService)6 Path (org.neo4j.graphdb.Path)6 StopEvaluator (org.neo4j.graphdb.StopEvaluator)6 TraversalPosition (org.neo4j.graphdb.TraversalPosition)6 ArrayList (java.util.ArrayList)5 HashMap (java.util.HashMap)5 ReentrantLock (java.util.concurrent.locks.ReentrantLock)4