RMLio / rmlmapper-java

The RMLMapper executes RML rules to generate high quality Linked Data from multiple originally (semi-)structured data sources
http://rml.io
MIT License
146 stars 61 forks source link

error raised during implementing grel:array_sum #160

Closed jiaoxlong closed 2 years ago

jiaoxlong commented 2 years ago
  rr:predicateObjectMap [
      rr:predicate mv:totalCapacity;
      rr:objectMap [
        fnml:functionValue [
             rr:predicateObjectMap [
                 rr:predicate fno:executes ;
                 rr:objectMap [ rr:constant grel:array_sum ; ]
             ];
             rr:predicateObjectMap [
                 rr:predicate grel:p_array_a ;
                 rr:objectMap [ rml:reference "bikes_in_use" ; ]
             ];
             rr:predicateObjectMap [
                 rr:predicate grel:p_array_a ;
                 rr:objectMap [ rml:reference "bikes_available"; ]
             ];
          ];
      ] ;
  ].
 [main] DEBUG b.ugent.rml.functions.FunctionLoader.getFunction(90) - Loading function: <http://users.ugent.be/~bjdmeest/function/grel.ttl#array_sum>
[main] ERROR be.ugent.rml.cli.Main               .main(393) - No mapping was found for the function with IRI <http://users.ugent.be/~bjdmeest/function/grel.ttl#array_sum> 
in the function descriptions.

Let me know if you need sample input data to reproduce the error.

bjdmeest commented 2 years ago

This is actually a problem in the GREL functions implementation, an MR is on its way

jiaoxlong commented 2 years ago

@ghsnd provides me an ad-hoc rmlmapper jar with the merge of https://github.com/FnOio/grel-functions-java/pull/9. The no mapping error should have been solved, but now we encounter another error "14:12:19.347 [main] ERROR be.ugent.rml.cli.Main .main(392) - No suitable method 'sum' with matching parameter types found in class 'io.fno.grel.ArrayFunctions'.".

bjdmeest commented 2 years ago

Have you tried adding rr:termType xsd:integer to the object maps?

  rr:predicateObjectMap [
      rr:predicate mv:totalCapacity;
      rr:objectMap [
        fnml:functionValue [
             rr:predicateObjectMap [
                 rr:predicate fno:executes ;
                 rr:objectMap [ rr:constant grel:array_sum ; ]
             ];
             rr:predicateObjectMap [
                 rr:predicate grel:p_array_a ;
                 rr:objectMap [ rml:reference "bikes_in_use"; rr:datatype xsd:integer ]
             ];
             rr:predicateObjectMap [
                 rr:predicate grel:p_array_a ;
                 rr:objectMap [ rml:reference "bikes_available"; rr:datatype xsd:integer ]
             ];
          ];
      ] ;
  ].
jiaoxlong commented 2 years ago

By introducing rr:datatype xsd:integer or using the intermediate build rmlmapper-5.0.0-r366-all.jar, the error has been solved.