File size: 3,107 Bytes
2795186 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# JanusGraph Examples
The JanusGraph examples show the basics of how to configure and construct
a graph application. It uses [Apache Maven](https://maven.apache.org) to
manage the numerous dependencies required to build the application. The common
application will:
* Open and initialize the graph
* Define the schema
* Build the graph
* Run traversal queries to get data from the graph
* Make updates to the graph
* Close the graph
By using different graph configurations, the same example code can run against
the various supported storage and indexing backends.
## Prerequisites
* Java 8 Development Kit, update 40 or higher. [Oracle Java](https://www.oracle.com/java/index.html) and [OpenJDK](https://openjdk.java.net/) have been tested successfully.
* [Apache Maven](https://maven.apache.org/), version 3.3 or higher
### JanusGraph distribution
Download the latest [JanusGraph release](https://github.com/JanusGraph/janusgraph/releases)
distribution zip file and unzip it.
### Build the examples
The examples are packaged with the JanusGraph distribution zip file in the
`examples` directory. Run the Maven build command from the `examples` directory.
```
mvn clean install
```
## Run the examples
These commands can be run from the `examples` or project's directory.
Please refer to the specific directions for each project as there may be
additional setup and configuration required.
### [Common and In-Memory](example-common/README.md)
```
mvn exec:java -pl :example-common
```
### [BerkeleyJE and Lucene](example-berkeleyje/README.md)
```
mvn exec:java -pl :example-berkeleyje
```
### [Cassandra CQL and Elasticsearch](example-cql/README.md)
```
mvn exec:java -pl :example-cql
```
### [HBase and SolrCloud](example-hbase/README.md)
```
mvn exec:java -pl :example-hbase
```
### [HBase and Solr Standalone (HTTP)](example-hbase/README.md#hbase-and-solr-standalone-http)
```
mvn exec:java -pl :example-hbase -Dexample.config="\${project.basedir}/conf/jgex-hbase-solr-http.properties"
```
### [Remote Graph](example-remotegraph/README.md)
```
mvn exec:java -pl :example-remotegraph
```
### [TinkerGraph](example-tinkergraph/README.md)
```
mvn exec:java -pl :example-tinkergraph
```
## Drop the graph
After running an example, you may want to drop the graph from storage. Make
sure to stop the application before dropping the graph. These commands can
be run from the `examples` or the project's directory, but please refer to
the specific directions for each project as there may be additional steps
for clean up.
### [BerkeleyJE and Lucene](example-berkeleyje/README.md)
```
mvn exec:java -pl :example-berkeleyje -Dcmd=drop
```
### [Cassandra CQL and Elasticsearch](example-cql/README.md)
```
mvn exec:java -pl :example-cql -Dcmd=drop
```
### [HBase and SolrCloud](example-hbase/README.md)
```
mvn exec:java -pl :example-hbase -Dcmd=drop
```
### [HBase and Solr Standalone (HTTP)](example-hbase/README.md#hbase-and-solr-standalone-http)
```
mvn exec:java -pl :example-hbase -Dexample.config="\${project.basedir}/conf/jgex-hbase-solr-http.properties" -Dcmd=drop
```
|