How to edit the DBpedia ontology and the mappings ?

The mappings are published on the website http://mappings.dbpedia.org , the English documentation is available this page.

This is a mediawiki, different data DBpedia there are published:

  • ontology
    • the classes
    • properties
    • datatypes
  • label that allows to give the labels in different languages using the model {{label}} . These inputs generate triples with rdfs: label.

To be able to edit the wiki, first create an account on it. In order to obtain editing rights you will then have to register on the DBPedia Forum, where you will have to introduce yourself on the la page dédiée.

Edition of ontology

Editing classes

For a class is defined by a model {{Class}} in the page in the namespace OntologyClass: with the class name.

For example the class http://dbpedia.org/ontology/Person is defined in the http://mappings.dbpedia.org/index.php/OntologyClass:Person which contains:

                    
                        {{Class
                        | labels =
                        {{label|en|person}}
                        {{label|de|Person}}
                        {{label|fr|personne}}
                        [...]
                        | rdfs:subClassOf = Agent
                        | owl:equivalentClass = foaf:Person, schema:Person
                        }}
                    
                

The class name is given by the name of the page that contains this model (by Person), the model also contains the fields:


Useful links:

Edit Properties

Each property is defined in the page in the OntologyProperty namespace. With the name of the property
Two models are used according to whether it is

The fields of these models are the same, the only difference is the accepted values for the field rdfs: range. For example
http://dbpedia.org/ontology/locationCity property is in the http://mappings.dbpedia.org/index.php/OntologyProperty:LocationCity which contains:

                    
                        {{ ObjectProperty
                        | labels =
                        {{label|en|location city}}
                        {{label|fr|situé dans la ville}}
                        [...]
                        | rdfs:domain = Organisation
                        | rdfs:range = City
                        | rdfs:subPropertyOf = location
                        |comments =
                        {{comment|en|City the thing is located.}}
                        }}
                    
                

The field rdfs: range should contain a class defined in the wiki.

The property is defined http://dbpedia.org/ontology/birthDate in the http://mappings.dbpedia.org/index.php/OntologyProperty:BirthDate which contains:

                    
                        {{DatatypeProperty
                        | labels =
                        {{label|en|birth date}}
                        {{label|fr|date de naissance}}
                        {{label|de|Geburtsdatum}}
                        [...]
                        | rdfs:domain = Person
                        | rdfs:range = xsd:date
                        | rdf:type = owl:FunctionalProperty
                        | owl:equivalentProperty = schema:birthDate
                        }}
                    
                

The field rdfs: range should contain either a datatype XSD, a datatype defined in the DBpedia ontology (see the following paragraph about the edition of the datatype).


Other fields are common:

  • labels and comments, as defined for the classes used to express and explain the property in different languages.
  • rdfs:domain gives the area of the property, that is to say, a class to which belong the subjects of the property, it must have been defined in the wiki.
  • rdfs:subPropertyOf and owl: equivalentProperty used to define generalization relationships/specialization or equivalence to other properties, they must be defined in the wiki.
  • rdf:type permet de préciser le type de la propriété (au delà du type owl:ObjectProperty/owl:DatatypeProperty). Actuellement seul le type owl:FunctionalProperty peut être donné, il signifie que la propriété définit une fonction, c'est-à-dire qu'elle ne peut prendre qu'une valeur par sujet.

Useful links :

Editing datatypes

Datatypes (or data types) used to define the types of missing values vocabulary XSD alone, mostly for defining units (centimeter, liter ...)

Each data type is defined by a template {{datatype}} in the page in the datatype namespace. with the name of the data type

For example, http://dbpedia.org/ontology/Currency is defined in the http://mappings.dbpedia.org/index.php/Datatype:Currency that contains: Holiday

                    
                        {{Datatype
                        |labels =
                        {{label|en|Currency}}
                        {{label|fr|Monnaie}}
                        [...]
                        }}
                    
                

Useful links :


Edit the mapping templates

Principle

