Skip to content

Commit 4c3eb99

Browse files
committed
Fixed issue with repeated parameters
1 parent 760dc72 commit 4c3eb99

File tree

4 files changed

+36
-2
lines changed

4 files changed

+36
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ You can easily customize your own configurations from the set of features that S
8484

8585
## Version
8686
```
87-
4.7.5.12.4
87+
4.7.5.12.5
8888
```
8989

9090
## RML-Test Cases

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.7.5.12.4
1+
4.7.5.12.5

rdfizer/rdfizer/__init__.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2757,6 +2757,23 @@ def mapping_parser(mapping_file):
27572757
else:
27582758
if func_map.name == "To be named":
27592759
func_map.name = str(result_triples_map.param_constant)
2760+
for elem in func_map.parameters:
2761+
if isinstance(func_map.parameters[elem],list):
2762+
unique = []
2763+
for sub_elem in func_map.parameters[elem]:
2764+
if sub_elem not in unique:
2765+
unique.append(sub_elem)
2766+
if len(unique) == 1:
2767+
func_map.parameters[elem] = unique[0]
2768+
else:
2769+
func_map.parameters[elem] = unique
2770+
2771+
2772+
#for func in func_map_list:
2773+
# print(func.func_map_id)
2774+
# print(func.name)
2775+
# print(func.parameters)
2776+
27602777
remove_triples_maps = []
27612778
mapping_query_results = mapping_graph.query(mapping_query)
27622779
for result_triples_map in mapping_query_results:

rdfizer/rdfizer/semantify.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2757,6 +2757,23 @@ def mapping_parser(mapping_file):
27572757
else:
27582758
if func_map.name == "To be named":
27592759
func_map.name = str(result_triples_map.param_constant)
2760+
for elem in func_map.parameters:
2761+
if isinstance(func_map.parameters[elem],list):
2762+
unique = []
2763+
for sub_elem in func_map.parameters[elem]:
2764+
if sub_elem not in unique:
2765+
unique.append(sub_elem)
2766+
if len(unique) == 1:
2767+
func_map.parameters[elem] = unique[0]
2768+
else:
2769+
func_map.parameters[elem] = unique
2770+
2771+
2772+
#for func in func_map_list:
2773+
# print(func.func_map_id)
2774+
# print(func.name)
2775+
# print(func.parameters)
2776+
27602777
remove_triples_maps = []
27612778
mapping_query_results = mapping_graph.query(mapping_query)
27622779
for result_triples_map in mapping_query_results:

0 commit comments

Comments
 (0)