Key types
Jump to navigation
Jump to search
Key types to be used with data items. For every key item the property key type (P9) should be set with a key type item.
Available types
- well-known values (Q8) – A key with a well defined list of values, e.g., key:highway, key:wheelchair, or key:religion.
- boolean values (Q21937) – The key is of type boolean and expects a value of either "yes" (Yes, True) or "no" (No, False).
- only/yes/no choice (Q23555) – The key expects a value of either "only", "yes", or "no".
- designated/yes/limited/no choice (Q23598) – The key expects a value of either "designated", "yes", "limited", or "no".
- country code (Q23568) – A ISO 3166-1 alpha-2 two letter country code. For other country code keys, use key type (P9) = well-known values (Q8).
- infinite values (Q23617) – A key with an infinite possibility (or a lot) of values (e.g., key:name).
- opening hours (Q23551) – A key describing opening hours, e.g., key:opening_hours.
- numbers:
- integer (Q23656) – Any integer number.
- non-negative integer (Q23655) – Any integer number greater than or equal to 0.
- positive integer (Q23654) – Any integer number greater than 0.
- boolean or positive integer (Q23657) – Combination of boolean values (Q21937) + positive integer (Q23654) / non-negative integer (Q23655). "no" equals "0". "yes" equals >=1.
- integer (Q23656) – Any integer number.
- contact-related:
- URL (Q23626) (website) – A valid uniform resource locator.
- email address (Q23615) – A valid email address.
- phone number (Q23581) – A valid telephone number (including the country code) following the ITU-T E.123/DIN 5008 or RFC 3966/NANP pattern.
How to create a new key type
Create a new data item and set instance of (P2)=key type (Q23552). Set subclass of (P3)=well-known values (Q8)/infinite values (Q23617) if appropriate.
Other useful properties for key types are value validation regex (P13), formatter URL (P8), and Wikidata concept (P12)/Wikidata equivalent (P7).