What I want to do
I want to process my DGraph data inside SPARK using GraphFrames/GraphX/etc.
What I did
pyspark --packages uk.co.gresearch.spark:spark-dgraph-connector_2.12:0.6.0-3.1,graphframes:graphframes:0.8.1-spark3.0-s_2.12
from gresearch.spark.dgraph.connector import *
triples: DataFrame = spark.read.dgraph.triples(“localhost:9080”)
edges: DataFrame = spark.read.dgraph.edges(“localhost:9080”)
nodes: DataFrame = spark.read.dgraph.nodes(“localhost:9080”)
triples.show()
±------±--------±--------±-----------±---------±-----------±--------------±------------±--------±-------------±---------+
|subject|predicate|objectUid|objectString|objectLong|objectDouble|objectTimestamp|objectBoolean|objectGeo|objectPassword|objectType|
±------±--------±--------±-----------±---------±-----------±--------------±------------±--------±-------------±---------+
±------±--------±--------±-----------±---------±-----------±--------------±------------±--------±-------------±---------+
edges.show()
±------±--------±--------+
|subject|predicate|objectUid|
±------±--------±--------+
±------±--------±--------+
nodes.show()
±------±--------±-----------±---------±-----------±--------------±------------±--------±-------------±---------+
|subject|predicate|objectString|objectLong|objectDouble|objectTimestamp|objectBoolean|objectGeo|objectPassword|objectType|
±------±--------±-----------±---------±-----------±--------------±------------±--------±-------------±---------+
±------±--------±-----------±---------±-----------±--------------±------------±--------±-------------±---------+
Please list the things you have tried.
I know my DGraph is up and working (and the connector would complain if not, or if it is given the wrong port). I’m not sure why it’s not showing me data in the Dataframe though!
Dgraph metadata
dgraph version
sudo docker run --rm -it -p “8080:8080” -p “9080:9080” -v ~/dgraph:/dgraph “dgraph/standalone:v21.03.1”