clojurewerkz.neocons.rest.relationships

add-to-index

(add-to-index connection rel idx key value)(add-to-index connection rel idx key value unique?)
Adds the given rel to the index

all-for

(all-for connection node & {:keys [types]})
Returns all relationships for given node

all-ids-for

(all-ids-for connection node & {:keys [types]})
Returns ids of all relationships for the given node

all-indexes

(all-indexes connection)
Returns all relationship indices

all-outgoing-between

(all-outgoing-between connection from to rels)
Returns all outgoing (outbound) relationships of given relationship types between two nodes

all-types

(all-types connection)
Returns all relationship types that exists in the entire database

create

(create connection from to rel-type)(create connection from to rel-type data)
Creates a relationship of given type between two nodes. 

create-index

(create-index connection s)(create-index connection s configuration)
Creates a new relationship index. Indexes are used for fast lookups by a property or full text search query.

create-many

(create-many connection from xs rel-type)(create-many connection from xs rel-type data)
Concurrently creates multiple relations of given type between the *from* node and several provded nodes.
All relationships will be of the same type.

This function should be used when number of relationships that need to be created is moderately high (dozens and more),
otherwise it would be less efficient than using clojure.core/map over the same sequence of nodes

create-unique-in-index

(create-unique-in-index connection from to rel-type idx k v)(create-unique-in-index connection from to rel-type idx k v data)
Atomically creates and returns a relationship with the given properties and adds it to an index while ensuring key uniqueness
in that index. This is the same as first creating a relationship using the `clojurewerkz.neocons.rest.relationships/create` function
and indexing it with the 4-arity of `clojurewerkz.neocons.rest.relationships/add-to-index` but performed atomically and requires
only a single request.

For more information, see http://docs.neo4j.org/chunked/milestone/rest-api-unique-indexes.html (section 19.8.4)

delete

(delete connection rel)
Deletes relationship by id

delete-from-index

(delete-from-index connection rel idx)(delete-from-index connection rel idx key)(delete-from-index connection rel idx key value)
Deletes the given rel from index

delete-index

(delete-index connection s)
Deletes a relationship index

delete-many

(delete-many connection ids)
Deletes multiple relationships by id.

delete-property

(delete-property connection id prop)
Deletes a property from relationship with the given id

ends-with?

(ends-with? rel id)
Returns true if provided relationship ends with the node with the provided id,
false otherwise

fetch-from

(fetch-from connection uri)
Fetches a relationships from given URI. Exactly like clojurewerkz.neocons.rest.relationships/get but takes a URI instead of an id.

find

(find connection key value)(find connection idx key value)
Finds relationships using the index

find-one

(find-one connection idx key value)
Finds a single relationship using the index

first-outgoing-between

(first-outgoing-between connection from to types)
Returns first outgoing (outbound) relationships of given relationship types between two nodes

get

(get connection id)
Fetches relationship by id

get-many

(get-many connection coll)
Fetches multiple relationships by id.

This is a non-standard operation that requires Cypher support as well as support for that very feature
by Cypher itself (Neo4j Server versions 1.6.3 and later).

incoming-for

(incoming-for connection node & {:keys [types]})
Returns incoming (inbound) relationships for the given node

maybe-create

(maybe-create connection from to rel-type)(maybe-create connection from to rel-type data)
Creates a relationship of given type between two nodes, unless it already exists

maybe-delete

(maybe-delete connection id)
Deletes relationship by id but only if it exists. Otherwise, does nothing and returns nil

maybe-delete-outgoing

(maybe-delete-outgoing connection id)(maybe-delete-outgoing connection from to rels)
Deletes outgoing relationship of given type between two nodes but only if it exists.
Otherwise, does nothing and returns nil

outgoing-for

(outgoing-for connection node & {:keys [types]})
Returns all outgoing (outbound) relationships for the given node

outgoing-ids-for

(outgoing-ids-for connection node & {:keys [types]})
Returns ids of all outgoing (outbound) relationships for given node.

purge-all

(purge-all connection node)
Deletes all relationships for given node. Usually used before deleting the node,
because Neo4J won't allow nodes with relationships to be deleted. Nodes are deleted sequentially
to avoid node locking problems with Neo4J Server before 1.8

purge-outgoing

(purge-outgoing connection node)(purge-outgoing connection node & {:keys [types]})
Deletes all outgoing relationships for given node. Nodes are deleted sequentially
to avoid node locking problems with Neo4J Server before 1.8

query

(query connection query)(query connection idx query)
Finds relationships using full text search query

replace-outgoing

(replace-outgoing connection from xs rel-type)
Deletes outgoing relationships of the node `from` with given type, then creates
new relationships of the same type with `xs` nodes

starts-with?

(starts-with? rel id)
Returns true if provided relationship starts with the node with the provided id,
false otherwise

traverse

(traverse connection id & {:keys [order relationships uniqueness prune-evaluator return-filter max-depth], :or {order "breadth_first", uniqueness "node_global", prune-evaluator {:language "builtin", :name "none"}, return-filter {:language "builtin", :name "all"}}})
Performs relationships traversal

update

(update connection rel data)
Updates relationship data by id