Skip to content
Browse files

Blueprints 1.1 Blueberry release commit.

  • Loading branch information...
1 parent 0da0a05 commit 30e1227af7aae5c1184e42c489e7ce44c313fde1 @okram okram committed Dec 6, 2011
Showing with 2,074 additions and 24 deletions.
  1. +4 −2 CHANGELOG.textile
  2. +2 −2 blueprints-core/pom.xml
  3. +2 −2 blueprints-dex-graph/pom.xml
  4. +2 −2 blueprints-graph-jung/pom.xml
  5. +2 −2 blueprints-graph-sail/pom.xml
  6. +2 −2 blueprints-neo4j-graph/pom.xml
  7. +2 −2 blueprints-neo4jbatch-graph/pom.xml
  8. +2 −2 blueprints-orient-graph/pom.xml
  9. +2 −2 blueprints-rexster-graph/pom.xml
  10. +2 −2 blueprints-sail-graph/pom.xml
  11. +2 −2 blueprints-test/pom.xml
  12. +16 −0 doc/wiki/Acknowledgments.textile
  13. +93 −0 doc/wiki/Code-Examples.textile
  14. +18 −0 doc/wiki/Desired-Implementations.textile
  15. +67 −0 doc/wiki/Dex-Implementation.textile
  16. +53 −0 doc/wiki/Event-Implementation.textile
  17. +15 −0 doc/wiki/Graph-Indices-Helpers.textile
  18. +73 −0 doc/wiki/Graph-Indices.textile
  19. +22 −0 doc/wiki/Graph-Morphisms.textile
  20. +74 −0 doc/wiki/Graph-Transactions.textile
  21. +196 −0 doc/wiki/GraphML-Reader-and-Writer-Library.textile
  22. +298 −0 doc/wiki/GraphSON-Reader-and-Writer-Library.textile
  23. +98 −0 doc/wiki/Home.textile
  24. +5 −0 doc/wiki/Implementations.textile
  25. +63 −0 doc/wiki/JUNG-Ouplementation.textile
  26. +18 −0 doc/wiki/Neo4j-Implementation.textile
  27. +15 −0 doc/wiki/Neo4jBatch-Implementation.textile
  28. +17 −0 doc/wiki/Neo4jHa-implementation.textile
  29. +21 −0 doc/wiki/OrientDB-Implementation.textile
  30. +7 −0 doc/wiki/Ouplementations.textile
  31. +22 −0 doc/wiki/Property-Graph-Implementations.textile
  32. +105 −0 doc/wiki/Property-Graph-Model-Test-Suite.textile
  33. +94 −0 doc/wiki/Property-Graph-Model.textile
  34. +16 −0 doc/wiki/ReadOnly-Implementation.textile
  35. +331 −0 doc/wiki/Release-Notes.textile
  36. +15 −0 doc/wiki/Rexster-Implementation.textile
  37. +81 −0 doc/wiki/Sail-Implementation.textile
  38. +181 −0 doc/wiki/Sail-Ouplementation.textile
  39. +12 −0 doc/wiki/The-Benefits-of-Blueprints.textile
  40. +22 −0 doc/wiki/TinkerGraph.textile
  41. +2 −2 pom.xml
