-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6000bbb
commit 9fdeb79
Showing
4 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
"_id","_labels","a","b","prop","did_it","_start","_end","_type" | ||
"0",":Dog","3","[""1"", ""2"", 3]","2","","","","" | ||
"1",":Human","","[[""1"",{""key"": 5}]]","","yes","","","" | ||
"5",":Cat","","{""prop"": {""prop2"": {""key"": 10}}}","","","0","1","loves" |
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
query: > | ||
LOAD CSV FROM "/_file1" WITH header AS row | ||
RETURN convert.str2object(row.b) AS list; | ||
output: | ||
- list: [ "1","2", 3] | ||
- list: [["1",{"key": 5}]] | ||
- list: {"prop": {"prop2": {"key": 10}}} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import mgp | ||
from json import loads | ||
|
||
|
||
@mgp.function | ||
def str2object(string: str) -> mgp.Any: | ||
if string: | ||
return loads(string) | ||
return None |