Closed jakubklimek closed 3 years ago
The reason these are defined as being relative to some other base URI is to invoke the URI/IRI resolution protocol defined in RFC3986. In this case, resolving an absolute IRI to a base IRI results in the original absolute IRI, so the spec does what you want.
This is spelled out in the Normalization section:
- If the property is a link property the value is turned into an absolute URL using the base URL and normalized as described in URL Normalization [tabular-data-model].
This description is common in specs that need to deal with relative URIs/IRIs.
Thanks for the explanation. After reading RFC6570 I realized that the {+ref}
syntax is actually defined by that RFC, even though it is not mentioned anywhere in the CSV on the Web spec, and it also explains the behavior, where with {ref}
, :
and /
are pct-encoded first, and therefore the result is treated as a relative URI, while with {+ref}
, those chars are not pct-encoded, and therefore the result is treated as an absolute URI.
My confusion came from just reading the CSV on the Web spec, and not knowing RFC6570.
With the current CSV on the Web specification, when I have a CSV column containing absolute URIs I want to use as resource URIs in the resulting RDF, there is no way for me to specify this. The
aboutUrl
,propertyUrl
andvalueUrl
are defined as relative to the table URL, when used with{reference}
. Therefore, my absolute URL from the input CSV is always appended to the URL of the table (and url-encoded).In RDF::Tabular there seems to be a proprietary extension for this using the
{+reference}
syntax. Could this be adopted to CSV on the Web?Sample CSV (in Czech):
Sample CSVW descriptor:
Expected output RDF (from RDF::Tabular):
Actual RDF output without
{+ref}
syntax: