public abstract class JacksonTermedStatementDocument extends Object implements TermedDocument, StatementDocument
TermedDocument. Like all Jackson
objects, it is not technically immutable, but it is strongly recommended to
treat it as such in all contexts: the setters are for Jackson; never call
them in your code.| Modifier and Type | Field and Description |
|---|---|
protected Map<String,List<JacksonMonolingualTextValue>> |
aliases |
protected Map<String,JacksonMonolingualTextValue> |
descriptions |
protected String |
entityId
The id of the entity that the document refers to.
|
static String |
JSON_TYPE_ITEM
String used to refer to items in JSON.
|
static String |
JSON_TYPE_PROPERTY
String used to refer to properties in JSON.
|
protected Map<String,JacksonMonolingualTextValue> |
labels |
protected String |
siteIri
The site IRI that this document refers to, or null if not specified.
|
| Constructor and Description |
|---|
JacksonTermedStatementDocument()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Map<String,List<MonolingualTextValue>> |
getAliases()
Return a Map from Wikibase language codes to lists of alias labels for a
given language.
|
Iterator<Statement> |
getAllStatements()
Returns an iterator that provides access to all statements, without
considering the statement groups.
|
Map<String,MonolingualTextValue> |
getDescriptions()
Return a Map from Wikibase language codes to descriptions.
|
Map<String,List<JacksonStatement>> |
getJsonClaims()
Returns the "claims".
|
String |
getJsonId()
Returns the string id of the entity that this document refers to.
|
Map<String,MonolingualTextValue> |
getLabels()
Return a Map from Wikibase language codes to labels.
|
String |
getSiteIri() |
List<StatementGroup> |
getStatementGroups()
Return the list of all StatementGroups stored for this item.
|
void |
setAliases(Map<String,List<JacksonMonolingualTextValue>> aliases)
Sets the aliases to the given value.
|
void |
setDescriptions(Map<String,JacksonMonolingualTextValue> descriptions)
Sets the descriptions to the given value.
|
void |
setJsonClaims(Map<String,List<JacksonStatement>> claims)
Sets the "claims" to the given value.
|
void |
setJsonId(String id)
Sets the string id of the entity that this document refers to.
|
void |
setLabels(Map<String,JacksonMonolingualTextValue> labels)
Sets the labels to the given value.
|
void |
setSiteIri(String siteIri)
Sets the site iri to the given value.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetEntityIdpublic static final String JSON_TYPE_ITEM
public static final String JSON_TYPE_PROPERTY
protected Map<String,List<JacksonMonolingualTextValue>> aliases
protected Map<String,JacksonMonolingualTextValue> labels
protected Map<String,JacksonMonolingualTextValue> descriptions
protected String entityId
The site IRI, which would also be required to create a complete
EntityIdValue, is not encoded in JSON. It needs to be injected
from the outside (if not, we default to Wikidata).
protected String siteIri
EntityIdValue.getSiteIri()public JacksonTermedStatementDocument()
public void setAliases(Map<String,List<JacksonMonolingualTextValue>> aliases)
aliases - new valuepublic Map<String,List<MonolingualTextValue>> getAliases()
TermedDocumentgetAliases in interface TermedDocumentpublic void setDescriptions(Map<String,JacksonMonolingualTextValue> descriptions)
descriptions - new valuepublic Map<String,MonolingualTextValue> getDescriptions()
TermedDocumentgetDescriptions in interface TermedDocumentpublic void setLabels(Map<String,JacksonMonolingualTextValue> labels)
labels - new valuepublic Map<String,MonolingualTextValue> getLabels()
TermedDocumentgetLabels in interface TermedDocumentpublic void setJsonId(String id)
id - new valuepublic String getJsonId()
public void setSiteIri(String siteIri)
siteIri - the site IRIEntityIdValue.getSiteIri()public String getSiteIri()
public List<StatementGroup> getStatementGroups()
StatementDocumentgetStatementGroups in interface StatementDocumentpublic void setJsonClaims(Map<String,List<JacksonStatement>> claims)
The name refers to the JSON model, where claims are similar to statement groups. This should not be confused with claims as used in the WDTK data model. This will probably only be used by the Jacksons' ObjectMapper.
claims - public Map<String,List<JacksonStatement>> getJsonClaims()
JSON "claims" correspond to statement groups in the WDTK model. You
should use getStatementGroups() to obtain
this data.
public Iterator<Statement> getAllStatements()
StatementDocumentgetAllStatements in interface StatementDocumentCopyright © 2014–2015 Wikidata Toolkit Developers. Generated from source code published under the Apache License 2.0. For more information, see the Wikidata Toolkit homepage