Project

General

Profile

« Previous | Next » 

Revision bbd809c0

Added by Andreas Kohlbecker over 8 years ago

using neo4j2 (2.0.1)

View differences:

pom.xml
31 31
    <swagger-annotations.version>1.3.11</swagger-annotations.version>
32 32
    <jackson-annotations.version>2.2.3</jackson-annotations.version>
33 33
    <apache.jena.version>3.0.0</apache.jena.version>
34
    <!--  
35
        NOTE: there is a tinkerpop version (2.7.1) 
36
        from https://github.com/allenai/blueprints which is much older!!
37
        the original tinkerpop is more recent
38
    -->
34 39
    <tinkerpop.version>2.6.0</tinkerpop.version>
35 40
    <sesame.version>2.7.10</sesame.version><!-- should match the version as used in tinkerpop.blueprints -->
36
    <neo4j.version>1.9.9</neo4j.version>
41
    <neo4j.version>2.0.1</neo4j.version>
37 42
  </properties>
38 43

  
39 44
  <dependencies>
......
152 157
    </dependency>
153 158
    <dependency>
154 159
        <groupId>com.tinkerpop.blueprints</groupId>
155
        <artifactId>blueprints-neo4j-graph</artifactId>
160
        <artifactId>blueprints-neo4j2-graph</artifactId>
156 161
        <version>${tinkerpop.version}</version>
157 162
    </dependency>
158 163
    <dependency>
src/main/java/org/bgbm/biovel/drf/checklist/EEA_BDC_Client.java
41 41
import com.tinkerpop.blueprints.Direction;
42 42
import com.tinkerpop.blueprints.Graph;
43 43
import com.tinkerpop.blueprints.Vertex;
44
import com.tinkerpop.blueprints.impls.neo4j.Neo4jGraph;
45
import com.tinkerpop.blueprints.impls.neo4j.Neo4jVertex;
44
import com.tinkerpop.blueprints.impls.neo4j2.Neo4j2Graph;
45
import com.tinkerpop.blueprints.impls.neo4j2.Neo4j2Vertex;
46 46
import com.tinkerpop.blueprints.oupls.sail.GraphSail;
47 47
import com.tinkerpop.gremlin.java.GremlinPipeline;
48 48
import com.tinkerpop.pipes.PipeFunction;
......
64 64
    private static final String SPECIES_RDF_FILE_URL = "http://localhost/download/species.rdf.gz"; // http://eunis.eea.europa.eu/rdf/species.rdf.gz
65 65
    private static final String LEGALREFS_RDF_FILE_URL = "http://localhost/download/legalrefs.rdf.gz"; // http://eunis.eea.europa.eu/rdf/legalrefs.rdf.gz
66 66
    private static final String REFERENCES_RDF_FILE_URL = "http://localhost/download/references.rdf.gz"; // http://eunis.eea.europa.eu/rdf/references.rdf.gz
67
    private static final boolean REFRESH_TDB = false;
67
    private static final boolean REFRESH_TDB = true;
68 68

  
69 69
    private static final Class<? extends IQueryClient> clientClass = TinkerPopClient.class;
70 70

  
......
194 194
    private void updateStore(Store neo4jStore) {
195 195
        try {
196 196
            neo4jStore.loadIntoStore(
197
                    //SPECIES_RDF_FILE_URL,
197
                    SPECIES_RDF_FILE_URL,
198 198
                    LEGALREFS_RDF_FILE_URL,
199 199
                    REFERENCES_RDF_FILE_URL
200 200
                    );
......
482 482
                        + "}"
483 483
                        );
484 484

  
485
                Neo4jGraph neo4jGraph = (Neo4jGraph)queryClient.graph();
485
                Neo4j2Graph neo4jGraph = (Neo4j2Graph)queryClient.graph();
486 486
                Vertex v = neo4jGraph.getVertex(2);
487 487

  
488 488
                SailRepositoryConnection connection = null;
......
693 693
    /**
694 694
     * @param vertex
695 695
     */
696
    private void printEdges(Neo4jVertex vertex) {
696
    private void printEdges(Neo4j2Vertex vertex) {
697 697
        Iterable<Relationship> rels = vertex.getRawVertex().getRelationships();
698 698
        Iterator<Relationship> iterator = rels.iterator();
699 699
        if(iterator.hasNext()) {
src/main/java/org/bgbm/biovel/drf/store/Neo4jStore.java
16 16
import org.openrdf.sail.SailException;
17 17

  
18 18
import com.tinkerpop.blueprints.Graph;
19
import com.tinkerpop.blueprints.impls.neo4j.Neo4jGraph;
19
import com.tinkerpop.blueprints.impls.neo4j2.Neo4j2Graph;
20 20
import com.tinkerpop.blueprints.oupls.sail.GraphSail;
21 21
import com.tinkerpop.blueprints.oupls.sail.SailLoader;
22 22
import com.tinkerpop.gremlin.java.GremlinPipeline;
......
28 28
 */
29 29
public class Neo4jStore extends Store{
30 30

  
31
    private Neo4jGraph graph;
31
    private Neo4j2Graph graph;
32 32
    private Sail sail;
33 33
    private SailRepository sailRepo;
34 34

  
......
47 47
    @Override
48 48
    protected void initStoreEngine() throws Exception  {
49 49

  
50
        graph = new Neo4jGraph(storeLocation.toString());
51
        sail = new GraphSail<Neo4jGraph>(graph);
50
        graph = new Neo4j2Graph(storeLocation.toString());
51
        sail = new GraphSail<Neo4j2Graph>(graph);
52 52
        sail.initialize();
53 53
        sailRepo = new SailRepository(sail);
54 54

  
......
84 84

  
85 85

  
86 86
    private long countEdges() {
87
        GremlinPipeline<Neo4jGraph, Object> pipe = new GremlinPipeline<Neo4jGraph, Object>();
87
        GremlinPipeline<Neo4j2Graph, Object> pipe = new GremlinPipeline<Neo4j2Graph, Object>();
88 88
        return pipe.start(graph).E().count();
89 89
    }
90 90

  
91 91
    private long countVertexes() {
92
        GremlinPipeline<Neo4jGraph, Object> pipe = new GremlinPipeline<Neo4jGraph, Object>();
92
        GremlinPipeline<Neo4j2Graph, Object> pipe = new GremlinPipeline<Neo4j2Graph, Object>();
93 93
        return pipe.start(graph).V().count();
94 94
    }
95 95

  

Also available in: Unified diff