API for clj-blueprints - clj-blueprints

by Eduardo Julián

Full namespace name: clj-blueprints

Overview

Wrapper for the TinkerPop Blueprints API for Graph DBMSs. It supports version 1.1 of the Blueprints API.

Public Variables and Functions



*db*

var

  
This dynamic var holds the currently used database.
Source


add-listener

function
Usage: (add-listener g l)
Adds a listener to an EventGraph.
Can be passed either a GraphChangedListener or a hash-map that is compatible with graph-listener.
Source


as-map

function
Usage: (as-map elem)
Transforms an element to a Clojure hash-map.
Source


as-read-only

function
Usage: (as-read-only)
       (as-read-only item)
When called with no arguments, this fn sets *db* to be a read-only version of itself.
When called with one argument (Graph, Vertex, Edge or Index), it returns a read only version of it.
Source


clear!

function
Usage: (clear!)
Clears *db* of all nodes and edges.
Source


create-automatic-index!

function
Usage: (create-automatic-index! kname class keys)

  
  
  Source


create-manual-index!

function
Usage: (create-manual-index! kname class)

  
  
  Source


current-buffer-size

function
Usage: (current-buffer-size)
Current Transaction Buffer Size
Source


drop-index!

function
Usage: (drop-index! kname)

  
  
  Source


event-graph

function
Usage: (event-graph graph)

  
  
  Source


get-edges

function
Usage: (get-edges vertex dir)
       (get-edges vertex dir label)
Gets the edges from a vertex given the direction (:in or :out) and an optional filtering label (as a keyword).
Source


get-ends

function
Usage: (get-ends vertex dir label)
       (get-ends vertex dir)
In case you don't want to get the edges that meet a requirement but the vertices at the end of those, use get-ends just like get-edges.
Source


get-id

function
Usage: (get-id elem)

  
  
  Source


get-index

function
Usage: (get-index kname class)

  
  
  Source


get-indices

function
Usage: (get-indices)
Returns the indices of the graph.
Source


get-label

function
Usage: (get-label edge)

  
  
  Source


function
Usage: (get-link v1 v2)
If vertex1 and vertex2 are connected by an edge, it returns that edge.
Source


get-max-buffer-size

function
Usage: (get-max-buffer-size)
Get Max Transaction Buffer Size
Source


get-raw-graph

function
Usage: (get-raw-graph eg)
Returns the graph wrapped by an EventGraph.
Source


get-vertex

function
Usage: (get-vertex edge dir)
Gets the :in or :out vertex from an edge.
Source


get-vertices

function
Usage: (get-vertices)
Returns all the vertices.
Source


graph-listener

function
Usage: (graph-listener {:keys [edge-add edge-prop-changed edge-prop-remove edge-remove vertex-add vertex-prop-changed vertex-prop-remove vertex-remove graph-cleared]})
Creates a GraphChangedListener object by being passed a hash-map of functions to be used. All the functions are optional.
Notation: vx = vertex; e = edge; k = key; v = val
Signatures:
edge-add [e]
edge-prop-changed[e k v] 
edge-prop-remove [e k v]
edge-remove [e]
vertex-add [vx]
vertex-prop-changed [vx k v]
vertex-prop-remove [vx k v]
vertex-remove [vx]
graph-cleared []
Source


iget

function
Usage: (iget index key val)
Gets an element from an index.
Source


index-class

function
Usage: (index-class i)

  
  
  Source


index-name

function
Usage: (index-name i)

  
  
  Source


index-type

function
Usage: (index-type i)
Returns whether the given index is :automatic or :manual.
Source


iput

function
Usage: (iput index key val element)
Puts an element from an index.
Source


iremove

function
Usage: (iremove index key val element)
Removes an element from an index.
Source


link!

function
Usage: (link! id v1 label props v2)
       (link! v1 label props v2)
       (link! v1 label v2)
Adds an edge between vertex1 and vertex 2 given a vector like [label props-map]. The label must be a keyword and props-map can be nil.
Source


linked?

function
Usage: (linked? v1 v2)
Tells whether or not two vertices have an edge between them.
Source


load-edge

function
Usage: (load-edge id)

  
  
  Source


load-vertex

function
Usage: (load-vertex id)

  
  
  Source


migrate-graph!

function
Usage: (migrate-graph! g1 g2)

  
  
  Source


passoc!

function
Usage: (passoc! elem prop v)
       (passoc! elem prop v & kvs)
Assocs an element's property (given as a keyword).
Source


pdissoc!

function
Usage: (pdissoc! elem prop)
Dissocs an element's property (given as a keyword).
Source


pget

function
Usage: (pget elem prop)
Retrieves an element's property (given as a keyword).
Source


pkeys

function
Usage: (pkeys elem)
Returns an element's keys as keywords.
Source


pvals

function
Usage: (pvals elem)
Returns an element's vals.
Source


read-graph-json!

function
Usage: (read-graph-json! input-stream)
       (read-graph-json! input-stream buffer-size)
Reads GraphSON formatted data into the current *db*.
Source


read-graph-ml!

function
Usage: (read-graph-ml! input-stream & {:keys [buffer-size vertex-id-key edge-id-key edge-label-key]})
Reads GraphML formatted data into the current *db*.
All the keys are optional.
Source


remove!

function
Usage: (remove! elem)
Removes either a vertex or an edge from the Graph.
Source


set-db!

function
Usage: (set-db! graph-db)
Given a Graph instance (like OrientGraph, TinkerGraph, etc), sets it as the global DB.
Source


set-max-buffer-size

function
Usage: (set-max-buffer-size buffer-size)
Set Max Transaction Buffer Size
Source


shutdown!

function
Usage: (shutdown!)

  
  
  Source


tinker-graph

function
Usage: (tinker-graph)
       (tinker-graph dir)

  
  
  Source


unlink!

function
Usage: (unlink! v1 v2)
Removes the edge between two vertices.
Source


vertex

function
Usage: (vertex id props)
       (vertex id)
       (vertex)
Adds a vertex to the database. If given a hash-map, sets the properties of the vertex.
Source


with-db

macro
Usage: (with-db graph-db & forms)
Evaluates the given forms with the given Graph DB bound to *db*.
Source


with-tx

macro
Usage: (with-tx & forms)
Evaluates the given forms inside a transaction.
Source


write-graph-json!

function
Usage: (write-graph-json! out-stream & {:keys [vertex-props edge-props show-types]})
Writes GraphSON formatted data from the current *db*.
All the keys are optional.
Source


write-graph-ml!

function
Usage: (write-graph-ml! out-stream & {:keys [vertex-types edge-types normalize]})
Writes GraphML formatted data from the current *db*.
All the keys are optional.
Source
Logo & site design by Tom Hickey.
Clojure auto-documentation system by Tom Faulhaber.