Wiki

Clone wiki

neo4j-databridge / 3.2 Adapters

3.2 Adapters

The job of an adapter is to load the data from a specific data source as defined by the resource descriptor and present it as a sequence of abstract rows of data to the importer.


Available adapters

Databridge comes with a predefined set of adapters for many data formats. Currently supported formats are:

  • CSV data
  • JSON data
  • Excel data
  • JDBC datasources
  • GPX data (GPS eXchange format)
  • ITN data (TomTom itineraries)
  • CIF data (Routing and Timetabling format)

Under development...

The following adapters are under development, and will be available shortly.

  • XML data

Declaring an explicit adapter

In most cases you never need to worry about which adapter to use, because the importer will automatically select the correct one based on the name of the resource in the resource descriptor. However in some cases it might not be possible for the importer to correctly detect a supported data format from the name of the resource. For example, you may have GPX data in a file called "waypoints.txt". Databridge checks file extensions and URI schemes to select an adapter, but if it cannot identify one, it will fall back to using the CSV Adapter by default. To solve this problem, you can either rename "waypoints.txt" to "waypoints.gpx", or explicitly tell the importer to use the GPX Adapter in the appropriate resource descriptor:

#!json
{
   "resource" : "waypoints.txt",
   "adapter"  : "com.graphaware.neo4j.databridge.adapters.gpx.GpxAdapter"
}

Updated