Help:Property naming

Jump to: navigation, search
Property naming
Naming guidelines and convention for properties
Table of Contents

The naming of properties is more important than one would probably expect at first. Property names should avoid ambiguity and confusion. Thus, it is good practice to create Property names as a verb phrase. Here's an example that uses Berlin and makes this practice more comprehensible:

Germany's capital is Berlin. ↔ Berlin is the capital of Germany.

In both cases one could assign a property named "Capital", but this does not convey exactly the intended meaning. The first sentences says that Germany has a capital called Berlin. Therefore the better name for the property is "Has capital". The second sentence states that Berlin is the capital of Germany. Hence the better name for the property is "Is capital" in this case. So the annotation avoiding ambiguity is as follows:

Germany's capital is [[Has capital::Berlin]]. ↔ [[Is capital::Berlin]] is the capital of Germany.

Avoid using the name of a datatype

For technical reasons a property name should not be the same as the name of one of the datatypes. So an annotation like e.g. [[Code::Qsdr-5t7Z-b99N]] will not serve the intended purpose, since the assigned datatype will always be "Code" and cannot be changed to "Text". (However, to name the property "Is registration code" or something alike is the better alternative for this in the first place anyway.)

Avoid using certain kinds of punctuation

Certain kinds of punctuation are to be avoided or have been declared invalid1 in property names, because they are also used as special syntax in semantic queries or they may cause problems for other reasons.

  • :: (two subsequent colons) - a single colon should not cause any trouble
  • - (hyphen) in initial position - for reasons to do with inverse properties
  • . (dot) - operator used to link properties in concatenation2
  • | (pipe)
  • # (number sign) - for datatype "Page" since it is interpreded as part of a subobject declaration.3 4
NoteNote:Semantic MediaWiki 2.5.0 introduced configuration parameter $smwgPropertyInvalidCharacterList1 helping wiki systemadministrators to exclude certain characters from being used right away.

Best practice

  • Use a verb phrase (recommended) to describe a property
  • "Style Guidelines for Naming and Labeling Ontologies in the Multilingual Web" 5 contains some general guidelines how to name properties and URI's

See also


  1. a b  Semantic MediaWiki: GitHub pull request #2282
  2. ^  Semantic MediaWiki: GitHub issue #676
  3. ^  Semantic MediaWiki: GitHub pull request #1088 comment
  4. ^  Semantic MediaWiki: GitHub pull request #1568
  5. ^  Elena Montiel-Ponsoda, Daniel Vila Suero, Vila Suero Villazón-Terrazas Boris D Montiel-Ponsoda E., Gordon Dunsire, Elena Escolano Rodríguez, Asunción Gómez-Pérez. "Style guidelines for naming and labeling ontologies in the multilingual web". Informatica (2011).