CompanyMarch 21, 2017

Getting the Hang of Using the DataStax Graph Loader: The Basics

Marc Selwan
Marc Selwan
Getting the Hang of Using the DataStax Graph Loader: The Basics
load(pokemonFile).asVertices {
}
load(pokemonFile).asVertices {
label "pokemon"
key "pokemon_id"
}
load(pokemonevolutionEdgeFile).asEdges {
}
load(pokemonevolutionEdgeFile).asEdges {
    label "evolves_to"
}
load(pokemonevolutionEdgeFile).asEdges {
    label "evolves_to"
    outV "from_id", {
        label "pokemon"
        key "pokemon_id"
    }
    inV "to_id", {
        label "pokemon"
        key "pokemon_id"
    }
}
inputfileV = '/path/to/data/vertices/'
inputfileE = '/path/to/data/edges/'
pokemonFile = File.csv(inputfileV + "pokemon.csv").delimiter(',')
pokemonevolutionEdgeFile = File.csv(inputfileE + "pokemon_evolves_to.csv").delimiter(',')
.header('header1', 'header2', ...)
./graphloader /path/to/poke_mapper.groovy -graph <graph name> -address <ip to DSE> -dryrun=true
./graphloader /path/to/poke_mapper.groovy -graph <graph name> -address <ip to DSE>
Share

One-stop Data API for Production GenAI

Astra DB gives JavaScript developers a complete data API and out-of-the-box integrations that make it easier to build production RAG apps with high relevancy and low latency.