public class LexemeDocumentImpl extends EntityDocumentImpl implements LexemeDocument
LexemeDocument
.Modifier and Type | Field and Description |
---|---|
protected Map<String,List<Statement>> |
claims
This is what is called claim in the JSON model.
|
entityId, revisionId, siteIri
Constructor and Description |
---|
LexemeDocumentImpl(String jsonId,
String lexicalCategory,
String language,
Map<String,MonolingualTextValue> lemmas,
Map<String,List<StatementImpl.PreStatement>> claims,
List<FormDocument> forms,
List<SenseDocument> senses,
long revisionId,
String siteIri)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected static Map<String,List<Statement>> |
addStatementToGroups(Statement statement,
Map<String,List<Statement>> claims)
Adds a Statement to a given collection of statement groups.
|
FormDocument |
createForm(List<MonolingualTextValue> representations)
Creates a new
FormDocument for this lexeme. |
SenseDocument |
createSense(List<MonolingualTextValue> glosses)
Creates a new
SenseDocument for this Lexeme. |
boolean |
equals(Object obj) |
StatementGroup |
findStatementGroup(String propertyIdValue)
Find a statement group by its property id, without checking for
equality with the site IRI.
|
Iterator<Statement> |
getAllStatements()
Returns an iterator that provides access to all statements, without
considering the statement groups.
|
LexemeIdValue |
getEntityId()
Returns the ID of the entity that the data refers to
|
FormDocument |
getForm(FormIdValue formId)
Return the inner form having the given id
|
List<FormDocument> |
getForms()
Return the lexeme forms
|
Map<String,List<Statement>> |
getJsonClaims()
Returns the "claims".
|
ItemIdValue |
getLanguage()
Return the ID of the language to which the lexeme belongs
(French, British English...)
|
Map<String,MonolingualTextValue> |
getLemmas()
Return the human readable representations of the lexeme indexed by Wikimedia language code
|
ItemIdValue |
getLexicalCategory()
Return the ID of the lexical category to which the lexeme belongs
(noun, verb...)
|
SenseDocument |
getSense(SenseIdValue senseId)
Return the inner sense having the given id
|
List<SenseDocument> |
getSenses()
Return the lexeme senses
|
List<StatementGroup> |
getStatementGroups()
Return the list of all StatementGroups stored for this item.
|
int |
hashCode() |
protected static Map<String,List<Statement>> |
removeStatements(Set<String> statementIds,
Map<String,List<Statement>> claims)
Removes statement ids from a collection of statement groups.
|
String |
toString() |
LexemeDocument |
withEntityId(LexemeIdValue newEntityId)
Returns a new version of this document with updated ID.
|
LexemeDocument |
withForm(FormDocument form)
Adds a
FormDocument to this lexeme. |
LexemeDocument |
withLanguage(ItemIdValue newLanguage) |
LexemeDocument |
withLemma(MonolingualTextValue lemma) |
LexemeDocument |
withLexicalCategory(ItemIdValue newLexicalCategory) |
LexemeDocument |
withoutStatementIds(Set<String> statementIds)
Returns a new version of this document where all statements matching
any of the statement ids provided have been removed.
|
LexemeDocument |
withRevisionId(long newRevisionId)
Returns a copy of this document with an updated revision id.
|
LexemeDocument |
withSense(SenseDocument sense)
Adds a
SenseDocument to this lexeme. |
LexemeDocument |
withStatement(Statement statement)
Returns a new version of this document which includes the
statement provided.
|
getJsonId, getRevisionId, getSiteIri
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
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
getRevisionId
public LexemeDocumentImpl(String jsonId, String lexicalCategory, String language, Map<String,MonolingualTextValue> lemmas, Map<String,List<StatementImpl.PreStatement>> claims, List<FormDocument> forms, List<SenseDocument> senses, long revisionId, String siteIri)
public LexemeIdValue getEntityId()
LexemeDocument
getEntityId
in interface EntityDocument
getEntityId
in interface LexemeDocument
public ItemIdValue getLexicalCategory()
LexemeDocument
getLexicalCategory
in interface LexemeDocument
public ItemIdValue getLanguage()
LexemeDocument
getLanguage
in interface LexemeDocument
public Map<String,MonolingualTextValue> getLemmas()
LexemeDocument
getLemmas
in interface LexemeDocument
public List<FormDocument> getForms()
LexemeDocument
getForms
in interface LexemeDocument
public List<SenseDocument> getSenses()
LexemeDocument
getSenses
in interface LexemeDocument
public FormDocument getForm(FormIdValue formId)
LexemeDocument
getForm
in interface LexemeDocument
public SenseDocument getSense(SenseIdValue senseId)
LexemeDocument
getSense
in interface LexemeDocument
public LexemeDocument withEntityId(LexemeIdValue newEntityId)
LexemeDocument
withEntityId
in interface LexemeDocument
newEntityId
- new ID of the documentpublic LexemeDocument withLexicalCategory(ItemIdValue newLexicalCategory)
withLexicalCategory
in interface LexemeDocument
public LexemeDocument withLanguage(ItemIdValue newLanguage)
withLanguage
in interface LexemeDocument
public LexemeDocument withLemma(MonolingualTextValue lemma)
withLemma
in interface LexemeDocument
public LexemeDocument withStatement(Statement statement)
LexemeDocument
withStatement
in interface LexemeDocument
withStatement
in interface StatementDocument
statement
- the statement to add or update in the documentpublic LexemeDocument withoutStatementIds(Set<String> statementIds)
LexemeDocument
withoutStatementIds
in interface LexemeDocument
withoutStatementIds
in interface StatementDocument
statementIds
- the identifiers of the statements to removepublic FormDocument createForm(List<MonolingualTextValue> representations)
LexemeDocument
FormDocument
for this lexeme.
The form is not added to the LexemeDocument
object,
it should be done with LexemeDocument.withForm(org.wikidata.wdtk.datamodel.interfaces.FormDocument)
.createForm
in interface LexemeDocument
public LexemeDocument withForm(FormDocument form)
LexemeDocument
FormDocument
to this lexeme.
The form id should be prefixed with the lexeme id.withForm
in interface LexemeDocument
public SenseDocument createSense(List<MonolingualTextValue> glosses)
LexemeDocument
SenseDocument
for this Lexeme.
The form is not added to the LexemeDocument
object,
it should be done with LexemeDocument.withSense(org.wikidata.wdtk.datamodel.interfaces.SenseDocument)
.createSense
in interface LexemeDocument
public LexemeDocument withSense(SenseDocument sense)
LexemeDocument
SenseDocument
to this lexeme.
The sense id should be prefixed with the lexeme id.withSense
in interface LexemeDocument
public LexemeDocument withRevisionId(long newRevisionId)
LexemeDocument
withRevisionId
in interface EntityDocument
withRevisionId
in interface LexemeDocument
withRevisionId
in interface StatementDocument
public List<StatementGroup> getStatementGroups()
StatementDocument
getStatementGroups
in interface StatementDocument
public StatementGroup findStatementGroup(String propertyIdValue)
findStatementGroup
in interface StatementDocument
propertyIdValue
- the property to search forStatementGroup
or nullpublic Map<String,List<Statement>> getJsonClaims()
JSON "claims" correspond to statement groups in the WDTK model. You
should use StatementDocumentImpl.getStatementGroups()
to obtain
this data.
public Iterator<Statement> getAllStatements()
StatementDocument
getAllStatements
in interface StatementDocument
protected static Map<String,List<Statement>> addStatementToGroups(Statement statement, Map<String,List<Statement>> claims)
statement
- claims
- Copyright © 2014–2024 Wikidata Toolkit Developers. Generated from source code published under the Apache License 2.0. For more information, see the Wikidata Toolkit homepage