Skip to content

conversion:subclass_of

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

Vocabulary conversion:Enhancements


What is first

  • The conversion:subclass_of enhancement applies when the conversion:range is rdfs:Resource, since the cell value most be a URI before it can be typed to a class.

What we will cover

This page describes how to type converted instances to external classes using the conversion:subclass_of enhancement.

Let's get to it

Example

The URIs for classes created for during conversion are "internal" to the dataset's vocabulary. This is done to avoid premature collisions with other similar terms with different meanings and representation intentions. A Subclass enhancement types instances to classes from more popular ontologies in addition to the default typing to an internal class.

The subclass enhancement can be applied to classes created by implicit bundles (see #Implicit column bundle resource promotion).

e.g., Dataset 1350

@prefix foaf:       <http://xmlns.com/foaf/0.1/> .
@prefix wgs:        <http://www.w3.org/2003/01/geo/wgs84_pos#> .
@prefix conversion: <http://purl.org/twc/vocab/conversion/> .
@prefix :           <http://logd.tw.rpi.edu/source/data-gov/dataset/1350/version/2009-May-18/params/enhancement/1/> .

:dataset a void:Dataset;
conversion:base_uri           "http://logd.tw.rpi.edu"^^xsd:anyURI;
conversion:source_identifier  "data-gov";
conversion:dataset_identifier "1350";
conversion:dataset_version    "2009-May-18";
conversion:conversion_process [
   a conversion:RawConversionProcess;
   conversion:enhancement_identifier "1";
   conversion:subject_discriminator  "appe-app-e";
   conversion:enhance [
      ov:csvCol         1;
      ov:csvHeader     "Licensee";
      conversion:label "Licensee";
      conversion:range  rdfs:Resource;
      conversion:range_name "Licensee";
   ];
   conversion:enhance [
      conversion:class_name "Licensee";
      conversion:subclass_of foaf:Organization;
   ];
   conversion:enhance [
      ov:csvCol         2;
      ov:csvHeader     "Location";
      conversion:label "Location";
      conversion:range  rdfs:Resource;
      conversion:range_name "Location";
   ];
   conversion:enhance [
      conversion:class_name "Location";
      conversion:subclass_of wgs:SpatialThing;
   ];

@prefix raw:               <http://logd.tw.rpi.edu/source/data-gov/dataset/1350/vocab/raw/> .
@prefix ds1350-appe-app-e: <http://logd.tw.rpi.edu/source/data-gov/dataset/1350/appe-app-e/version/2009-May-18/> .

ds1350-appe-app-e:thing_1
  raw:licensee "Aerotest" ;
  raw:location "San Ramon, CA" .

becomes

@prefix e1:                <http://logd.tw.rpi.edu/source/data-gov/dataset/1350/vocab/enhancement/1/> .
@prefix ds1350_vocab:      <http://logd.tw.rpi.edu/source/data-gov/dataset/1350/vocab/> .
@prefix value_of_licensee: <http://logd.tw.rpi.edu/source/data-gov/dataset/1350/appe-app-e/value-of/licensee/> .
@prefix value_of_location: <http://logd.tw.rpi.edu/source/data-gov/dataset/1350/appe-app-e/value-of/location/> .

ds1350-appe-app-e:thing_1
  e1:licensee typed_licensee:Aerotest ;
  e1:location typed_location:San_Ramon_CA .

typed_licensee:Aerotest 
  a ds1350_vocab:Licensee, foaf:Organization ;
  rdfs:label "Aerotest" .

typed_location:San_Ramon_CA 
  a ds1350_vocab:Location, wgs:SpatialThing ;
  rdfs:label "San Ramon, CA" .

The conversion:domain_name and conversion:range_name properties provide the local label names to create two classes: http://logd.tw.rpi.edu/source/data-gov/dataset/1554/vocab/FOIA_Request http://logd.tw.rpi.edu/source/data-gov/dataset/1554/vocab/Requester

The conversion:class_name property cites the local label name of the class that should be subclassed.

Classes present in the internal dataset namespace are created using when using the properties: conv:domain_name (via #Subject type parameter) conv:range_name (via #Typed resource promotion parameter) conv:type_name (via #Implicit column bundle resource promotion parameter)

Querying for datasets that use this enhancement?

Datasets with enhancements that subclass their local classes to more commonly acknowledged classes (results):

prefix conversion: <http://purl.org/twc/vocab/conversion/>

select distinct ?source ?dataset ?version ?local ?super
where {
  graph <http://purl.org/twc/vocab/conversion/ConversionProcess> {
    ?layer
      conversion:source_identifier  ?source;
      conversion:dataset_identifier ?dataset;
      conversion:conversion_process [
        conversion:enhancement_identifier ?e;
        conversion:enhance [ 
          conversion:class_name  ?local;
          conversion:subclass_of ?super
        ]
      ] 
    optional {?layer conversion:dataset_version    ?version}
    optional {?layer conversion:version_identifier ?version}
  }
} order by ?super ?local ?source ?dataset ?version
Clone this wiki locally