Class WikiData
- java.lang.Object
-
- org.openstreetmap.atlas.checks.database.wikidata.WikiData
-
public final class WikiData extends java.lang.ObjectA WikiData bean for encoding/decoding WikiData table information. Any item with an @Unstable annotation is not yet finalized. Please avoid using them, or expect breakage if you do.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidclearWikiData()Clear wiki data items after a database updatejava.util.Collection<java.lang.String>getBelongsToRelationTypeP43()If this WikiData item is a relation role, this links to the corresponding relation type (for example, "boundary=inner" -> "multipolygon").java.util.Collection<java.lang.String>getCombinationP46()This key/tag works well with the returned Q id key/tags.java.util.Collection<java.lang.String>getDifferentFromP18()Item that is different from another item, but they are often confused.java.util.Collection<java.lang.String>getDocumentationWikiPagesP31()Wiki pages for this item in different languages.java.util.Collection<java.lang.String>getFormatterUrlP8()URI template from which "$1" can be automatically replaced with the effective property value on items.java.util.Collection<java.lang.String>getGeographicCodeP49()A code that represents either a country or a country's subdivision code.java.lang.StringgetGroupP25()Indicates which group the given tag or a key belongs to.java.lang.StringgetId()Get the Q id for this itemjava.util.Collection<java.lang.String>getIdenticalToP51()Current key/tag has identical meaning to the target key/tag, and both are actively used by the community.java.lang.StringgetImageCaptionP47()A qualifier to add to an image to specify image caption in a specific language.java.lang.StringgetImageP28()Image of the subject.java.util.Collection<java.lang.String>getImpliesP45()Any feature with the current key/tag also implies this key/tag, even if they are not explicitly set.java.util.Collection<java.lang.String>getIncompatibleWithP44()List of keys and tags that are incompatible with the current key or tag.java.util.Collection<java.lang.String>getInstanceOfP2()That class of which this subject is a particular example and member.java.lang.StringgetKeyForThisTagP10()For a given tag item, links to the corresponding key item.WikiDataItemgetKeyTypeP9()Type of the key entity, e.g.java.lang.StringgetLanguageCodeP32()A two or three letter ISO-639 language code.java.util.Collection<java.lang.String>getLimitedToLanguageP26()A qualifier property to specify when a statement only applies to a given documentation language, and nowhere else.java.lang.StringgetLimitedToRegionP48()Indicate that something is limited to a region.java.util.Collection<java.lang.String>getMustOnlyBeUsedInRegionP29()This key or tag is to be used only in the given region(s).java.util.Collection<java.lang.String>getNotToBeUsedInRegionP30()This key or tag must not be used in the given region(s).java.lang.StringgetOSMCartoImageP39()The OSM Carto rendering of the given feature.java.lang.StringgetPermanentKeyIdP16()A string representing the key ID.java.lang.StringgetPermanentRelationTypeIdP41()A string representing the role ID.java.lang.StringgetPermanentTagIdP19()A string in a "key=value" format as used in OSM.java.lang.StringgetPropertyDifferentFromP20()Property that is different from another property, but they are often confused.java.lang.StringgetProposalDiscussionP11()A link to the key or tag proposal page For more information, see Property:P11.java.lang.StringgetRedirectsToWikiPageP50()A qualifier for P31 (wiki page) indicating that the page is a redirect to another page.java.util.Collection<java.lang.String>getRedirectToP17()Indicates that the current key, tag or relation type should not be used.java.lang.StringgetRelationRoleIdP21()A string in a "relationtype=role" format.java.util.Collection<java.lang.String>getRequiredKeyOrTagP22()One or more tags or keys that are required for this item.WikiDataItemgetStatusP6()Community acceptance status.java.lang.StringgetSubclassOfP3()For more information, see Property:P3.java.lang.StringgetTagForThisRelationTypeP40()For a given relation item, links to the corresponding tag item, e.g.java.util.regex.PatterngetValueValidationRegexP13()Regular expression to test the validity of the tag's value.static WikiDatagetWikiData(java.lang.String identifier)Get a wikidata that goes with an identifierstatic WikiDatagetWikiData(java.util.Map<java.lang.String,java.lang.Object> wikiMap)Get or create a WikiData item from a mapjava.lang.StringgetWikiDataConceptP12()This key or tag represents a concept described by the given Wikidata item .For more information, see Property:P12.java.lang.StringgetWikidataEquivalentP7()This entity has an equivalent Wikidata entity, like "instance of".booleanisUseOnAreasP35()Use status to indicate if this key or tag should be used on areas (closed ways).booleanisUseOnChangesetsP37()Use status to indicate if this key or tag should be used on changesets For more information, see Property:P37.booleanisUseOnNodesP33()Use status to indicate if this key or tag should be used on nodes.booleanisUseOnRelationsP36()Use status to indicate if this key or tag should be used on relations.booleanisUseOnWaysP34()Use status to indicate if this key or tag should be used on ways (not areas).
-
-
-
Method Detail
-
clearWikiData
public static void clearWikiData()
Clear wiki data items after a database update
-
getWikiData
@Nullable public static WikiData getWikiData(java.util.Map<java.lang.String,java.lang.Object> wikiMap)
Get or create a WikiData item from a map- Parameters:
wikiMap- The map to convert to an item- Returns:
- A WikiData item or
null, if the map does not contain an "id" key.
-
getWikiData
@Nullable public static WikiData getWikiData(java.lang.String identifier)
Get a wikidata that goes with an identifier- Parameters:
identifier- The identifier to get- Returns:
- A WikiData item or
null, if one is not found.
-
getBelongsToRelationTypeP43
@Nonnull public java.util.Collection<java.lang.String> getBelongsToRelationTypeP43()
If this WikiData item is a relation role, this links to the corresponding relation type (for example, "boundary=inner" -> "multipolygon"). For more information, see Property:P43.- Returns:
- A collection of Q id relations
-
getCombinationP46
@Nonnull public java.util.Collection<java.lang.String> getCombinationP46()
This key/tag works well with the returned Q id key/tags. This can be used for suggestions. For more information, see Property:P46.- Returns:
- A list of Q id key/tags that this key/tag works well with
-
getDifferentFromP18
@Nonnull public java.util.Collection<java.lang.String> getDifferentFromP18()
Item that is different from another item, but they are often confused. For more information, see Property:P18.- Returns:
- A collection of Q ids that can be confused with this Q id
-
getDocumentationWikiPagesP31
@Unstable @Nonnull public java.util.Collection<java.lang.String> getDocumentationWikiPagesP31()
Wiki pages for this item in different languages. There should be no more than one value per language. For more information, see Property:P31.- Returns:
- Documentation wiki pages.
-
getFormatterUrlP8
@Nonnull public java.util.Collection<java.lang.String> getFormatterUrlP8()
URI template from which "$1" can be automatically replaced with the effective property value on items. For more information, see Property:P8.- Returns:
- A collection of formatting urls, where "$1" should be replaced (e.g.,
String.replace("\\$1", value))
-
getGeographicCodeP49
@Nonnull public java.util.Collection<java.lang.String> getGeographicCodeP49()
A code that represents either a country or a country's subdivision code. For more information, see Property:P49.- Returns:
- ISO 3166-1 alpha-2 or ISO 3166-2 codes
-
getGroupP25
@Unstable @Nonnull public java.lang.String getGroupP25()
Indicates which group the given tag or a key belongs to. For more information, see Property:P25.- Returns:
- The group for the wiki item
-
getId
@Nonnull public java.lang.String getId()
Get the Q id for this item- Returns:
- The Q id (Wiki Data ID)
-
getIdenticalToP51
@Nonnull public java.util.Collection<java.lang.String> getIdenticalToP51()
Current key/tag has identical meaning to the target key/tag, and both are actively used by the community. Both key/tags should appear on the object. For more information, see Property:P51.- Returns:
- A collection of Q ids that this wiki item is considered to be equivalent to
-
getImageCaptionP47
@Unstable @Nonnull public java.lang.String getImageCaptionP47()
A qualifier to add to an image to specify image caption in a specific language. For more information, see Property:P47.- Returns:
- A caption to add to an image
-
getImageP28
@Unstable @Nonnull public java.lang.String getImageP28()
Image of the subject. For more information, see Property:P28.- Returns:
- An image to show for the subject
-
getImpliesP45
@Nonnull public java.util.Collection<java.lang.String> getImpliesP45()
Any feature with the current key/tag also implies this key/tag, even if they are not explicitly set. For more information, see Property:P45.- Returns:
- A collection of Q ids which are implied by this key/tag
-
getIncompatibleWithP44
@Nonnull public java.util.Collection<java.lang.String> getIncompatibleWithP44()
List of keys and tags that are incompatible with the current key or tag. For more information, see Property:P44.- Returns:
- A list of Q ids that should not appear with this key/tag
-
getInstanceOfP2
@Nonnull public java.util.Collection<java.lang.String> getInstanceOfP2()
That class of which this subject is a particular example and member. For more information, see Property:P2.- Returns:
- Typically "key" or "tag", but may have multiple entries
-
getKeyForThisTagP10
@Nonnull public java.lang.String getKeyForThisTagP10()
For a given tag item, links to the corresponding key item. For more information, see Property:P10.- Returns:
- The Q id for the key for this tag
-
getKeyTypeP9
@Nullable public WikiDataItem getKeyTypeP9()
Type of the key entity, e.g. enum, external id. For more information, see Property:P9.- Returns:
- Either
nullorWikiDataItem.WELL_KNOWN_VALUES_Q8. If the latter, all values should be documented.
-
getLanguageCodeP32
@Nonnull public java.lang.String getLanguageCodeP32()
A two or three letter ISO-639 language code. For more information, see Property:P32.- Returns:
- The language code for the wiki item
-
getLimitedToLanguageP26
@Unstable @Nonnull public java.util.Collection<java.lang.String> getLimitedToLanguageP26()
A qualifier property to specify when a statement only applies to a given documentation language, and nowhere else. For more information, see Property:P26.- Returns:
- A collection of languages where the statement is limited to a language(s)
-
getLimitedToRegionP48
@Unstable @Nonnull public java.lang.String getLimitedToRegionP48()
Indicate that something is limited to a region. For more information, see Property:P48.- Returns:
- The limited regions
-
getMustOnlyBeUsedInRegionP29
@Nonnull public java.util.Collection<java.lang.String> getMustOnlyBeUsedInRegionP29()
This key or tag is to be used only in the given region(s). This property cannot be used at the same time as P30. For more information, see Property:P29.- Returns:
- A list of Q ids for the regions which the key/tag can be used in
-
getNotToBeUsedInRegionP30
@Nonnull public java.util.Collection<java.lang.String> getNotToBeUsedInRegionP30()
This key or tag must not be used in the given region(s). This property cannot be used at the same time as P29. For more information, see Property:P30.- Returns:
- A list of Q ids for the regions which the key/tag must not be used in
-
getOSMCartoImageP39
@Unstable @Nonnull public java.lang.String getOSMCartoImageP39()
The OSM Carto rendering of the given feature. For more information, see Property:P39.- Returns:
- The image used for rendering (you should prefix it with
"https://wiki.openstreetmap.org/wiki/File:").
-
getPermanentKeyIdP16
@Nonnull public java.lang.String getPermanentKeyIdP16()
A string representing the key ID. For more information, see Property:P16.- Returns:
- The key for the wiki item
-
getPermanentRelationTypeIdP41
@Nonnull public java.lang.String getPermanentRelationTypeIdP41()
A string representing the role ID. For more information, see Property:P41.- Returns:
- The relation type id (should be present as the value for the "type" key)
-
getPermanentTagIdP19
@Nonnull public java.lang.String getPermanentTagIdP19()
A string in a "key=value" format as used in OSM. For more information, see Property:P19.- Returns:
- The tag ("key=value")
-
getPropertyDifferentFromP20
@Unstable @Nonnull public java.lang.String getPropertyDifferentFromP20()
Property that is different from another property, but they are often confused. For more information, see Property:P20.- Returns:
- A property that this property is different from (not used for wiki items)
-
getProposalDiscussionP11
@Nonnull public java.lang.String getProposalDiscussionP11()
A link to the key or tag proposal page For more information, see Property:P11.- Returns:
- A full link to the proposal for this key/tag.
-
getRedirectToP17
@Nonnull public java.util.Collection<java.lang.String> getRedirectToP17()
Indicates that the current key, tag or relation type should not be used. Use the target item instead. For more information, see Property:P17.- Returns:
- The replacement key/tags
-
getRedirectsToWikiPageP50
@Unstable @Nonnull public java.lang.String getRedirectsToWikiPageP50()
A qualifier for P31 (wiki page) indicating that the page is a redirect to another page. For more information, see Property:P50.- Returns:
- The wiki page redirects
-
getRelationRoleIdP21
@Nonnull public java.lang.String getRelationRoleIdP21()
A string in a "relationtype=role" format. Should only be set on relation role items. For more information, see Property:P21.- Returns:
- The relation role id (
relation_type=role)
-
getRequiredKeyOrTagP22
@Nonnull public java.util.Collection<java.lang.String> getRequiredKeyOrTagP22()
One or more tags or keys that are required for this item. For more information, see Property:P22.- Returns:
- A collection of required keys or tags for this key/tag
-
getStatusP6
@Unstable @Nullable public WikiDataItem getStatusP6()
Community acceptance status. Use reference to link to the proposal discussion page (P11). For more information, see Property:P6.- Returns:
- The acceptance status
-
getSubclassOfP3
@Nonnull public java.lang.String getSubclassOfP3()
For more information, see Property:P3.- Returns:
- The parent class of this wiki item
-
getTagForThisRelationTypeP40
@Nonnull public java.lang.String getTagForThisRelationTypeP40()
For a given relation item, links to the corresponding tag item, e.g. type=multipolygon. For more information, see Property:P40.- Returns:
- The relation type that this wiki item is a part of
-
getValueValidationRegexP13
@Nullable public java.util.regex.Pattern getValueValidationRegexP13()
Regular expression to test the validity of the tag's value. May also be used for role names. The wrapping ^( and )$ are assumed. Should not be used for well-known keys. For more information, see Property:P13.- Returns:
- A precompiled regex pattern with the wrapping ^( and )$ already added, or
nullif there is no regex.
-
getWikiDataConceptP12
@Nonnull public java.lang.String getWikiDataConceptP12()
This key or tag represents a concept described by the given Wikidata item .For more information, see Property:P12.- Returns:
- A Q id item for an external wiki data item
-
getWikidataEquivalentP7
@Nonnull public java.lang.String getWikidataEquivalentP7()
This entity has an equivalent Wikidata entity, like "instance of". For more information, see Property:P7.- Returns:
- The wikidata identifier (external).
-
isUseOnAreasP35
@Unstable @Nonnull public boolean isUseOnAreasP35()
Use status to indicate if this key or tag should be used on areas (closed ways). Keep in mind that closed ways can be an area, a way, or both. For more information, see Property:P35.- Returns:
trueif the key/tag can generally be used on areas (defaults totrue)
-
isUseOnChangesetsP37
@Unstable @Nonnull public boolean isUseOnChangesetsP37()
Use status to indicate if this key or tag should be used on changesets For more information, see Property:P37.- Returns:
trueif the key/tag can generally be used on changesets (defaults totrue)
-
isUseOnNodesP33
public boolean isUseOnNodesP33()
Use status to indicate if this key or tag should be used on nodes. For more information, see Property:P33.- Returns:
trueif the key/tag can generally be used on nodes (defaults totrue)
-
isUseOnRelationsP36
public boolean isUseOnRelationsP36()
Use status to indicate if this key or tag should be used on relations. For more information, see Property:P36.- Returns:
trueif the key/tag can generall be used on nodes (defaults totrue)
-
isUseOnWaysP34
public boolean isUseOnWaysP34()
Use status to indicate if this key or tag should be used on ways (not areas). Keep in mind that a closed way can be a way, an area, or both. For more information, see Property:P34.- Returns:
trueif the key/tag can generally be used on ways (defaults totrue)
-
-