Skip to content

Commit

Permalink
Fixed issue with missing keys in JSONPath
Browse files Browse the repository at this point in the history
  • Loading branch information
eiglesias34 committed Dec 1, 2022
1 parent 6fec6b9 commit 2e4316e
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ You can easily customize your own configurations from the set of features that S

## Version
```
4.6.4
4.6.4.1
```

## RML-Test Cases
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.6.4
4.6.4.1
15 changes: 12 additions & 3 deletions rdfizer/rdfizer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1460,13 +1460,22 @@ def semantify_json(triples_map, triples_map_list, delimiter, output_file_descrip
new_iterator += tp + "."
if "$" != tp and "" != tp:
if "[*][*]" in tp:
row = row[tp.split("[*][*]")[0]]
if tp.split("[*][*]")[0] in row:
row = row[tp.split("[*][*]")[0]]
else:
row = []
elif "[*]" in tp:
row = row[tp.split("[*]")[0]]
if tp.split("[*]")[0] in row:
row = row[tp.split("[*]")[0]]
else:
row = []
elif "*" == tp:
pass
else:
row = row[tp]
if tp in row:
row = row[tp]
else:
row = []
if new_iterator != ".":
if "*" == new_iterator[-2]:
for sub_row in row:
Expand Down
15 changes: 12 additions & 3 deletions rdfizer/rdfizer/semantify.py
Original file line number Diff line number Diff line change
Expand Up @@ -1460,13 +1460,22 @@ def semantify_json(triples_map, triples_map_list, delimiter, output_file_descrip
new_iterator += tp + "."
if "$" != tp and "" != tp:
if "[*][*]" in tp:
row = row[tp.split("[*][*]")[0]]
if tp.split("[*][*]")[0] in row:
row = row[tp.split("[*][*]")[0]]
else:
row = []
elif "[*]" in tp:
row = row[tp.split("[*]")[0]]
if tp.split("[*]")[0] in row:
row = row[tp.split("[*]")[0]]
else:
row = []
elif "*" == tp:
pass
else:
row = row[tp]
if tp in row:
row = row[tp]
else:
row = []
if new_iterator != ".":
if "*" == new_iterator[-2]:
for sub_row in row:
Expand Down

0 comments on commit 2e4316e

Please sign in to comment.