Class EntityIdValueImpl
java.lang.Object
org.wikidata.wdtk.datamodel.implementation.ValueImpl
org.wikidata.wdtk.datamodel.implementation.EntityIdValueImpl
- All Implemented Interfaces:
EntityIdValue,IriIdentifiedValue,Value
- Direct Known Subclasses:
ItemIdValueImpl,LexemeIdValueImpl,MediaInfoIdValueImpl,PropertyIdValueImpl
Abstract base implementation of
EntityIdValue for Jackson.- Author:
- Markus Kroetzsch, Fredo Erxleben, Thomas Pellissier Tanon, Antonin Delpeuch
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe string used in JSON to denote the type of entity id values that are lexemes forms.static final StringThe string used in JSON to denote the type of entity id values that are items.static final StringThe string used in JSON to denote the type of entity id values that are lexemes.static final StringThe string used in JSON to denote the type of entity id values that are media info.static final StringThe string used in JSON to denote the type of entity id values that are properties.static final StringThe string used in JSON to denote the type of entity id values that are lexemes senses.Fields inherited from class org.wikidata.wdtk.datamodel.implementation.ValueImpl
JSON_VALUE_TYPE_ENTITY_ID, JSON_VALUE_TYPE_GLOBE_COORDINATES, JSON_VALUE_TYPE_MONOLINGUAL_TEXT, JSON_VALUE_TYPE_QUANTITY, JSON_VALUE_TYPE_STRING, JSON_VALUE_TYPE_TIMEFields inherited from interface org.wikidata.wdtk.datamodel.interfaces.EntityIdValue
ET_FORM, ET_ITEM, ET_LEXEME, ET_MEDIA_INFO, ET_PROPERTY, ET_SENSE, ET_UNSUPPORTED, SITE_LOCAL -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedEntityIdValueImpl(String id, String siteIri) Constructor.protectedEntityIdValueImpl(org.wikidata.wdtk.datamodel.implementation.EntityIdValueImpl.JacksonInnerEntityId value, String siteIri) Constructor used for deserialization with Jackson. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidassertHasJsonEntityType(String expectedType) static EntityIdValueParses an item idgetId()Returns the id of this entity.getIri()Get the IRI of this entity.Returns an IRI that identifies the site that this entity comes from,, e.g., "http://www.wikidata.org/entity/" for Wikidata.org.wikidata.wdtk.datamodel.implementation.EntityIdValueImpl.JacksonInnerEntityIdgetValue()Returns the inner value helper object.static StringReturns the entity type of the id like "item" or "property"Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.wikidata.wdtk.datamodel.interfaces.EntityIdValue
getEntityType, isPlaceholder
-
Field Details
-
JSON_ENTITY_TYPE_ITEM
The string used in JSON to denote the type of entity id values that are items.- See Also:
-
JSON_ENTITY_TYPE_PROPERTY
The string used in JSON to denote the type of entity id values that are properties.- See Also:
-
JSON_ENTITY_TYPE_LEXEME
The string used in JSON to denote the type of entity id values that are lexemes.- See Also:
-
JSON_ENTITY_TYPE_FORM
The string used in JSON to denote the type of entity id values that are lexemes forms.- See Also:
-
JSON_ENTITY_TYPE_SENSE
The string used in JSON to denote the type of entity id values that are lexemes senses.- See Also:
-
JSON_ENTITY_TYPE_MEDIA_INFO
The string used in JSON to denote the type of entity id values that are media info.- See Also:
-
-
Constructor Details
-
EntityIdValueImpl
Constructor.- Parameters:
id- the identifier of the entity, such as "Q42"siteIri- the siteIRI that this value refers to
-
EntityIdValueImpl
protected EntityIdValueImpl(org.wikidata.wdtk.datamodel.implementation.EntityIdValueImpl.JacksonInnerEntityId value, String siteIri) Constructor used for deserialization with Jackson.
-
-
Method Details
-
fromId
Parses an item id- Parameters:
id- the identifier of the entity, such as "Q42"siteIri- the siteIRI that this value refers to- Throws:
IllegalArgumentException- if the id is invalid
-
guessEntityTypeFromId
Returns the entity type of the id like "item" or "property"- Parameters:
id- the identifier of the entity, such as "Q42"- Throws:
IllegalArgumentException- if the id is invalid
-
getValue
public org.wikidata.wdtk.datamodel.implementation.EntityIdValueImpl.JacksonInnerEntityId getValue()Returns the inner value helper object. Only for use by Jackson during serialization.- Returns:
- the inner entity id value
-
getIri
Description copied from interface:IriIdentifiedValueGet the IRI of this entity.- Specified by:
getIriin interfaceIriIdentifiedValue- Returns:
- String with the IRI
-
getId
Description copied from interface:EntityIdValueReturns the id of this entity.- Specified by:
getIdin interfaceEntityIdValue- Returns:
- String id of this entity
-
getSiteIri
Description copied from interface:EntityIdValueReturns an IRI that identifies the site that this entity comes from,, e.g., "http://www.wikidata.org/entity/" for Wikidata.- Specified by:
getSiteIriin interfaceEntityIdValue- Returns:
- the site IRI string
-
assertHasJsonEntityType
-