Hi Gregory,

First of all, thank you for using our new Neo4j to OrientDB Importer

In version 2.2.14 (that will be released soon), we have changed the way the 
importer behaves in case of Neo4j nodes with multiple labels

The documentation that Oleksandr posted is about the new version (as I've 
updated the documentation already)

So, starting from version 2.2.14, Neo4j nodes with multiple labels will be 
imported into a single OrientDB Class ("MultipleLabelNeo4jConversion"). 
Things are a bit more optimized now, but still we have some ideas on our 
roadmap on how we can improve the migration in this specific case

My suggestion is that you retry the import with v. 2.2.14: all nodes will 
be migrated into a single class and in each vertex you will find the 
property Neo4jLabelList, that includes the original Neo4j label

This Neo4jLabelList property has an index on it, and you can use it to 
query on a specific neo4j label. Let me show you an example:

//return all nodes/vertices with label LabelName

Neo4j query:

MATCH (n:LabelName) RETURN n

Corresponding query in OrientDB:

SELECT * FROM V WHERE Neo4jLabelList CONTAINS 'LabelName'

or using our MATCH syntax:

MATCH {class: V, as: n, where: (Neo4jLabelList CONTAINS 'LabelName')} 
RETURN n

Once the import has been completed (with version 2.2.14), surely you can 
bulk change the classes of records. I was planning to document this into an 
article, that I still have on draft - thanks for your patience. I'll try to 
explain how to do this briefly below:

- first you'll need to create the classes where you want to move the 
records. When creating them, please keep in mind the following:
-- It will be important that in your new classes you'll define a few 
properties: Neo4jNodeID, with a unique index (in case you'll want to query 
by original neo4j id) and Neo4jLabelList of type Embedded list string, with 
a not unique index on it (in case you want to query by original neo4j label)

- to bulk change the class, please use the MOVE VERTEX syntax 
(http://orientdb.com/docs/2.2/SQL-Move-Vertex.html)

How to use the Move vertex syntax? you can select all vertices that have a 
specific neo4j label, and then move them to your new class, e.g.

MOVE VERTEX (SELECT FROM MultipleLabelNeo4jConversion WHERE Neo4jLabelList 
CONTAINS 'Your Neo4j Label here' TO CLASS:YourNewClassHere

Note that I am planning to automate the creation of these classes (one of 
each original neo4j label) so that you'll just need to use the move vertex 
syntax (without the need to create the classes, the properties and the 
indices first). I'm thinking to use an option for this. We are doing our 
best to improve the experience of our users

About 3 - that's a good question. Sure, we have this in our roadmap 
already. It will take some time to implement this, but I believe that 
importing into a single class + moving vertices (using a where condition on 
the original neo4j label) is a good temporary workaround. What's your 
opinion?

Note that we have improved a few things in 2.2.14 (the list of improvements 
is 
here: 
https://github.com/orientechnologies/orientdb-neo4j-importer/issues?q=is%3Aissue+is%3Aclosed)
 
so my suggestion is to wait a few more days and give v. 2.2.14 a try

Hope the information above helps. I'll be glad to help with any issues 
you'll find. If you can somehow share the database, I can test the import 
myself, and see what can be done to optimize it, if needed

Thanks,

On Monday, 19 December 2016 20:13:12 UTC+1, Gregory Mace wrote:
>
>
> I've imported several millions of records from Neo4j.  They all came over, 
> but the class type is not what I wanted them to be. I have some questions:
>
> 1. can orientdb represent Vertexes similar to Neo4j in terms of supporting 
> multiple Labels on a Vertex.  If so, how?
> 2. how can I bulk change the classes of records ( Vertexes ) that I 
> imported from Neo4j?
> 3. Is there a way to pre-define how I want an import to assign classes?
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to orient-database+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to