w3c / csvw

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

clarification for valueUrl of non-virtual column #875

Open VladimirAlexiev opened 3 years ago

VladimirAlexiev commented 3 years ago

https://w3c.github.io/csvw/primer/#example-60:

{
  "titles": "country",
  "name": "country",
  "valueUrl": "http://example.org/country/{country}",
  "propertyUrl": "schema:url"
}

Can I use another column in valueUrl, eg "http://example.org/country/{latitude}"? Can I use several columns as shown in https://w3c.github.io/csvw/primer/#example-63 for "virtual": true?

gkellogg commented 3 years ago

valueUrl is defined as a URI template property. The variables coming from [column names]() (e.g., latitude), _column, _sourceColumn, _row, _sourceRow, and _name. So, a valueUrl used within a column can reference any other columns in that table or multiple columns. The way these are interpreted is defined in URI-TEMPLATE.

VladimirAlexiev commented 3 years ago

Great explanation! To check my understanding, for this example {country} and {_name} will output the same, right?

Can you put this explanation at or around example-60? The primer currently doesn't refer to "uri template"