public class DataObjectFactoryImpl extends Object implements DataObjectFactory
Constructor and Description |
---|
DataObjectFactoryImpl() |
public ItemIdValue getItemIdValue(String id, String siteIri)
DataObjectFactory
ItemIdValue
.getItemIdValue
in interface DataObjectFactory
id
- a string of the form Qn... where n... is the string
representation of a positive integer numbersiteIri
- IRI to identify the site, usually the first part of the entity
IRI of the site this belongs to, e.g.,
"http://www.wikidata.org/entity/"ItemIdValue
corresponding to the inputpublic PropertyIdValue getPropertyIdValue(String id, String siteIri)
DataObjectFactory
PropertyIdValue
.getPropertyIdValue
in interface DataObjectFactory
id
- a string of the form Pn... where n... is the string
representation of a positive integer numbersiteIri
- IRI to identify the site, usually the first part of the entity
IRI of the site this belongs to, e.g.,
"http://www.wikidata.org/entity/"PropertyIdValue
corresponding to the inputpublic LexemeIdValue getLexemeIdValue(String id, String siteIri)
DataObjectFactory
LexemeIdValue
.getLexemeIdValue
in interface DataObjectFactory
id
- a string of the form Ln... where n... is the string
representation of a positive integer numbersiteIri
- IRI to identify the site, usually the first part of the entity
IRI of the site this belongs to, e.g.,
"http://www.wikidata.org/entity/"LexemeIdValue
corresponding to the inputpublic FormIdValue getFormIdValue(String id, String siteIri)
DataObjectFactory
FormIdValue
.getFormIdValue
in interface DataObjectFactory
id
- a string of the form Ln...-Fm... where n... and m... are the string
representation of a positive integer numbersiteIri
- IRI to identify the site, usually the first part of the entity
IRI of the site this belongs to, e.g.,
"http://www.wikidata.org/entity/"FormIdValue
corresponding to the inputpublic SenseIdValue getSenseIdValue(String id, String siteIri)
DataObjectFactory
SenseIdValue
.getSenseIdValue
in interface DataObjectFactory
id
- a string of the form Ln...-Sm... where n... and m... are the string
representation of a positive integer numbersiteIri
- IRI to identify the site, usually the first part of the entity
IRI of the site this belongs to, e.g.,
"http://www.wikidata.org/entity/"SenseIdValue
corresponding to the inputpublic MediaInfoIdValue getMediaInfoIdValue(String id, String siteIri)
DataObjectFactory
MediaInfoIdValue
.getMediaInfoIdValue
in interface DataObjectFactory
id
- a string of the form Mn... where n... is the string
representation of a positive integer numbersiteIri
- IRI to identify the site, usually the first part of the entity
IRI of the site this belongs to, e.g.,
"http://www.wikidata.org/entity/"MediaInfoIdValue
corresponding to the inputpublic DatatypeIdValue getDatatypeIdValue(String id)
DataObjectFactory
DatatypeIdValue
. The datatype IRI is usually one of the
constants defined in DatatypeIdValue
, but this is not enforced,
since there might be extensions that provide additional types.getDatatypeIdValue
in interface DataObjectFactory
id
- the IRI string that identifies the datatypeDatatypeIdValue
corresponding to the inputpublic DatatypeIdValue getDatatypeIdValueFromJsonId(String jsonId)
DataObjectFactory
DatatypeIdValue
. The datatype IRI is usually one of the
constants defined in DatatypeIdValue
, but this is not enforced,
since there might be extensions that provide additional types. The JSON
string is its representation in the JSON serialization of properties.getDatatypeIdValueFromJsonId
in interface DataObjectFactory
jsonId
- the JSON representation of this datatype, which cannot be nullDatatypeIdValue
corresponding to the inputpublic TimeValue getTimeValue(long year, byte month, byte day, byte hour, byte minute, byte second, byte precision, int beforeTolerance, int afterTolerance, int timezoneOffset, String calendarModel)
DataObjectFactory
TimeValue
.getTimeValue
in interface DataObjectFactory
year
- a year number, where 0 refers to 1BCEmonth
- a month number between 1 and 12day
- a day number between 1 and 31hour
- an hour number between 0 and 23minute
- a minute number between 0 and 59second
- a second number between 0 and 60 (possible leap second)precision
- a value in the range of TimeValue.PREC_DAY
, ...,
TimeValue.PREC_1GY
beforeTolerance
- non-negative integer tolerance before the value; see
TimeValue.getBeforeTolerance()
afterTolerance
- non-zero, positive integer tolerance before the value; see
TimeValue.getAfterTolerance()
timezoneOffset
- offset in minutes that should be applied when displaying this
timecalendarModel
- the IRI of the calendar model preferred when displaying the
date; usually TimeValue.CM_GREGORIAN_PRO
or
TimeValue.CM_JULIAN_PRO
TimeValue
corresponding to the inputpublic GlobeCoordinatesValue getGlobeCoordinatesValue(double latitude, double longitude, double precision, String globeIri)
DataObjectFactory
GlobeCoordinatesValue
.getGlobeCoordinatesValue
in interface DataObjectFactory
latitude
- the latitude of the coordinates in degreeslongitude
- the longitude of the coordinates in degreesprecision
- the precision of the coordinates in degreesglobeIri
- IRI specifying the celestial objects of the coordinatesGlobeCoordinatesValue
corresponding to the inputpublic StringValue getStringValue(String string)
DataObjectFactory
StringValue
.getStringValue
in interface DataObjectFactory
StringValue
corresponding to the inputpublic MonolingualTextValue getMonolingualTextValue(String text, String languageCode)
DataObjectFactory
MonolingualTextValue
.getMonolingualTextValue
in interface DataObjectFactory
text
- the text of the valuelanguageCode
- the language code of the valueMonolingualTextValue
corresponding to the inputpublic QuantityValue getQuantityValue(BigDecimal numericValue)
DataObjectFactory
QuantityValue
without a unit of measurement and bounds.getQuantityValue
in interface DataObjectFactory
numericValue
- the numeric value of this quantityQuantityValue
corresponding to the inputpublic QuantityValue getQuantityValue(BigDecimal numericValue, BigDecimal lowerBound, BigDecimal upperBound)
DataObjectFactory
QuantityValue
without a unit of measurement.getQuantityValue
in interface DataObjectFactory
numericValue
- the numeric value of this quantitylowerBound
- the lower bound of the numeric value of this quantityupperBound
- the upper bound of the numeric value of this quantityQuantityValue
corresponding to the inputpublic QuantityValue getQuantityValue(BigDecimal numericValue, String unit)
DataObjectFactory
QuantityValue
without bounds.getQuantityValue
in interface DataObjectFactory
numericValue
- the numeric value of this quantityunit
- the unit of this quantity, or the empty string if there is no
unitQuantityValue
corresponding to the inputpublic QuantityValue getQuantityValue(BigDecimal numericValue, ItemIdValue unit)
DataObjectFactory
QuantityValue
without bounds.getQuantityValue
in interface DataObjectFactory
numericValue
- the numeric value of this quantityunit
- the unit of this quantity, or null if there is no
unitQuantityValue
corresponding to the input@Deprecated public QuantityValue getQuantityValue(BigDecimal numericValue, BigDecimal lowerBound, BigDecimal upperBound, String unit)
DataObjectFactory
QuantityValue
.getQuantityValue
in interface DataObjectFactory
numericValue
- the numeric value of this quantitylowerBound
- the lower bound of the numeric value of this quantityupperBound
- the upper bound of the numeric value of this quantityunit
- the unit of this quantity, or the empty string if there is no
unitQuantityValue
corresponding to the inputpublic QuantityValue getQuantityValue(BigDecimal numericValue, BigDecimal lowerBound, BigDecimal upperBound, ItemIdValue unit)
DataObjectFactory
QuantityValue
.getQuantityValue
in interface DataObjectFactory
numericValue
- the numeric value of this quantitylowerBound
- the lower bound of the numeric value of this quantityupperBound
- the upper bound of the numeric value of this quantityunit
- the unit of this quantity, or null if there is no
unitQuantityValue
corresponding to the inputpublic ValueSnak getValueSnak(PropertyIdValue propertyId, Value value)
ValueSnakImpl
. Value snaks in JSON need to know the
datatype of their property, which is not given in the parameters of this
method. The snak that will be returned will use a default type based on
the kind of value that is used (usually the "simplest" type for that
value). This may not be desired.getValueSnak
in interface DataObjectFactory
ValueSnak
corresponding to the inputDataObjectFactory.getValueSnak(PropertyIdValue, Value)
public SomeValueSnak getSomeValueSnak(PropertyIdValue propertyId)
DataObjectFactory
SomeValueSnak
.getSomeValueSnak
in interface DataObjectFactory
SomeValueSnak
corresponding to the inputpublic NoValueSnak getNoValueSnak(PropertyIdValue propertyId)
DataObjectFactory
NoValueSnak
.getNoValueSnak
in interface DataObjectFactory
NoValueSnak
corresponding to the inputpublic SnakGroup getSnakGroup(List<? extends Snak> snaks)
DataObjectFactory
SnakGroup
.getSnakGroup
in interface DataObjectFactory
snaks
- a non-empty list of snaks that use the same propertySnakGroup
corresponding to the inputpublic Claim getClaim(EntityIdValue subject, Snak mainSnak, List<SnakGroup> qualifiers)
DataObjectFactory
Claim
. It might be more convenient to use
DataObjectFactory.getStatement(org.wikidata.wdtk.datamodel.interfaces.EntityIdValue, org.wikidata.wdtk.datamodel.interfaces.Snak, java.util.List<org.wikidata.wdtk.datamodel.interfaces.SnakGroup>, java.util.List<org.wikidata.wdtk.datamodel.interfaces.Reference>, org.wikidata.wdtk.datamodel.interfaces.StatementRank, java.lang.String)
directly if you want to build a statement.getClaim
in interface DataObjectFactory
subject
- the subject the Statement refers tomainSnak
- the main Snak of the Statementqualifiers
- the qualifiers of the Statement, grouped in SnakGroupsClaim
corresponding to the inputpublic Reference getReference(List<SnakGroup> snakGroups)
DataObjectFactory
Reference
. It might be more convenient to use
ReferenceBuilder
instead.getReference
in interface DataObjectFactory
snakGroups
- list of snak groupsReference
corresponding to the inputpublic Statement getStatement(Claim claim, List<Reference> references, StatementRank rank, String statementId)
DataObjectFactory
Statement
. It might be more convenient to use
StatementBuilder
instead.
The string id is used mainly for communication with a Wikibase site, in order to refer to statements of that site. When creating new statements that are not on any site, the empty string can be used.
getStatement
in interface DataObjectFactory
claim
- the main claim the Statement refers toreferences
- the references for the Statementrank
- the rank of the StatementstatementId
- the string id of the StatementStatement
corresponding to the inputpublic Statement getStatement(EntityIdValue subject, Snak mainSnak, List<SnakGroup> qualifiers, List<Reference> references, StatementRank rank, String statementId)
DataObjectFactory
Statement
. It might be more convenient to use
StatementBuilder
instead.
The string id is used mainly for communication with a Wikibase site, in order to refer to statements of that site. When creating new statements that are not on any site, the empty string can be used.
getStatement
in interface DataObjectFactory
subject
- the subject the Statement refers tomainSnak
- the main Snak of the Statementqualifiers
- the qualifiers of the Statement, grouped in SnakGroupsreferences
- the references for the Statementrank
- the rank of the StatementstatementId
- the string id of the StatementStatement
corresponding to the inputpublic StatementGroup getStatementGroup(List<Statement> statements)
DataObjectFactory
StatementGroup
.getStatementGroup
in interface DataObjectFactory
statements
- a non-empty list of statements that use the same subject and
main-snak property in their claimStatementGroup
corresponding to the inputpublic SiteLink getSiteLink(String title, String siteKey, List<ItemIdValue> badges)
DataObjectFactory
SiteLink
.getSiteLink
in interface DataObjectFactory
title
- the title string of the linked page, including namespace
prefixes if anysiteKey
- the string key of the site of the linked articlebadges
- the list of badges of the linked articleSiteLink
corresponding to the inputpublic PropertyDocument getPropertyDocument(PropertyIdValue propertyId, List<MonolingualTextValue> labels, List<MonolingualTextValue> descriptions, List<MonolingualTextValue> aliases, List<StatementGroup> statementGroups, DatatypeIdValue datatypeId, long revisionId)
DataObjectFactory
PropertyDocument
. It might be more convenient to use
the PropertyDocumentBuilder
instead.getPropertyDocument
in interface DataObjectFactory
propertyId
- the id of the property that data is aboutlabels
- the list of labels of this property, with at most one label
for each language codedescriptions
- the list of descriptions of this property, with at most one
description for each language codealiases
- the list of aliases of this propertystatementGroups
- the list of statement groups of this item; all of them must
have the given itemIdValue as their subjectdatatypeId
- the datatype of that propertyrevisionId
- the revision ID or 0 if not known; see
EntityDocument.getRevisionId()
PropertyDocument
corresponding to the inputpublic ItemDocument getItemDocument(ItemIdValue itemIdValue, List<MonolingualTextValue> labels, List<MonolingualTextValue> descriptions, List<MonolingualTextValue> aliases, List<StatementGroup> statementGroups, Map<String,SiteLink> siteLinks, long revisionId)
DataObjectFactory
ItemDocument
. It might be more convenient to use the
ItemDocumentBuilder
instead.getItemDocument
in interface DataObjectFactory
itemIdValue
- the id of the item that data is aboutlabels
- the list of labels of this item, with at most one label for
each language codedescriptions
- the list of descriptions of this item, with at most one
description for each language codealiases
- the list of aliases of this itemstatementGroups
- the list of statement groups of this item; all of them must
have the given itemIdValue as their subjectsiteLinks
- the sitelinks of this item by site keyrevisionId
- the revision ID or 0 if not known; see
EntityDocument.getRevisionId()
ItemDocument
corresponding to the inputpublic LexemeDocument getLexemeDocument(LexemeIdValue lexemeIdValue, ItemIdValue lexicalCategory, ItemIdValue language, List<MonolingualTextValue> lemmas, List<StatementGroup> statementGroups, List<FormDocument> forms, List<SenseDocument> senses, long revisionId)
DataObjectFactory
LexemeDocument
.getLexemeDocument
in interface DataObjectFactory
lexemeIdValue
- the id of the lexeme that data is aboutlexicalCategory
- the lexical category to which the lexeme belongs
(noun, verb...)language
- the language to which the lexeme belongs
(French, British English...)lemmas
- the human readable representations of the lexemestatementGroups
- the list of statement groups of this lexeme; all of them must
have the given lexemeIdValue as their subjectforms
- the forms of the lexemesenses
- the senses of the lexemerevisionId
- the revision ID or 0 if not known; see
EntityDocument.getRevisionId()
LexemeDocument
corresponding to the inputpublic FormDocument getFormDocument(FormIdValue formIdValue, List<MonolingualTextValue> representations, List<ItemIdValue> grammaticalFeatures, List<StatementGroup> statementGroups, long revisionId)
DataObjectFactory
FormDocument
.getFormDocument
in interface DataObjectFactory
formIdValue
- the id of the form that data is aboutrepresentations
- the list of representations of this lexeme, with at most one
lemma for each language codegrammaticalFeatures
- the grammatical features of the lexemestatementGroups
- the list of statement groups of this lexeme; all of them must
have the given lexemeIdValue as their subjectrevisionId
- the revision ID or 0 if not known; see
EntityDocument.getRevisionId()
FormDocument
corresponding to the inputpublic SenseDocument getSenseDocument(SenseIdValue senseIdValue, List<MonolingualTextValue> glosses, List<StatementGroup> statementGroups, long revisionId)
DataObjectFactory
SenseDocument
.getSenseDocument
in interface DataObjectFactory
senseIdValue
- the id of the form that data is aboutglosses
- the list of glosses of this lexeme, with at most one
gloss for each language codestatementGroups
- the list of statement groups of this lexeme; all of them must
have the given lexemeIdValue as their subjectrevisionId
- the revision ID or 0 if not known; see
EntityDocument.getRevisionId()
SenseDocument
corresponding to the inputpublic MediaInfoDocument getMediaInfoDocument(MediaInfoIdValue mediaInfoIdValue, List<MonolingualTextValue> labels, List<StatementGroup> statementGroups, long revisionId)
DataObjectFactory
MediaInfoDocument
.getMediaInfoDocument
in interface DataObjectFactory
mediaInfoIdValue
- the id of the form that data is aboutlabels
- the list of labels of this media info, with at most one label for
each language codestatementGroups
- the list of statement groups of this lexeme; all of them must
have the given mediaInfoIdValue as their subjectrevisionId
- the revision ID or 0 if not known; see
EntityDocument.getRevisionId()
MediaInfoDocument
corresponding to the inputpublic TermUpdate getTermUpdate(Collection<MonolingualTextValue> modified, Collection<String> removed)
DataObjectFactory
TermUpdate
. It might be more convenient to
use TermUpdateBuilder
.getTermUpdate
in interface DataObjectFactory
modified
- added or changed valuesremoved
- language codes of removed valuesTermUpdate
public AliasUpdate getAliasUpdate(List<MonolingualTextValue> recreated, List<MonolingualTextValue> added, Collection<MonolingualTextValue> removed)
DataObjectFactory
AliasUpdate
. Callers should specify either
recreated
parameter or added
and removed
parameters,
because combination of the two update approaches is not possible. To remove
all aliases, pass empty list in recreated
parameter.getAliasUpdate
in interface DataObjectFactory
recreated
- new list of aliases that completely replaces the old ones or
null
to not recreate aliasesadded
- aliases added in this update or empty collection for no additionsremoved
- aliases removed in this update or empty collection for no removalsAliasUpdate
public StatementUpdate getStatementUpdate(Collection<Statement> added, Collection<Statement> replaced, Collection<String> removed)
DataObjectFactory
StatementUpdate
. It might be more convenient to use
StatementUpdateBuilder
.getStatementUpdate
in interface DataObjectFactory
added
- added statementsreplaced
- replaced statementsremoved
- IDs of removed statementsStatementUpdate
public SenseUpdate getSenseUpdate(SenseIdValue entityId, long revisionId, TermUpdate glosses, StatementUpdate statements)
DataObjectFactory
SenseUpdate
. It might be more convenient to use
SenseUpdateBuilder
.getSenseUpdate
in interface DataObjectFactory
entityId
- ID of the sense that is to be updatedrevisionId
- base sense revision to be updated or zero if not availableglosses
- changes in sense glosses or null
for no changestatements
- changes in entity statements, possibly emptySenseUpdate
public FormUpdate getFormUpdate(FormIdValue entityId, long revisionId, TermUpdate representations, Collection<ItemIdValue> grammaticalFeatures, StatementUpdate statements)
DataObjectFactory
FormUpdate
. It might be more convenient to use
FormUpdateBuilder
.getFormUpdate
in interface DataObjectFactory
entityId
- ID of the form that is to be updatedrevisionId
- base form revision to be updated or zero if not availablerepresentations
- changes in form representations or null
for no changegrammaticalFeatures
- new grammatical features of the form or null
for no changestatements
- changes in entity statements, possibly emptyFormUpdate
public LexemeUpdate getLexemeUpdate(LexemeIdValue entityId, long revisionId, ItemIdValue language, ItemIdValue lexicalCategory, TermUpdate lemmas, StatementUpdate statements, Collection<SenseDocument> addedSenses, Collection<SenseUpdate> updatedSenses, Collection<SenseIdValue> removedSenses, Collection<FormDocument> addedForms, Collection<FormUpdate> updatedForms, Collection<FormIdValue> removedForms)
DataObjectFactory
LexemeUpdate
. It might be more convenient to use
LexemeUpdateBuilder
.getLexemeUpdate
in interface DataObjectFactory
entityId
- ID of the lexeme that is to be updatedrevisionId
- base lexeme revision to be updated or zero if not availablelanguage
- new lexeme language or null
for no changelexicalCategory
- new lexical category of the lexeme or null
for no changelemmas
- changes in lemmas or null
for no changestatements
- changes in entity statements, possibly emptyaddedSenses
- added sensesupdatedSenses
- updated sensesremovedSenses
- IDs of removed sensesaddedForms
- added formsupdatedForms
- updated formsremovedForms
- IDs of removed formsLexemeUpdate
public MediaInfoUpdate getMediaInfoUpdate(MediaInfoIdValue entityId, long revisionId, TermUpdate labels, StatementUpdate statements)
DataObjectFactory
MediaInfoUpdate
. It might be more convenient to use
MediaInfoUpdateBuilder
.getMediaInfoUpdate
in interface DataObjectFactory
entityId
- ID of the media that is to be updatedrevisionId
- base media revision to be updated or zero if not availablelabels
- changes in entity labels or null
for no changestatements
- changes in entity statements, possibly emptyMediaInfoUpdate
public ItemUpdate getItemUpdate(ItemIdValue entityId, long revisionId, TermUpdate labels, TermUpdate descriptions, Map<String,AliasUpdate> aliases, StatementUpdate statements, Collection<SiteLink> modifiedSiteLinks, Collection<String> removedSiteLinks)
DataObjectFactory
ItemUpdate
. It might be more convenient to use
ItemUpdateBuilder
.getItemUpdate
in interface DataObjectFactory
entityId
- ID of the item that is to be updatedrevisionId
- base item revision to be updated or zero if not availablelabels
- changes in entity labels or null
for no changedescriptions
- changes in entity descriptions or null
for no changealiases
- changes in entity aliases, possibly emptystatements
- changes in entity statements, possibly emptymodifiedSiteLinks
- added or replaced site linksremovedSiteLinks
- site keys of removed site linksItemUpdate
public PropertyUpdate getPropertyUpdate(PropertyIdValue entityId, long revisionId, TermUpdate labels, TermUpdate descriptions, Map<String,AliasUpdate> aliases, StatementUpdate statements)
DataObjectFactory
PropertyUpdate
. It might be more convenient to use
PropertyUpdateBuilder
.getPropertyUpdate
in interface DataObjectFactory
entityId
- ID of the property entity that is to be updatedrevisionId
- base property revision to be updated or zero if not availablelabels
- changes in entity labels or null
for no changedescriptions
- changes in entity descriptions or null
for no changealiases
- changes in entity aliases, possibly emptystatements
- changes in entity statements, possibly emptyPropertyUpdate
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