Skip to content

conversion:ImplicitBundle

timrdf edited this page Dec 16, 2012 · 11 revisions
csv2rdf4lod-automation is licensed under the [Apache License, Version 2.0](https://github.com/timrdf/csv2rdf4lod-automation/wiki/License)

A conversion:Enhancement

see also conversion:bundled_by

The first, middle, and last names of visitors are cited in Dataset 10025. Each of these values is describing an unmodeled person. Using an implicit bundle will create a URI for this person and will be described with the bundled first, middle, and last name properties. When the implicit bundle incorporates these properties, it loses its association to the remaining elements of the csv row -- the row needs to connect to the new implicit bundle. The property conversion:property_name is used to cite the local name of the property from the row resource to the new ImplicitBundle.

The type created from conversion:type_name (e.g., "Person"") can be subclassed to an external class (e.g. foaf:Person) using #Subclass enhancement)

@prefix conversion: <http://purl.org/twc/vocab/conversion/> .
@prefix :           <http://logd.tw.rpi.edu/whitehouse-gov/dataset/visitor-records/params/enhancement/1/> .

:visitor_bundle
   a conversion:ImplicitBundle;
   conversion:property_name "visitor";
   conversion:type_name     "Person";
.

:dataset a void:Dataset;
   conversion:base_uri           "http://logd.tw.rpi.edu"^^xsd:anyURI;
   conversion:source_identifier  "whitehouse-gov";
   conversion:dataset_identifier "visitor-records";
   conversion:dataset_version    "2010-Mar-26";
   conversion:conversion_process [
       a conversion:RawConversionProcess;
      conversion:enhancement_identifier "1";
      conversion:enhance [
         ov:csvCol         1;
         ov:csvHeader     "NAMELAST";
         conversion:range  rdfs:Literal;
         conversion:label "Last name";
         conversion:bundled_by :visitor_bundle;
      ];
      conversion:enhance [
         ov:csvCol         2;
         ov:csvHeader     "NAMEFIRST";
         conversion:range  rdfs:Literal;
         conversion:label "First name";
         conversion:bundled_by :visitor_bundle;
      ];
      conversion:enhance [
         ov:csvCol         3;
         ov:csvHeader     "NAMEMID";
         conversion:range  rdfs:Literal;
         conversion:label "Middle name";
         conversion:bundled_by :visitor_bundle;
      ];
   ];
.

with input:

@prefix visitor-records: <http://logd.tw.rpi.edu/source/whitehouse-gov/dataset/visitor-records/version/2010-Mar-26/>.
@prefix raw:             <http://logd.tw.rpi.edu/source/whitehouse-gov/dataset/visitor-records/vocab/raw/> .
@prefix e1:              <http://logd.tw.rpi.edu/source/whitehouse-gov/dataset/visitor-records/vocab/enhancement/1/>.
 
visitor-records:thing_1
  raw:last_name   "AABY";
  raw:first_name  "DONETT";
  raw:middle_name "L";
.

becomes

visitor-records:thing_1
   e1:visitor visitor-records:implicit_visitor_1;
.
visitor-records:implicit_visitor_1
   rdf:type        vocab:Person;
   e1:last_name   "AABY";
   e1:first_name  "DONETT";
   e1:middle_name "L"
.

TODO: version/2009-Oct-02/PROPERTY_NAME/thing_1 (1 == row's thing_1) (when implicit bundle not typed)
TODO: version/2009-Oct-02/PROPERTY_NAME/type_1 (1 == rows's thing_1) (when implicit bundled typed with type_name)

e.g., Dataset 1450

@prefix : <http://logd.tw.rpi.edu/source/data-gov/dataset/1450/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 "1450";
   conversion:dataset_version    "2009-May-18";
   conversion:conversion_process [
      a conversion:RawConversionProcess;
      conversion:enhancement_identifier "1";

      conversion:enhance [
         ov:csvCol         7;
         ov:csvHeader     "LAST NAME";
         conversion:range  rdfs:Literal;
      ];
      conversion:enhance [
         ov:csvCol         8;
         ov:csvHeader     "FIRST NAME";
         conversion:range  rdfs:Literal;
      ];
      conversion:enhance [
         ov:csvCol         9;
         ov:csvHeader     "MI";
         conversion:range  rdfs:Literal;
      ];

   ];
.

input:

@prefix ds1450: <http://csv2rdf.org/source/data-gov/dataset/1450/version/18-May-2009/> .
@prefix raw:    <http://csv2rdf.org/source/data-gov/dataset/1450/vocab/raw/> .

ds1450:<font color="#0000FF">thing_1</font>
  raw:state                    "Alabama";
  raw:legal_entity_name        "ACCENDO INSURANCE COMPANY";
  raw:organization_name        "RxAmerica";
  raw:organization_description "PDP";
  raw:title                    "Director of Medicare Services";
  raw:last_name                "Low";
  raw:first_name               "Jeff";
  raw:phone                    "1-801-961-6251";
  raw:fax                      "1-801-961-6313";
  raw:email                    "[email protected]";
  raw:street_address           "221 N. Charles Lindbergh Dr.";
  raw:city                     "SLC";
  raw:state_2                  "UT";
  raw:zip                      "84116";
  ov:csvRow                     2;
.

becomes

@prefix e1:           <http://csv2rdf.org/source/data-gov/dataset/1450/vocab/enhancement/1/> . 
@prefix legal-entity: <http://csv2rdf.org/source/data-gov/dataset/1450/version/18-May-2009/legal-entity/> .
@prefix organization: <http://csv2rdf.org/source/data-gov/dataset/1450/version/18-May-2009/organization/> .
@prefix state:        <http://csv2rdf.org/source/data-gov/dataset/1450/version/18-May-2009/state/> .
@prefix city:         <http://csv2rdf.org/source/data-gov/dataset/1450/version/18-May-2009/city/> .
@prefix title:        <http://csv2rdf.org/source/data-gov/dataset/1450/version/18-May-2009/title/> .

ds1450:<font color="#0000FF">thing_1</font>
   e1:address                          ds1450:implicit_address_1;
   e1:legal_entity_name          legal-entity:ACCENDO_INSURANCE_COMPANY;
   e1:organization_description "PDP" ;
   e1:organization_name          organization:RxAmerica;
   e1:point_of_contact                 ds1450:implicit_point_of_contact_1;
   e1:state                             state:Alabama;
   ov:csvRow                    2; 
.

ds1450:implicit_address_1
   e1:city             city:SLC;
   e1:state_2         state:UT;
   e1:street_address "221 N. Charles Lindbergh Dr.";
   e1:zip            "84116" 
.

legal-entity:ACCENDO_INSURANCE_COMPANY
   rdfs:label "ACCENDO INSURANCE COMPANY" 
.

organization:RxAmerica
   rdfs:label "RxAmerica" 
.

ds1450:implicit_point_of_contact_1
   e1:email      "[email protected]";
   e1:fax        "1-801-961-6313";
   e1:first_name "Jeff";
   e1:last_name  "Low";
   e1:phone      "1-801-961-6251";
   e1:title       title:Director_of_Medicare_Services 
.

title:Director_of_Medicare_Services
   rdfs:label "Director of Medicare Services" 
.

What datasets use this enhancement?

PREFIX rdfs:       <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd:        <http://www.w3.org/2001/XMLSchema#>
PREFIX conversion: <http://purl.org/twc/vocab/conversion/>

SELECT distinct ?implicit_bundle
WHERE {
  GRAPH <http://purl.org/twc/vocab/conversion/ConversionProcess> {
    ?dataset a void:Dataset;
      conversion:conversion_process [
        conversion:enhance [ 
          conversion:bundled_by ?implicit_bundle
        ]
      ]
    .
    ?implicit_bundle conversion:type_name ?type .
  }
}
Clone this wiki locally