Template:Class: Difference between revisions

From DBpedia Mappings
Jump to navigationJump to search
(render up to three comma-separated base classes, equivalent classes and disjoint classes correctly)
No edit summary
 
(23 intermediate revisions by 2 users not shown)
Line 5: Line 5:
  <th colspan="2" style="text-align:left">Ontology class <small>([[Template:Class|<span style="cursor:help;">help</span>]])</small></th>
  <th colspan="2" style="text-align:left">Ontology class <small>([[Template:Class|<span style="cursor:help;">help</span>]])</small></th>
</tr>
</tr>
{{#if:{{{labels|}}}|{{{labels}}}|
{{#if:{{{rdfs:label@en|}}}|<!-- no message -->|
<tr>
<tr>
  <td width="150px">rdfs:label@en</td>
  <td colspan="2">please define an English label: <pre>labels = {{label|en|...}}</pre></td>
<td width="400px">{{#if:{{{rdfs:label@en|}}}|{{{rdfs:label@en}}}|<span style="color:red">please define an English label</span>}}</td>
</tr>
</tr>
}}
}}
{{#if:{{{rdfs:label@ar|}}}|<tr>
{{#if:{{{rdfs:label@ar|}}}|<tr>
  <td width="150px">rdfs:label@ar</td>
  <td width="150px">rdfs:label@ar</td>
  <td>{{{rdfs:label@ar}}}</td></tr>}} {{#if:{{{rdfs:label@bn|}}}|<tr>
  <td>{{{rdfs:label@ar}}}</td></tr>}} {{#if:{{{rdfs:label@be|}}}|<tr>
<td width="150px">rdfs:label@be</td>
<td>{{{rdfs:label@be}}}</td></tr>}} {{#if:{{{rdfs:label@bg|}}}|<tr>
<td width="150px">rdfs:label@bg</td>
<td>{{{rdfs:label@bg}}}</td></tr>}} {{#if:{{{rdfs:label@bn|}}}|<tr>
  <td width="150px">rdfs:label@bn</td>
  <td width="150px">rdfs:label@bn</td>
  <td>{{{rdfs:label@bn}}}</td></tr>}} {{#if:{{{rdfs:label@ca|}}}|<tr>
  <td>{{{rdfs:label@bn}}}</td></tr>}} {{#if:{{{rdfs:label@ca|}}}|<tr>
Line 21: Line 28:
  <td>{{{rdfs:label@de}}}</td></tr>}} {{#if:{{{rdfs:label@el|}}}|<tr>
  <td>{{{rdfs:label@de}}}</td></tr>}} {{#if:{{{rdfs:label@el|}}}|<tr>
  <td width="150px">rdfs:label@el</td>
  <td width="150px">rdfs:label@el</td>
  <td>{{{rdfs:label@el}}}</td></tr>}} {{#if:{{{rdfs:label@es|}}}|<tr>
  <td>{{{rdfs:label@el}}}</td></tr>}} {{#if:{{{rdfs:label@en|}}}|<tr>
<td width="150px">rdfs:label@en</td>
<td>{{{rdfs:label@en}}}</td></tr>}} {{#if:{{{rdfs:label@es|}}}|<tr>
  <td width="150px">rdfs:label@es</td>
  <td width="150px">rdfs:label@es</td>
  <td>{{{rdfs:label@es}}}</td></tr>}} {{#if:{{{rdfs:label@fr|}}}|<tr>
  <td>{{{rdfs:label@es}}}</td></tr>}} {{#if:{{{rdfs:label@fr|}}}|<tr>
Line 35: Line 44:
  <td>{{{rdfs:label@hu}}}</td></tr>}} {{#if:{{{rdfs:label@it|}}}|<tr>
  <td>{{{rdfs:label@hu}}}</td></tr>}} {{#if:{{{rdfs:label@it|}}}|<tr>
  <td width="150px">rdfs:label@it</td>
  <td width="150px">rdfs:label@it</td>
  <td>{{{rdfs:label@it}}}</td></tr>}} {{#if:{{{rdfs:label@ko|}}}|<tr>
  <td>{{{rdfs:label@it}}}</td></tr>}} {{#if:{{{rdfs:label@ja|}}}|<tr>
<td width="150px">rdfs:label@ja</td>
<td>{{{rdfs:label@ja}}}</td></tr>}} {{#if:{{{rdfs:label@ko|}}}|<tr>
  <td width="150px">rdfs:label@ko</td>
  <td width="150px">rdfs:label@ko</td>
  <td>{{{rdfs:label@ko}}}</td></tr>}} {{#if:{{{rdfs:label@nl|}}}|<tr>
  <td>{{{rdfs:label@ko}}}</td></tr>}} {{#if:{{{rdfs:label@nl|}}}|<tr>
Line 50: Line 61:
  <td width="150px">rdfs:label@tr</td>
  <td width="150px">rdfs:label@tr</td>
  <td>{{{rdfs:label@tr}}}</td></tr>}}
  <td>{{{rdfs:label@tr}}}</td></tr>}}
{{{comments|}}}
{{#if:{{{rdfs:comment@en|}}}|
<tr>
<tr>
  <td>rdfs:comment@en</td>
  <td>rdfs:comment@en</td>
  <td>{{#if:{{{rdfs:comment@en|}}}|{{{rdfs:comment@en}}}}}</td>
  <td>{{{rdfs:comment@en}}}</td>
</tr>
</tr>
}}
<tr>
<tr>
  <td>rdfs:subClassOf</td>
  <td>rdfs:subClassOf</td>
  <td>{{#if:{{#explode:{{{rdfs:subClassOf|}}}|,|0}}|[[OntologyClass:{{#explode:{{{rdfs:subClassOf}}}|,|0}}|{{#explode:{{{rdfs:subClassOf}}}|,|0}}]]{{#if:{{#explode:{{{rdfs:subClassOf}}}|,|1}}|, [[OntologyClass:{{#explode:{{{rdfs:subClassOf}}}|,|1}}|{{#explode:{{{rdfs:subClassOf}}}|,|1}}]]{{#if:{{#explode:{{{rdfs:subClassOf}}}|,|2}}|, [[OntologyClass:{{#explode:{{{rdfs:subClassOf}}}|,|2}}|{{#explode:{{{rdfs:subClassOf}}}|,|2}}]]|}}|}}|owl:Thing}}</td>
  <td>{{linkClasses|{{{rdfs:subClassOf|}}}|owl:Thing}}</td>
</tr>
</tr>
<tr>
<tr>
  <td>owl:equivalentClass</td>
  <td>owl:equivalentClass</td>
  <td>{{#if:{{#explode:{{{owl:equivalentClass|}}}|,|0}}|[[OntologyClass:{{#explode:{{{owl:equivalentClass}}}|,|0}}|{{#explode:{{{owl:equivalentClass}}}|,|0}}]]{{#if:{{#explode:{{{owl:equivalentClass}}}|,|1}}|, [[OntologyClass:{{#explode:{{{owl:equivalentClass}}}|,|1}}|{{#explode:{{{owl:equivalentClass}}}|,|1}}]]{{#if:{{#explode:{{{owl:equivalentClass}}}|,|2}}|, [[OntologyClass:{{#explode:{{{owl:equivalentClass}}}|,|2}}|{{#explode:{{{owl:equivalentClass}}}|,|2}}]]|}}|}}|}}</td>
  <td>{{linkClasses|{{{owl:equivalentClass|}}}}}</td>
</tr>
</tr>
<tr>
<tr>
  <td>owl:disjointWith</td>
  <td>owl:disjointWith</td>
  <td>{{#if:{{#explode:{{{owl:disjointWith|}}}|,|0}}|[[OntologyClass:{{#explode:{{{owl:disjointWith}}}|,|0}}|{{#explode:{{{owl:disjointWith}}}|,|0}}]]{{#if:{{#explode:{{{owl:disjointWith}}}|,|1}}|, [[OntologyClass:{{#explode:{{{owl:disjointWith}}}|,|1}}|{{#explode:{{{owl:disjointWith}}}|,|1}}]]{{#if:{{#explode:{{{owl:disjointWith}}}|,|2}}|, [[OntologyClass:{{#explode:{{{owl:disjointWith}}}|,|2}}|{{#explode:{{{owl:disjointWith}}}|,|2}}]]|}}|}}|}}</td>
  <td>{{linkClasses|{{{owl:disjointWith|}}}}}</td>
</tr>
</tr>
</table>
</table>
Line 74: Line 88:


<pre>
<pre>
{{Class  
{{Class
| rdfs:label@en         =
| labels              =
| rdfs:label@..         =
{{label|en|...}}
| rdfs:comment@en       =
{{label|..|...}}
| rdfs:comment@..       =
| comments            =
{{comment|en|...}}
{{comment|..|...}}
| rdfs:subClassOf    =
| rdfs:subClassOf    =
| owl:equivalentClass =
| owl:equivalentClass =
Line 86: Line 102:
</pre>
</pre>


=== Meanings ===
==== Details ====


* '''rdfs:label@en''': should be defined to provide a human-readable version of a class name. Use ISO language code 639-1 (e.g. @en).
* '''labels''': should be defined to provide a human-readable version of a class name. Use ISO language code 639-1 (e.g. <nowiki>{{label|en|...}}</nowiki>).
* '''rdfs:comment@en''': should be defined to provide a human-readable description of a class.  Use ISO language code 639-1 (e.g. @en).
* '''comments''': should be defined to provide a human-readable description of a class.  Use ISO language code 639-1 (e.g. <nowiki>{{comment|en|...}}</nowiki>).
* '''rdfs:subClassOf''': is used to state that all the instances of one class are instances anothers.
* '''rdfs:subClassOf''': is used to state that all the instances of one class are instances anothers.
* '''owl:equivalentClass''':
* '''owl:equivalentClass''':
* '''owl:disjointWith''':  
* '''owl:disjointWith''':  
* '''specificProperties''': refine property units for this class using [[Template:SpecificProperty|SpecificProperty template]].
* '''specificProperties''': refine property units for this class using [[Template:SpecificProperty|SpecificProperty template]].
For backwards compatibilty, the following format for labels and comments is also possible but '''deprecated''':
<pre>
{{Class
| rdfs:label@en          =
| rdfs:label@..          =
| rdfs:comment@en        =
</pre>


=== Example ===
=== Example ===
Line 100: Line 125:
<pre>
<pre>
{{Class
{{Class
| rdfs:label@en     = Artist
| labels          = {{label|en|Artist}}
| rdfs:comment@en   =
| comments        = {{comment|en|An artist is a person who creates pieces of art.}}
| rdfs:subClassOf = Person
| rdfs:subClassOf = Person
}}
}}
Line 107: Line 132:


It will be rendered to this table:
It will be rendered to this table:
{{Class
{{Class
| rdfs:label@en     = Artist
| labels          = {{label|en|Artist}}
| rdfs:comment@en   =
| comments        = {{comment|en|An artist is a person who creates pieces of art.}}
| rdfs:subClassOf = Person
| rdfs:subClassOf = Person
}}
}}
</noinclude>
</noinclude>

Latest revision as of 14:28, 10 March 2015

The {{Class}} template can be used to define ontology classes.

Usage

{{Class
| labels              =
{{label|en|...}}
{{label|..|...}}
| comments            =
{{comment|en|...}}
{{comment|..|...}}
| rdfs:subClassOf     =
| owl:equivalentClass =
| owl:disjointWith    =
| specificProperties  =
}}

Details

  • labels: should be defined to provide a human-readable version of a class name. Use ISO language code 639-1 (e.g. {{label|en|...}}).
  • comments: should be defined to provide a human-readable description of a class. Use ISO language code 639-1 (e.g. {{comment|en|...}}).
  • rdfs:subClassOf: is used to state that all the instances of one class are instances anothers.
  • owl:equivalentClass:
  • owl:disjointWith:
  • specificProperties: refine property units for this class using SpecificProperty template.

For backwards compatibilty, the following format for labels and comments is also possible but deprecated:

{{Class
| rdfs:label@en          =
| rdfs:label@..          =
| rdfs:comment@en        =

Example

The definition of the DBpedia ontology class Artist:

{{Class
| labels          = {{label|en|Artist}}
| comments        = {{comment|en|An artist is a person who creates pieces of art.}}
| rdfs:subClassOf = Person
}}

It will be rendered to this table:


This is the definition of an ontology class.

Show all properties available for this class.

Show class in class hierarchy.

Read more about editing the ontology schema.

You can see the result of your edit on DBpedia Live (this is BETA!): http://live.dbpedia.org/ontology/Class

Ontology class (help)
rdfs:label (en)Artist
rdfs:comment (en)An artist is a person who creates pieces of art.
rdfs:subClassOf Person
owl:equivalentClass
owl:disjointWith