Open SvenLieber opened 3 years ago
For completeness: in my particular case I found a workaround.
In case the string which needs to be included is not embedded in variable content, a combination of concatenation
and grel:string_contains
can be used with a single function call. For example:
s: ex:myMessage_$(status.id_str)
condition:
function: grel:string_contains
parameters:
- [grel:valueParameter, "$(warc-header.warc-type)_$(warc-header.warc-target-uri)"]
- [grel:string_sub, "response_https://api.twitter.com/1.1/statuses/show.json"]
In this case the string would be something like this: https://api.twitter.com/1.1/statuses/show.json?user_id=1
, where the variable parts (user_id
) is after the static part and thus the concatenation works.
Similarly this workaround would work for something like user_id=1,static-part-ending-in-show
with a reversed concatenation, but not for user_id=1,show,other_id=2
with variable content "on both sides".
Are there any news on this issue? I have a similar one trying to chain trueCondition
, array_join
, grel:boolean_and
and grel:boolean_not
rr:predicateObjectMap [ rr:predicate fno:executes; rr:objectMap [ rr:constant idlab:trueCondition ]; ];
rr:predicateObjectMap [ rr:predicate idlab:str; rr:objectMap [ fnml:functionValue [ rr:predicateObjectMap [ rr:predicate fno:executes; rr:objectMap [ rr:constant grel:array_join ]; ];
rr:predicateObjectMap [ rr:predicate grel:p_array_a; rr:objectMap [ rr:constant "mailto:" ]; ];
rr:predicateObjectMap [ rr:predicate grel:p_array_a; rr:objectMap [ rml:reference "address" ]; ]; ]; ]; ];
rr:predicateObjectMap [ rr:predicate idlab:strBoolean; rr:objectMap [ fnml:functionValue [ rr:predicateObjectMap [ rr:predicate fno:executes; rr:objectMap [ rr:constant grel:boolean_and ]; ];
rr:predicateObjectMap [ rr:predicateMap [ rr:constant grel:param_rep_b ] ;
rr:objectMap [ fnml:functionValue [ rr:predicateObjectMap [ rr:predicate fno:executes; rr:objectMap [ rr:constant grel:boolean_not ]; ];
rr:predicateObjectMap [ rr:predicate grel:bool_b; rr:objectMap [ rr:constant true ];];];];];
Hi,
in one of my mappings I have a boolean conjunction as condition: a subject should only be created if the field
warc-header.warc-type
has the string valueresponse
and if the string of the fieldwarc-header.warc-target-uri
contains the substringshow
.However, I get a
java.lang.ClassCastException
as shown belong when using the results of the functiongrel:string_contains
ingrel:boolean_and
. Attached are a minimal example in both YARRRML and RML as well as example data. I used the RMLMapper in version4.9.1
and the YARRRML-parser in version1.1.1
Error message
YARRRML mapping rules
RML mapping rules
test data
failing-message.json