zazuko / data-cube-curation

MIT License
1 stars 0 forks source link

Add attribute from string template #13

Open tpluscode opened 5 years ago

tpluscode commented 5 years ago

Description

Similar to #12 but instead of selecting a column it should be possible to provide a template string, from which the column names will be extracted.

Create attribute from template

Properties

Required:

Optional:

Requirements:

Example resulting triples

<target/observation> 
  dataCube:attribute <target/observation/attribute/1> .

<target/observation/attribute/1>
  dataCube:template "{Salutation} {first} {last}"^^dataCube:iriTemplate ;
  dataCube:column # implicit, extracted from template
    <source/column/salutation> ,
    <source/column/first> ,
    <source/column/last> ; 
  rdf:predicate rdfs:label ;
  rdf:type ex:fullName .
bergos commented 5 years ago

The CSV on the Web spec doesn't cover this. Maybe it could be implemented by forcing the value term to be a literal if a datatype is given. That means to have a definition for a column that contains a valueUrl which will become a literal.

tpluscode commented 5 years ago

Does not cover what exactly?

bergos commented 5 years ago

Using an IRI Template to generate literal objects, it's only possible to create named node objects. For our use case it only makes sense to use IRI Templates for the subjects and objects pointing to dimension tables.

tpluscode commented 5 years ago

Ah, that's a bummer for CSVW.

On the other hand the mapping must not be tied to just CSV on the Web. With an output of R2RML, such mapping could be supported.

For the CSVW writer there will have to be a restriction that only URLs can be mapped from multiple columns using a template.