Writing Mappings/Tables: Difference between revisions

From DBpedia Mappings
Jump to navigationJump to search
No edit summary
No edit summary
Line 6: Line 6:
A table mapping applies to a table if a set of keywords occurs in the table header.  
A table mapping applies to a table if a set of keywords occurs in the table header.  


The ''TableMapping'' template offers the following template parameters:
The ''[[Template:TableMapping]]'' template offers the following template parameters:
* ''mapToClass''
* ''mapToClass''
** Table rows are mapped to ontology classes. The template parameter mapToClass allows one DBpedia ontology class as a value.
** Table rows are mapped to ontology classes. The template parameter mapToClass allows one DBpedia ontology class as a value.
Line 16: Line 16:
** Lists all mapped table column headers, separated by semicolons. Each column definition can contain alternative definitions, separated by colons. If the column is defined by several keywords, the keywords have to be separated by & in the order of their appearance.
** Lists all mapped table column headers, separated by semicolons. Each column definition can contain alternative definitions, separated by colons. If the column is defined by several keywords, the keywords have to be separated by & in the order of their appearance.
* ''mappings''
* ''mappings''
** Mappings map table columns to ontology properties, they have to be defined by using the same templates as in mappings on DBpediaTemplateMapping. A separate mapping for each alternative column header definition has to be specified.
** Mappings map table columns to ontology properties, they have to be defined by using the same templates as in mappings on [[Template:TemplateMapping]]. A separate mapping for each alternative column header definition has to be specified.
   
   
<!--
<!--
Line 29: Line 29:
Lists all mapped table column headers, separated by semicolons. Each column definition can contain alternative definitions, separated by colons. If the column is defined by several keywords, the keywords have to be separated by & in the order of their appearance.
Lists all mapped table column headers, separated by semicolons. Each column definition can contain alternative definitions, separated by colons. If the column is defined by several keywords, the keywords have to be separated by & in the order of their appearance.
• mappings
• mappings
Mappings map table columns to ontology properties, they have to be defined by using the same templates as in mappings on DBpediaTemplateMapping. A separate mapping for each alternative column header definition has to be specified.
Mappings map table columns to ontology properties, they have to be defined by using the same templates as in mappings on [[Template:TemplateMapping]]. A separate mapping for each alternative column header definition has to be specified.




Line 36: Line 36:
Example: The rows of tables with the columns Engine Name, Type, Engine code, and Top speed are mapped to instances of the ontology class Automobile Engine, while the columns are mapped to the corresponding ontology properties. If an infobox that is mapped to the ontology class Automobile is in the same section as the table, the instances generated for the table rows are connected to the instance generated from the infobox by the ontology property MeanOfTransportation/engine.
Example: The rows of tables with the columns Engine Name, Type, Engine code, and Top speed are mapped to instances of the ontology class Automobile Engine, while the columns are mapped to the corresponding ontology properties. If an infobox that is mapped to the ontology class Automobile is in the same section as the table, the instances generated for the table rows are connected to the instance generated from the infobox by the ontology property MeanOfTransportation/engine.
Implementation:  
Implementation:  
{{ DBpediaTableMapping
{{ TableMapping
  | mapToClass            = AutomobileEngine
  | mapToClass            = AutomobileEngine
  | correspondingClass    = Automobile
  | correspondingClass    = Automobile
Line 43: Line 43:
  | header                = speed; code; name, engine ; type
  | header                = speed; code; name, engine ; type
  | mappings              =  
  | mappings              =  
{{ DBpediaPropertyMapping | templateProperty = engine | ontologyProperty = AutomobileEngine/name }}
{{ PropertyMapping | templateProperty = engine | ontologyProperty = AutomobileEngine/name }}
{{ DBpediaPropertyMapping | templateProperty = type | ontologyProperty = AutomobileEngine/type }}
{{ PropertyMapping | templateProperty = type | ontologyProperty = AutomobileEngine/type }}
{{ DBpediaPropertyMapping | templateProperty = code | ontologyProperty = AutomobileEngine/code }}
{{ PropertyMapping | templateProperty = code | ontologyProperty = AutomobileEngine/code }}
{{ DBpediaPropertyMapping | templateProperty = speed | ontologyProperty = AutomobileEngine/speed | unit = kilometerPerHour }}
{{ PropertyMapping | templateProperty = speed | ontologyProperty = AutomobileEngine/speed | unit = kilometerPerHour }}
}}
}}
-->
-->

Revision as of 17:41, 3 March 2010

The full documentation on writing mappings can be found via the DBpedia SVN Repository.

Table mappings should be added to the Mapping namespace, using the Table prefix, e.g. here.

If a table mapping is defined, all rows of the table are mapped to instances of an ontology class, all of its columns are be mapped to ontology properties. A table mapping applies to a table if a set of keywords occurs in the table header.

The Template:TableMapping template offers the following template parameters:

  • mapToClass
    • Table rows are mapped to ontology classes. The template parameter mapToClass allows one DBpedia ontology class as a value.
  • correspondingClass, correspondingProperty
    • If an instance of type correspondingClass is found in the same section as the table, it will be connected to the instances extracted from the table rows by correspondingProperty.
  • keywords
    • Keywords define mandatory table column headers or parts of them. Keywords can be separated by semicolons meaning they have to occur in different column headers. Alternatives of keywords can be separated by colons.
  • header
    • Lists all mapped table column headers, separated by semicolons. Each column definition can contain alternative definitions, separated by colons. If the column is defined by several keywords, the keywords have to be separated by & in the order of their appearance.
  • mappings
    • Mappings map table columns to ontology properties, they have to be defined by using the same templates as in mappings on Template:TemplateMapping. A separate mapping for each alternative column header definition has to be specified.