NeoClient class
Constructors
NeoClient ()
Constructs NeoClient.
Database's address can be added, otherwise the localhost address is used with Neo4J's default port is used (7474).
factory
NeoClient.withAuthorization ({required String username , required String password , String databaseAddress = 'http://localhost:7474/' })
Constructs NeoClient with authentication credentials (user & password).
Database's address can be added, otherwise the localhost address is used with Neo4J's default port is used (7474).
Username and password are encoded to build the authentication token.
factory
NeoClient.withHttpClient ({required Client httpClient })
factory
NeoClient.withoutCredentialsForTest ({String databaseAddress = 'http://localhost:7474/' })
factory
Properties
hashCode
→ int
The hash code for this object.
no setter inherited
runtimeType
→ Type
A representation of the runtime type of the object.
no setter inherited
Methods
computeDistanceBetweenTwoPoints ({required double latP1 , required double longP1 , required double latP2 , required double longP2 })
→ Future <num >
Compute the distance between two points
computeShortestPathDijkstra ({required double sourceLat , required double sourceLong , required double targetLat , required double targetLong , required String projectionName , required String propertyWeightName })
→ Future <Path >
Compute the shortest path between two nodes
If Path is empty it could means that there is no path between the two given nodes
createGraphProjection ({required String projectionName , required String label , required String relationshipName , required String relationshipProperty , required bool isDirected })
→ Future <bool >
Create a projection of the graph at the T instant
createNode ({required List <String > labels , required Map <String , dynamic > properties })
→ Future <Node ? >
Create Neo4J node
createNodeWithNode (Node node )
→ Future <void >
Create Neo4J node with given node
createRelationship ({required int startNodeId , required int endNodeId , required String relationshipLabel , required Map <String , dynamic > properties })
→ Future <Relationship ? >
Create relationship between two nodes : start node startNodeId
and end node endNodeId
The relationship has a name relationshipLabel
and can have properties properties
createRelationshipFromNodeToNodes ({required int startNodeId , required List <int > endNodesId , required String relationName , required Map <String , dynamic > properties })
→ Future <List <Relationship ? > >
Create relationship between one to many nodes (1->*)
deleteAllNode ()
→ Future <void >
Deletes all nodes in the database.
/!\ Transaction commits at submission.
deleteNodeById (int id )
→ Future <void >
Delete node corresponding to the given id id
findAllNodes ()
→ Future <List <Node > >
Finds all nodes in database.
Relationship are not return.
findAllNodesByLabel (String label )
→ Future <List <Node > >
Finds all nodes in database with given type
findAllNodesByProperties ({required List <PropertyToCheck > propertiesToCheck })
→ Future <List <Node > >
Find all nodes with given properties
Relationship not returned
findAllRelationship ()
→ Future <List <Relationship > >
findNodeById (int id )
→ Future <Node ? >
findRelationshipById (int id )
→ Future <Relationship ? >
Finds relationship with given ID (if id<0, return null).
findRelationshipWithNodeProperties ({required String relationshipLabel , required Map <String , dynamic > properties })
→ Future <List <Relationship ? > >
Find relationship of a node with node properties
findRelationshipWithStartNodeIdEndNodeId (int startNode , int endNode )
→ Future <Relationship ? >
Find relationship with start node id startNodeId
and end node id endNodeId
getNodesWithHighestProperty (int limit , String propertyName )
→ Future <List <Relationship > >
isRelationshipExistsBetweenTwoNodes (int firstNode , int secondNode )
→ Future <bool >
Check if a relationship exists between two nodes firstNode
and secondNode
noSuchMethod (Invocation invocation )
→ dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString ()
→ String
A string representation of this object.
inherited
updateNodeById ({required int nodeId , required Map <String , dynamic > propertiesToAddOrUpdate })
→ Future <Node ? >
Update node corresponding to the given nodeId
with propertiesToAddOrUpdate
updateRelationshipById ({required int relationshipId , required Map <String , dynamic > propertiesToAddOrUpdate })
→ Future <Relationship ? >
Update Relationship corresponding to the given relationshipId
with propertiesToAddOrUpdate