-
Notifications
You must be signed in to change notification settings - Fork 36
conversion:domain_template
Tim L edited this page May 30, 2013
·
24 revisions
csv2rdf4lod-automation is licensed under the [Apache License, Version 2.0](/~https://github.com/timrdf/csv2rdf4lod-automation/wiki/License)
The conversion:domain_template enhancement overrides how the URI for each row's subject is created (or, for each cell's subject if converting with cell based subjects). For example, if the subject of each row is identified within one of the row's columns using something like a DOI:
"autor","id"
"David Tilman","doi:10.6073/AA/knb-lter-cdr.157002.122"
dataone-objects:thing_2
raw:author "David Tilman" ;
raw:id "doi:10.6073/AA/knb-lter-cdr.157002.122" ;
...
The following enhancement tells the converter to use the value from column 2 as the URI for the subject of the row.
conversion:enhance [
conversion:domain_template "[#2]";
];
conversion:enhance [
ov:csvCol 1;
conversion:equivalent_property dcterms:author;
];
conversion:enhance [
ov:csvCol 2;
conversion:equivalent_property dcterms:identifier;
conversion:range rdfs:Literal;
conversion:object_search [
conversion:regex "^doi:(.+)*$";
conversion:predicate prov:generalizationOf;
conversion:object "http://doi.org/[\\1]";
];
conversion:object_search [
conversion:regex "^doi:(.+)*$";
conversion:predicate bibo:doi,
dcterms:identifier;
conversion:object "[\\1]";
];
];
Which results in
<doi:10.6073/AA/knb-lter-cdr.157002.122>
dcterms:author "David Tilman";
dcterms:identifier "doi:10.6073/AA/knb-lter-cdr.157002.122";
dcterms:identifier "10.6073/AA/knb-lter-cdr.157002.122";
bibo:doi "10.6073/AA/knb-lter-cdr.157002.122";
prov:generalizationOf <http://doi.org/10.6073/AA/knb-lter-cdr.157002.122>;
.
DEPRECATED (but is still widely used) conversion:Enhancement because the naming is a bit of a misnomer. We should have called this enhancement conversion:subject_template since the value is not talking about the type/class of the subject. It is actually talking about the subject.
-
Using template variables to construct new values for use within values of
conversion:domain_template
.