I need to make a mapping that involve one simple table, however my predicate needs to be dynamic based on the values coming from one column.
This is my query:
SELECT
item_id,
Concat_WS('@', metadatavalue.text_value, cast(metadatavalue.text_lang as text)) AS textValue,
(CASE metadata_field_id
WHEN '3' THEN 'creator'
WHEN '79' THEN 'docnumber'
END) AS Field
FROM
metadatavalue
ORDER BY
item_id, Field, textValue;
The values from field returns the predicate to use.
I want to produce triple of the form
<pub:1234> dc:creator “jean francois”@en
<pub:1234> dc:docnumber 1345
<pub:1234> dc:subject “poverty”@en
So basically all my predicate are in the column metadata_field_id the values are the identifier of the predicate.
I am not sure but it seems like R2RML is supposed to support that.
Yes, you can do that in R2RML.
There are two ways:
1) Use an
rr:template
as the predicate.2) Use an
rr:column
as the predicate. In this case, create the actual URI in the SQL query: