Open florent-andre opened 2 years ago
Hi @florent-andre
Thanks for the issue! Do you have a full example?
test/function-emit-iri
folder (.yaml & .data files)patch-package
file: patches/@rmlio+yarrrml-parser+1.3.2.patch
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:
+mappings:
iri
I just get a little more on that :
full url
string this ok (example: http://www.w3.org/2004/02/skos/core#prefLabel
)namespaced
string this bug (example skos:prefLabel
) whereas "static string rule" works:
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 type: iri
for function outputs!
@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 key: "iri"
to key: {"@id": "iri"}
, but this is also quite annoying since there might be cases where the object is an IRI that should not be converted.
@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 formediri
string (ex:hrdf:IdentifierType
). I don't catch the good syntax.Here is my example function and "commented tries" :