The models (template in English), especially the infoboxes are used to provide factual information on the described items. Different models are used depending on the type of the subject described (Artist, Building, Event ...)
Each template contains a list of attributes that contain the values describing the subject. The meaning of the attributes depends on the model, for example in the Infobox Museum, the country attribute specifies the location of the museum, while in the Infobox Cyclist it means the sport nationality of the rider.
The mappings allow two things:

  • typer instances involving a class of ontology to each model
  • translate the attributes of models ontology properties.

Elemental mapping of a model

The mapping of a model of French Wikipedia is defined by a model {{ TemplateMapping }} to a page of the namespace Mapping_fr followed by the model name. For example, the mapping model [ Infobox Referee ] is defined in the http://mappings.dbpedia.org/index.php/Mapping_fr:Infobox_Arbitre which contains:

                    
                        {{TemplateMapping 
                        | mapToClass = Referee
                        | mappings =
                          {{PropertyMapping | templateProperty = nom | ontologyProperty = foaf:name }}
                          {{PropertyMapping | templateProperty = nom_de_l'arbitre  | ontologyProperty = foaf:name }}
                          {{PropertyMapping | templateProperty = surnom | ontologyProperty = foaf:nick }}
                          {{PropertyMapping | templateProperty = date_de_naissance | ontologyProperty = birthDate }}
                        [...]
                        }}
                    
                

The field mapToclass precise the class associated to the mapped model, here all the instances where the Wikipedia article contains a [Infobox Arbitre] will be typed as http://dbpedia.org/ontology/Referee. But the class need to be definied first in the wiki. The mapping field contains all the mapping attributes (called here template properties). The attributes mappings are defined in the model { {PropertyMapping} } with the following fields :

  • templateProperty : the attribute of the mapped model
  • ontologyProperty : propriété associée à l'attribut (doit être définie dans le wiki).
  • unit permet de spécifier le type de données associé si la propriété est de type owl:DatatypeProperty (soit un dataype xsd, soit défini dans le wiki)
  • facteur permet de multiplier la valeur trouvée par ce facteur, par exemple si un nombre est exprimé en millions.

Constant mappings

Sometimes, some properties are not given as an attribute, but implicitly by choosing a model, for example using the template Infobox commune of France implies that the municipality is in France. The model {{ ConstantMapping }} which is used in the mapping allows to introduce the implicit property:

                    
                        {{TemplateMapping 
                        | mapToClass = Settlement
                        | mappings =
                          {{ConstantMapping | ontologyProperty = country | value = France }}
                          {{PropertyMapping | templateProperty = nomcommune | ontologyProperty = foaf:name }}
                        [...]
                        }}
                    
                

The ontologyProperty means the property to use for the generated triplet, the Value contains either a literal in the case of an owl property type: DatatypeProperty or an instance without the prefix (here France ).

Introduction of intermediate nodes

Sometimes it is necessary to gather information, for example to describe the different positions occupied by people during his career must consolidate the nature of the position with the dates of beginning and end. In RDF, this is achieved by introducing intermediate nodes (also called white nodes if they have no public identifier). For example, the article on Arlette Laguiller mention two items:

                    
                        {{Infobox Politicien
                        | nom = Arlette Laguiller
                        [...]
                        | fonction1 = [[Parlement européen|Députée européenne]]
                        | à partir du fonction1 = {{date|20|juillet|1999}}
                        | jusqu'au fonction1 = {{date|19|juillet|2004}}
                        | fonction2 = [[Conseil régional d'Île-de-France|Conseillère régionale d'Île-de-France]]
                        | à partir du fonction2 = {{date|15|mars|1998}}
                        | jusqu'au fonction2 = {{date|28|mars|2004}}
                        [...]
                        }}
                    
                

The introduction of intermediate nodes db-fr: Arlette Laguiller __1 and db-fr: Arlette_Laguiller__2 provides the following representation:

                    
                        db-fr:Arlette_Laguiller     db-owl:occupation   db-fr:Arlette_Laguiller__1
                        db-fr:Arlette_Laguiller__1  rdf:type    db-owl:PersonFunction
                        db-fr:Arlette_Laguiller__1  db-owl:title    "Députée européenne"@fr
                        db-fr:Arlette_Laguiller__1  db-owl:functionStartDate    "1999-07-20"
                        db-fr:Arlette_Laguiller__1  db-owl:functionEndDate  "2004-07-19"
                        db-fr:Arlette_Laguiller     db-owl:occupation   db-fr:Arlette_Laguiller__2
                        db-fr:Arlette_Laguiller__2  rdf:type    db-owl:PersonFunction
                        db-fr:Arlette_Laguiller__2  db-owl:title    "Conseillère régionale d'Île-de-France"@fr
                        db-fr:Arlette_Laguiller__2  db-owl:functionStartDate    "1998-03-15"
                        db-fr:Arlette_Laguiller__2  db-owl:functionEndDate  "2004-03-28"
                    
                

This is achieved using a model {{IntermediateNodeMapping}} in the field mappings. The result of the example of Arlette Laguiller is obtained with the [Infobox Personnalité politique]:

                    
                        {{TemplateMapping
                        | mapToClass = OfficeHolder
                        | mappings = 
                          {{IntermediateNodeMapping
                          | nodeClass = PersonFunction
                          | correspondingProperty = occupation
                          | mappings =
                            {{PropertyMapping | templateProperty = fonction1 | ontologyProperty = title }}
                            {{PropertyMapping | templateProperty = à partir du fonction1 | ontologyProperty = functionStartDate }}
                            {{PropertyMapping | templateProperty = jusqu'au fonction1 | ontologyProperty = functionEndDate }}
                          }}
                          {{IntermediateNodeMapping
                          | nodeClass = PersonFunction
                          | correspondingProperty = occupation
                          | mappings =
                            {{PropertyMapping | templateProperty = fonction2 | ontologyProperty = title }}
                            {{PropertyMapping | templateProperty = à partir du fonction2 | ontologyProperty = functionStartDate }}
                            {{PropertyMapping | templateProperty = jusqu'au fonction2 | ontologyProperty = functionEndDate }}
                          }}
                        [...]
                        }}
                    
                

Conditional mappings

Sometimes the same model is used to describe different types of subjects that is specified in a field. For example the model Infobox Catholic Prelate is used to describe the ready, Cardinals and popes, the title specifies the type. The model {{ConditionnalMapping}} to define the type to give instances as the value taken by the attribute title :

                    
                        {{ConditionalMapping
                        | cases =
                         {{Condition
                            | templateProperty = titre
                            | operator = equals
                            | value = Pape
                            | mapping = {{TemplateMapping | mapToClass = Pope }}
                         }}
                         {{Condition
                            | templateProperty = titre
                            | operator = equals
                            | value = Cardinal
                            | mapping = {{TemplateMapping | mapToClass = Cardinal }}
                         }}
                        [...]
                        {{Condition
                        | operator = otherwise
                        | mapping = {{TemplateMapping |mapToClass = Cleric }}
                        }}
                        
                        | defaultMappings =
                          {{PropertyMapping | templateProperty = nom | ontologyProperty = foaf:name }}
                          {{PropertyMapping | templateProperty = nom | ontologyProperty = foaf:nick }}
                          {{PropertyMapping | templateProperty = nom naissance | ontologyProperty = birthName }}
                        [...]
                        }}
                    
                

This model is used by top models {{Mapping Template}}, it contains two fields:

  • checkboxes which are given different alternatives, each in a model {{condition}} .
  • default mappings that contains mappings attributes common to all cases (misleading name!).

The model {{condition}} establish a condition and mappings to be applied if the condition is satisfied:

  • the criteria is determined by the field operator:
    • isSet to check if a field is used (given field templateProperty),
    • equals and contains to compare the contents of a field (given in (donné dans templateProperty) avec la valeur donnée dans value
    • otherwise pour la valeur par défaut
  • the field mappings contains the { {TemplateMapping} } to apply.