Skip to content

conversion:range rdfs:Resource

Tim L edited this page Sep 25, 2013 · 13 revisions
csv2rdf4lod-automation is licensed under the [Apache License, Version 2.0](https://github.com/timrdf/csv2rdf4lod-automation/wiki/License)

What is first

Promoting a cell value to a URI

Changing the conversion:range from rdfs:Literal to rdfs:Resource will promote the cell value to a URI (using a default namespace within the dataset). For example,

      conversion:enhance [
         ov:csvCol          1;
         ov:csvHeader       "JURISDICTION NAME";
         conversion:range   rdfs:Resource;
      ];

from this dataset will result in:

e1:jurisdiction_name 
   <http://logd.tw.rpi.edu/source/nycopendata-socrata-com/dataset/zip-code-breakdowns/value-of/jurisdiction_name/10001>

Adding a type to a promoted URI

conversion:range_name will type the URI to a local class.

      conversion:enhance [
         ov:csvCol          1;
         ov:csvHeader       "JURISDICTION NAME";
         conversion:range   rdfs:Resource;
         conversion:range_name "Zip Code";   ## Add a name for the type of resource that gets created.
      ];

results in:

e1:jurisdiction_name
    <http://logd.tw.rpi.edu/source/nycopendata-socrata-com/dataset/zip-code-breakdowns/typed/zip_code/10001>;
.

<http://logd.tw.rpi.edu/source/nycopendata-socrata-com/dataset/zip-code-breakdowns/typed/zip_code/10001> a :Zip_Code .

Using your own URI by filling a template

      conversion:enhance [
         ov:csvCol          1;
         ov:csvHeader       "JURISDICTION NAME";
         conversion:range   rdfs:Resource;
         conversion:range_name "Zip Code";   
         conversion:range_template "[/]us/zip/[.]";  ## Use the cell value to construct an entirely different URI.
      ];
e1:jurisdiction_name <http://logd.tw.rpi.edu/us/zip/10001> ;

Typing the promoted resource to an external class

The conversion:subclass_of enhancement is used to pair the locally-defined class with an class from another, external, vocabulary. For example:

conversion:conversion_process [
   ...
   conversion:enhance [
      conversion:class_name "Zip Code";
      conversion:subclass_of wgs:SpatialThing;
   ];
Clone this wiki locally