CLARIAH / wp4-requirements

Requirements for WP4 sprints
0 stars 0 forks source link

Jinja2 templates and Base URI #57

Closed RinkeHoekstra closed 7 years ago

RinkeHoekstra commented 7 years ago

See CLARIAH/wp4-converters#13

rlzijdeman commented 7 years ago

Hi @RinkeHoekstra could you please document the work around and close the issue?

rlzijdeman commented 7 years ago

Hi @RinkeHoekstra could you please let me know what the next action is on this issue?

RinkeHoekstra commented 7 years ago

I just closed CLARIAH/wp4-converters#13 with a workaround to use an xsd:anyURI datatype in combination with a value, rather than a valueUrl.

Documented at http://csvw-converter.readthedocs.io/en/latest/

rlzijdeman commented 7 years ago

Richard: add comment from Rinke to readme.

RinkeHoekstra commented 7 years ago

A valueUrl is part of the CSVW spec & JSON-LD which means the converter is 'too late' when it comes to intelligently substituting a namespace prefix or dealing with the base uri (the JSON-LD parser will already have expanded the value of valueUrl to a full URI).

The workaround consists of specifying the Jinja2 template in a value attribute (usually only used for literal values), but then specifying the datatype to be xsd:anyURI. This will make the converter generate a URI from exactly the string produced by applying the Jinja2 template to the value of the cell.