You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-11
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,10 @@
1
1
# blazegraph-gremlin
2
2
3
-
Welcome to the Blazegraph/Tinkerpop3 project. The TP3 implementation has some significant differences from the TP2 version. The data model has been changed to use RDF*, an RDF reification framework described [here](https://wiki.blazegraph.com/wiki/index.php/Reification_Done_Right).
The concept behind blazegraph-gremlin is that property graph (PG) data can be loaded and accessed via the Tinkerpop3 API, but underneath the hood the data will be stored as RDF using the PG data model described in this document. Once PG data has been loaded you can interact with it just like you would interact with ordinary RDF - you can run SPARQL queries or interact with the data via the SAIL API. It just works. The PG data model is also customizable via a round-tripping interface called the BlazeValueFactory, also described in detail in this document.
5
+
Welcome to the [Blazegraph](https://www.blazegraph.com)/[TinkerPop3](http://tinkerpop.incubator.apache.org/) project. The TP3 implementation has some significant differences from the TP2 version. The data model has been changed to use RDF*, an RDF reification framework described [here](https://wiki.blazegraph.com/wiki/index.php/Reification_Done_Right).
6
+
7
+
The concept behind blazegraph-gremlin is that property graph (PG) data can be loaded and accessed via the TinkerPop3 API, but underneath the hood the data will be stored as RDF using the PG data model described in this document. Once PG data has been loaded you can interact with it just like you would interact with ordinary RDF - you can run SPARQL queries or interact with the data via the SAIL API. It just works. The PG data model is also customizable via a round-tripping interface called the BlazeValueFactory, also described in detail in this document.
6
8
7
9
Some interesting features of the Blazegraph/TP3 implementation include:
8
10
@@ -15,7 +17,7 @@ Some interesting features of the Blazegraph/TP3 implementation include:
15
17
* Support for MVCC concurrency model for high-concurrency read access.
16
18
17
19
## Maven Central Dependency
18
-
Blazegraph and the Tinkerpop3 implementation are available on Maven Central.
20
+
Blazegraph and the TinkerPop3 implementation are available on Maven Central.
19
21
20
22
```
21
23
<dependency>
@@ -119,7 +121,7 @@ Cardinality.list uses a specially datatyped and monotonically increasing interna
119
121
120
122
#### Putting it all together: The Crew
121
123
122
-
Here is how the Tinkerpop3 "Crew" dataset looks when loaded into Blazegraph. Human-friendly IDs have been assigned to vertices and edge UUIDs have been abbreviated to 5 characters for brevity.
124
+
Here is how the TinkerPop3 "Crew" dataset looks when loaded into Blazegraph. Human-friendly IDs have been assigned to vertices and edge UUIDs have been abbreviated to 5 characters for brevity.
123
125
124
126
blaze:tinkergraph rdf:type blaze:software ;
125
127
blaze:name "tinkergraph" .
@@ -225,9 +227,9 @@ Here is how the Tinkerpop3 "Crew" dataset looks when loaded into Blazegraph. Hu
225
227
226
228
## Getting up and running with Blazegraph/TP3
227
229
228
-
Currently **BlazeGraphEmbedded** is the only concrete implementation of the Blazegraph Tinkerpop3 API. BlazeGraphEmbedded is backed by an embedded (same JVM) instance of Blazegraph. This puts the enterprise features of Blazegraph (high-availability, scale-out, etc.) out of reach for the 1.0 version of the TP3 integration, since those features are accessed via Blazegraph's client/server API. A TP3 integration with the client/server version of Blazegraph is reserved for a future blazegraph-tinkerpop release.
230
+
Currently **BlazeGraphEmbedded** is the only concrete implementation of the Blazegraph TinkerPop3 API. BlazeGraphEmbedded is backed by an embedded (same JVM) instance of Blazegraph. This puts the enterprise features of Blazegraph (high-availability, scale-out, etc.) out of reach for the 1.0 version of the TP3 integration, since those features are accessed via Blazegraph's client/server API. A TP3 integration with the client/server version of Blazegraph is reserved for a future blazegraph-tinkerpop release.
229
231
230
-
BlazeGraphEmbedded is instantiated by providing an open and initialized Blazegraph RDF repository (OpenRDF SAIL). There a numerous resources available at [blazegraph.com](http://wiki.blazegraph.com) on how to configure a Blazegraph SAIL, however blazegraph-gremlin comes with a quick start factory that will allow you to get up and running with Blazegraph with a reasonable set of defaults for the Tinkerpop3 API. BasicRepositoryProvider in blazegraph-gremlin/src/main allows you to create or open an RDF repository backed by a persistent journal file at a specified location. This RDF repository can then be used to open a BlazeGraphEmbedded instance:
232
+
BlazeGraphEmbedded is instantiated by providing an open and initialized Blazegraph RDF repository (OpenRDF SAIL). There a numerous resources available at [blazegraph.com](http://wiki.blazegraph.com) on how to configure a Blazegraph SAIL, however blazegraph-gremlin comes with a quick start factory that will allow you to get up and running with Blazegraph with a reasonable set of defaults for the TinkerPop3 API. BasicRepositoryProvider in blazegraph-gremlin/src/main allows you to create or open an RDF repository backed by a persistent journal file at a specified location. This RDF repository can then be used to open a BlazeGraphEmbedded instance:
231
233
232
234
/*
233
235
* A journal file is the persistence mechanism for an embedded
@@ -238,7 +240,7 @@ BlazeGraphEmbedded is instantiated by providing an open and initialized Blazegra
238
240
/*
239
241
* BasicRepositoryProvider will create a Blazegraph repository using the
240
242
* specified journal file with a reasonable default configuration set
241
-
* for the Tinkerpop3 API. This will also open a previously created
243
+
* for the TinkerPop3 API. This will also open a previously created
242
244
* repository if the specified journal already exists.
243
245
*
244
246
* ("Bigdata" is the legacy product name for Blazegraph).
@@ -261,9 +263,9 @@ There is even a convenience factory that combines those last two steps:
Blazegraph/TP3 has a number of features that go beyond the standard Tinkerpop3 Graph API.
268
+
Blazegraph/TP3 has a number of features that go beyond the standard TinkerPop3 Graph API.
267
269
268
270
### Bulk Load API
269
271
@@ -430,7 +432,7 @@ Sample usage of this API can be found in SampleCode.demonstrateHistoryAPI(), whi
430
432
431
433
### Transaction and Concurrency API
432
434
433
-
Blazegraph's concurrency model is MVCC, which more or less lines up with Tinkerpop's Transaction model. When you open a BlazeGraphEmbedded instance, you are working with the unisolated (writer) view of the database. This view supports Tinkerpop Transactions, and reads are done against the unisolated connection, so uncommitted changes will be visible. A BlazeGraphEmbedded can be shared across multiple threads, but only one thread can have a Tinkerpop Transaction open at a time (other threads will be blocked until the transaction is closed). A TP3 Transaction is automatically opened on any read or write operation, and automatically closed on any commit or rollback operation. The Transaction can also be closed manually, which you will need to do after read operations to unblock other waiting threads.
435
+
Blazegraph's concurrency model is MVCC, which more or less lines up with TinkerPop's Transaction model. When you open a BlazeGraphEmbedded instance, you are working with the unisolated (writer) view of the database. This view supports TinkerPop Transactions, and reads are done against the unisolated connection, so uncommitted changes will be visible. A BlazeGraphEmbedded can be shared across multiple threads, but only one thread can have a TinkerPop Transaction open at a time (other threads will be blocked until the transaction is closed). A TP3 Transaction is automatically opened on any read or write operation, and automatically closed on any commit or rollback operation. The Transaction can also be closed manually, which you will need to do after read operations to unblock other waiting threads.
434
436
435
437
BlazegraphGraphEmbedded's database operations are thus single-threaded, but Blazegraph/MVCC allows for many concurrent readers in parallel with both the single writer and other readers. This is possible by opening a read-only view that will read against the last commit point on the database. The read-only view can be be accessed in parallel to the writer without any of the restrictions described above. To get a read-only snapshot, use the following pattern:
436
438
@@ -454,7 +456,7 @@ Since it is an RDF graph database at its core, Blazegraph supports the full Spar
454
456
455
457
Blazegraph has one of the fastest native query engines of any graph database. Currently blazegraph-gremlin does not provide a native TraversalStrategy implementation for Gremlin. Gremlin traversals will thus be executed via the graph API rather than compiled down into Sparql queries and run natively. As such it is highly recommended that for the 1.0 release of this module you write any application queries or traversals with high performance requirements in Sparql rather than Gremlin. Future releases will include a native Blazegraph TraversalStrategy that will execute Gremlin traversals directly against Blazegraph's ultra-fast query engine. Please contact us for developer support if you would like help expressing your application's queries as Sparql in the most optimized fashion for Blazegraph.
456
458
457
-
Sample usage of this API can be found in SampleCode.demonstrateSparqlAPI(). This example demonstrates how to formulate one of the gremlin queries from the Tinkerpop3 documentation as a Sparql query:
459
+
Sample usage of this API can be found in SampleCode.demonstrateSparqlAPI(). This example demonstrates how to formulate one of the gremlin queries from the TinkerPop3 documentation as a Sparql query:
0 commit comments