Skip to content

Gradoop Data Importers

Philip Fritzsche edited this page Jan 15, 2019 · 2 revisions

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).


MinimalJSONImporter

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.

MinimalJSONImporter example

Paths to files can point to local (file://) or distributed (hdfs://) files.

DataSource importer = new MinimalJSONImporter("/path/to/jsonfile");

Clone this wiki locally