I have a large oracle database that I am importing as part of a GDPR cleanup , each table in oracle is a Label in neo4j with the fields of the table as properties in the Label.
I desire to join the Labels (one created in the db for each row) on keys (id to fk_id)
Using the bulk import function (so far so good with help on this board already given)
However, when its imported in (and its > 100 Label types) I'd like to be able to list all Paths from Parents to Children (DAG style)
In the 'Use the Import Tool' there are example files and if I run call db.schema() i get the three labels
Actor Movie and Sequel
Actor being the parent to the two other labels.
I would expect if I clicked text or table that I would get
Actor, ACTED_IN , Movie
and
Actor, ACTED_IN, Sequel
but I dont.
Considering that my db will have many more nodes joined in a long path and have paths of varying length
Can someone recommend me a process to print from the schema all possible paths in that meta graph?
(also, can I deselect Labels I dont want appearing in that call db.schema() ? )
As a starting query, you can do something like this:
MATCH p=(a:Something)-[r:*]->(b:SomethingElse)
RETURN p ORDER BY length(p)
This will return every path in the database that goes from a Something to a SomethingElse.
Be aware that this is a big request, you're probably requesting most of the contents of the database, if not all of them. So this could be a very large transaction which you might want to batch or otherwise constrain if you have a lot of data.
There will also be a lot of duplicate paths. If there is more than one way to go from a....b then you'll get both ways in this output. Additionally, if you have a graph that has, for example A -> B -> C -> D, then you'll get many paths output. First one A -> B, then A -> B -> C, then B -> C, then A -> B -> C -> D, and so on. This is why constraining the query with labels on the heads and tails, and also other criteria is important to prevent your results from blowing up.
I think I am super bad at explaining. No, I managed to import relationships. So the call to db.schema() works. And using the examples movie graph I can see three nodes connected by two 'acted in' relationships...
(which I can get if I run 'Match (n:Actor)-[r]->(s) Return * Limit 25')
But the call to db.schema does not show me this.......If I need to write out the paths myself, it negates the point, as thats what I want to find out. (the paths) ..
I would have expected similar when clicking text in db.schema or at least a text representation of the meta graph.