-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interpret function output as an iri #140
Comments
Thanks for the issue! Do you have a full example? |
diff --git a/node_modules/@rmlio/yarrrml-parser/test/function-emit-iri/data.txt b/node_modules/@rmlio/yarrrml-parser/test/function-emit-iri/data.txt
new file mode 100644
index 0000000..567d50e
--- /dev/null
+++ b/node_modules/@rmlio/yarrrml-parser/test/function-emit-iri/data.txt
@@ -0,0 +1,2 @@
+id;name
+SKOS:PREFLABEL;john
diff --git a/node_modules/@rmlio/yarrrml-parser/test/function-emit-iri/mapping.yaml b/node_modules/@rmlio/yarrrml-parser/test/function-emit-iri/mapping.yaml
new file mode 100644
index 0000000..bc473e2
--- /dev/null
+++ b/node_modules/@rmlio/yarrrml-parser/test/function-emit-iri/mapping.yaml
@@ -0,0 +1,18 @@
+prefixes:
+ ex: "http://example.com/"
+ grel: http://users.ugent.be/~bjdmeest/function/grel.ttl#
+
+mappings:
+ person:
+ sources:
+ - access: data.txt
+ referenceFormulation: csv
+ delimiter: ';'
+ s: http://example.com/$(id)
+ po:
+ - p: schema:name
+ o:
+ - function: grel:toLowerCase(grel:valueParameter = $(id))
+ # @TODO: add a parameter to bind function output to `iri`
+ # type: iri
+ # datatype: iri
|
I just get a little more on that :
- [schema:name, skos:prefLabel~iri] |
I see what you want to achieve. However, this is not possible out of the box, because replacing the prefixes happens during the conversion from YARRRML to RML and at that point is the value of toLowerCase function is not known yet. But it's possible to define custom function that replicates this behavior. Would this work for you? |
Any news on this? Would be great if you could specify |
@MadsHolten We didn't get a response from @florent-andre to my last message. Would the solution I propose with a custom function work for you? |
How would this work exactly? a custom function that turns a string into a URI and can be nested with the function that generates the string? For now, I do a post-processing that detects objects that are IRIs and convert from |
@MadsHolten Is your issue with the result of the function that has to be seen as an IRI or is is with the expansion of prefixes? |
I would like to be able to return an IRI from my function |
Ok, in that case can you create a separate issue with an minimum example so that we can have a look? Thanks! |
Hy there,
Thanks for the good parser here and documentation !
Seeing this
rdf:Property~iri
.I would like to interpret a function output as a well formed
iri
string (ex:hrdf:IdentifierType
).I don't catch the good syntax.
Here is my example function and "commented tries" :
The text was updated successfully, but these errors were encountered: