-
Notifications
You must be signed in to change notification settings - Fork 88
Gradoop Data Importers
Data Importers can be used to create simple graphs from common data formats.
Data Importers are unlike Data Sources as the format does not have to be Gradoop-specific,
but they can be used like a data source (without a matching data sink).
The minimal JSON importer can be used to turn text files where every line is a JSON object into a graph.
A vertex will be created for every JSON object, the properties of the object will be added as properties to the new vertex. Every property is parsed as a string. The label of the vertex will be the same for every vertex.
For example the JSON object
{"Name": "Max", "Age": 28, "Address": {"Street": "Main Street", "City": "SomeCity", "ZIPCode": 12345}}will be turned into a vertex with label JsonRowVertex and properties Name, Age and Address set to "Max", "28" and "{\"Street\":\"Main Street\",\"City\":\"SomeCity\",\"ZIPCode\":12345}}" respectively.
Array-type properties are supported, but every element of an array is assumed to be a string.
Paths to files can point to local (file://) or distributed (hdfs://) files.
DataSource importer = new MinimalJSONImporter("/path/to/jsonfile");