This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ai.grakn.examples; | |
import ai.grakn.GraknTxType; | |
import ai.grakn.Keyspace; | |
import ai.grakn.client.Grakn; | |
import ai.grakn.util.SimpleURI; | |
/** | |
* reads a JSON encoded value as a stream of tokens, | |
* @see <a href="https://google.github.io/gson/apidocs/com/google/gson/stream/JsonReader.html">JsonReader</a> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ai.grakn.examples; | |
import ai.grakn.GraknTxType; | |
import ai.grakn.Keyspace; | |
import ai.grakn.client.Grakn; | |
import ai.grakn.util.SimpleURI; | |
/** | |
* a collection of fast and reliable Java-based parsers for CSV, TSV and Fixed Width files | |
* @see <a href="https://www.univocity.com/pages/univocity_parsers_documentation">univocity</a> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// other imports | |
import javax.xml.stream.XMLInputFactory; | |
import javax.xml.stream.XMLStreamConstants; | |
import javax.xml.stream.XMLStreamException; | |
import javax.xml.stream.XMLStreamReader; | |
public class XmlMigration { | |
abstract static class Input { | |
String path; | |
String selector; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// imports | |
public class XmlMigration { | |
abstract static class Input { | |
String path; | |
String selector; | |
public Input(String path, String selector) { | |
this.path = path; | |
this.selector = selector; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// other imports | |
import com.google.gson.stream.JsonReader; | |
public class Migration { | |
abstract static class Input {...} | |
public static void main(String[] args) {...} | |
static void connectAndMigrate(Collection<Input> inputs) {...} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dependency> | |
<groupId>com.google.code.gson</groupId> | |
<artifactId>gson</artifactId> | |
<version>2.7</version> | |
</dependency> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// other imports | |
import com.univocity.parsers.csv.CsvParser; | |
import com.univocity.parsers.csv.CsvParserSettings; | |
public class Migration { | |
abstract static class Input {...} | |
public static void main(String[] args) {...} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// other imports | |
import java.io.InputStreamReader; | |
import java.io.Reader; | |
public class Migration { | |
abstract static class Input {...} | |
public static void main(String[] args) {...} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dependency> | |
<groupId>com.univocity</groupId> | |
<artifactId>univocity-parsers</artifactId> | |
<version>2.7.6</version> | |
</dependency> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// imports | |
public class Migration { | |
abstract static class Input {...} | |
public static void main(String[] args) { | |
Collection<Input> inputs = initialiseInputs(); | |
connectAndMigrate(inputs); | |
} |