Interface PropertyDocument
- All Superinterfaces:
EntityDocument
,LabeledDocument
,LabeledStatementDocument
,StatementDocument
,TermedDocument
,TermedStatementDocument
- All Known Implementing Classes:
PropertyDocumentImpl
Interface for datasets that describe properties. It extends
EntityDocument
with information about the datatype of a property.
Claims or Statements on properties might be supported in the future.
- Author:
- Markus Kroetzsch
-
Method Summary
Modifier and TypeMethodDescriptionGet the datatype id of the datatype defined for this property.Return the ID of the item that the data refers to.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).withEntityId
(PropertyIdValue newEntityId) Returns a new version of this document with updated ID.withLabel
(MonolingualTextValue newLabel) Returns a new version of this document with a new label (which overrides any existing label for this language).withoutStatementIds
(Set<String> statementIds) Returns a new version of this document where all statements matching any of the statement ids provided have been removed.withRevisionId
(long newRevisionId) Returns a copy of this document with an updated revision id.withStatement
(Statement statement) Returns a new version of this document which includes the statement provided.Methods inherited from interface org.wikidata.wdtk.datamodel.interfaces.EntityDocument
getRevisionId
Methods inherited from interface org.wikidata.wdtk.datamodel.interfaces.LabeledDocument
findLabel, getLabels
Methods inherited from interface org.wikidata.wdtk.datamodel.interfaces.StatementDocument
findStatement, findStatement, findStatementEntityIdValue, findStatementEntityIdValue, findStatementGlobeCoordinatesValue, findStatementGlobeCoordinatesValue, findStatementGroup, findStatementGroup, findStatementItemIdValue, findStatementItemIdValue, findStatementMonolingualTextValue, findStatementMonolingualTextValue, findStatementPropertyIdValue, findStatementPropertyIdValue, findStatementQuantityValue, findStatementQuantityValue, findStatementStringValue, findStatementStringValue, findStatementTimeValue, findStatementTimeValue, findStatementValue, findStatementValue, getAllStatements, getStatementGroups, hasStatement, hasStatement, hasStatementValue, hasStatementValue, hasStatementValue, hasStatementValue
Methods inherited from interface org.wikidata.wdtk.datamodel.interfaces.TermedDocument
findDescription, getAliases, getDescriptions
-
Method Details
-
getEntityId
PropertyIdValue getEntityId()Return the ID of the item that the data refers to.- Specified by:
getEntityId
in interfaceEntityDocument
- Returns:
- item id
-
getDatatype
DatatypeIdValue getDatatype()Get the datatype id of the datatype defined for this property.- Returns:
DatatypeIdValue
-
withEntityId
Returns a new version of this document with updated ID.- Parameters:
newEntityId
- new ID of the document- Returns:
- document with updated ID
-
withRevisionId
Description copied from interface:TermedDocument
Returns a copy of this document with an updated revision id.- Specified by:
withRevisionId
in interfaceEntityDocument
- Specified by:
withRevisionId
in interfaceLabeledDocument
- Specified by:
withRevisionId
in interfaceLabeledStatementDocument
- Specified by:
withRevisionId
in interfaceStatementDocument
- Specified by:
withRevisionId
in interfaceTermedDocument
- Specified by:
withRevisionId
in interfaceTermedStatementDocument
-
withLabel
Description copied from interface:TermedDocument
Returns a new version of this document with a new label (which overrides any existing label for this language).- Specified by:
withLabel
in interfaceLabeledDocument
- Specified by:
withLabel
in interfaceLabeledStatementDocument
- Specified by:
withLabel
in interfaceTermedDocument
- Specified by:
withLabel
in interfaceTermedStatementDocument
-
withDescription
Description copied from interface:TermedDocument
Returns a new version of this document with a new description (which overrides any existing description).- Specified by:
withDescription
in interfaceTermedDocument
- Specified by:
withDescription
in interfaceTermedStatementDocument
-
withAliases
Description copied from interface:TermedDocument
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.- Specified by:
withAliases
in interfaceTermedDocument
- Specified by:
withAliases
in interfaceTermedStatementDocument
- 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.
-
withStatement
Description copied from interface:StatementDocument
Returns a new version of this document which includes the statement provided. If the identifier of this statement matches that of any other statement for the same property, then the existing statement will be replaced by the new one. Otherwise, the new statement will be added at the end of the list of statements in this group.- Specified by:
withStatement
in interfaceLabeledStatementDocument
- Specified by:
withStatement
in interfaceStatementDocument
- Specified by:
withStatement
in interfaceTermedStatementDocument
- Parameters:
statement
- the statement to add or update in the document
-
withoutStatementIds
Description copied from interface:StatementDocument
Returns a new version of this document where all statements matching any of the statement ids provided have been removed. These statements can use different properties.- Specified by:
withoutStatementIds
in interfaceLabeledStatementDocument
- Specified by:
withoutStatementIds
in interfaceStatementDocument
- Specified by:
withoutStatementIds
in interfaceTermedStatementDocument
- Parameters:
statementIds
- the identifiers of the statements to remove
-