View
6 CHANGELOG.textile
@@ -13,13 +13,13 @@ Blueprints: A Property Graph Model Interface
!https://github.com/tinkerpop/blueprints/raw/master/doc/images/blueprints-blueberry.png!
-h3. Version 1.1 (Blueberry -- NOT RELEASED YET)
+h3. Version 1.1 (Blueberry -- December 7, 2011)
```xml
<dependency>
<groupId>com.tinkerpop.blueprints</groupId>
<artifactId>blueprints-core</artifactId>
- <version>1.1-SNAPSHOT</version>
+ <version>1.1</version>
</dependency>
```
@@ -34,6 +34,8 @@ h3. Version 1.1 (Blueberry -- NOT RELEASED YET)
* Added @WrappedGraph@ as a template for how to build stackable graph implementations
* Added @SparqlRepositorySailGraph@ to support a @Graph@ representation of any SPARQL endpoint
* Renamed @GraphJSONxxx@ to @GraphSONxxx@ to promote as standardized JSON graph format
+* Bumped to support OrientDB 1.0rc7
+* Bumped to support Neo4j 1.5
==<hr/>==
View
4 blueprints-core/pom.xml
@@ -6,11 +6,11 @@
<parent>
<groupId>com.tinkerpop.blueprints</groupId>
<artifactId>blueprints</artifactId>
- <version>1.1-SNAPSHOT</version>
+ <version>1.1</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>blueprints-core</artifactId>
- <version>1.1-SNAPSHOT</version>
+ <version>1.1</version>
<packaging>jar</packaging>
<url>http://blueprints.tinkerpop.com</url>
<name>Blueprints-Core</name>
View
4 blueprints-dex-graph/pom.xml
@@ -5,11 +5,11 @@
<parent>
<groupId>com.tinkerpop.blueprints</groupId>
<artifactId>blueprints</artifactId>
- <version>1.1-SNAPSHOT</version>
+ <version>1.1</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>blueprints-dex-graph</artifactId>
- <version>1.1-SNAPSHOT</version>
+ <version>1.1</version>
<packaging>jar</packaging>
<name>Blueprints-DexGraph</name>
<description>Blueprints property graph implementation for the DEX graph database</description>
View
4 blueprints-graph-jung/pom.xml
@@ -5,11 +5,11 @@
<parent>
<groupId>com.tinkerpop.blueprints</groupId>
<artifactId>blueprints</artifactId>
- <version>1.1-SNAPSHOT</version>
+ <version>1.1</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>blueprints-graph-jung</artifactId>
- <version>1.1-SNAPSHOT</version>
+ <version>1.1</version>
<packaging>jar</packaging>
<name>Blueprints-GraphJung</name>
<description>Blueprints property graphs outplementation for the JUNG (Java Universal Network/Graph Framework)
View
4 blueprints-graph-sail/pom.xml
@@ -5,11 +5,11 @@
<parent>
<groupId>com.tinkerpop.blueprints</groupId>
<artifactId>blueprints</artifactId>
- <version>1.1-SNAPSHOT</version>
+ <version>1.1</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>blueprints-graph-sail</artifactId>
- <version>1.1-SNAPSHOT</version>
+ <version>1.1</version>
<packaging>jar</packaging>
<name>Blueprints-GraphSail</name>
<description>Blueprints property graphs outplementation for Sesame RDS Sail</description>
View
4 blueprints-neo4j-graph/pom.xml
@@ -5,11 +5,11 @@
<parent>
<groupId>com.tinkerpop.blueprints</groupId>
<artifactId>blueprints</artifactId>
- <version>1.1-SNAPSHOT</version>
+ <version>1.1</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>blueprints-neo4j-graph</artifactId>
- <version>1.1-SNAPSHOT</version>
+ <version>1.1</version>
<packaging>jar</packaging>
<name>Blueprints-Neo4jGraph</name>
<description>Blueprints property graph implementation for the Neo4j graph database</description>
View
4 blueprints-neo4jbatch-graph/pom.xml
@@ -5,11 +5,11 @@
<parent>
<groupId>com.tinkerpop.blueprints</groupId>
<artifactId>blueprints</artifactId>
- <version>1.1-SNAPSHOT</version>
+ <version>1.1</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>blueprints-neo4jbatch-graph</artifactId>
- <version>1.1-SNAPSHOT</version>
+ <version>1.1</version>
<packaging>jar</packaging>
<name>Blueprints-Neo4jBatchGraph</name>
<description>Blueprints property graph implementation for the Neo4j batch inserter</description>
View
4 blueprints-orient-graph/pom.xml
@@ -5,11 +5,11 @@
<parent>
<groupId>com.tinkerpop.blueprints</groupId>
<artifactId>blueprints</artifactId>
- <version>1.1-SNAPSHOT</version>
+ <version>1.1</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>blueprints-orient-graph</artifactId>
- <version>1.1-SNAPSHOT</version>
+ <version>1.1</version>
<packaging>jar</packaging>
<name>Blueprints-OrientGraph</name>
<description>Blueprints property graph implementation for the OrientDB graph database</description>
View
4 blueprints-rexster-graph/pom.xml
@@ -5,11 +5,11 @@
<parent>
<groupId>com.tinkerpop.blueprints</groupId>
<artifactId>blueprints</artifactId>
- <version>1.1-SNAPSHOT</version>
+ <version>1.1</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>blueprints-rexster-graph</artifactId>
- <version>1.1-SNAPSHOT</version>
+ <version>1.1</version>
<packaging>jar</packaging>
<name>Blueprints-RexsterGraph</name>
<description>Blueprints property graph implementation for Rexster</description>
View
4 blueprints-sail-graph/pom.xml
@@ -5,11 +5,11 @@
<parent>
<groupId>com.tinkerpop.blueprints</groupId>
<artifactId>blueprints</artifactId>
- <version>1.1-SNAPSHOT</version>
+ <version>1.1</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>blueprints-sail-graph</artifactId>
- <version>1.1-SNAPSHOT</version>
+ <version>1.1</version>
<packaging>jar</packaging>
<name>Blueprints-SailGraph</name>
<description>Blueprints property graph implementation for Sesame RDF Sail</description>
View
4 blueprints-test/pom.xml
@@ -5,11 +5,11 @@
<parent>
<groupId>com.tinkerpop.blueprints</groupId>
<artifactId>blueprints</artifactId>
- <version>1.1-SNAPSHOT</version>
+ <version>1.1</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>blueprints-test</artifactId>
- <version>1.1-SNAPSHOT</version>
+ <version>1.1</version>
<packaging>jar</packaging>
<name>Blueprints-Test</name>
<description>Reusable test suites for Blueprints</description>
View
16 doc/wiki/Acknowledgments.textile
@@ -0,0 +1,16 @@
+<img width="100" src="https://github.com/tinkerpop/blueprints/raw/master/doc/images/blueprints-character-2.png"/>
+
+This section provides a list of the people that have contributed in some way to the creation of Blueprints.
+
+# "Marko A. Rodriguez":http://markorodriguez.com -- designed, developed, tested, and documented Blueprints.
+# "Luca Garulli":http://orientechnologies.com -- developed the OrientDB implementatio (@OrientGraph@).
+# "Joshua Shinavier":http://fortytwo.net -- developed Blueprints Sail (@GraphSail@).
+# "Darrick Weibe":http://github.com/pangloss -- tests, bug fixes, and transaction work.
+# "Stephen Mallette":http://stephen.genoprime.com -- develops @RexsterGraph@.
+# "Sergio Gómez Villamor":http://personals.ac.upc.edu/sgomez -- developed the Dex implementation (@DexGraph@).
+# "Pierre De Wilde":http://www.linkedin.com/in/pierredewilde -- designs and tests new features.
+# "Ketrina Yim":http://www.ketrinayim.com/ -- designed the Blueprints logo.
+
+Please review Blueprints' "pom.xml":http://github.com/tinkerpop/blueprints/blob/master/pom.xml. Blueprints would not be possible without the work done by others to create these useful packages.
+
+<small>YourKit is kindly supporting open source projects with its full-featured Java Profiler. YourKit, LLC is the creator of innovative and intelligent tools for profiling Java and .NET applications. Take a look at YourKit's leading software products: <a href="http://www.yourkit.com/java/profiler/index.jsp">YourKit Java Profiler</a> and <a href="http://www.yourkit.com/.net/profiler/index.jsp">YourKit .NET Profiler</a>.</small>
View
93 doc/wiki/Code-Examples.textile
@@ -0,0 +1,93 @@
+This section will provide a collection of code examples that work with the Blueprints graph API. The in-memory [[TinkerGraph]] database will be used throughout the examples. Please feel free to alter the graph constructor to work with different graph databases. These code examples can be found in the main Blueprints distribution "at this location":https://github.com/tinkerpop/blueprints/blob/master/blueprints-test/src/test/java/com/tinkerpop/blueprints/pgm/impls/tg/CodeExamples.java.
+
+# "Create a Simple Graph":#create
+# "Iterate through the Elements of a Graph":#elements
+# "Iterate through the Edges of a Vertex":#edge
+# "Use Indices to Get a Vertex by its Property":#index
+
+h2(#create). Create a Simple Graph
+
+Create a graph. Add two vertices. Set the @name@ property of each vertex. Create an @knows@ edge between the two vertices. Print the components of the graph.
+
+```java
+Graph graph = new TinkerGraph();
+Vertex a = graph.addVertex(null);
+Vertex b = graph.addVertex(null);
+a.setProperty("name", "marko");
+b.setProperty("name", "peter");
+Edge e = graph.addEdge(null, a, b, "knows");
+System.out.println(e.getOutVertex().getProperty("name") + "--" + e.getLabel() + "-->" + e.getInVertex().getProperty("name"));
+```
+
+The @System.out@ after the code executes is:
+
+bc. marko--knows-->peter
+
+h2(#elements). Iterate through the Elements of a Graph
+
+Load the TinkerPop play graph diagrammed in [[Property Graph Model]]. Iterate through all the vertices and print them to @System.out@. Iterate through all the edges and print them to @System.out@.
+
+```java
+public void testIteratingGraph() {
+ Graph graph = TinkerGraphFactory.createTinkerGraph();
+ System.out.println("Vertices of " + graph);
+ for (Vertex vertex : graph.getVertices()) {
+ System.out.println(vertex);
+ }
+ System.out.println("Edges of " + graph);
+ for (Edge edge : graph.getEdges()) {
+ System.out.println(edge);
+ }
+}
+```
+
+The @System.out@ after the code executes is:
+
+bc. Vertices of tinkergraph[vertices:6 edges:6]
+v[3]
+v[2]
+v[1]
+v[6]
+v[5]
+v[4]
+Edges of tinkergraph[vertices:6 edges:6]
+e[10][4-created->5]
+e[7][1-knows->2]
+e[9][1-created->3]
+e[8][1-knows->4]
+e[11][4-created->3]
+e[12][6-created->3]
+
+h2(#edge). Iterate through the Edges of a Vertex
+
+Load the TinkerPop play graph diagrammed in [[Property Graph Model]]. Get vertex @1@ from the graph by its @id@. Print some information about the vertex. Iterate through the outgoing edges of the vertex and print the edges.
+
+```java
+Graph graph = TinkerGraphFactory.createTinkerGraph();
+Vertex a = graph.getVertex("1");
+System.out.println("vertex " + a.getId() + " has name " + a.getProperty("name"));
+for(Edge e : a.getOutEdges()) {
+ System.out.println(e);
+}
+```
+
+The @System.out@ after the code executes is:
+
+bc. vertex 1 has name marko
+e[7][1-knows->2]
+e[9][1-created->3]
+e[8][1-knows->4]
+
+h2(#index). Use Indices to Get a Vertex by its Property
+
+Load the TinkerPop play graph diagrammed in [[Property Graph Model]]. [[TinkerGraph]] implements the @IndexableGraph@ interface. Get the standard vertex index and then get all vertices named @marko@. Given that there is only one, we can simple next the first vertex out of the returned iterable. Print some information about the vertex.
+
+```java
+Graph graph = TinkerGraphFactory.createTinkerGraph();
+Vertex a = ((IndexableGraph)graph).getIndex(Index.VERTICES, Vertex.class).get("name", "marko").iterator().next();
+System.out.println("vertex " + a.getId() + " has age " + a.getProperty("age"));
+```
+
+The @System.out@ after the code executes is:
+
+bc. vertex 1 has age 29
View
18 doc/wiki/Desired-Implementations.textile
@@ -0,0 +1,18 @@
+!https://github.com/tinkerpop/blueprints/raw/master/doc/images/blueprints-bob-the-builder.png!
+
+It is a time consuming process to maintain Blueprints implementations as graph database/framework versions and features change. Many developers focusing on a particular implementation is an ideal way of ensuring that Blueprints has wide reach and is always consistent with the latest developments. If there is a graph database/framework that is currently not supported by Blueprints and you are an expert with that system, please contribute an implementation. To get a feel of what is required, see [[Property Graph Model]] and [[Property Graph Model Test Suite]].
+
+Below is a list of desired implementations. This list is not intended to be exhaustive. Please feel free to add to the list.
+
+* "db4o":http://developer.db4o.com
+* "Versant Object Database":http://www.versant.com
+* "InfiniteGraph":http://www.infinitegraph.com/ (currently in development)
+* "InfoGrid":http://infogrid.org/
+* "sones":http://www.sones.com/
+* "vertexdb":http://www.dekorte.com/projects/opensource/vertexdb/
+* "Redis":http://code.google.com/p/redis/ (see "Blueredis":https://github.com/dmitriid/blueredis)
+* Sail-based RDF Stores (very easy to do as only a @Sail@ constructor is needed)
+** "4Store":http://4store.org/
+** "AllegroGraph":http://www.franz.com/agraph/allegrograph/
+** "OpenVirtuoso":http://virtuoso.openlinksw.com/
+** "OWLim":http://www.ontotext.com/owlim/
View
67 doc/wiki/Dex-Implementation.textile
@@ -0,0 +1,67 @@
+[[http://www.sparsity-technologies.com/images/sparsity_logo_web.png]]
+
+```xml
+<dependency>
+ <groupId>com.tinkerpop.blueprints</groupId>
+ <artifactId>blueprints-dex-graph</artifactId>
+ <version>??</version>
+</dependency>
+```
+
+```java
+Graph graph = new DexGraph("/tmp/graph.dex");
+```
+
+"DEX":http://www.sparsity-technologies.com/dex is a graph database developed by "Sparsity Technologies":http://www.sparsity-technologies.com/. For a fine summary of the DEX graph database, please review the following "presentations":http://www.sparsity-technologies.com/dex_tutorials. The software can be downloaded from "here":http://www.sparsity-technologies.com/dex_downloads and be used with the default evaluation license (which restricts the amount of information DEX can deal with).
+
+DEX natively supports the property graph data model defined by Blueprints. However, there are a few peculiarities.
+
+# *No user defined element identifiers*: DEX is the gatekeeper and creator of vertex and edge identifiers. Thus, when creating a new vertex or edge instance, the provided object identifier is ignored.
+# *Vertices are labeled too*: When adding vertices, the user can set @DEXGraph#LABEL@ to be used as the label of the vertex to be created. Also, the label of a vertex (or even an element) can be retrieved through the @DEXElement#LABEL_PROPERTY@ property.
+
+@DexGraph@ implements @IndexableGraph@. However, the use of indices is limited when working with DEX and is explained as follows:
+
+# There is no support to create indices.
+# By default, there is an @AutomaticIndex@ for each existing label which corresponds to the name of the index. Also, each index contains a key for each existing property.
+
+*Memory configuration*
+
+DEX memory is not managed by the JVM heap, so an specific memory configuration must be set for DEX in order to set the maximum amount of memory to be used by a DEX application.
+
+Specifically, users should set @dex.io.cache.maxsize@ as is explained [[here|http://www.sparsity-technologies.com/downloads/javadoc/edu/upc/dama/dex/utils/DEXConfig.html]].
+
+*Managment of @Iterable@ collections*
+
+As before, since DEX resources are not managed by the JVM heap, DEX-based blueprints applications should take into account the management of @Iterable@ collections and explicitly close them in order to free native resources.
+
+For example, if we execute a long traversal like this:
+
+```java
+for (final Vertex vertex : graph.getVertices()) {
+ for (final Edge edge : vertex.getOutEdges()) {
+ final Vertex vertex2 = edge.getInVertex();
+ for (final Edge edge2 : vertex2.getOutEdges()) {
+ ...
+ }
+ }
+}
+```
+
+all retrieved collections won't be closed until the graph database is stopped. Of course, keep active this amount of resources will have a negative impact in the performance. To avoid this, we should implement something like this:
+
+```java
+DexIterable<Vertex> vv = (DexIterable<Vertex>)graph.getVertices();
+for (final Vertex vertex : vv) {
+ DexIterable<Edge> ee = (DexIterable<Edge>)vertex.getOutEdges();
+ for (final Edge edge : ee) {
+ final Vertex vertex2 = edge.getInVertex();
+ DexIterable<Edge> ee2 = (DexIterable<Edge>)vertex2.getOutEdges();
+ for (final Edge edge2 : ee2) {
+ ...
+ }
+ ee2.close();
+ }
+ ee.close();
+}
+vv.close();
+```
View
53 doc/wiki/Event-Implementation.textile
@@ -0,0 +1,53 @@
+```xml
+<dependency>
+ <groupId>com.tinkerpop.blueprints</groupId>
+ <artifactId>blueprints-core</artifactId>
+ <version>??</version>
+</dependency>
+```
+
+@EventGraph@ and @EventIndexableGraph@ wrap any @Graph@ or @IndexableGraph@, respectively. The purpose of an @EventGraph@ is to raise events to one or more @GraphChangedListener@ as changes to the underlying @Graph@ occur. The obvious limitation is that events will only be raised to listeners if the changes to the @Graph@ occur within the same process.
+
+The following events are raised:
+
+* New vertex
+* New edge
+* Vertex property changed
+* Edge property changed
+* Vertex property removed
+* Edge property removed
+* Vertex removed
+* Edge removed
+* Graph cleared
+
+To start processing events from a @Graph@ first implement the @GraphChangedListener@ interface. An example of this implementation is the @ConsoleGraphChangedListener@ which writes output to the console for each event.
+
+To add a listener to the @EventGraph@:
+
+```java
+EventGraph graph = new EventGraph(TinkerGraphFactory.createTinkerGraph());
+graph.addListener(new ConsoleGraphChangedListener(graph));
+
+Vertex v = graph.addVertex(100);
+v.setProperty("name", "noname");
+
+for (Edge edge : graph.getEdges()) {
+ edge.removeProperty("weight");
+}
+
+graph.clear();
+```
+
+The following output would appear in the console:
+
+```text
+Vertex [v[100]] added to graph [eventgraph[tinkergraph[vertices:6 edges:6]]]
+Vertex [v[4]] property [name] set to value of [noname] in graph [eventgraph[tinkergraph[vertices:6 edges:6]]]
+Edge [e[10][4-created->5]] property [weight] with value of [1.0] removed in graph [eventgraph[tinkergraph[vertices:6 edges:6]]]
+Edge [e[7][1-knows->2]] property [weight] with value of [0.5] removed in graph [eventgraph[tinkergraph[vertices:6 edges:6]]]
+Edge [e[9][1-created->3]] property [weight] with value of [0.4] removed in graph [eventgraph[tinkergraph[vertices:6 edges:6]]]
+Edge [e[8][1-knows->4]] property [weight] with value of [1.0] removed in graph [eventgraph[tinkergraph[vertices:6 edges:6]]]
+Edge [e[11][4-created->3]] property [weight] with value of [0.4] removed in graph [eventgraph[tinkergraph[vertices:6 edges:6]]]
+Edge [e[12][6-created->3]] property [weight] with value of [0.2] removed in graph [eventgraph[tinkergraph[vertices:6 edges:6]]]
+Graph [eventgraph[tinkergraph[vertices:6 edges:6]]] cleared.
+```
View
15 doc/wiki/Graph-Indices-Helpers.textile
@@ -0,0 +1,15 @@
+A "helper class" in Blueprints is provided in the @com.tinkerpop.blueprints.pgm.util@ package. Helper classes provide (usually) static methods that yield high-level support for manipulating various Blueprints objects. Of particular interest to this page of documentation, there are a collection of helper classes for handling indices.
+
+h2. AutomaticIndexHelper
+
+@AutomaticIndexHelper@ provides high-level methods for adding, removing, and reindexing elements in an @AutomaticIndex@. Here is an example.
+
+```java
+graph = TinkerGraphFactory.createTinkerGraph();
+indexKeys = new HashSet<String>();
+indexKeys.add("name");
+index = graph.createAutomaticIndex("test-idx", Vertex.class, indexKeys);
+index.get("name","marko"); // returns an empty iterator
+index = AutomaticIndexHelper.reIndexElements(graph, index, graph.getVertices()); // reindex all the vertices in the graph
+index.get("name","marko"); // returns an iterator with v[1] in it
+```
View
73 doc/wiki/Graph-Indices.textile
@@ -0,0 +1,73 @@
+!https://github.com/tinkerpop/blueprints/raw/master/doc/images/indices-example.png!
+
+An @IndexableGraph@ is a @Graph@ that supports the indexing of its vertices and edges. An index is a data structure that allows for the fast retrieval of an element by a particular key/value pair. The @IndexableGraph@ interface has the following methods:
+
+```java
+public <T extends Element> Index<T> createAutomaticIndex(String indexName, Class<T> indexClass, Set<String> indexKeys);
+public <T extends Element> Index<T> createManualIndex(String indexName, Class<T> indexClass);
+public <T extends Element> Index<T> getIndex(String indexName, Class<T> indexClass);
+public Iterable<Index<? extends Element>> getIndices();
+public void dropIndex(String indexName);
+```
+
+h2. Manual Indices
+
+There are two types of indices: @Type.AUTOMATIC@ and @Type.MANUAL@. A manual index requires the developer to manually put, get, and remove elements from the index. To create a manual index of vertices, do the following:
+
+```java
+Index<Vertex> index = graph.createManualIndex("test-idx", Vertex.class);
+```
+
+The @Index@ interface has the following methods:
+
+```java
+public long count(String key, Object value);
+public String getIndexName();
+public Class<T> getIndexClass();
+public Type getIndexType();
+public void put(String key, Object value, T element);
+public Iterable<T> get(String key, Object value);
+public void remove(String key, Object value, T element);
+```
+
+Given the @index@ object created previous, to add, query, and remove a vertex from this index, do the following:
+
+```java
+index.put("name","peter",vertex);
+Iterable<Vertex> results = index.get("name","peter");
+index.remove("name","peter",vertex);
+```
+
+With manual indices, the developer must be cognizant of maintaining the index with these methods.
+
+h2. Automatic Indices
+
+When the developer does not wish to maintain an index, the developer can rely on indices of @Type.AUTOMATIC@. An automatic index will automatically @put@ and @remove@ elements from an index as the element mutates. That is, an automatic index indexes the properties of an element where the property key is the key and the property value is the value. As these properties change, an automatic index automatically reflects these changes. To create an automatic index, do the following:
+
+```java
+Set<String> indexKeys = ...
+AutomaticIndex<Vertex> autoIndex = graph.createAutomaticIndex("test-aidx", Vertex.class, indexKeys);
+```
+
+The @AutomaticIndex@ interface extends @Index@ and provides, along with the @Index@ methods, the following method:
+
+```java
+public Set<String> getAutoIndexKeys();
+```
+
+An @AutomaticIndex@ will index all newly created elements by the provide set of auto index keys. If this set of auto index keys is @null@, then all keys will be indexed. Here is an example of all this together:
+
+```java
+Set<String> indexKeys = new HashSet<String>();
+indexKeys.add("name");
+AutomaticIndex<Vertex> autoIndex = graph.createAutomaticIndex("test-aidx", Vertex.class, indexKeys);
+Vertex a = graph.addVertex(null);
+a.setProperty("name","pavel");
+a.setProperty("country","belarus");
+Iterable<Vertex> results = autoIndex.get("name","pavel");
+// results contains vertex a
+results = autoIndex.get("country","belarus");
+// results does not contain vertex a
+```
+
+*Note*: When an @IndexableGraph@ is created a new (not constructed, but when there is no historic persistence), it comes with two automatic indices named @Index.VERTICES@ and @Index.EDGES@ that index all properties (constructed with @null@ indexKeys argument). These indices automatically index any created vertices and edges, respectively. If these indices are not desired, simply @graph.dropIndex(Index.VERTICES)@ and @graph.dropIndex(Index.EDGES)@ before adding elements.
View
22 doc/wiki/Graph-Morphisms.textile
@@ -0,0 +1,22 @@
+In the world of graphs, there are numerous "graph types":http://en.wikipedia.org/wiki/Graph_%28mathematics%29. The diagram below describes the important feature of a collection of common graph types. Note that many of these types can be mixed and matched. For example, the [[property graph model]] of Blueprints can be seen as a *vertex/edge-labeled/attributed, directed, multi-graph*.
+
+!https://github.com/tinkerpop/blueprints/raw/master/doc/images/graph-types.jpg!
+
+* *half-edge graph*: a unary edge graph where an edge connects only one vertex.
+* *multi-graph*: when edges are labeled, the various ways in which vertices are related can be denoted.
+* *simple graph*: the prototypical graph where an edge connects two vertices and no loops are allowed.
+* *weighted graph*: used to represent strength of ties or transition probabilities.
+* *vertex-labeled graph*: most every graph makes use of labeled vertices (e.g. an identifier)
+* *semantic graph*: used to model cognitive structures such as the relationship between concepts and instances of a concept.
+* *vertex-attributed*: used in applications where it is desirable to append non-relational metadata to a vertex.
+* *edge-labeled graph*: provides the ability to denote the way in which two vertices are related (e.g. friendships, kinships, etc.).
+* *directed graph*: orders the vertices connected by an edge to denote directionality.
+* *hypergraph*: generalizes a binary graph to allow an edge to connect to an arbitrary number of vertices.
+* *undirected graph*: the typical graph that is used when the relationship is symmetrical (e.g. friendship).
+* *resource description framework graph*: a graph standard developed by the the World Wide Web consortium that denotes vertices and edges by Uniform Resource Identifiers (see [[Sail Implementation]] and [[Sail Ouplementation]]).
+* *edge-attributed graph*: used in applications where its desirable to append non-relational metadata to an edge.
+* *pseudo graph*: generally allowed in most disciplines to denote a reflexive relationship.
+
+The [[property graph model]] is a convenient graph data model. From the standpoint of a property graph its easy to represent other graph types. The following diagram provides the "morphisms":http://en.wikipedia.org/wiki/Morphism that go from one graph type to another. Note that a "hypergraph":http://en.wikipedia.org/wiki/Hypergraph can be modeled using a property graph, though its not as straightforward as modeling other graph types.
+
+!https://github.com/tinkerpop/blueprints/raw/master/doc/images/graph-types-morphisms.jpg!
View
74 doc/wiki/Graph-Transactions.textile
@@ -0,0 +1,74 @@
+A @Graph@ that implements the @TransactionalGraph@ interface is a graph that supports Blueprints-style transactions. A @TransactionalGraph@ has the following methods:
+
+```java
+public void setMaxBufferSize(int bufferSize);
+public int getMaxBufferSize();
+public int getCurrentBufferSize();
+public void startTransaction();
+public void stopTransaction(Conclusion conclusion);
+```
+
+h2. Automatic Transactions
+
+A @TransactionalGraph@ supports a transactional buffer. When the buffer size is greater than 0, every X manipulations of the graph (e.g. set/remove property, add/remove vertex, add/remove edge) is automatically wrapped in a transaction and committed, where X is the transaction buffer size. In this way, the developer does not need to start and stop transactions as this is automatically handled by the implementation. Upon construction, every @TransactionalGraph@ has a transaction buffer size of 1. When the transaction buffer size is 0, the developer is required to manually start and stop transactions when editing the graph. That is done with the methods @startTransaction()@ and @stopTransaction()@.
+
+h2. Transaction Examples
+
+To put a graph in manual transaction model, evaluate the following:
+
+```java
+txGraph.setMaxBufferSize(0);
+```
+
+Upon doing so, any edit operation (or group of edit operations) must be wrapped in a transaction. This is done as follows.
+
+```java
+txGraph.startTransaction();
+// edit operations
+txGraph.stopTransaction(TransactionalGraph.Conclusion.SUCCESS);
+```
+
+There are two types of conclusions: @Conclusion.SUCCESS@ and @Conclusion.FAILURE@. When a transaction is successful, it is committed to the underlying store. When the transaction is a failure, then all the edit operations up to the start of the transaction are rolled back. *Note*: Blueprints-enabled graphs do not require transactions for read-based operations.
+
+Finally, the relationship between automatic and manual transactions are explained with an example. When doing batch mutations using manual transactions, the code looks as follows:
+
+```java
+int counter = 0;
+txGraph.setMaxBufferSize(0);
+txGraph.startTransaction();
+
+while(doingStuff) {
+ // do a graph manipulation
+ counter++;
+ if(counter % 1000 == 0) {
+ System.out.print(".");
+ txGraph.stopTransaction(Conclusion.SUCCESS);
+ txGraph.startTransaction();
+ }
+}
+txGraph.stopTransaction(Conclusion.SUCCESS);
+```
+
+This code, using automatic transaction handling can be simplified with a transaction buffer size of 1000.
+
+```java
+txGraph.setMaxBufferSize(1000);
+while(doingStuff) {
+ // do a graph manipulation
+ if((txGraph.getCurrentBufferSize()-1) % 1000 == 0)
+ System.out.print(".");
+}
+```
+
+h2. Note on Automatic Transaction Semantics
+
+When the max buffer size of a @TransactionalGraph@ is greater than @0@ (i.e. automatic mode) and the buffer max has not been reached, it is possible to commit or rollback the buffer prematurely using @stopTransaction()@. From there, everything prior to the last commit will be committed (@Conclusion.SUCCESS@) or rolled back (@Conclusion.FAILURE@). Once the the transaction has been stopped, the current buffer size is reset to 0 and writes can occur again. Finally, when the graph is @shutdown()@, any open transactions are successfully committed.
+
+The following methods do not obey the standard transaction semantics. They are not subject to commit and rollback behavior. Moreover, the starred methods (*) will cause the complete transaction buffer to commit when evaluated.
+
+* @Graph.clear()@ *
+* @Graph.shutdown()@ *
+* @IndexableGraph.createManualIndex()@
+* @IndexableGraph.createAutomaticIndex()@
+* @IndexableGraph.dropIndex()@ *
+* @TransactionalGraph.setMaxBufferSize()@ *
View
196 doc/wiki/GraphML-Reader-and-Writer-Library.textile
@@ -0,0 +1,196 @@
+```xml
+<dependency>
+ <groupId>com.tinkerpop.blueprints</groupId>
+ <artifactId>blueprints-core</artifactId>
+ <version>??</version>
+</dependency>
+```
+
+Besides being able to query and manipulate the underlying data management system with Blueprints, a "GraphML":http://graphml.graphdrawing.org reader and writer package is provided with Blueprints for streaming XML graph representations into and out of the underlying graph framework. The GraphML package uses "StAX":http://stax.codehaus.org to process a GraphML graph. This section discusses the use of the GraphML library for reading and writing XML-encoded graphs.
+
+!https://github.com/tinkerpop/blueprints/raw/master/doc/images/graph-example-1.jpg!
+
+Below is the GraphML representation of the graph diagrammed above. Here are some of the important XML elements to recognize.
+
+* *graphml*: the root element of the GraphML document
+ ** *key*: a type description for graph element properties
+ ** *graph*: the beginning of the graph representation
+ **** *node*: the beginning of a vertex representation
+ **** *edge*: the beginning of an edge representation
+ ****** *data*: the key/value data associated with a graph element
+
+```xml
+<?xml version="1.0" encoding="UTF-8"?>
+<graphml xmlns="http://graphml.graphdrawing.org/xmlns">
+ <key id="weight" for="edge" attr.name="weight" attr.type="float"/>
+ <key id="name" for="node" attr.name="name" attr.type="string"/>
+ <key id="age" for="node" attr.name="age" attr.type="int"/>
+ <key id="lang" for="node" attr.name="lang" attr.type="string"/>
+ <graph id="G" edgedefault="directed">
+ <node id="1">
+ <data key="name">marko</data>
+ <data key="age">29</data>
+ </node>
+ <node id="2">
+ <data key="name">vadas</data>
+ <data key="age">27</data>
+ </node>
+ <node id="3">
+ <data key="name">lop</data>
+ <data key="lang">java</data>
+ </node>
+ <node id="4">
+ <data key="name">josh</data>
+ <data key="age">32</data>
+ </node>
+ <node id="5">
+ <data key="name">ripple</data>
+ <data key="lang">java</data>
+ </node>
+ <node id="6">
+ <data key="name">peter</data>
+ <data key="age">35</data>
+ </node>
+ <edge id="7" source="1" target="2" label="knows">
+ <data key="weight">0.5</data>
+ </edge>
+ <edge id="8" source="1" target="4" label="knows" >
+ <data key="weight">1.0</data>
+ </edge>
+ <edge id="9" source="1" target="3" label="created">
+ <data key="weight">0.4</data>
+ </edge>
+ <edge id="10" source="4" target="5" label="created">
+ <data key="weight">1.0</data>
+ </edge>
+ <edge id="11" source="4" target="3" label="created">
+ <data key="weight">0.4</data>
+ </edge>
+ <edge id="12" source="6" target="3" label="created">
+ <data key="weight">0.2</data>
+ </edge>
+ </graph>
+</graphml>
+```
+
+Note that line breaks and indentation have been added for clarity. The default output contains no unnecessary whitespace, but @GraphMLWriter@ does include an option to actually insert the whitespace, as well as ordering elements in the output (see below).
+
+h2. Usage
+
+To read GraphML data into a graph, pass the graph into the @GraphMLReader@ constructor, then call @inputGraph@:
+
+```java
+Graph graph = ...
+InputStream in = ...
+
+GraphMLReader reader = new GraphMLReader(graph);
+reader.inputGraph(in);
+```
+
+Note that @inputGraph@ is also overloaded with a "buffer size" parameter. Several setter methods are provided for customizing the property keys which @GraphMLReader@ uses to map the GraphML data into the Property Graphs model. If used, these should be called before @inputGraph@, e.g.
+
+```java
+GraphMLReader reader = new GraphMLReader(graph);
+reader.setVertexIdKey("_id");
+reader.setEdgeIdKey("_id");
+reader.setEdgeLabelKey("_label");
+reader.inputGraph(in);
+```
+
+To output a graph in GraphML format, pass the graph into the @GraphMLWriter@ constructor, then call @outputGraph@:
+
+```java
+Graph graph = ...
+OutputStream out = ...
+
+GraphMLWriter writer = new GraphMLWriter(graph);
+writer.outputGraph(out);
+```
+
+If you have a large graph and you know the key and value type of all vertex and/or edge properties used in your graph, you can speed up @outputGraph@ by first specifying those properties, e.g.
+
+```java
+Map<String, String> vertexKeyTypes = new HashMap<String, String>();
+vertexKeyTypes.put("age", GraphMLTokens.INT);
+vertexKeyTypes.put("lang", GraphMLTokens.STRING);
+vertexKeyTypes.put("name", GraphMLTokens.STRING);
+Map<String, String> edgeKeyTypes = new HashMap<String, String>();
+edgeKeyTypes.put("weight", GraphMLTokens.FLOAT);
+
+GraphMLWriter writer = new GraphMLWriter(graph);
+writer.setVertexKeyTypes(vertexKeyTypes);
+writer.setEdgeKeyTypes(edgeKeyTypes);
+writer.outputGraph(out);
+```
+
+There is an additional @GraphMLWriter@ method, described below, for enabling normalized GraphML output for use with versioning tools.
+
+h2. Normalizing GraphMLWriter output
+
+@GraphMLWriter@ 's default output is sufficient for saving all of the information in a graph in an interoperable format, which can be loaded in @GraphMLReader@ in order to re-create the graph. However, another important use case for @GraphMLWriter@ has to do with versioning and collaborative editing of graphs. If you call the @setNormalize@ method before calling @outputGraph@, @GraphMLWriter@ will apply additional formatting and constraints to the output so as to make it compatible with line-based versioning tools such as "Subversion":http://subversion.apache.org/ and "Git":http://git-scm.com/, e.g.
+
+```java
+GraphMLWriter writer = new GraphMLWriter(graph);
+writer.setNormalize(true);
+writer.outputGraph(out);
+```
+
+The following is an example of normalized GraphML output. Key definitions appear in alphabetical order, as do vertices and edges (according to the string representation of the id) and vertex and edge properties. The XML is indented consistently, with one start and/or end tag per line:
+
+```xml
+<?xml version="1.0" ?>
+<graphml xmlns="http://graphml.graphdrawing.org/xmlns">
+ <key id="age" for="node" attr.name="age" attr.type="int"></key>
+ <key id="lang" for="node" attr.name="lang" attr.type="string"></key>
+ <key id="name" for="node" attr.name="name" attr.type="string"></key>
+ <key id="weight" for="edge" attr.name="weight" attr.type="float"></key>
+ <graph id="G" edgedefault="directed">
+ <node id="1">
+ <data key="age">29</data>
+ <data key="name">marko</data>
+ </node>
+ <node id="2">
+ <data key="age">27</data>
+ <data key="name">vadas</data>
+ </node>
+ <node id="3">
+ <data key="lang">java</data>
+ <data key="name">lop</data>
+ </node>
+ <node id="4">
+ <data key="age">32</data>
+ <data key="name">josh</data>
+ </node>
+ <node id="5">
+ <data key="lang">java</data>
+ <data key="name">ripple</data>
+ </node>
+ <node id="6">
+ <data key="age">35</data>
+ <data key="name">peter</data>
+ </node>
+ <edge id="10" source="4" target="5" label="created">
+ <data key="weight">1.0</data>
+ </edge>
+ <edge id="11" source="4" target="3" label="created">
+ <data key="weight">0.4</data>
+ </edge>
+ <edge id="12" source="6" target="3" label="created">
+ <data key="weight">0.2</data>
+ </edge>
+ <edge id="7" source="1" target="2" label="knows">
+ <data key="weight">0.5</data>
+ </edge>
+ <edge id="8" source="1" target="4" label="knows">
+ <data key="weight">1.0</data>
+ </edge>
+ <edge id="9" source="1" target="3" label="created">
+ <data key="weight">0.4</data>
+ </edge>
+ </graph>
+</graphml>
+```
+
+This format permits line diffs to be used to capture incremental changes to graphs, so that graphs can be conveniently checked in to a version control repository. You can then commit changes to the graph and roll back to previous versions of the graph, just as you would do with a piece of source code. Forking and merging graphs is also possible within certain limits.
+
+Note that normalizing output in @GraphMLWriter@ is a memory-intensive process, so it is best used in connection with small to medium-sized graphs.
View
298 doc/wiki/GraphSON-Reader-and-Writer-Library.textile
@@ -0,0 +1,298 @@
+```xml
+<dependency>
+ <groupId>com.tinkerpop.blueprints</groupId>
+ <artifactId>blueprints-core</artifactId>
+ <version>??</version>
+</dependency>
+```
+
+The "JSON":http://json.org reader and writer package allows an entire graph to be streamed to and from the standard JSON format utilized across the TinkerPop stack called GraphSON. The format comes in two flavors: one that uses explicit data typing within the JSON and one that does not. For most scenarios, standard JSON without data typing should generally be acceptable. Using the more verbose outputting of explicit data types only provides the added value of ensuring that numeric values are converted properly (ie. float versus double).
+
+!https://github.com/tinkerpop/blueprints/raw/master/doc/images/graph-example-1.jpg!
+
+The following example shows the format without explicit data types:
+
+```javascript
+{
+ "graph": {
+ "vertices": [
+ {
+ "name": "lop",
+ "lang": "java",
+ "_id": "3",
+ "_type": "vertex"
+ },
+ {
+ "name": "vadas",
+ "age": 27,
+ "_id": "2",
+ "_type": "vertex"
+ },
+ {
+ "name": "marko",
+ "age": 29,
+ "_id": "1",
+ "_type": "vertex"
+ },
+ {
+ "name": "peter",
+ "age": 35,
+ "_id": "6",
+ "_type": "vertex"
+ },
+ {
+ "name": "ripple",
+ "lang": "java",
+ "_id": "5",
+ "_type": "vertex"
+ },
+ {
+ "name": "josh",
+ "age": 32,
+ "_id": "4",
+ "_type": "vertex"
+ }
+ ],
+ "edges": [
+ {
+ "weight": 1,
+ "_id": "10",
+ "_type": "edge",
+ "_outV": "4",
+ "_inV": "5",
+ "_label": "created"
+ },
+ {
+ "weight": 0.5,
+ "_id": "7",
+ "_type": "edge",
+ "_outV": "1",
+ "_inV": "2",
+ "_label": "knows"
+ },
+ {
+ "weight": 0.4000000059604645,
+ "_id": "9",
+ "_type": "edge",
+ "_outV": "1",
+ "_inV": "3",
+ "_label": "created"
+ },
+ {
+ "weight": 1,
+ "_id": "8",
+ "_type": "edge",
+ "_outV": "1",
+ "_inV": "4",
+ "_label": "knows"
+ },
+ {
+ "weight": 0.4000000059604645,
+ "_id": "11",
+ "_type": "edge",
+ "_outV": "4",
+ "_inV": "3",
+ "_label": "created"
+ },
+ {
+ "weight": 0.20000000298023224,
+ "_id": "12",
+ "_type": "edge",
+ "_outV": "6",
+ "_inV": "3",
+ "_label": "created"
+ }
+ ]
+ }
+}
+```
+
+The following example shows the format with explicit data types:
+
+```javascript
+{
+ "embeddedTypes":true,
+ "vertices": [
+ {
+ "name": {
+ "type": "string",
+ "value": "lop"
+ },
+ "lang": {
+ "type": "string",
+ "value": "java"
+ },
+ "_id": "3",
+ "_type": "vertex"
+ },
+ {
+ "name": {
+ "type": "string",
+ "value": "vadas"
+ },
+ "age": {
+ "type": "integer",
+ "value": 27
+ },
+ "_id": "2",
+ "_type": "vertex"
+ },
+ {
+ "name": {
+ "type": "string",
+ "value": "marko"
+ },
+ "age": {
+ "type": "integer",
+ "value": 29
+ },
+ "_id": "1",
+ "_type": "vertex"
+ },
+ {
+ "name": {
+ "type": "string",
+ "value": "peter"
+ },
+ "age": {
+ "type": "integer",
+ "value": 35
+ },
+ "_id": "6",
+ "_type": "vertex"
+ },
+ {
+ "name": {
+ "type": "string",
+ "value": "ripple"
+ },
+ "lang": {
+ "type": "string",
+ "value": "java"
+ },
+ "_id": "5",
+ "_type": "vertex"
+ },
+ {
+ "name": {
+ "type": "string",
+ "value": "josh"
+ },
+ "age": {
+ "type": "integer",
+ "value": 32
+ },
+ "_id": "4",
+ "_type": "vertex"
+ }
+ ],
+ "edges": [
+ {
+ "weight": {
+ "type": "float",
+ "value": 1
+ },
+ "_id": "10",
+ "_type": "edge",
+ "_outV": "4",
+ "_inV": "5",
+ "_label": "created"
+ },
+ {
+ "weight": {
+ "type": "float",
+ "value": 0.5
+ },
+ "_id": "7",
+ "_type": "edge",
+ "_outV": "1",
+ "_inV": "2",
+ "_label": "knows"
+ },
+ {
+ "weight": {
+ "type": "float",
+ "value": 0.4000000059604645
+ },
+ "_id": "9",
+ "_type": "edge",
+ "_outV": "1",
+ "_inV": "3",
+ "_label": "created"
+ },
+ {
+ "weight": {
+ "type": "float",
+ "value": 1
+ },
+ "_id": "8",
+ "_type": "edge",
+ "_outV": "1",
+ "_inV": "4",
+ "_label": "knows"
+ },
+ {
+ "weight": {
+ "type": "float",
+ "value": 0.4000000059604645
+ },
+ "_id": "11",
+ "_type": "edge",
+ "_outV": "4",
+ "_inV": "3",
+ "_label": "created"
+ },
+ {
+ "weight": {
+ "type": "float",
+ "value": 0.20000000298023224
+ },
+ "_id": "12",
+ "_type": "edge",
+ "_outV": "6",
+ "_inV": "3",
+ "_label": "created"
+ }
+ ]
+}
+```
+
+There are a few differences between the formats. If types are embedded, the JSON must start with an @embeddedTypes@ key with a value of @true@. This key acts as a hint to the reader that it must extract property values in a different manner. If the key is omitted, that setting is assumed to be false.
+
+All values of keys, short of the values for reserved keys that start with an underscore, must contain an object that has two keys: @type@ and @value@. The @type@ must be one of the following: @boolean@, @string@, @integer@, @long@, @float@, @double@, @list@, or @map@.
+
+If the type is a @map@ or a @list@, then each component object that make up that key must use that same format. For example:
+
+```javascript
+"someMap": {
+ "name": {"type":"string", "value":"william"},
+ "age": {"type":"int", "value":76}
+},
+"someList" [{"type":"int", "value":1},{"type":"int", "value":2},{"type":"int", "value":3}]
+```
+
+Please note that complex objects stored as properties will be converted to strings by way of the object's @toString@ method.
+
+h1. Usage
+
+To output a graph in JSON format, pass the graph into the @GraphSONWriter@ constructor, then call @outputGraph@:
+
+```java
+Graph graph = ...
+OutputStream out = ...
+
+GraphSONWriter writer = new GraphSONWriter(graph);
+writer.outputGraph(out);
+```
+
+The @GraphSONReader@ works in a similar format. Simply pass what would likely be an empty graph into the constructor, then call @inputGraph@:
+
+```java
+Graph graph = ...
+InputStream in = ...
+
+GraphSONReader reader = new GraphSONReader(graph);
+reader.inputGraph(in);
+```
+
+There are a number of static method overloads that offer more options and control.
View
98 doc/wiki/Home.textile
@@ -0,0 +1,98 @@
+!https://github.com/tinkerpop/blueprints/raw/master/doc/images/blueprints-logo.png!
+
+[[https://github.com/tinkerpop/rexster/raw/master/doc/images/rexster-system-arch.png|width=350px|align=right|float]]
+
+Blueprints is a collection of interfaces, implementations, ouplementations, and test suites for the property graph data model. Blueprints is analogous to the "JDBC":http://en.wikipedia.org/wiki/Java_Database_Connectivity, but for "graph databases":http://en.wikipedia.org/wiki/Graph_database. As such, it provides a common set of interfaces to allow developers to plug-and-play their graph database backend. Moreover, software written atop Blueprints works over all Blueprints-enabled graph databases. Within the TinkerPop software stack, Blueprints serves as the foundational technology for:
+
+* "Pipes":http://pipes.tinkerpop.com: A lazy, data flow framework
+* "Gremlin":http://gremlin.tinkerpop.com: A graph traversal language
+* "Frames":http://frames.tinkerpop.com: An object-to-graph mapper
+* "Furnace":http://furnace.tinkerpop.com: A graph algorithms package
+* "Rexster":http://rexster.tinkerpop.com: A graph server
+
+The documentation herein will provide information regarding the use of Blueprints.[1] Please join the Gremlin users group at "http://groups.google.com/group/gremlin-users":http://groups.google.com/group/gremlin-users for all "TinkerPop":http://tinkerpop.com related discussions.
+
+* Blueprints 1.1 "JavaDoc":http://tinkerpop.com/maven2/com/tinkerpop/blueprints/blueprints/1.1/api/
+* Blueprints 1.0 "JavaDoc":http://tinkerpop.com/maven2/com/tinkerpop/blueprints/blueprints/1.0/api/
+* Blueprints 0.9 "JavaDoc":http://tinkerpop.com/maven2/com/tinkerpop/blueprints/blueprints/0.9/api/
+* Blueprints 0.8 "JavaDoc":http://tinkerpop.com/maven2/com/tinkerpop/blueprints/blueprints/0.8/api/
+* Blueprints 0.7 "JavaDoc":http://tinkerpop.com/maven2/com/tinkerpop/blueprints/blueprints/0.7/api/
+* Blueprints 0.6 "JavaDoc":http://tinkerpop.com/maven2/com/tinkerpop/blueprints/blueprints/0.6/api/
+* Blueprints 0.5 "JavaDoc":http://tinkerpop.com/maven2/com/tinkerpop/blueprints/0.5/api/
+* Blueprints 0.4 "JavaDoc":http://tinkerpop.com/maven2/com/tinkerpop/blueprints/0.4/api/
+* Blueprints 0.3 "JavaDoc":http://tinkerpop.com/maven2/com/tinkerpop/blueprints/0.3/api/
+* Blueprints 0.2 "JavaDoc":http://tinkerpop.com/maven2/com/tinkerpop/blueprints/0.2/api/
+* Blueprints 0.1 "JavaDoc":http://tinkerpop.com/maven2/com/tinkerpop/blueprints/0.1/api/
+
+==<hr/>==
+
+```xml
+<!-- neo4j used in this example -->
+<dependency>
+ <groupId>com.tinkerpop.blueprints</groupId>
+ <artifactId>blueprints-neo4j-graph</artifactId>
+ <version>1.1</version>
+</dependency>
+```
+
+For non-Maven users, *download the requisite jars*:
+* "http://tinkerpop.com/maven2/com/tinkerpop/blueprints/blueprints-core/1.1/blueprints-core-1.1.jar":http://tinkerpop.com/maven2/com/tinkerpop/blueprints/blueprints-core/1.1/blueprints-core-1.1.jar
+* "http://tinkerpop.com/maven2/com/tinkerpop/blueprints/blueprints-neo4j-graph/1.1/blueprints-neo4j-graph-1.1.jar":http://tinkerpop.com/maven2/com/tinkerpop/blueprints/blueprints-neo4j-graph/1.1/blueprints-neo4j-graph-1.1.jar
+(The general schema is @blueprints-{impl}-graph-{version}@ or @blueprints-graph-{oupl}-{version}@)
+
+```java
+Graph graph = new Neo4jGraph("/tmp/my_graph");
+Vertex a = graph.addVertex(null);
+Vertex b = graph.addVertex(null);
+a.setProperty("name","marko");
+b.setProperty("name","peter");
+Edge e = graph.addEdge(null, a, b, "knows");
+e.setProperty("since", 2006);
+graph.shutdown();
+```
+
+==<hr/>==
+
+* Introduction
+ ** [[The Benefits of Blueprints]]
+ ** [[Property Graph Model]]
+ ** [[Graph Morphisms]]
+ ** [[Property Graph Model Test Suite]]
+ ** [[Code Examples]]
+* Advanced Graph Handling
+ ** [[Graph Transactions]]
+ ** [[Graph Indices]]
+ **** [[Graph Indices Helpers]]
+* [[Implementations]]
+ ** [[TinkerGraph]]
+ ** [[Neo4j Implementation]]
+ **** [[Neo4j HA Implementation|Neo4jHa Implementation]]
+ **** [[Neo4jBatch Implementation]]
+ ** [[Sail Implementation]]
+ ** [[OrientDB Implementation]]
+ ** [[Dex Implementation]]
+ ** [[Rexster Implementation]]
+ ** [[Desired Implementations]] (*help contribute*)
+* [[Ouplementations]]
+ ** [[JUNG Ouplementation]]
+ ** [[Sail Ouplementation]]
+* Utilities
+ ** [[GraphML Reader and Writer Library]]
+ ** [[GraphSON Reader and Writer Library]]
+ ** [[ReadOnly Implementation]]
+ ** [[Event Implementation]]
+* Conclusion
+ ** [[Acknowledgments]]
+ ** [[Release Notes]]
+
+==<hr/>==
+
+```xml
+<repository>
+ <id>tinkerpop-repository</id>
+ <name>TinkerPop Maven2 Repository</name>
+ <url>http://tinkerpop.com/maven2</url>
+</repository>
+```
+
+fn1. Blueprints documentation is up to date with the current Blueprints "codebase":http://github.com/tinkerpop/blueprints/tree/master, not with the latest Blueprints "release":http://github.com/tinkerpop/blueprints/downloads.
View
5 doc/wiki/Implementations.textile
@@ -0,0 +1,5 @@
+!https://github.com/tinkerpop/blueprints/raw/master/doc/images/impls.png!
+
+In order to connect a graph database to Blueprints, the Blueprints property graph interfaces must be implemented. As such, the graph database API and the Blueprints API need to be coupled. Each subsection discusses the various implementations of the Blueprints interfaces maintained by the main Blueprints distribution.
+
+*DEPENDENCY NOTE*: It is important to note that including a @<dependency/>@ to Blueprints does not entail all the respective graph database dependencies. The reason for this is that it allows users to include only those graph database implementations they wish for their particular projects (e.g. based on licensing, size, performance, etc.).
View
63 doc/wiki/JUNG-Ouplementation.textile
@@ -0,0 +1,63 @@
+!https://github.com/tinkerpop/blueprints/raw/master/doc/images/jung-visualization.png!
+
+```xml
+<dependency>
+ <groupId>com.tinkerpop.blueprints</groupId>
+ <artifactId>blueprints-graph-jung</artifactId>
+ <version>??</version>
+</dependency>
+```
+
+Blueprints provides an implementation of the "JUNG":http://jung.sourceforge.net/ @edu.uci.ics.jung.graph.Graph<Vertex, Edge>@ interface called @com.tinkerpop.blueprints.pgm.oupl.jung.GraphJung@.
+
+bq. The Java Universal Network/Graph Framework is a software library that provides a common and extensible language for the modeling, analysis, and visualization of data that can be represented as a graph or network. It is written in Java, which allows JUNG-based applications to make use of the extensive built-in capabilities of the Java API, as well as those of other existing third-party Java libraries. -- "JUNG Development Team":http://jung.sourceforge.net/team.html
+
+The benefits of @GraphJung@ is that any application that is written to talk to a JUNG @edu.uci.ics.jung.graph.Graph<Vertex, Edge>@ can now, indirectly, talk to a Blueprints @com.tinkerpop.blueprints.pgm.Graph@. Exciting applications include the use of the JUNG visualization and algorithms packages (see "JUNG JavaDoc":http://jung.sourceforge.net/doc/api/index.html) over any Blueprints-enabled graph database/framework. An example use case involving the JUNG algorithms package is provided below.
+
+```java
+Graph graph = ... // construct a particular Blueprints graph implementation
+PageRank<Vertex,Edge> pageRank = new PageRank<Vertex, Edge>(new GraphJung(graph), 0.15d);
+pageRank.evaluate();
+for (Vertex vertex : graph.getVertices()) {
+ System.out.println("The PageRank score of " + vertex + " is: " + pageRank.getVertexScore(vertex));
+}
+```
+
+For those interested in visualization, the visualization provided at the beginning of this page is done with the following.
+
+```java
+public static void main(String[] args) {
+ GraphJung graph = new GraphJung(TinkerGraphFactory.createTinkerGraph());
+ Layout<Vertex, Edge> layout = new CircleLayout<Vertex, Edge>(graph);
+ layout.setSize(new Dimension(300, 300));
+ BasicVisualizationServer<Vertex, Edge> viz = new BasicVisualizationServer<Vertex, Edge>(layout);
+ viz.setPreferredSize(new Dimension(350, 350));
+
+ Transformer<Vertex, String> vertexLabelTransformer = new Transformer<Vertex, String>() {
+ public String transform(Vertex vertex) {
+ return (String) vertex.getProperty("name");
+ }
+ };
+
+ Transformer<Edge, String> edgeLabelTransformer = new Transformer<Edge, String>() {
+ public String transform(Edge edge) {
+ return edge.getLabel();
+ }
+ };
+
+ viz.getRenderContext().setEdgeLabelTransformer(edgeLabelTransformer);
+ viz.getRenderContext().setVertexLabelTransformer(vertexLabelTransformer);
+
+ JFrame frame = new JFrame("TinkerPop");
+ frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ frame.getContentPane().add(viz);
+ frame.pack();
+ frame.setVisible(true);
+}
+```
+
+<br/>
+<hr/>
+<br/>
+
+*NOTE*: JUNG is a library that was developed for in-memory graph structures. As such, many of the aspects of its various classes are memory based. For instance, given the above @PageRank@ example, the method @pageRank.getVertexScore()@ is pulling from an in-memory @Map<Vertex,Double>@ that contains the score for each vertex. If the number of vertices in the graph is large, then such in-memory structures will ultimately throw an @OutOfMemoryError@. As such, be wary of such situations when using @GraphJung@.
View
18 doc/wiki/Neo4j-Implementation.textile
@@ -0,0 +1,18 @@
+!https://github.com/tinkerpop/blueprints/raw/master/doc/images/neotech-logo.png!:http://neotechnology.com
+
+```xml
+<dependency>
+ <groupId>com.tinkerpop.blueprints</groupId>
+ <artifactId>blueprints-neo4j-graph</artifactId>
+ <version>??</version>
+</dependency>
+```
+
+```java
+Graph graph = new Neo4jGraph("/tmp/neo4j");
+```
+
+"Neo Technology":http://neotechnology.com are the developers of the "Neo4j graph database":http://neo4j.org. Neo4j natively supports the property graph data model. However, there are a few peculiarities in Neo4j that make it not completely faithful to the [[property graph model]] as specified by Blueprints. These are itemized below.
+
+# *No user defined element identifiers*: Neo4j is the gatekeeper and creator of vertex and edge identifiers. Thus, when creating a new vertex or edge, the provided object identifier is ignored.
+# *Only primitive property values*: Neo4j requires that the value objects in the property map of an element be Java primitives, @java.lang.String@s, or arrays of primitives and @java.lang.String@s.
View
15 doc/wiki/Neo4jBatch-Implementation.textile
@@ -0,0 +1,15 @@
+```xml
+<dependency>
+ <groupId>com.tinkerpop.blueprints</groupId>
+ <artifactId>blueprints-neo4jbatch-graph</artifactId>
+ <version>??</version>
+</dependency>
+```
+
+```java
+Graph graph = new Neo4jBatchGraph("/tmp/neo4j");
+```
+
+@Neo4jBatchGraph@ provides support for the bulk insertion of data into a "Neo4j":http://neo4j.org graph. This Blueprints implementation is single-threaded and non-transactional. It is meant for initial dumps of raw data into a Neo4j graph and is much faster than doing the equivalent process using @Neo4jGraph@ (see [[Neo4j Implementation]]).
+
+*Note*: This is not a pure Blueprints implementation as numerous methods throw an @UnsupportedOperationException@. Those that due are primarily delete methods. Be sure to review the respective JavaDoc for information on method peculiarities.
View
17 doc/wiki/Neo4jHa-implementation.textile
@@ -0,0 +1,17 @@
+```xml
+<dependency>
+ <groupId>com.tinkerpop.blueprints</groupId>
+ <artifactId>blueprints-neo4j-graph</artifactId>
+ <version>??</version>
+</dependency>
+```
+
+```java
+Map<String, String> configuration = new HashMap<String, String>();
+configuration.put("ha.machine_id", "1");
+configuration.put("ha.server", "localhost:6001");
+configuration.put("ha.zoo_keeper_servers", "localhost:2181,localhost:2182,localhost:2183");
+Graph graph = new Neo4jHaGraph("/tmp/neo4j", configuration);
+```
+
+@Neo4jHaGraph@ provides support for the Neo4j "High Availability Cluster (HA)":http://wiki.neo4j.org/content/High_Availability_Cluster which provides a fault-tolerant database structure and horizontal scaling capability. Instantiating the @Neo4jHaGraph@ class requires several configuration elements as shown in the sample above as well as a running "Zookeeper":http://zookeeper.apache.org/ cluster for HA coordination. Setting up the cluster is described "here":http://wiki.neo4j.org/content/High_Availability_Cluster.
View
21 doc/wiki/OrientDB-Implementation.textile
@@ -0,0 +1,21 @@
+!https://github.com/tinkerpop/blueprints/raw/master/doc/images/orientdb-logo.png!
+
+```xml
+<dependency>
+ <groupId>com.tinkerpop.blueprints</groupId>
+ <artifactId>blueprints-orient-graph</artifactId>
+ <version>??</version>
+</dependency>
+```
+
+```java
+Graph graph = new OrientGraph("local:/tmp/orient");
+```
+
+"Orient Technologies":http://www.orientechnologies.com/ are the developers of "OrientDB":http://www.orientechnologies.com/orient-db.htm. OrientDB is pure to the property graph model.
+
+<div style="width:425px" id="__ss_4476629"><strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/lvca/orient-db-introduction" title="OrientDB introduction - NoSQL">OrientDB introduction - NoSQL</a></strong><object id="__sse4476629" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=orientdbintroduction-100611113558-phpapp01&rel=0&stripped_title=orient-db-introduction&userName=lvca" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed name="__sse4476629" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=orientdbintroduction-100611113558-phpapp01&rel=0&stripped_title=orient-db-introduction&userName=lvca" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object><div style="padding:5px 0 12px">View more <a href="http://www.slideshare.net/">presentations</a> from <a href="http://www.slideshare.net/lvca">Luca Garulli</a>.</div></div>
+
+There is no impedance mismatch between Blueprints and OrientDB. However, there are a few peculiarities in OrientDB that make it not completely faithful to the [[property graph model]]. These are itemized below.
+
+# *No user defined element identifiers*: OrientDB is the gatekeeper and creator of vertex and edge identifiers. Thus, when creating a new vertex or edge, the provided object identifier is ignored.
View
7 doc/wiki/Ouplementations.textile
@@ -0,0 +1,7 @@
+!https://github.com/tinkerpop/blueprints/raw/master/doc/images/oupls.png!
+
+Blueprints is a collection of interfaces. If these interfaces are implemented, then the underlying graph database is "Blueprints-enabled." In many situations, its desirable to not expose a Blueprints-enabled graph database, but instead, to expose an implementation of another set of interfaces. In the package @com.tinkerpop.blueprints.pgm.oupls@, there are "outplementations" for other popular interfaces. In this way, any Blueprints-enabled graph database can be framed within the context of that set of interfaces.
+
+The naming convention for @impls@ and @oupls@ is as such.
+ * @XXXGraph@: An implementation of the @Graph@ interface. @XXX@ is modeled as a @Graph@.
+ * @GraphXXX@: An ouplementation of the @Graph@ interface to @XXX@. @Graph@ is modeled as an @XXX@.
View
22 doc/wiki/Property-Graph-Implementations.textile
@@ -0,0 +1,22 @@
+In order to connect a graph database to Blueprints, the Blueprints property graph interfaces must be implemented. As such, the graph database API and the Blueprints API need to be coupled. Each subsection discusses the various implementations of the Blueprints interfaces maintained by the main Blueprints distribution.
+
+*DEPENDENCY NOTE*: It is important to note that including a @<dependency/>@ to Blueprints does not entail all the respective graph database dependencies. The reason for this is that it allows users to include only those graph database implementations they wish for their particular projects (e.g. based on licensing, size, performance, etc.). However, if all dependencies are desired, then the following @<dependency/>@ can be added to your project's @pom.xml@.
+
+```xml
+<dependency>
+ <groupId>com.tinkerpop</groupId>
+ <artifactId>graphdb-deps-all</artifactId>
+ <version>0.3</version>
+ <packaging>pom</packaging>
+</dependency>
+```
+
+To tailor to particular implementations, please see the @<dependency/>@ snippets in the subsections that follow in this documentation.
+
+```xml
+<repository>
+ <id>tinkerpop-repository</id>
+ <name>TinkerPop Maven2 Repository</name>
+ <url>http://tinkerpop.com/maven2</url>
+</repository>
+```
View
105 doc/wiki/Property-Graph-Model-Test-Suite.textile
@@ -0,0 +1,105 @@
+Blueprints comes with a suite of test cases to ensure that any implementation of the [[property graph model]] interfaces behaves as required in order to work seamlessly within applications that depend on Blueprints. This section will discuss the test suites and how to build a simple JUnit test class to validate an implementation of this model.
+
+There currently exists the following test suites:
+
+# *AutomaticIndexTestSuite*: ensures that automatic indices are managed properly.
+# *EdgeTestSuite*: ensure that edges and their properties are added and removed properly.
+# *GraphMLReaderTestSuite*: ensure that GraphML files are read properly from disk and represented properly.
+# *GraphTestSuite*: ensure that vertices and edges work together properly.
+# *IndexableGraphTestSuite*: ensures that graphs that support indices behave properly.
+# *IndexTestSuite*: ensure that the index system works properly.
+# *TransactionalGraphTestSuite*: ensures that graphs that support transactions behave properly.
+# *VertexTestSuite*: ensure that vertices and their properties are added and removed properly.
+
+h2. Blueprints-Tests Dependency
+
+It is necessary that the Blueprints test suite is depended when testing a Blueprints-enabled graph framework. Simply import the @blueprints-tests@. With this dependency the test suite is available.
+
+```xml
+<dependency>
+ <groupId>com.tinkerpop</groupId>
+ <artifactId>blueprints-tests</artifactId>
+ <version>0.5</version>
+ <scope>test</scope>
+</dependency>
+```
+
+h2. Testing a Property Graph Model Implementation
+
+To ensure that an implementation of the [[property graph model]] is implemented correctly, a simple "JUnit":http://www.junit.org/ test case of the following form will determine its compliance. Unfortunately, there is no perfect general interface solution that will work regardless of the underlying graph framework, while being specific enough to be useful. For this reason, a @GraphTest@ has public boolean fields that need to be set that specify the peculiarities of the graph framework.
+
+```java
+public class TinkerGraphTest extends GraphTest {
+
+ public TinkerGraphTest() {
+ this.allowsDuplicateEdges = true;
+ this.allowsSelfLoops = true;
+ this.ignoresSuppliedIds = false;
+ this.isPersistent = false;
+ this.isRDFModel = false;
+ this.supportsVertexIteration = true;
+ this.supportsEdgeIteration = true;
+ this.supportsVertexIndex = true;
+ this.supportsEdgeIndex = true;
+ this.supportsTransactions = false;
+ }
+
+ public void testVertexTestSuite() throws Exception {
+ this.stopWatch();
+ doTestSuite(new VertexTestSuite(this));
+ printTestPerformance("VertexTestSuite", this.stopWatch());
+ }
+
+ public void testEdgeTestSuite() throws Exception {
+ this.stopWatch();
+ doTestSuite(new EdgeTestSuite(this));
+ printTestPerformance("EdgeTestSuite", this.stopWatch());
+ }
+
+ public void testGraphTestSuite() throws Exception {
+ this.stopWatch();
+ doTestSuite(new GraphTestSuite(this));
+ printTestPerformance("GraphTestSuite", this.stopWatch());
+ }
+
+ public void testIndexableGraphTestSuite() throws Exception {
+ this.stopWatch();
+ doTestSuite(new IndexableGraphTestSuite(this));
+ printTestPerformance("IndexableGraphTestSuite", this.stopWatch());
+ }
+
+ public void testIndexTestSuite() throws Exception {
+ this.stopWatch();
+ doTestSuite(new IndexTestSuite(this));
+ printTestPerformance("IndexTestSuite", this.stopWatch());
+ }
+
+ public void testAutomaticIndexTestSuite() throws Exception {
+ this.stopWatch();
+ doTestSuite(new AutomaticIndexTestSuite(this));
+ printTestPerformance("AutomaticIndexTestSuite", this.stopWatch());
+ }
+
+ public void testGraphMLReaderTestSuite() throws Exception {
+ this.stopWatch();
+ doTestSuite(new GraphMLReaderTestSuite(this));
+ printTestPerformance("GraphMLReaderTestSuite", this.stopWatch());
+ }
+
+ public Graph getGraphInstance() {
+ return new TinkerGraph();
+ }
+
+ public void doTestSuite(final TestSuite testSuite) throws Exception {
+ String doTest = System.getProperty("testTinkerGraph");
+ if (doTest == null || doTest.equals("true")) {
+ for (Method method : testSuite.getClass().getDeclaredMethods()) {
+ if (method.getName().startsWith("test")) {
+ System.out.println("Testing " + method.getName() + "...");
+ method.invoke(testSuite);
+ }
+ }
+ }
+ }
+}
+```
View
94 doc/wiki/Property-Graph-Model.textile
@@ -0,0 +1,94 @@
+!https://github.com/tinkerpop/blueprints/raw/master/doc/images/graph-example-1.jpg!
+
+Blueprints provides a set of interfaces for the property graph data model. An example instance is diagrammed above. In order to make a data management system "Blueprints-enabled," these interfaces must be implemented. Any applications that bind to the Blueprints property graph model API can make use of different data management systems (i.e. plug and play graph backends).
+
+The property graph interfaces are itemized below and in the following sub-sections, their method signatures presented.
+
+# *graph*: an object that contains vertices and edges.
+ ** *transactional graph*: a graph that supports transactions
+ ** *indexable graph*: a graph that supports indices
+# *element*: an object that maintains properties (i.e. key/value pair map).
+ ** *vertex*: an object that is connected to other objects by edges.
+ ** *edge*: an object that connects two vertices.
+# *index*: an object that maintains a map structure of key/value pairs to elements.
+ ** *automatic index*: an index that manages itself as elements are updated.
+
+In order to aid in the understanding of the various methods defined below, the following diagram identifies the names of the different components of a graph.
+
+!https://github.com/tinkerpop/blueprints/raw/master/doc/images/property-graph-model.jpg!
+
+h2. Graph
+
+```java
+public Vertex addVertex(Object id);
+public Vertex getVertex(Object id);
+public Iterable<Vertex> getVertices();
+public void removeVertex(Vertex vertex);
+public Edge addEdge(Object id, Vertex outVertex, Vertex inVertex, String label);
+public Iterable<Edge> getEdges();
+public void removeEdge(Edge edge);
+public void clear();
+public void shutdown();
+```
+
+h3. TransactionalGraph (extends Graph)
+
+```java
+public void startTransaction();
+public void stopTransaction(Conclusion conclusion);
+public void setMaxBufferSize(int bufferSize);
+public int getMaxBufferSize();
+public int getCurrentBufferSize();
+```
+
+h3. IndexableGraph (extends Graph)
+
+```java
+public <T extends Element> Index<T> createManualIndex(String indexName, Class<T> indexClass);
+public <T extends Element> AutomaticIndex<T> createAutomaticIndex(String name, Class<T> indexClass);
+public <T extends Element> Index<T> getIndex(String indexName, Class<T> indexClass);
+public Iterable<Index> getIndices();
+public void dropIndex(String indexName);
+```
+
+h2. Element
+
+```java
+public Object getProperty(String key);
+public Set<String> getPropertyKeys();
+public void setProperty(String key, Object value);
+public Object getId();
+```
+
+h3. Vertex (extends Element)
+
+```java
+public Iterable<Edge> getOutEdges(String... labels);
+public Iterable<Edge> getInEdges(String... labels);
+```
+
+h3. Edge (extends Element)
+
+```java
+public Vertex getOutVertex();
+public Vertex getInVertex();
+public String getLabel();
+```
+
+h2. Index [T extends Element]
+
+```java
+public long count(String key, Object value);
+public String getIndexName();
+public Class<T> getIndexClass();
+public Type getIndexType();
+public void put(String key, Object value, T element);
+public Iterable<T> get(String key, Object value);
+public void remove(String key, Object value, T element);
+```
+
+h3. AutomaticIndex (extends Index)
+
+```java
+public Set<String> getAutoIndexKeys();
+```
View
16 doc/wiki/ReadOnly-Implementation.textile
@@ -0,0 +1,16 @@
+!http://icons.iconarchive.com/icons/dryicons/aesthetica-2/128/lock-icon.png!
+
+```xml
+<dependency>
+ <groupId>com.tinkerpop.blueprints</groupId>
+ <artifactId>blueprints-core</artifactId>
+ <version>??</version>
+</dependency>
+```
+
+@ReadOnlyGraph@ and @ReadOnlyIndexableGraph@ wrap any @Graph@ or @IndexableGraph@, respectively. The purpose of a @ReadOnlyGraph@ is to ensure that the graph is not mutated by a mutating method invocation. The following methods throw an @UnsupportedOperationException@:
+
+* @Graph@: @addVertex()@, @removeVertex()@, @addEdge()@, @removeEdge()@, @clear()@, @shutdown()@
+* @IndexableGraph@: @dropIndex()@, @createManualIndex()@, @createAutomaticIndex()@
+* @Element@: @setProperty()@, @removeProperty()@
+* @Index@: @put()@, @remove()@
View
331 doc/wiki/Release-Notes.textile
@@ -0,0 +1,331 @@
+All releases can be accessed through the "TinkerPop":http://tinkerpop.com Maven2 repository identified below.
+
+```xml
+<repository>
+ <id>tinkerpop-repository</id>
+ <name>TinkerPop Maven2 Repository</name>
+ <url>http://tinkerpop.com/maven2</url>
+</repository>
+```
+
+==<hr/>==
+
+!https://github.com/tinkerpop/blueprints/raw/master/doc/images/blueprints-blueberry.png!
+
+h3. Version 1.1 (Blueberry -- December 7, 2011)
+
+```xml
+<dependency>
+ <groupId>com.tinkerpop.blueprints</groupId>
+ <artifactId>blueprints-core</artifactId>
+ <version>1.1</version>
+</dependency>
+```
+
+Blueprints 1.1 "JavaDocs":http://tinkerpop.com/maven2/com/tinkerpop/blueprints/blueprints/1.1/api
+
+* Fixed index consistency issue in @OrientGraph@
+* Added @Neo4jHaGraph@ allowing a more direct way to utilize Neo4j High Availability mode
+* General API consistency improvements
+** Graphs attempt to create directories structures for graph persistence
+** GetVertex/Edge throw @IllegalArgumentException@ if passed a null identifier as a parameter.
+** GetVertex/Edge return @null@ if the element cannot be found, if the identifier does not match the expected format of the underlying graph database or if the underlying graph database throws exceptions during the lookup.
+* @RexsterGraph@ utilizes the @application/vnd.rexster.typed+json@ custom mime type
+* The @EventGraph.addEdge()@ method now properly fires the @onEdgeAdded@ event with improved test cases
+* Added @WrappedGraph@ as a template for how to build stackable graph implementations
+* Added @SparqlRepositorySailGraph@ to support a @Graph@ representation of any SPARQL endpoint
+* Renamed @GraphJSONxxx@ to @GraphSONxxx@ to promote as standardized JSON graph format
+* Bumped to support OrientDB 1.0rc7
+* Bumped to support Neo4j 1.5
+
+==<hr/>==
+
+!https://github.com/tinkerpop/blueprints/raw/master/doc/images/blueprints-blueprints.png!
+
+h3. Version 1.0 (Blueprints -- September 18, 2011)
+
+```xml
+<dependency>
+ <groupId>com.tinkerpop.blueprints</groupId>
+ <artifactId>blueprints-core</artifactId>
+ <version>1.0</version>
+</dependency>
+```
+
+Blueprints 1.0 "JavaDocs":http://tinkerpop.com/maven2/com/tinkerpop/blueprints/blueprints/1.0/api
+
+* Bumped to support Neo4j 1.5.M01
+* Bumped to support OrientDB 1.0rc5
+* @RexsterGraph@ uses the actual count REST API instead of pulling back all results first and checking size
+* @GraphJSONReader@ and @GraphJSONWriter@ utility classes
+* Updated @TransactionalGraph@ API to support transaction buffers
+** Removed @TransactionalGraphHelper.CommitManager@ as it is no longer relevant
+** Changed @TransactionalGraph.close()@ to @Conclusion.SUCCESS@ any open transactions
+* Fixed a @ConcurrentModificationException@ in @TinkerGraph@ and added respective test cases for all graphs
+* Added @StringFactory.graphString()@ for a unified @String@ representation of a Blueprints graph
+* Added @Neo4jBatchGraph@ to support bulk inserting of graph data into a Neo4j instance
+
+==<hr/>==
+
+!https://github.com/tinkerpop/blueprints/raw/master/doc/images/blueprints-marvin.png!
+
+h3. Version 0.9 (Marvin -- August 1, 2011)
+
+```xml
+<dependency>
+ <groupId>com.tinkerpop.blueprints</groupId>
+ <artifactId>blueprints-core</artifactId>
+ <version>0.9</version>
+</dependency>
+```
+
+Blueprints 0.9 "JavaDocs":http://tinkerpop.com/maven2/com/tinkerpop/blueprints/blueprints/0.9/api
+
+* Updated Vertex API to have @getOutEdges(String...)@ and @getInEdges(String...)@
+* Updated @TinkerGraph@ to be @ConcurrentModificationException@ safe
+* Bumped to support Neo4j 1.4
+* Bumped to support OrientDB 1.0rc4
+* @IndexableGraph.getIndex()@ now return @null@ for non-existent indices instead of @RuntimeException@
+* Added support for statement deduplication (now the default) in @GraphSail@
+* Refactored @GraphMLReader@ and @GraphMLWriter@ to use a more typical pattern for readers and writers (rather than continuing to overload @inputGraph()@ and @outputGraph()@). Added normalizing functionality to @GraphMLWriter@, enabling graph versioning
+* Changed the property graph schema of @GraphSail@ to more closely resemble the @SailGraph@ schema
+* Extended @GraphSail@ to support Sesame-style inferencing
+* @SailGraph@ dangling connection issue fixed
+* Updated @Index.toString()@ to make it more readable and compact
+* Updated @graph.getVertex/Edge(null)@ to ensure that @null@ is returned
+
+==<hr/>==
+
+!https://github.com/tinkerpop/blueprints/raw/master/doc/images/blueprints-winnie.png!
+
+h3. Version 0.8 (Winnie -- June 15, 2011)
+
+```xml
+<dependency>
+ <groupId>com.tinkerpop.blueprints</groupId>
+ <artifactId>blueprints-core</artifactId>
+ <version>0.8</version>
+</dependency>
+```
+
+Blueprints 0.8 "JavaDocs":http://tinkerpop.com/maven2/com/tinkerpop/blueprints/blueprints/0.8/api
+
+* Added @EventGraph@ implementation
+* @RexsterGraph@ improvements
+** Use of POST for REST Service Requests
+** Better implementation URL encoding
+* Change JSON library from json-simple to jettison to be more in line with the rest of the TinkerPop stack.
+* A more robust implementation of the @TransactionalGraph@ implementation for @Neo4jGraph@, @OrientGraph@, and @SailGraph@.
+* Bumped to Neo4j 1.4.M04
+* Bumped to Orient 1.0rc2
+* Bumped to Sail 2.4.0
+
+==<hr/>==
+
+!https://github.com/tinkerpop/blueprints/raw/master/doc/images/blueprints-patrick.png!
+
+h3. Version 0.7 (Patrick -- May 8, 2011)
+
+```xml
+<dependency>
+ <groupId>com.tinkerpop.blueprints</groupId>
+ <artifactId>blueprints-core</artifactId>
+ <version>0.7</version>
+</dependency>
+```
+
+Blueprints 0.7 "JavaDocs":http://tinkerpop.com/maven2/com/tinkerpop/blueprints/blueprints/0.7/api
+
+* Updated @RexsterGraph@ to work with latest Rexster REST API changes
+* Bumped to Neo4j 1.4.M01
+* Bumped to OrientDB 1.0rc1
+* Bumped to Sail 2.3.3
+
+==<hr/>==
+
+!https://github.com/tinkerpop/blueprints/raw/master/doc/images/blueprints-oscar.png!
+
+h3. Version 0.6 (Oscar -- April 4, 2011)
+
+```xml
+<dependency>
+ <groupId>com.tinkerpop.blueprints</groupId>
+ <artifactId>blueprints-core</artifactId>
+ <version>0.6</version>
+</dependency>
+```
+
+Blueprints 0.6 "JavaDocs":http://tinkerpop.com/maven2/com/tinkerpop/blueprints/blueprints/0.6/api
+
+* Refactored to create a Maven multiproject with one module per major Blueprints component
+* Added @DexGraph@ implementation ("Sparsity Technologies":http://www.sparsity-technologies.com/)
+* Bumped to OrientDB 1.0rc1-SNAPSHOT
+* Bumped to Neo4j 1.3M05
+* Fixed equals() and hashCode() bug in @ReadOnlyGraph@
+* Bumped to supporting JUNG 2.0.1
+* Added @Index.count()@ method to Blueprints core API.
+
+==<hr/>==
+
+!https://github.com/tinkerpop/blueprints/raw/master/doc/images/blueprints-scooby.png!
+
+h3. Version 0.5 (Scooby -- March 2, 2011)
+
+```xml
+<dependency>
+ <groupId>com.tinkerpop</groupId>
+ <artifactId>blueprints</artifactId>
+ <version>0.5</version>
+</dependency>
+```
+
+Blueprints 0.5 "JavaDocs":http://tinkerpop.com/maven2/com/tinkerpop/blueprints/0.5/api
+
+* Updated index model
+** Changed the API and semantics of @AutomaticIndex@
+** Changed the API of @IndexableGraph@
+* Fixed index related bug in @RexsterGraph@
+* Added numerous utilities to @util@ package
+** Added support for bulk processing with @CommitManager@
+* Added UTF-8 writer to @GraphMLWriter@
+* Updates to @OrientGraph@ implementation
+* Fixed bug in @Neo4jGraph@ index loader
+* Added @toString()@ method to indices
+* Added experimental Lucene query syntax support for @Neo4jGraph@
+* Bumped version support to Neo4j 1.3.M03
+* Added performance benchmark for Neo4j @GraphDatabaseService@ vs. Blueprints @Neo4jGraph@
+* Added performance benchmark for OrientDB @OGraphDatabase@ vs. Blueprints @OrientGraph@
+* Added @Vertex.getOutEdges(String label)@ and @Vertex.getInEdges(String label)@
+* Rewrote OrientDB implementation from scratch (significant reduction in code) (Luca)
+* Added @ReadOnlyGraph@ and @ReadOnlyIndexableGraph@ to prevent graph mutations
+
+==<hr/>==
+
+!https://github.com/tinkerpop/blueprints/raw/master/doc/images/blueprints-elmo.png!
+
+h3. Version 0.4 (Elmo -- January 22, 2011)
+
+```xml
+<dependency>
+ <groupId>com.tinkerpop</groupId>
+ <artifactId>blueprints</artifactId>
+ <version>0.4</version>
+</dependency>
+```
+
+Blueprints 0.4 "JavaDocs":http://tinkerpop.com/maven2/com/tinkerpop/blueprints/0.4/api/
+
+* Added Support for Neo4j 1.2
+* Added edge label indexing to @AutomaticIndex@
+* Added concept of "ouplementation"
+** Repackaged JUNG ouplementation as @GraphJung@
+** Added Sail ouplementation as @GraphSail@
+* Created @util@ utility package
+** Repackaged GraphML library in @util.graphml@
+
+==<hr/>==
+
+!https://github.com/tinkerpop/blueprints/raw/master/doc/images/blueprints-smurf.png!
+
+h3. Version 0.3 (Smurf -- December 14, 2010)
+
+```xml
+<dependency>
+ <groupId>com.tinkerpop</groupId>
+ <artifactId>blueprints</artifactId>
+ <version>0.3</version>
+</dependency>
+```
+
+Blueprints 0.3 "JavaDocs":http://tinkerpop.com/maven2/com/tinkerpop/blueprints/0.3/api/
+
+* Moved to @graphdb-deps-*@ database dependency management model
+** Neo4j 1.2.M05
+** OrientDB 0.9.24.1
+** Sail 2.3.1
+** Rexster 0.1
+* Removed object document model to focus Blueprints specifically on property graphs
+** Removed support for TinkerDoc, MongoDB, and CouchDB
+* @OrientGraph@ now implements @TransactionalGraph@ interface
+* Many updates to @TransactionalGraphTestSuite@
+** Large transactions now tested
+** Added timing tests to all tests
+* Updated @Index@ semantics where @get()@ no elements returns an empty iterator, not @null@
+* Updated the @toString()@ method of @TinkerGraph@ to display both vertex and edge counts
+* Added support for multiple indices
+** Added @IndexableGraph@, @Index@, and @AutomaticIndex@ interfaces
+** Added numerous test cases to the test suite
+* Updated @GraphMLReader@
+** More efficient implementation
+** Can specify ids and labels through @_id@ and @_label@ data properties
+* Added @GraphMigrator@ to stream the data in one graph to another
+* Added @RexsterGraph@ to connect to remote graphs over HTTP-REST
+* Added JavaDoc to all property graph model interfaces
+
+==<hr/>==
+
+!https://github.com/tinkerpop/blueprints/raw/master/doc/images/blueprints-kermi.png!
+
+h3. Version 0.2 (Kermit -- September 22, 2010)
+
+```xml
+<dependency>
+ <groupId>com.tinkerpop</groupId>
+ <artifactId>blueprints</artifactId>
+ <version>0.2</version>
+</dependency>
+```
+
+Blueprints 0.2 "JavaDocs":http://tinkerpop.com/maven2/com/tinkerpop/blueprints/0.2/api/
+
+* Removed Blueprints Pipes BETA and put it into a separate project
+* @Neo4jGraph@ constructor can be passed in a Neo4j properties map
+* @Neo4jGraph@ constructor can be passed in a live @GraphDatabaseService@
+* Updated @GraphMLWriter@ to write all vertices and then all edges
+* Added RDF load functionality to @SailGraph@
+* Added SPARQL functioanlity to @SailGraph@
+* Fixed sever @GraphMLReader@ bug
+* Added OrientDB (OrientGraph) as a property graph implementation
+* Added support for @Graph.getEdge(Object id)@
+* Added support for @kind@ in the Sail implementation of Blueprints
+* Made iterating edges in @SailGraph@ faster and more memory efficient
+* Support for transactions through @TransactionalGraph@
+
+==<hr/>==
+
+!https://github.com/tinkerpop/blueprints/raw/master/doc/images/blueprints-bob-the-builder.png!
+
+h3. Version 0.1.1 (Bob the Builder -- March 7, 2010)
+
+```xml
+<dependency>
+ <groupId>com.tinkerpop</groupId>
+ <artifactId>blueprints</artifactId>
+ <version>0.1.1</version>
+</dependency>
+```
+
+Blueprints 0.1.1 "JavaDocs":http://tinkerpop.com/maven2/com/tinkerpop/blueprints/0.1.1/api/
+
+* Added Blueprints Pipes BETA to the distribution
+* Changed all the OpenRDF Sesame dependencies to version 2.3.1
+* Added performance timing printouts to model test cases
+* Neo4j depedency was changed for 1.0-rc to 1.0
+* Added object document interfaces
+* Added TinkerDoc implementation of the object document interfaces
+* Added MongoDB implementation of the object document interfaces
+
+h3. Version 0.1 (Bob the Builder -- February 9, 2010)
+
+```xml
+<dependency>
+ <groupId>com.tinkerpop</groupId>
+ <artifactId>blueprints</artifactId>
+ <version>0.1</version>
+</dependency>
+```
+
+Blueprints 0.1 "JavaDocs":http://tinkerpop.com/maven2/com/tinkerpop/blueprints/0.1/api/
+
+* Initial release providing the property graph model
+* Code originally packaged with "Gremlin":http://gremlin.tinkerpop.com
View
15 doc/wiki/Rexster-Implementation.textile
@@ -0,0 +1,15 @@
+!https://github.com/tinkerpop/rexster/raw/master/doc/images/rexster-logo.png!
+
+```xml
+<dependency>
+ <groupId>com.tinkerpop.blueprints</groupId>
+ <artifactId>blueprints-rexster-graph</artifactId>
+ <version>??</version>
+</dependency>
+```
+
+"Rexster":http://rexster.tinkerpop.com is a RESTful graph shell that exposes any Blueprints graph through a standalone HTTP server. @RexsterGraph@ talks to a Rexster-exposed graph via the "Rexster RESTful API":https://github.com/tinkerpop/rexster/wiki/Basic-REST-API. Thus, @RexsterGraph@ can be used to communicate with a remote graph with complete HTTP-transparency to the user. @RexsterGraph@ is composed of HTTP calls (through @java.net.*@) and "JSON":http://json.org/ parsing (through "JSON-simple":http://code.google.com/p/json-simple/).
+
+```java
+Graph graph = new RexsterGraph("http://localhost:8182/graphs/tinkergraph");
+```
View
81 doc/wiki/Sail-Implementation.textile
@@ -0,0 +1,81 @@
+!https://github.com/tinkerpop/blueprints/raw/master/doc/images/openrdf-logo.png!:http://www.openrdf.org
+
+"OpenRDF":http://www.openrdf.org is the creator of the "Sail":http://www.openrdf.org/doc/sesame2/2.3.0/users/ch08.html interface (Storage and Inference Layer). Any triple or quad-store developer can implement the Sail interfaces in order to allow third-party developer to work with different stores without having to change their code. This is very handy as different RDF-store implementations are optimized for different types of use cases. In analogy, Sail is like the "JDBC":http://java.sun.com/javase/technologies/database/ of the RDF database world.
+
+bq.. The Storage And Inference Layer (Sail) API is a low level System API (SPI) for RDF stores and inferencers. Its purpose is to abstract from the storage and inference details, allowing various types of storage and inference to be used. The Sail API is mainly of interest for those who are developing Sail implementations, for all others it suffices to know how to create and configure one. There are several implementations of the Sail API, for example the MemoryStore which stores RDF data in main memory, and the NativeStore which uses dedicated on-disk data structures for storage. (source "OpenRDF Sesame Users Guide":http://www.openrdf.org/doc/sesame2/2.3.0/users/index.html)
+
+p. Many triple and quad-store developers have implemented the Sail interface. Supported implementations are provided below.
+
+```xml
+<dependency>
+ <groupId>com.tinkerpop.blueprints</groupId>
+ <artifactId>blueprints-sail-graph</artifactId>
+ <version>??</version>
+</dependency>
+```
+
+* "OpenRDF":http://www.openrdf.org ("MemoryStore":http://www.openrdf.org/doc/sesame2/2.3.0/users/ch08.html#d0e705, "NativeStore":http://www.openrdf.org/doc/sesame2/2.3.0/users/ch08.html#d0e746)
+
+```java
+Graph graph = new MemoryStoreSailGraph();
+Graph graph = new NativeStoreSailGraph("/tmp/nativestore");
+```
+
+* "Linked Data Sail":https://github.com/joshsh/ripple/wiki/LinkedDataSail
+
+```java
+Graph graph = new LinkedDataSailGraph(new MemoryStoreSailGraph());
+Vertex v = graph.getVertex("http://dbpedia.org/resource/Graph_Database");
+```
+
+* "SPARQL Repository":http://www.openrdf.org/doc/sesame2/api/org/openrdf/repository/sparql/SPARQLRepository.html
+
+```java
+Graph graph = new SparqlRepositorySailGraph("http://dbpedia.org/sparql");
+```
+
+Any of these stores can be manipulated with Blueprints through their Sail interfaces. Here is a list of aspects of RDF that should be understood when dealing with Blueprints over an RDF store.
+
+# *No duplicate edges*: RDF considers two edges the same if they share the same subject, predicate, object, and graph. Thus, edges with these in common are, in fact, the same edge.
+# *No indices*: There are no indices as no elements have properties that can not be accessed simply by using referencing their id (i.e. their URI, blank node, or literal string).
+# *Infinite vertices*: RDF is edge based and as such, every possible vertex exists. It is only when finding outgoing or incoming edges to some vertex do you recognize it within a larger graph structure. For this reason, you can not iterate over all vertices in the graph.
+
+==<hr/>==
+
+!https://github.com/tinkerpop/blueprints/raw/master/doc/images/rdf-logo.gif!:http://www.w3.org/RDF/
+
+The "Resource Description Framework":http://www.w3.org/RDF/ can be modeled as a property graph. Moreover, it is possible to model "RDF quads":http://www.w3.org/2004/03/trix/ (triples within a named graph) as a property graph. This page articulates the mapping between RDF quads and the property graph model.
+
+h2. Mapping RDF to a Property Graph
+
+An RDF quad statement is denoted by a subject, a predicate, an object, and a named graph (the "spog" model for short). The set of subjects is the set of all Uniform Resource Identifiers (URIs) and blank nodes. The set of predicates is the set of all URIs. The set of objects is the set of all URIs, blank nodes, and literals. Finally, the set of named graphs is the set of all URIs and blank nodes. The following diagram demonstrates how RDF is modeled using the [[property graph model]].
+
+!https://github.com/tinkerpop/blueprints/raw/master/doc/images/rdf-graph-model.jpg!
+
+The identifier (@id@) of a vertex is the string representation of the RDF value that it is modeling/representing. A few examples are provided below:
+
+# URI
+ ** @http://markorodriguez.com@
+ ** @http://tinkerpop.com#ripple@
+ ** @urn:uuid:aa9d07d7-8ccf-454a-b08a-5e5a8c560154@
+# Blank Node
+ ** @_:A12345@
+ ** @_:anonymous-node@
+# Literal
+ ** @"hello"@
+ ** @"hello"@ @@en@
+ ** @"hello"^^<http://www.w3.org/2001/XMLSchema#string>@
+
+All vertices have a *kind* property (@kind@) that is either @uri@, @literal@, or @bnode@. Only literal-based vertices have three other vertex properties. Only two of which can be set. These properties are the *language* (@lang@), the *datatype* (@type@), and the *typecasted value* (@value@) of the literal label. Note that in RDF, a literal can have either a language, a datatype, or neither. Never can a literal have both a language and a datatype. The typecasted value is the object created by the casting of the label of the literal by its datatype. In other words the @value@ of @"6"^^<http://www.w3.org/2001/XMLSchema#int>@ is the integer 6.
+
+Finally, an edge in the [[property graph model]] represents an RDF statement. The identifier of an edge is the string representation of the RDF statement. Two examples are provided below. One where the RDF statement is a triple and the other where the statement is a quad.
+
+# Statement
+ ** @(http://tinkerpop.com#marko, http://someontology.com#age, "30"^^<http://www.w3.org/2001/XMLSchema#int>)@
+ ** @(http://tinkerpop.com#marko, http://www.w3.org/2002/07/owl#sameAs, http://markorodrigue.com#marko) [http://tinkerpop.com#graph]@
+
+Statements can only have a single property. Namely, the named graph property (@ng@).
+
+The graph diagrammed in [[GraphML Reader and Writer Library]] would be represented in an RDF property graph as the following.
+
+!https://github.com/tinkerpop/gremlin/raw/master/doc/images/graph-example-1-rdf.jpg!
View
181 doc/wiki/Sail-Ouplementation.textile
@@ -0,0 +1,181 @@
+!https://github.com/tinkerpop/blueprints/raw/master/doc/images/openrdf-logo.png!
+
+```xml
+<dependency>
+ <groupId>com.tinkerpop.blueprints</groupId>
+ <artifactId>blueprints-graph-sail</artifactId>
+ <version>??</version>
+</dependency>
+```
+
+
+"Sail":http://www.openrdf.org/doc/sesame2/api/org/openrdf/sail/Sail.html is an "RDF":http://www.w3.org/RDF/ triple/quad store interface developed by "OpenRDF":http://openrdf.org. Any database the implements the Sail interfaces properly is a valid RDF triple/quad store. A graph database is a great way to build a triple/quad store because its possible to mix indexing and graph traversals to solve the RDF "pattern match" problem. To go from @Graph@ to @Sail@, simply use @GraphSail@. @GraphSail@ requires an @IndexableGraph@ (e.g. @TinkerGraph@, @Neo4jGraph@, @OrientGraph@). The examples below use [[TinkerGraph]] and expose it as a @GraphSail@ and thus, a @Sail@. While some basic examples are provided, please refer to the "OpenRDF":http://openrdf.org Sail documentation for a complete review of the framework.
+
+*NOTE ON TRANSACTIONS*: @Sail@ has its own transaction model that is different from the transaction model used by @TransactionalGraph@. @GraphSail@ provides the user the flexibility of using @TransactionalGraph@ transaction buffers (see [[Graph Transactions]]). If the transaction buffer is set to size 0, then the @Sail@ transaction semantics are as expected. If greater than 0, then the @Sail@ transaction semantics are ignored.
+
+h2. Basic Statement Handling
+
+A statement in RDF is a triple or quad. The components of a statement are called: subject, predicate, object, and graph/context. The subject can be a URI or blank node. The predicate can only be a URI. The object can be a URI, blank node, or literal. Finally, the graph (or context) can be a URI or blank node.
+
+```java
+Sail sail = new GraphSail(new TinkerGraph());
+sail.initialize();
+SailConnection sc = sail.getConnection();
+ValueFactory vf = sail.getValueFactory();
+sc.addStatement(vf.createURI("http://tinkerpop.com#1"), vf.createURI("http://tinkerpop.com#knows"), vf.createURI("http://tinkerpop.com#3"), vf.createURI("http://tinkerpop.com"));
+sc.addStatement(vf.createURI("http://tinkerpop.com#1"), vf.createURI("http://tinkerpop.com#name"), vf.createLiteral("marko"), vf.createURI("http://tinkerpop.com"));
+sc.addStatement(vf.createURI("http://tinkerpop.com#3"), vf.createURI("http://tinkerpop.com#name"), vf.createLiteral("josh"), vf.createURI("http://tinkerpop.com"));
+
+System.out.println("get statements: ?s ?p ?o ?g");
+CloseableIteration<? extends Statement, SailException> results = sc.getStatements(null, null, null, false);
+while(results.hasNext()) {
+ System.out.println(results.next());
+}
+
+System.out.println("\nget statements: http://tinkerpop.com#3 ?p ?o ?g");
+results = sc.getStatements(vf.createURI("http://tinkerpop.com#3"), null, null, false);
+while(results.hasNext()) {
+ System.out.println(results.next());
+}
+```
+
+```text
+get statements: ?s ?p ?o ?g
+(http://tinkerpop.com#1, http://tinkerpop.com#knows, http://tinkerpop.com#3) [http://tinkerpop.com]
+(http://tinkerpop.com#3, http://tinkerpop.com#name, "josh") [http://tinkerpop.com]
+(http://tinkerpop.com#1, http://tinkerpop.com#name, "marko") [http://tinkerpop.com]
+
+get statements: http://tinkerpop.com#3 ?p ?o ?g
+(http://tinkerpop.com#3, http://tinkerpop.com#name, "josh") [http://tinkerpop.com]
+```
+
+h2. Using SPARQL
+
+"SPARQL":http://www.w3.org/TR/rdf-sparql-query/ is the standard query language for RDF stores. OpenRDF provides a SPARQL query engine that can be used over any @Sail@. An example is provided below. Assume that the same statements from the previous example exist in the @GraphSail@ below.
+
+```java
+SPARQLParser parser = new SPARQLParser();
+CloseableIteration<? extends BindingSet, QueryEvaluationException> sparqlResults;
+String queryString = "SELECT ?x ?y WHERE { ?x <http://tinkerpop.com#knows> ?y }";
+ParsedQuery query = parser.parseQuery(queryString, "http://tinkerPop.com");
+
+System.out.println("\nSPARQL: " + queryString);
+sparqlResults = sc.evaluate(query.getTupleExpr(), query.getDataset(), new EmptyBindingSet(), false);
+while (sparqlResults.hasNext()) {
+ System.out.println(sparqlResults.next());
+}
+```
+
+```text
+SPARQL: SELECT ?x ?y WHERE { ?x <http://tinkerpop.com#knows> ?y }
+[y=http://tinkerpop.com#3;x=http://tinkerpop.com#1]
+```
+
+h2. Moving Between Sail and Graph
+
+Its possible to get the @Graph@ that is being modeled as a @Sail@ and work from the Blueprints API perspective. In this way, its possible to leverage the tools provided for both @Sail@ and Blueprints @Graph@.
+
+```java
+Graph graph = ((GraphSail) sail).getGraph();
+System.out.println();
+for (Vertex v : graph.getVertices()) {
+ System.out.println("------");
+ System.out.println(v);
+ for (String key : v.getPropertyKeys()) {
+ System.out.println(key + "=" + v.getProperty(key));
+ }
+}
+for (Edge e : graph.getEdges()) {
+System.out.println("------");
+System.out.println(e);
+for (String key : e.getPropertyKeys()) {
+ System.out.println(key + "=" + e.getProperty(key));
+}
+```
+
+```text
+------
+v[2]
+value=http://tinkerpop.com#3
+kind=uri
+------
+v[1]
+value=http://tinkerpop.com#1
+kind=uri
+------
+v[0]
+value=urn:com.tinkerpop.blueprints.pgm.oupls.sail:namespaces
+------
+v[6]
+value=josh
+kind=literal
+------
+v[4]
+value=marko
+kind=literal
+------
+e[3][1-http://tinkerpop.com#knows->2]
+cp=U http://tinkerpop.com U http://tinkerpop.com#knows
+c=U http://tinkerpop.com
+p=U http://tinkerpop.com#knows
+------
+e[7][2-http://tinkerpop.com#name->6]
+cp=U http://tinkerpop.com U http://tinkerpop.com#name
+c=U http://tinkerpop.com
+p=U http://tinkerpop.com#name
+------
+e[5][1-http://tinkerpop.com#name->4]
+cp=U http://tinkerpop.com U http://tinkerpop.com#name
+c=U http://tinkerpop.com
+p=U http://tinkerpop.com#name
+```
+
+h2. Inferencing support
+
+Blueprints Sail implements "NotifyingSail":http://www.openrdf.org/doc/sesame2/api/org/openrdf/sail/NotifyingSail.html, produces "InferencerConnections":http://www.openrdf.org/doc/sesame2/api/org/openrdf/sail/inferencer/InferencerConnection.html, and does all of the right things under the hood to support Sesame-based reasoning/inferencing tools such as "ForwardChainingRDFSInferencer":http://www.openrdf.org/doc/sesame2/api/org/openrdf/sail/inferencer/fc/ForwardChainingRDFSInferencer.html, with no extra plumbing required. For example:
+
+```java
+ Sail reasoner = new ForwardChainingRDFSInferencer(new GraphSail(new TinkerGraph()));
+ reasoner.initialize();
+```
+
+How it works: a reasoner such as @ForwardChainingRDFSInferencer@ is expected to listen for RDF statements added to or removed from the base @Sail@ (here: an instance of @GraphSail@) and to manage a collection of "inferred" statements accordingly. The inferred statements are stored along with the explicitly asserted RDF statements in the base @Sail@. In Blueprints Sail, these statements are marked with a special property, @inferred@, which when present has the boolean value @true@, so you can see which edges "you" have added, and which edges the reasoner has added, when traversing the underlying Property Graph. The following is a more detailed example:
+
+```java
+Resource beijing = new URIImpl("http://example.org/things/Beijing");
+Resource city = new URIImpl("http://example.org/terms/city");
+Resource place = new URIImpl("http://example.org/terms/place");
+
+Sail reasoner = new ForwardChainingRDFSInferencer(new GraphSail(new TinkerGraph()));
+reasoner.initialize();
+
+try {
+ SailConnection c = reasoner.getConnection();
+ try {
+ c.addStatement(city, RDFS.SUBCLASSOF, place);
+ c.addStatement(beijing, RDF.TYPE, city);
+ c.commit();
+
+ CloseableIteration<? extends Statement, SailException> i
+ = c.getStatements(beijing, null, null, true);
+ try {
+ while (i.hasNext()) {
+ System.out.println("statement " + i.next());
+ }
+ } finally {
+ i.close();
+ }
+ } finally {
+ c.close();
+ }
+} finally {
+ reasoner.shutDown();
+}
+```
+
+Output of the example:
+```
+statement (http://example.org/things/Beijing, http://www.w3.org/1999/02/22-rdf-syntax-ns#type, http://www.w3.org/2000/01/rdf-schema#Resource)
+statement (http://example.org/things/Beijing, http://www.w3.org/1999/02/22-rdf-syntax-ns#type, http://example.org/terms/place)
+statement (http://example.org/things/Beijing, http://www.w3.org/1999/02/22-rdf-syntax-ns#type, http://example.org/terms/city)
+```
View
12 doc/wiki/The-Benefits-of-Blueprints.textile
@@ -0,0 +1,12 @@
+!https://github.com/tinkerpop/blueprints/raw/master/doc/images/blueprints-logo.png!
+
+Blueprints is a generic graph Java API that binds to various graph backends (i.e. frameworks and "databases":http://en.wikipedia.org/wiki/Graph_database). Below is a list of reasons for using Blueprints.
+
+* Blueprints makes it relatively easy to swap in and out different graph backends. In this way, its possible to avoid "vendor lock-in":http://en.wikipedia.org/wiki/Vendor_lock-in.
+* Any software built for Blueprints will work with any Blueprints-enabled graph backend (e.g "Gremlin":http://gremlin.tinkerpop.com).
+* Blueprints comes with a large library of utilities to make it easy to manipulate a graph.
+* Blueprints can turn any graph databases into a "RDF store":http://en.wikipedia.org/wiki/Triplestore (see [[Sail Ouplementation]]).
+* Blueprints can turn any RDF store into a graph database (see [[Sail Implementation]]).
+* Blueprints can turn any graph into a "JUNG":http://jung.sourceforge.net/ graph (see [[JUNG Ouplementation]]).
+* Blueprints has support for "GraphML":http://graphml.graphdrawing.org/ reading and writing (see [[GraphML Reader and Writer Library]]).
+* Its open source and free to use under a liberal "BSD license":http://en.wikipedia.org/wiki/BSD_licenses.
View
22 doc/wiki/TinkerGraph.textile