Hello Bastian,

first, units are parsed by the UnitValueParser. "If a template property 
containing a numerical value and a unit is mapped, the unit has to be defined 
(Please use only values from DBpedia unit and dimensions). If a template 
property has no default unit defined, e.g. its values can contain different 
units of the same dimension, the dimension has to be defined for usability as 
well as validation reasons. Possible dimensions are Length or Mass." 
(http://mappings.dbpedia.org/index.php/Template:PropertyMapping)
In your example no default unit is given, therefore the dimension is sufficient:
{{ PropertyMapping | templateProperty =  area | ontologyProperty = area | unit 
= Area}}
The UnitValueParser recognises the used unit and converts it to the standard 
unit of the Area dimension.

Second, if you take a look at the 
http://mappings.dbpedia.org/index.php/Mapping:Taxobox you will find 
conditionals for more than one property. They are all defined in one 
ConditionalMapping template:

{{ConditionalMapping
| cases =
{{Condition
    | templateProperty = divisio
    | operator = contains
    | value = Magnoliophyta
    | mapping = {{TemplateMapping
                | mapToClass = FloweringPlant
                }}
 }}
{{Condition
    | templateProperty = classis
    | operator = contains
    | value = Chondrichthyes
    | mapping = {{TemplateMapping
                   | mapToClass = Fish
                }}
 }}
{{Condition
    | templateProperty = regnum
    | operator = contains
    | value = Plant
    | mapping = {{TemplateMapping
                   | mapToClass = Plant
                }}
 }}

best regards,
paul

> > Do you mean nested conditions? If the unit is given in an extra
> property, it could work, i never tried it and i couldn't found an example.
> 
> Let's just say we have an infobox like:
> {{ Infobox settlement
>    | area =
>    | elevation =
>    ...
> }}
> 
> If valid units of the values were km2/mi2 (area) and m/ft (elevation)
> - the user would then have to specify the unit when using the
> template, e.g. "area = 23 km2" - you'd have two independent
> categories. In the mapping you'd have to make a condition based on
> which unit string is contained in the area property. The same holds
> true for the elevation property. But as far as I understood the syntax
> of mappings you cannot nest the conditions, can you? Am I right with
> the assumption that conditions have to be at the first level and that
> the conditional mapping statements have to be whole templatemappings?
> It would be nifty to be able to define the mapping like this:
> 
> {{ TemplateMapping
>    | mapToClass = Settlement
>    | mappings =
> 
> <!-- AREA mapping based on a condition -->
>      {{ ConditionalMapping
>         | cases =
>           {{ Condition
>              | templateProperty = area
>              | operator              = contains
>              | value                  = km2
>              | mapping             =
>                {{ PropertyMapping | templateProperty =  area |
> ontologyProperty = area | unit = squareKilometre }}
>           }}
>           {{ Condition
>              | templateProperty = area
>              | operator              = contains
>              | value                  = mi2
>              | mapping             =
>                {{ PropertyMapping | templateProperty =  area |
> ontologyProperty = area | unit = squareMiles }}
>           }}
>        }}
> 
> <!-- ELEVATION mapping based on a condition -->
>      {{ ConditionalMapping
>         | cases =
>           {{ Condition
>              | templateProperty = area
>              | operator              = contains
>              | value                  = m
>              | mapping             =
>                {{ PropertyMapping | templateProperty =  area |
> ontologyProperty = area | unit = metre }}
>           }}
>           {{ Condition
>              | templateProperty = area
>              | operator              = contains
>              | value                  = ft
>              | mapping             =
>                {{ PropertyMapping | templateProperty =  area |
> ontologyProperty = area | unit = feet }}
>           }}
>        }}
> }}
> 
> Do you take my point?
> 
> Cheers,
> Bastian

------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
Dbpedia-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion

Reply via email to