CSC790 HW1 Encoding and traversing (through Python) the Neo4J network a directed ascyclic graph (DAG) as shown below: In this
please look into the uploaded homework document and Please include the Cypher statements that you use to upload the CSV file into the Neo4j Desktop. Ând Place them at the top of your Python file and comment them out. Please download the MS Word file which contains the Homework instructions
CSC790_HW1
Encoding and traversing (through Python) the Neo4J network – a directed ascyclic graph (DAG) as shown below:
In this DAG, the definitions of the arrows (from parent to child) called relationships
· The black circle is a relationship called Mandatory
· The white circle is a relationship called Optional
· The white triangle grouping couple of children is a relationship called alternative (only one)
· The black triangle grouping couple of children is a relationship called OR (one to many)
· Consider the requires relationship as parent-child. Ex: Polygonize is the parent of OGR and the relationship between them is called Requires
Example: for parent-child relationships:
· RasterVectorProcessing node is the parent of the library child and the relationship between them is called Mandatory
· The library node is the parent of children: GDAL (the relationship here is Mandatory) and OGR (the relationship here is Optional)
· The ReadingAlgorithm node is the parent of two children. The relationship between it and the two children (CustomBlock) and NativeBlock) is called OR
· The Polygonize node is the parent of four children. The relationship between it and the four children (DeleteEmptyPolygons), (Dissolve), (AreaCalc) and (AddFields) is called Alternative
And so on ….
Create a CSV which contain 3 columns. The first is the parent node, the second is the child node, and the third one is the relationship type (property of the relationship). You can name the property type of a relationship as you want (ex. rType) with the value like Optional, Mandatory and so on following the graph. The nodes have a property called name so that the names of the nodes are displayed inside them and shown in the graph.
Example of how to create the CSV file:
Parent |
Child |
Relationship |
root |
RasterVectorProcessing |
Mandatory |
Library |
GDAL |
Mandatory |
Polygonize |
OGR |
Requires |
Polygonize |
AddFields |
Alternative |
Polygonize |
Dissolve |
Alternative |
ReadingAlgorithm |
NativeBlock |
OR |
ReadingAlgorithm |
CustomBlock |
OR |
OutputFormat |
PNG |
Optional |
And so on ….
Load the CSV file into Neo4j Desktop by doing research on how to import a CSV to the program.
Hint: don’t use the CREATE statement in Cypher since it will create duplicates nodes that have the same name. Use MERGE statement instead. The Cypher code in Neo4J Desktop command line to create this DAG consists of only 4 statements.
Use Python to traverse the DAG you created through the CSV file and return only the parents even if there are duplicates names.
Submit the CSV file your created along with the Python file.
Don’t copy your code from another student, otherwise it will be considered as plagiarism.
Collepals.com Plagiarism Free Papers
Are you looking for custom essay writing service or even dissertation writing services? Just request for our write my paper service, and we'll match you with the best essay writer in your subject! With an exceptional team of professional academic experts in a wide range of subjects, we can guarantee you an unrivaled quality of custom-written papers.
Get ZERO PLAGIARISM, HUMAN WRITTEN ESSAYS
Why Hire Collepals.com writers to do your paper?
Quality- We are experienced and have access to ample research materials.
We write plagiarism Free Content
Confidential- We never share or sell your personal information to third parties.
Support-Chat with us today! We are always waiting to answer all your questions.