Skip to content
This repository has been archived by the owner on Oct 30, 2023. It is now read-only.

orientechnologies/orientdb-neo4j-importer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Develop: Build Status 2.2.x: Build Status

Neo4j to OrientDB Importer

Documentation

http://orientdb.com/docs/last/OrientDB-Neo4j-Importer.html

Internals

Compile

mvn clean install

To skip tests:

mvn clean install -DskipTests

To run only a specific test, e.g. shouldImportEmptyDb:

mvn -Dtest=ONeo4jImporterTest#shouldImportEmptyDb test

Tests

The test databases are created using the following queries:

graphdb_empty_db (test shouldImportEmptyDb)

Empty database

graphdb_unique_constraints_only (test shouldImportUniqueConstraintsOnlyDb)

CREATE CONSTRAINT ON (n:NodeLabelA) ASSERT n.p_number   IS UNIQUE
CREATE CONSTRAINT ON (n:NodeLabelB) ASSERT n.p_string   IS UNIQUE
CREATE CONSTRAINT ON (n:NodeLabelC) ASSERT n.p_boolean  IS UNIQUE

graphdb_nodes_only (test shouldImportNodesOnlyDb)

foreach(x in range(1,10) | create (:NodeLabelA {p_number:x, other_property: "NodeLabelA-"+x}))
foreach(x in range(1,10) | create (:NodeLabelB {p_string:"string_value_" + x, other_property: "NodeLabelB-"+x}))
foreach(x in range(1,5)  | create (:NodeLabelC {p_boolean:false, other_property: "NodeLabelC-"+x}))
foreach(x in range(6,10) | create (:NodeLabelC {p_boolean:true, other_property: "NodeLabelC-"+x}))

graphdb_nodes_only_no_labels (test shouldImportNodesOnlyNoLabelsDb)

foreach(x in range(1,10) | create ( {p_number:x, other_property: "string-"+x}))
foreach(x in range(1,10) | create ( {p_string:"string_value_" + x, other_property: "string-"+x}))
foreach(x in range(1,5)  | create ( {p_boolean:false, other_property: "string-"+x}))
foreach(x in range(6,10) | create ( {p_boolean:true, other_property: "string-"+x}))

graphdb_nodes_only_mixed_labels_and_no_labels (test shouldImportNodesOnlyMixedLabelsNoLabelsDb)

foreach(x in range(1,10) | create (:NodeLabelA {p_number:x, other_property: "NodeLabelA-"+x}))
foreach(x in range(1,10) | create ( {p_string:"string_value_" + x, other_property: "string-"+x}))
foreach(x in range(1,5)  | create (:NodeLabelC {p_boolean:false, other_property: "NodeLabelC-"+x}))
foreach(x in range(6,10) | create ( {p_boolean:true, other_property: "string-"+x}))

graphdb_nodes_only_label_case_test (test shouldImportNodesOnlyLabelCaseDb)

foreach(x in range(1,10) | create (:NodeLabelA {p_number:x, other_property: "NodeLabelA-"+x}))
foreach(x in range(1,10) | create (:NodeLABELA {p_string:"string_value_" + x, other_property: "NodeLABELA-"+x}))
foreach(x in range(1,5)  | create (:NodeLabelC {p_boolean:false, other_property: "NodeLabelC-"+x}))
foreach(x in range(6,10) | create ( {p_boolean:true, other_property: "string-"+x}))

graphdb_nodes_only_label_case_test_constraints (test shouldImportNodesOnlyLabelCaseConstraintsDb)

CREATE CONSTRAINT ON (n:NodeLabelA) ASSERT n.p_number        IS UNIQUE
CREATE CONSTRAINT ON (n:NodeLabelB) ASSERT n.p_number        IS UNIQUE
CREATE CONSTRAINT ON (n:NodeLABELB) ASSERT n.p_number        IS UNIQUE

foreach(x in range(1,10) | create (:NodeLabelA {p_number:x, other_property: "NodeLabelA-"+x}))
foreach(x in range(1,10) | create (:NodeLABELA {p_string:"string_value_" + x, other_property: "NodeLABELA-"+x}))
foreach(x in range(1,10) | create (:NodeLabelB {p_number:x, other_property: "NodeLabelB-"+x}))
foreach(x in range(1,10) | create (:NodeLABELB {p_number:x, other_property: "NodeLABELB-"+x}))

graphdb_nodes_only_multiple_labels (test shouldImportNodesOnlyMultipleLabelsDb)

foreach(x in range(1,10) | create (:NodeLabelA:NodeLabelB {p_number:x, other_property: "NodeLabelA-NodeLabelB-"+x}))
foreach(x in range(1,10) | create (:NodeLabelC:NodeLabelD {p_string:"string_value_" + x, other_property: "NodeLabelC-NodeLabelD"+x}))
foreach(x in range(1,10) | create (:NodeLabelE {p_boolean:true, other_property: "NodeLabelE-"+x}))

graphdb_multiple_labels_and_constraints (test shouldImportMultipleLabelsAndConstraintsDb)

CREATE CONSTRAINT ON (n:NodeLabelA) ASSERT n.p_number        IS UNIQUE
CREATE CONSTRAINT ON (n:NodeLabelB) ASSERT n.p_number        IS UNIQUE
CREATE CONSTRAINT ON (n:NodeLabelC) ASSERT n.p_string        IS UNIQUE
CREATE CONSTRAINT ON (n:NodeLabelE) ASSERT n.other_property  IS UNIQUE

foreach(x in range(1,10) | create (:NodeLabelA:NodeLabelB {p_number:x, other_property: "NodeLabelA-NodeLabelB-"+x}))
foreach(x in range(11,20) | create (:NodeLabelB {p_number:x, other_property: "NodeLabelB-"+x}))
foreach(x in range(1,10) | create (:NodeLabelC:NodeLabelD {p_string:"string_value_" + x, other_property: "NodeLabelC-NodeLabelD"+x}))
foreach(x in range(1,10) | create (:NodeLabelE {p_boolean:true, other_property: "NodeLabelE-"+x}))