Interface TermedDocument
- All Superinterfaces:
EntityDocument
,LabeledDocument
- All Known Subinterfaces:
ItemDocument
,PropertyDocument
,TermedStatementDocument
- All Known Implementing Classes:
ItemDocumentImpl
,PropertyDocumentImpl
,TermedStatementDocumentImpl
Interface for EntityDocuments that can be described by terms in several
languages. These terms consist labels, descriptions, and aliases.
- Author:
- Markus Kroetzsch
-
Method Summary
Modifier and TypeMethodDescriptiondefault String
findDescription
(String languageCode) Returns the string description for the given language code, or null if there is no description for this code.Return a Map from Wikibase language codes to lists of alias labels for a given language.Return a Map from Wikibase language codes to descriptions.withAliases
(String language, List<MonolingualTextValue> aliases) Returns a new version of this document with a new list of aliases for the given language code.withDescription
(MonolingualTextValue newDescription) Returns a new version of this document with a new description (which overrides any existing description).withLabel
(MonolingualTextValue newLabel) Returns a new version of this document with a new label (which overrides any existing label for this language).withRevisionId
(long newRevisionId) Returns a copy of this document with an updated revision id.Methods inherited from interface org.wikidata.wdtk.datamodel.interfaces.EntityDocument
getEntityId, getRevisionId
Methods inherited from interface org.wikidata.wdtk.datamodel.interfaces.LabeledDocument
findLabel, getLabels
-
Method Details
-
getDescriptions
Map<String,MonolingualTextValue> getDescriptions()Return a Map from Wikibase language codes to descriptions.- Returns:
- the map of descriptions
-
getAliases
Map<String,List<MonolingualTextValue>> getAliases()Return a Map from Wikibase language codes to lists of alias labels for a given language.- Returns:
- the aliases for this language
-
findDescription
Returns the string description for the given language code, or null if there is no description for this code. This is a convenience method for accessing the data that can be obtained viagetDescriptions()
.- Parameters:
languageCode
- a string that represents language- Returns:
- the description string or null if it does not exists
-
withRevisionId
Returns a copy of this document with an updated revision id.- Specified by:
withRevisionId
in interfaceEntityDocument
- Specified by:
withRevisionId
in interfaceLabeledDocument
-
withLabel
Returns a new version of this document with a new label (which overrides any existing label for this language).- Specified by:
withLabel
in interfaceLabeledDocument
-
withDescription
Returns a new version of this document with a new description (which overrides any existing description). -
withAliases
Returns a new version of this document with a new list of aliases for the given language code. Any existing aliases for this language will be discarded.- Parameters:
language
- the language code for which the aliases should be setaliases
- the aliases to set for this language. The language codes they contain should all match the supplied language.
-