Giter Club home page Giter Club logo

Comments (4)

arenas-guerrero-julian avatar arenas-guerrero-julian commented on June 16, 2024 1

Maybe this corner case is a limitation of RML-FNML, since the current specification does not consider it. I am not sure if what you are trying to achieve is feasible, but function execution is handled here and probably the parser would need to be modified aswell.

In the workaround that I mentioned, you could provide your list in Python style as input, for instance [1, 2] or ['one', 'two'] and cast the list at the beginning of the function input_parm = list(input_parm).

from morph-kgc.

arenas-guerrero-julian avatar arenas-guerrero-julian commented on June 16, 2024

Hi @KappaGi ,

I am not sure if I understood well since you are missing a complete example with the full mapping, data and udf. I think what you are trying to do is not possible. You could maybe try:

<#Execution>
    fnml:function ex:myFunction;
    fnml:input
    [
      fnml:parameter grel:param;
      fnml:valueMap [
        rml:reference "column_1";
      ]
    ];
    fnml:input
    [
      fnml:parameter grel:myParameter;
      fnml:value "ex:value_1 ex:value_2";
    ];
.

And manage the multiple values of the parameter within the udf. This is, you can provide the multiple parameters as a character-separated literal (e.g., comma or a whitespace), that in the udf (by splitting...).

from morph-kgc.

KappaGi avatar KappaGi commented on June 16, 2024

Hello @arenas-guerrero-julian,

Thank you for your answer. I want to have several fnml:values for grel:myParameter in my mappings so that in my udf in python I can manage those values as a python list. It works if I use a single rdf resource or a single rdf literal as fnml:value, but It seems that I can't use several rdf resources (nor literals) in the mappings for this purpose.

So the only current solution to have a list of values for a single parameter in python udf is to provide several values in a single literal (i.e. using a delimeter) in the mappings and do the required post-processing in the udf.

from morph-kgc.

KappaGi avatar KappaGi commented on June 16, 2024

@arenas-guerrero-julian

Would it be possible to modify the way udf's are defined to accept several rdf resources for a a single parameter? Could you please refer to any piece of code that I can modify to such purpose?

Thanks for the support

from morph-kgc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.