- graph = grakn.Client(uri='http://localhost:4567', keyspace=keyspace)
- some_results = graph.execute('some query; get $x;')
- for some_result in some_results:
- print(some_result['x']['value'])
+ client = grakn.Grakn(uri='localhost:48555')
+ with client.session(keyspace=keyspace).transaction(grakn.TxType.READ) as graph:
+ some_results = [some_result.map() for some_result in graph.query('some query; get $x')]
+ for some_result in some_results:
+ print(some_result['x'].value())
Using map() preserved the syntax of using variable names as keys; however, you could also collect_concepts(), particularly for queries of only one variable.
This PR doesn't make any functional changes, except for CWE-120, where I changed has func-name contains {} to has func-name {}, which fixes the bug where getsomething() is treated the same as gets(). The same probably needs to be done for other queries, but I will make those changes in a separate PR once I get the horsepower to test the challenge binaries.
Fixes #3
My suggested changes for this PR and the Dockerize PR are at https://github.com/devtty1er/PaperMachete.wiki.git (the links won't work, because they point to the upstream wiki).
Most of the changes were:
Using
map()
preserved the syntax of using variable names as keys; however, you could alsocollect_concepts()
, particularly for queries of only one variable.This PR doesn't make any functional changes, except for CWE-120, where I changed
has func-name contains {}
tohas func-name {}
, which fixes the bug wheregetsomething()
is treated the same asgets()
. The same probably needs to be done for other queries, but I will make those changes in a separate PR once I get the horsepower to test the challenge binaries.