w3c / csvw

Documents produced by the CSV on the Web Working Group
Other
162 stars 57 forks source link

What is the difference between {#reference} and {reference} URI template? #870

Closed jakubklimek closed 4 years ago

jakubklimek commented 4 years ago

In the Metadata Vocabulary for Tabular Data Example 11, there is a reference with a hash inside the curly braces {#_name}. I did not find what this syntax means and if/how it is different from {_name}?

The same syntax appears also here and here in Example 27 but nowhere else.

Is this an error?

gkellogg commented 4 years ago

These are defined by the URI Template spec (RFC6570), as they are URI Template Properties. In this case {#_name} uses Fragment Expansion, which sets the fragment of the URI by expanding the _name variable.

The propertyUrl property might be defined as "{#_name}", meaning that it resolves as a fragment identifier relative to the URL of the source of the table. For example, accessing it from a column with the column name GID would look like:

EXAMPLE 11: expanded propertyUrl using {#_name} "http://example.org/example.csv#GID"

The use of {_name} uses Simple String Expansion.

jakubklimek commented 4 years ago

I see, thanks for the explanation. I read through RFC6570 and it is clear now.