Skip to content

Commit 9b9decb

Browse files
committed
Fixed issue with FNML function
1 parent 5ddb2fd commit 9b9decb

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
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.8
87+
4.7.5.12.9
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.8
1+
4.7.5.12.9

rdfizer/rdfizer/fnml_functions.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"escape":"","schema":"","string_replace":"",
2020
"parseURL":"","random":"","length":"","string_substring":"",
2121
"array_join":"","controls_if":"","string_md5":"","string_contains":"",
22-
"string_replace":"","slugify":"","trueCondition":"","isNull":"",
22+
"slugify":"","trueCondition":"","isNull":"",
2323
"notEqual":"","equal":"","normalizeDateTime":"","normalizeDate":"",
2424
"listContainsElement":""}
2525

@@ -86,9 +86,15 @@ def string_md5():
8686

8787
def controls_if():
8888
if bool(global_dic["bool_b"]):
89-
return str(global_dic["any_true"])
89+
if "any_true" in global_dic:
90+
return str(global_dic["any_true"])
91+
else:
92+
return None
9093
else:
91-
return str(global_dic["any_false"])
94+
if "any_false" in global_dic:
95+
return str(global_dic["any_false"])
96+
else:
97+
return None
9298

9399
def array_join():
94100
output = ""
@@ -116,8 +122,8 @@ def toUpperCase():
116122
def helloworld():
117123
return "Hello World!"
118124

119-
def string_replace():
120-
return global_dic["valueParam"].replace(global_dic["param_find"],global_dic["param_replace"])
125+
#def string_replace():
126+
# return global_dic["valueParam"].replace(global_dic["param_find"],global_dic["param_replace"])
121127

122128
def parseURL():
123129
parsed = {}
@@ -257,7 +263,7 @@ def execution_dic(row,header,dic):
257263
output[param] = string_substitution(dic["inputs"][inputs]["value"], "{(.+?)}", row, "subject", "yes", "None")
258264
else:
259265
output[param] = string_substitution_array(dic["inputs"][inputs]["value"], "{(.+?)}", row, header, "subject", "yes")
260-
if output[param] == None:
266+
if output[param] == None and "controls_if" not in dic["function"]:
261267
return None
262268
else:
263269
output[param] = dic["inputs"][inputs]["value"]

0 commit comments

Comments
 (0)