Graph
Object-Graph Map
Static Member Summary
Static Public Members | ||
public static get |
Node: * |
|
public static get |
|
|
public static get |
Relationship: * |
|
public static get |
|
|
public static get |
|
|
public static get |
|
|
public static get |
|
|
public static get |
db: * Get a database instance. |
Static Method Summary
Static Public Methods | ||
public static |
Build a graph from query results. |
|
public static |
Get the Neo4j node entity |
|
public static |
Get Neo4j Node id |
|
public static |
Get the type of the entity |
Constructor Summary
Public Constructor | ||
public |
constructor(result: neo4j.Result, models: object, links: object) Creates an instance of Graph. |
Member Summary
Public Members | ||
public |
index: * |
|
public |
links: * |
|
public |
models: * |
|
public |
nodes: * |
|
public |
references: {} |
|
public |
|
Method Summary
Public Methods | ||
public |
add(entity: neo4j.types.Node | neo4j.types.Node[] | neo4j.types.Relationship | neo4j.types.Relationship[], key: string) Add one or more entities to the graph |
|
public |
addLinks(record: neo4j.Record) Link record items |
|
public |
addRecords(records: neo4j.Record[]) Add records to the graph |
|
public |
Get linked results mapped to Models |
|
public |
Get the map used for the entity |
|
public |
getNodeModel(id: Number | neo4j.integer, $Node: Function<Node>): Node Wrap a Neo4j node in a specified Node model |
|
public |
Get all Nodes for a reference used in the Cypher query |
|
public |
getRelated(node: Node, $Relationship: Function): Node[] Get related nodes |
|
public |
getRelationship(start: Node, end: Node, $Relationship: Function): Relationship Get Relationship from the graph |
|
public |
remove(obj: neo4j.types.Node | neo4j.types.Node[] | neo4j.types.Relationship | neo4j.types.Relationship[] | Node | Node[] | Relationship | Relationship[]) Remove one or more entities from the graph |
|
public |
Run a Cypher query and add the result to the current Graph instance |
|
public |
setRelationshipsIndex(entity: *) |
Static Public Members
public static get Node: * source
public static get NodeCollection: * source
public static get Relationship: * source
Static Public Methods
public static build(query: string, parameters: object, models: object, links: object): Graph source
Build a graph from query results. Map variables returned from the query to Nodes
public static getEntity(subject: Node | neo4j.types.Node | Object): neo4j.types.Node source
Get the Neo4j node entity
Return:
neo4j.types.Node | The Neo4j Node entity |
Public Constructors
Public Members
public index: * source
public links: * source
public models: * source
public nodes: * source
public references: {} source
public relationships: * source
Public Methods
public add(entity: neo4j.types.Node | neo4j.types.Node[] | neo4j.types.Relationship | neo4j.types.Relationship[], key: string) source
Add one or more entities to the graph
Params:
Name | Type | Attribute | Description |
entity | neo4j.types.Node | neo4j.types.Node[] | neo4j.types.Relationship | neo4j.types.Relationship[] | One or more entities |
|
key | string | The key associated with this |
public addLinks(record: neo4j.Record) source
Link record items
Params:
Name | Type | Attribute | Description |
record | neo4j.Record | Neo4j Record |
public addRecords(records: neo4j.Record[]) source
Add records to the graph
Params:
Name | Type | Attribute | Description |
records | neo4j.Record[] | Neo4j Records |
public getLinked(node: Node, name: string): any source
Get linked results mapped to Models
Return:
any | The linked result |
public getMap(entity: any): Map source
Get the map used for the entity
Params:
Name | Type | Attribute | Description |
entity | any | Entity object |
public getNodeModel(id: Number | neo4j.integer, $Node: Function<Node>): Node source
Wrap a Neo4j node in a specified Node model
public getNodes(reference: string): array source
Get all Nodes for a reference used in the Cypher query
Params:
Name | Type | Attribute | Description |
reference | string | The reference |
Return:
array | An array of nodes |
public getRelationship(start: Node, end: Node, $Relationship: Function): Relationship source
Get Relationship from the graph
public remove(obj: neo4j.types.Node | neo4j.types.Node[] | neo4j.types.Relationship | neo4j.types.Relationship[] | Node | Node[] | Relationship | Relationship[]) source
Remove one or more entities from the graph
Params:
Name | Type | Attribute | Description |
obj | neo4j.types.Node | neo4j.types.Node[] | neo4j.types.Relationship | neo4j.types.Relationship[] | Node | Node[] | Relationship | Relationship[] | One or more objects |
public run(query: string, parameters: Object, models: Object, links: Object): Promise source
Run a Cypher query and add the result to the current Graph instance
public setRelationshipsIndex(entity: *) source
Params:
Name | Type | Attribute | Description |
entity | * |