Created
September 14, 2018 10:45
-
-
Save sorsaffari/b57395a4cae644439ac5d0e573d0e49b to your computer and use it in GitHub Desktop.
Phone Calls | Loading Data: construct insert query, execute and commit
This file contains 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
async function loadDataIntoGrakn(input, session) { | |
const items = await parseDataToObjects(input); | |
for (item of items) { | |
const tx = await session.transaction(Grakn.txType.WRITE); | |
const graqlInsertQuery = input.template(item); | |
await tx.query(graqlInsertQuery); | |
await tx.commit(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment