Skip to content

Instantly share code, notes, and snippets.

@bmcgavin
Created August 21, 2015 12:05
Show Gist options
  • Save bmcgavin/177b549a68c7e38e6626 to your computer and use it in GitHub Desktop.
Save bmcgavin/177b549a68c7e38e6626 to your computer and use it in GitHub Desktop.
{
"config": {
"log": "info"
},
"source" :{
"file": {"path":"/home/vagrant/duplicate_indexed_edge.json"}
},
"extractor" : {
"json": {}
},
"transformers": [
{ "merge": {"joinFieldName": "articleId", "lookup": "Article.articleId" } },
{"vertex": {"class":"Article"}},
{"edge": {
"class": "Link",
"joinFieldName": "linkedArticles",
"lookup": "Article.articleId",
"direction": "out",
"unresolvedVertexAction": "CREATE",
"unresolvedLinkAction": "CREATE",
"skipDuplicates": true
}},
{"field": {"fieldName": "linkedArticles", "operation":"remove"}},
],
"loader": {
"orientdb": {
"dbURL": "plocal:/data/orientdb_databases/duplicateIndexedEdge",
"dbUser":"admin",
"dbPassword":"admin",
"dbAutoDropIfExists": false,
"dbAutoCreate": false,
"standardElementConstraints": true,
"tx": true,
"wal": false,
"batchCommit": 1000,
"dbType": "graph",
"classes": [
{"name":"Article", "extends":"V"},
{"name":"Link","extends":"E"}
],
"indexes": [
{"class":"Article", "fields":["articleId:string"],"type":"UNIQUE_HASH_INDEX"},
{"class":"Link", "fields":["in:LINK","out:LINK"],"type":"UNIQUE_HASH_INDEX","metadata":{mergeKeys:true}}
]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment