public class DataObjectFactoryImpl extends Object implements DataObjectFactory
| Constructor and Description |
|---|
DataObjectFactoryImpl() |
public ItemIdValue getItemIdValue(String id, String siteIri)
DataObjectFactoryItemIdValue.getItemIdValue in interface DataObjectFactoryid - 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)
DataObjectFactoryPropertyIdValue.getPropertyIdValue in interface DataObjectFactoryid - 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)
DataObjectFactoryLexemeIdValue.getLexemeIdValue in interface DataObjectFactoryid - 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)
DataObjectFactoryFormIdValue.getFormIdValue in interface DataObjectFactoryid - 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)
DataObjectFactorySenseIdValue.getSenseIdValue in interface DataObjectFactoryid - 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)
DataObjectFactoryMediaInfoIdValue.getMediaInfoIdValue in interface DataObjectFactoryid - 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)
DataObjectFactoryDatatypeIdValue. 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 DataObjectFactoryid - the IRI string that identifies the datatypeDatatypeIdValue corresponding to the inputpublic DatatypeIdValue getDatatypeIdValueFromJsonId(String jsonId)
DataObjectFactoryDatatypeIdValue. 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 DataObjectFactoryjsonId - 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)
DataObjectFactoryTimeValue.getTimeValue in interface DataObjectFactoryyear - 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_1GYbeforeTolerance - 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_PROTimeValue corresponding to the inputpublic GlobeCoordinatesValue getGlobeCoordinatesValue(double latitude, double longitude, double precision, String globeIri)
DataObjectFactoryGlobeCoordinatesValue.getGlobeCoordinatesValue in interface DataObjectFactorylatitude - 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)
DataObjectFactoryStringValue.getStringValue in interface DataObjectFactoryStringValue corresponding to the inputpublic MonolingualTextValue getMonolingualTextValue(String text, String languageCode)
DataObjectFactoryMonolingualTextValue.getMonolingualTextValue in interface DataObjectFactorytext - the text of the valuelanguageCode - the language code of the valueMonolingualTextValue corresponding to the inputpublic QuantityValue getQuantityValue(BigDecimal numericValue)
DataObjectFactoryQuantityValue without a unit of measurement and bounds.getQuantityValue in interface DataObjectFactorynumericValue - the numeric value of this quantityQuantityValue corresponding to the inputpublic QuantityValue getQuantityValue(BigDecimal numericValue, BigDecimal lowerBound, BigDecimal upperBound)
DataObjectFactoryQuantityValue without a unit of measurement.getQuantityValue in interface DataObjectFactorynumericValue - 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)
DataObjectFactoryQuantityValue without bounds.getQuantityValue in interface DataObjectFactorynumericValue - 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)
DataObjectFactoryQuantityValue without bounds.getQuantityValue in interface DataObjectFactorynumericValue - 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)
DataObjectFactoryQuantityValue.getQuantityValue in interface DataObjectFactorynumericValue - 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)
DataObjectFactoryQuantityValue.getQuantityValue in interface DataObjectFactorynumericValue - 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 DataObjectFactoryValueSnak corresponding to the inputDataObjectFactory.getValueSnak(PropertyIdValue, Value)public SomeValueSnak getSomeValueSnak(PropertyIdValue propertyId)
DataObjectFactorySomeValueSnak.getSomeValueSnak in interface DataObjectFactorySomeValueSnak corresponding to the inputpublic NoValueSnak getNoValueSnak(PropertyIdValue propertyId)
DataObjectFactoryNoValueSnak.getNoValueSnak in interface DataObjectFactoryNoValueSnak corresponding to the inputpublic SnakGroup getSnakGroup(List<? extends Snak> snaks)
DataObjectFactorySnakGroup.getSnakGroup in interface DataObjectFactorysnaks - a non-empty list of snaks that use the same propertySnakGroup corresponding to the inputpublic Claim getClaim(EntityIdValue subject, Snak mainSnak, List<SnakGroup> qualifiers)
DataObjectFactoryClaim. 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 DataObjectFactorysubject - 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)
DataObjectFactoryReference. It might be more convenient to use
ReferenceBuilder instead.getReference in interface DataObjectFactorysnakGroups - list of snak groupsReference corresponding to the inputpublic Statement getStatement(Claim claim, List<Reference> references, StatementRank rank, String statementId)
DataObjectFactoryStatement. 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 DataObjectFactoryclaim - 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)
DataObjectFactoryStatement. 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 DataObjectFactorysubject - 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)
DataObjectFactoryStatementGroup.getStatementGroup in interface DataObjectFactorystatements - 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)
DataObjectFactorySiteLink.getSiteLink in interface DataObjectFactorytitle - 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)
DataObjectFactoryPropertyDocument. It might be more convenient to use
the PropertyDocumentBuilder instead.getPropertyDocument in interface DataObjectFactorypropertyId - 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)
DataObjectFactoryItemDocument. It might be more convenient to use the
ItemDocumentBuilder instead.getItemDocument in interface DataObjectFactoryitemIdValue - 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)
DataObjectFactoryLexemeDocument.getLexemeDocument in interface DataObjectFactorylexemeIdValue - 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)
DataObjectFactoryFormDocument.getFormDocument in interface DataObjectFactoryformIdValue - 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)
DataObjectFactorySenseDocument.getSenseDocument in interface DataObjectFactorysenseIdValue - 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)
DataObjectFactoryMediaInfoDocument.getMediaInfoDocument in interface DataObjectFactorymediaInfoIdValue - 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)
DataObjectFactoryTermUpdate. It might be more convenient to
use TermUpdateBuilder.getTermUpdate in interface DataObjectFactorymodified - added or changed valuesremoved - language codes of removed valuesTermUpdatepublic AliasUpdate getAliasUpdate(List<MonolingualTextValue> recreated, List<MonolingualTextValue> added, Collection<MonolingualTextValue> removed)
DataObjectFactoryAliasUpdate. 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 DataObjectFactoryrecreated - 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 removalsAliasUpdatepublic StatementUpdate getStatementUpdate(Collection<Statement> added, Collection<Statement> replaced, Collection<String> removed)
DataObjectFactoryStatementUpdate. It might be more convenient to use
StatementUpdateBuilder.getStatementUpdate in interface DataObjectFactoryadded - added statementsreplaced - replaced statementsremoved - IDs of removed statementsStatementUpdatepublic SenseUpdate getSenseUpdate(SenseIdValue entityId, long revisionId, TermUpdate glosses, StatementUpdate statements)
DataObjectFactorySenseUpdate. It might be more convenient to use
SenseUpdateBuilder.getSenseUpdate in interface DataObjectFactoryentityId - 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 emptySenseUpdatepublic FormUpdate getFormUpdate(FormIdValue entityId, long revisionId, TermUpdate representations, Collection<ItemIdValue> grammaticalFeatures, StatementUpdate statements)
DataObjectFactoryFormUpdate. It might be more convenient to use
FormUpdateBuilder.getFormUpdate in interface DataObjectFactoryentityId - 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 emptyFormUpdatepublic 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)
DataObjectFactoryLexemeUpdate. It might be more convenient to use
LexemeUpdateBuilder.getLexemeUpdate in interface DataObjectFactoryentityId - 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 formsLexemeUpdatepublic MediaInfoUpdate getMediaInfoUpdate(MediaInfoIdValue entityId, long revisionId, TermUpdate labels, StatementUpdate statements)
DataObjectFactoryMediaInfoUpdate. It might be more convenient to use
MediaInfoUpdateBuilder.getMediaInfoUpdate in interface DataObjectFactoryentityId - 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 emptyMediaInfoUpdatepublic ItemUpdate getItemUpdate(ItemIdValue entityId, long revisionId, TermUpdate labels, TermUpdate descriptions, Map<String,AliasUpdate> aliases, StatementUpdate statements, Collection<SiteLink> modifiedSiteLinks, Collection<String> removedSiteLinks)
DataObjectFactoryItemUpdate. It might be more convenient to use
ItemUpdateBuilder.getItemUpdate in interface DataObjectFactoryentityId - 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 linksItemUpdatepublic PropertyUpdate getPropertyUpdate(PropertyIdValue entityId, long revisionId, TermUpdate labels, TermUpdate descriptions, Map<String,AliasUpdate> aliases, StatementUpdate statements)
DataObjectFactoryPropertyUpdate. It might be more convenient to use
PropertyUpdateBuilder.getPropertyUpdate in interface DataObjectFactoryentityId - 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 emptyPropertyUpdateCopyright © 2014–2022 Wikidata Toolkit Developers. Generated from source code published under the Apache License 2.0. For more information, see the Wikidata Toolkit homepage