How to achieve Implementation-Independence of RML Functions? #39
Replies: 3 comments 8 replies
-
@tobiasschweizer I'm going to move this to the forum, as it's more a discussion than an issue for the FNML spec. Hope that it will be fine for you. |
Beta Was this translation helpful? Give feedback.
-
FnO with RML + FNML exposes the function in an abstract way without depending on the implementation in terms of mapping rules. However, the engine still have to support of course the function in its implementation.
There's a Function Hub of FnO which allows to find respectively implementations in programming languages of a given function: https://fno.io/hub/ It is not a standard library, but gives you an overview where you could find a certain function. CC: @bjdmeest since he knows this stuff much better in detail. |
Beta Was this translation helpful? Give feedback.
-
I have been thinking about the ways functions are called in RML. Would it be feasible to call a function from within an So rr:predicateObjectMap [
rr:predicate schema:keywords ;
rr:objectMap [
a fnml:FunctionMap ;
fnml:functionValue [
rml:logicalSource <#LogicalSourceGrant> ;
rr:subjectMap [
rr:template "functionExec";
rr:termType rr:BlankNode ;
rr:class fno:Execution
] ;
rr:predicateObjectMap [
rr:predicate fno:executes ;
rr:objectMap [
rr:constant ex:splitFunction ;
]
],
[
rr:predicate ex:strParameterA ;
rr:objectMap [ rml:reference "Keywords" ]
]
] ;
rr:datatype xsd:string ;
]
] ; could become something like rr:predicateObjectMap [
rr:predicate schema:keywords ;
rr:objectMap [
rr:template "{Keywords.split().trim()}" ;
rr:datatype xsd:string
] ; Leaving the problem of how to bind specific implementations to definitions aside for a moment, I think including function calls in templates would greatly enhance readability, especially when it comes to method chaining. I am not sure though what this would mean regarding the R2RML specs (compatibility). |
Beta Was this translation helpful? Give feedback.
-
Hi there,
Last summer I started using RML for the generation of RDF. Since the beginning, I have been using RMLMapper and CARML in parallel because I think any given mapping should be processable by either of the two engines.
Now I've started looking at using RML functions. So far, I could handle quite a lot of issues with preprocessing, but as you write, this inhibits reuse. Also it weakens the declarative approach because the preprocessing is most likely procedural.
I understand that FnO aims at describing functions formally without being bound to a specific implementation. I guess this is inspired by a functional programming paradigm.
I understand that it is not the goal to a have a standard library interface (maybe something like the JSON-LD processor interface) that would have to be implemented by every engine but something more flexible.
But how would this work in practice?
Would I implement a function in Java and then register it in RMLmapper and CARML, respectively? What about RML engines that are not implemented with JVM technologies?
Thanks for your feedback!
Tobias
Beta Was this translation helpful? Give feedback.
All reactions