public class Datamodel extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
SITE_WIKIDATA
The site IRI of Wikidata.
|
| Constructor and Description |
|---|
Datamodel() |
| Modifier and Type | Method and Description |
|---|---|
static Claim |
makeClaim(EntityIdValue subject,
Snak mainSnak,
List<SnakGroup> qualifiers)
Creates a
Claim. |
static DatatypeIdValue |
makeDatatypeIdValue(String id)
Creates a
DatatypeIdValue. |
static GlobeCoordinatesValue |
makeGlobeCoordinatesValue(long latitude,
long longitude,
long precision,
String globeIri)
Creates a
GlobeCoordinatesValue. |
static ItemDocument |
makeItemDocument(ItemIdValue itemIdValue,
List<MonolingualTextValue> labels,
List<MonolingualTextValue> descriptions,
List<MonolingualTextValue> aliases,
List<StatementGroup> statementGroups,
Map<String,SiteLink> siteLinks)
Creates an
ItemDocument. |
static ItemIdValue |
makeItemIdValue(String id,
String siteIri)
Creates an
ItemIdValue. |
static MonolingualTextValue |
makeMonolingualTextValue(String text,
String languageCode)
Creates a
MonolingualTextValue. |
static NoValueSnak |
makeNoValueSnak(PropertyIdValue propertyId)
Creates a
NoValueSnak. |
static PropertyDocument |
makePropertyDocument(PropertyIdValue propertyId,
List<MonolingualTextValue> labels,
List<MonolingualTextValue> descriptions,
List<MonolingualTextValue> aliases,
DatatypeIdValue datatypeId)
Creates a
PropertyDocument. |
static PropertyIdValue |
makePropertyIdValue(String id,
String siteIri)
Creates a
PropertyIdValue. |
static QuantityValue |
makeQuantityValue(BigDecimal numericValue,
BigDecimal lowerBound,
BigDecimal upperBound)
Creates a
QuantityValue. |
static QuantityValue |
makeQuantityValue(long numericValue,
long lowerBound,
long upperBound)
Creates a
QuantityValue from long numbers. |
static Reference |
makeReference(List<SnakGroup> snakGroups)
Creates a
Reference. |
static SiteLink |
makeSiteLink(String title,
String siteKey,
List<String> badges)
Creates a
SiteLink. |
static SnakGroup |
makeSnakGroup(List<? extends Snak> snaks)
Creates a
SnakGroup. |
static SomeValueSnak |
makeSomeValueSnak(PropertyIdValue propertyId)
Creates a
SomeValueSnak. |
static Statement |
makeStatement(Claim claim,
List<? extends Reference> references,
StatementRank rank,
String statementId)
Creates a
Statement. |
static StatementGroup |
makeStatementGroup(List<Statement> statements)
Creates a
StatementGroup. |
static StringValue |
makeStringValue(String string)
Creates a
StringValue. |
static TimeValue |
makeTimeValue(long year,
byte month,
byte day,
byte hour,
byte minute,
byte second,
byte precision,
int beforeTolerance,
int afterTolerance,
int timezoneOffset,
String calendarModel)
Creates a
TimeValue. |
static TimeValue |
makeTimeValue(long year,
byte month,
byte day,
byte hour,
byte minute,
byte second,
int timezoneOffset,
String calendarModel)
Creates a
TimeValue for a given date and time. |
static TimeValue |
makeTimeValue(long year,
byte month,
byte day,
String calendarModel)
Creates a
TimeValue for a given date. |
static ValueSnak |
makeValueSnak(PropertyIdValue propertyId,
Value value)
Creates a
ValueSnak. |
static ItemIdValue |
makeWikidataItemIdValue(String id)
Creates an
ItemIdValue for Wikidata. |
static PropertyIdValue |
makeWikidataPropertyIdValue(String id)
Creates a
PropertyIdValue. |
public static String SITE_WIKIDATA
public static ItemIdValue makeItemIdValue(String id, String siteIri)
ItemIdValue.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 static ItemIdValue makeWikidataItemIdValue(String id)
ItemIdValue for Wikidata.id - a string of the form Qn... where n... is the string
representation of a positive integer numberItemIdValue corresponding to the inputpublic static PropertyIdValue makePropertyIdValue(String id, String siteIri)
PropertyIdValue.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 static PropertyIdValue makeWikidataPropertyIdValue(String id)
PropertyIdValue.id - a string of the form Pn... where n... is the string
representation of a positive integer numberPropertyIdValue corresponding to the inputpublic static DatatypeIdValue makeDatatypeIdValue(String id)
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.id - the IRI string that identifies the datatypeDatatypeIdValue corresponding to the inputpublic static TimeValue makeTimeValue(long year, byte month, byte day, byte hour, byte minute, byte second, byte precision, int beforeTolerance, int afterTolerance, int timezoneOffset, String calendarModel)
TimeValue.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_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 static TimeValue makeTimeValue(long year, byte month, byte day, byte hour, byte minute, byte second, int timezoneOffset, String calendarModel)
TimeValue for a given date and time. The precision is
automatically set to TimeValue.PREC_SECOND.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)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 static TimeValue makeTimeValue(long year, byte month, byte day, String calendarModel)
TimeValue for a given date. The precision is
automatically set to TimeValue.PREC_DAY.year - a year number, where 0 refers to 1BCEmonth - a month number between 1 and 12day - a day number between 1 and 31calendarModel - 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 static GlobeCoordinatesValue makeGlobeCoordinatesValue(long latitude, long longitude, long precision, String globeIri)
GlobeCoordinatesValue.latitude - the latitude of the coordinates in nanodegreeslongitude - the longitude of the coordinates in nanodegreesprecision - the precision of the coordinates in nanodegreesglobeIri - IRI specifying the celestial objects of the coordinatesGlobeCoordinatesValue corresponding to the inputpublic static StringValue makeStringValue(String string)
StringValue.string - StringValue corresponding to the inputpublic static MonolingualTextValue makeMonolingualTextValue(String text, String languageCode)
MonolingualTextValue.text - the text of the valuelanguageCode - the language code of the valueMonolingualTextValue corresponding to the inputpublic static QuantityValue makeQuantityValue(BigDecimal numericValue, BigDecimal lowerBound, BigDecimal upperBound)
QuantityValue.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 static QuantityValue makeQuantityValue(long numericValue, long lowerBound, long upperBound)
QuantityValue from long numbers.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 static ValueSnak makeValueSnak(PropertyIdValue propertyId, Value value)
ValueSnak.propertyId - value - ValueSnak corresponding to the inputpublic static SomeValueSnak makeSomeValueSnak(PropertyIdValue propertyId)
SomeValueSnak.propertyId - SomeValueSnak corresponding to the inputpublic static NoValueSnak makeNoValueSnak(PropertyIdValue propertyId)
NoValueSnak.propertyId - NoValueSnak corresponding to the inputpublic static SnakGroup makeSnakGroup(List<? extends Snak> snaks)
SnakGroup.snaks - a non-empty list of snaks that use the same propertySnakGroup corresponding to the inputpublic static Claim makeClaim(EntityIdValue subject, Snak mainSnak, List<SnakGroup> qualifiers)
Claim.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 static Reference makeReference(List<SnakGroup> snakGroups)
Reference.snakGroups - list of snak groupsReference corresponding to the inputpublic static Statement makeStatement(Claim claim, List<? extends Reference> references, StatementRank rank, String statementId)
Statement.
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.
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 static StatementGroup makeStatementGroup(List<Statement> statements)
StatementGroup.statements - a non-empty list of statements that use the same subject and
main-snak property in their claimStatementGroup corresponding to the inputpublic static SiteLink makeSiteLink(String title, String siteKey, List<String> badges)
SiteLink.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 static PropertyDocument makePropertyDocument(PropertyIdValue propertyId, List<MonolingualTextValue> labels, List<MonolingualTextValue> descriptions, List<MonolingualTextValue> aliases, DatatypeIdValue datatypeId)
PropertyDocument.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 propertydatatypeId - the datatype of that propertyPropertyDocument corresponding to the inputpublic static ItemDocument makeItemDocument(ItemIdValue itemIdValue, List<MonolingualTextValue> labels, List<MonolingualTextValue> descriptions, List<MonolingualTextValue> aliases, List<StatementGroup> statementGroups, Map<String,SiteLink> siteLinks)
ItemDocument.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 keyItemDocument corresponding to the inputCopyright © 2014 Wikidata Toolkit Developers. Generated from source code published under the Apache License 2.0. For more information, see the Wikidata Toolkit homepage