Develop: 2.2.x: plugin-2.2.x plugin-develop
http://orientdb.com/docs/last/OrientDB-Neo4j-Importer.html
mvn clean install
To skip tests:
mvn clean install -DskipTests
To run only a specific test, e.g. shouldImportEmptyDb
:
mvn -Dtest=ONeo4jImporterTest#shouldImportEmptyDb test
The test databases are created using the following queries:
shouldImportEmptyDb
)Empty database
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
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}))
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}))
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}))
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}))
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}))
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}))
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}))