Interface LexemeDocument
- All Superinterfaces:
EntityDocument
,StatementDocument
- All Known Implementing Classes:
LexemeDocumentImpl
Interface for datasets that describe lexemes.
- Author:
- Thomas Pellissier Tanon
-
Method Summary
Modifier and TypeMethodDescriptioncreateForm
(List<MonolingualTextValue> representations) Creates a newFormDocument
for this lexeme.createSense
(List<MonolingualTextValue> glosses) Creates a newSenseDocument
for this Lexeme.Returns the ID of the entity that the data refers togetForm
(FormIdValue formId) Return the inner form having the given idgetForms()
Return the lexeme formsReturn the ID of the language to which the lexeme belongs (French, British English...)Return the human readable representations of the lexeme indexed by Wikimedia language codeReturn the ID of the lexical category to which the lexeme belongs (noun, verb...)getSense
(SenseIdValue formId) Return the inner sense having the given idReturn the lexeme senseswithEntityId
(LexemeIdValue newEntityId) Returns a new version of this document with updated ID.withForm
(FormDocument form) Adds aFormDocument
to this lexeme.withLanguage
(ItemIdValue newLanguage) withLemma
(MonolingualTextValue lemma) withLexicalCategory
(ItemIdValue newLexicalCategory) 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.withSense
(SenseDocument sense) Adds aSenseDocument
to this lexeme.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.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
-
Method Details
-
getEntityId
LexemeIdValue getEntityId()Returns the ID of the entity that the data refers to- Specified by:
getEntityId
in interfaceEntityDocument
- Returns:
- lexeme id
-
getLexicalCategory
ItemIdValue getLexicalCategory()Return the ID of the lexical category to which the lexeme belongs (noun, verb...)- Returns:
- item id
-
getLanguage
ItemIdValue getLanguage()Return the ID of the language to which the lexeme belongs (French, British English...)- Returns:
- item id
-
getLemmas
Map<String,MonolingualTextValue> getLemmas()Return the human readable representations of the lexeme indexed by Wikimedia language code- Returns:
- a map from Wikimedia language code to the lemma
-
getForms
List<FormDocument> getForms()Return the lexeme forms- Returns:
- the list of forms
-
getForm
Return the inner form having the given id- Throws:
IndexOutOfBoundsException
- if there is no form with this id in the document
-
getSenses
List<SenseDocument> getSenses()Return the lexeme senses- Returns:
- the list of senses
-
getSense
Return the inner sense having the given id- Throws:
IndexOutOfBoundsException
- if there is no sense with this id in the document
-
withEntityId
Returns a new version of this document with updated ID.- Parameters:
newEntityId
- new ID of the document- Returns:
- document with updated ID
-
withRevisionId
Returns a copy of this document with an updated revision id.- Specified by:
withRevisionId
in interfaceEntityDocument
- Specified by:
withRevisionId
in interfaceStatementDocument
-
withLexicalCategory
-
withLanguage
-
withLemma
-
withStatement
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 interfaceStatementDocument
- Parameters:
statement
- the statement to add or update in the document
-
withoutStatementIds
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 interfaceStatementDocument
- Parameters:
statementIds
- the identifiers of the statements to remove
-
createForm
Creates a newFormDocument
for this lexeme. The form is not added to theLexemeDocument
object, it should be done withwithForm(org.wikidata.wdtk.datamodel.interfaces.FormDocument)
. -
withForm
Adds aFormDocument
to this lexeme. The form id should be prefixed with the lexeme id. -
createSense
Creates a newSenseDocument
for this Lexeme. The form is not added to theLexemeDocument
object, it should be done withwithSense(org.wikidata.wdtk.datamodel.interfaces.SenseDocument)
. -
withSense
Adds aSenseDocument
to this lexeme. The sense id should be prefixed with the lexeme id.
-