- Re-allowed installation with PHP 8.x
ReferenceList::addNewReference(),Statement::addNewReference()and theStatementListconstructor supported being called with a variadic argument list, with a single array argument, or (in the case ofStatementList) with a singleTraversableargument. The latter two forms are now deprecated (though they still work); please update your code: for instance, change->addNewReference( [ $x, $y ] )to->addNewReference( $x, $y ), and->addNewReference( $snaks )to->addNewReference( ...$snaks ).Statement,Reference,SnakListandSnakno longer implement theHashableandImmutableinterfaces fromDataValues/DataValues.
- Updated release notes
- Added PHP 7.4 support
- Added
getGuidParttoStatementGuid
- Raised minimum PHP version to 7.1
- Added
TermTypeswith term type constants - Allow installing with wikimedia/assert 0.5.0
TermListnow throwsInvalidArgumentExceptionwhen given non-iterable rather than failing silentlySiteLinkListnow throwsInvalidArgumentExceptionwhen given non-iterable rather than failing silently- Slightly optimized
EntityId::isForeign
- Raised minimum PHP version to 7.0 or HHVM
- Redirecting an entity to itself now causes an exception
ItemandPropertynow implementClearableEntityagain
- Breaking change:
EntityDocumentno longer extendsClearableEntity(8.0.0 revert) - The
TermListconstructor now takes anyiterableinstead of justarray - The
SiteLinkListconstructor now takes anyiterableinstead of justarray - Added
TermList::addAll
Item::setIdandProperty::setIdno longer accept integers- Removed
Item::getSiteLinksandItem::hasSiteLinks - Removed
HashArray SnakListno longer extendsHashArrayand no longer has these public and protected methods:addElementgetByElementHashgetNewOffsetgetObjectTypehasElementhasElementHashhasValidTypepreSetElementremoveByElementHashremoveElementsetElement
- Removed
WIKIBASE_DATAMODEL_VERSIONconstant - Added periods to the list of disallowed characters in
RepositoryNameAssert EntityDocumentnow extendsClearableEntity
- Added
StatementListProvidingEntity - Un-deprecated several sitelink related shortcuts from
Item:addSiteLinkgetSiteLinkhasLinkToSiteremoveSiteLink
- Installation together with DataValues 2.x is now supported
- Introduce
ClearableEntityinterface.
- Removed
clearfromEntityDocument. This was a compatibility break of the interface.
- Added
cleartoEntityDocument
- Performance optimizations on
EntityId:- Added protected
$repositoryNameand$localPartproperties - Added protected
extractRepositoryNameAndLocalPart
- Added protected
- Performance optimizations on methods critical for dump generation:
DispatchingEntityIdParser::parseSnakList::orderByProperty
- Changed
EntityIdValue::getArrayValueto allow it handle foreign entity IDs and entity IDs that do not have a numeric representation. - Fixed exception handling in
EntityIdValuenot always forwarding the full stack trace. - Deprecated
EntityIdValue::newFromArray - Deprecated
StatementGuid::getSerialization - Improved documentation of
EntityDocument::isEmpty - Removed MediaWiki integration files
This release adds support for custom entity types to EntityIdValue, and thus changes the hashes of
snaks, qualifiers, and references.
- Changed the internal
serialize()format of severalEntityIdrelated classes. In all casesunserialize()still supports the previous format.- Serialization of
SnakObject(includesPropertyNoValueSnakandPropertySomeValueSnak) does not use numeric IDs any more - Serialization of
PropertyValueSnak(includesDerivedPropertyValueSnak) does not use numeric IDs any more - Serialization of
EntityIdValuedoes not use numeric IDs any more EntityIdValuecan now serialize and unserializeEntityIds other thanItemIdandPropertyId- Minimized serialization of
ItemIdandPropertyIdto not include the entity type any more
- Serialization of
- Removed
FingerprintHolder. UseTermList::clearandAliasGroupList::clearinstead.ItemandPropertyalso still implementsetFingerprint. - Removed class aliases deprecated since 3.0:
Wikibase\DataModel\Claim\ClaimWikibase\DataModel\Claim\ClaimGuidWikibase\DataModel\StatementListProvider
- Added a
SnakListconstructor that is not compatible with theArrayListconstructor any more, and does not accept null any more. - Removed
HashArray::equals, andHashArraydoes not implementComparableany more - Removed
HashArray::getHash, andHashArraydoes not implementHashableany more - Removed
HashArray::rebuildIndices - Removed
HashArray::indicesAreUpToDate - Removed
HashArray::removeDuplicates - Removed
$acceptDuplicatesfeature fromHashArray
- Added
cleartoTermList,AliasGroupListandStatementList - Added
newFromRepositoryAndNumbertoItemIdandPropertyId
- Fixed
ReferenceList::addReferencesometimes moving existing references around - Fixed exceptions in
DispatchingEntityIdParserandItemIdParsernot forwarding the previous exception
ItemId::getNumericIdandPropertyId::getNumericIdno longer throw exceptions for foreign IDs
- Added
RepositoryNameAssertclass
- Raised minimum PHP version to 5.5
- Added basic support for foreign EntityIds
- Added
isForeign,getRepositoryandgetLocalParttoEntityId - The constructor of
EntityIdwas made public - Added static
EntityId::splitSerializationandEntityId::joinSerialization getNumericIdthrows an exception for foreign EntityIds- Added documentation for foreign EntityIds
- Added
- Added optional index parameter to
Statement::addStatement. - Added
Int32EntityIdinterface.ItemIdandPropertyIdnow implementInt32EntityId.ItemIdandPropertyIdconstruction now fails for numbers larger than 2147483647.
- Added an
idelement containing the full ID string to theEntityIdValue::getArrayValueserialization. - Fixed
ByPropertyIdArrayiterating the properties of non-traversable objects.
- Fixed
ItemIdandPropertyIdnot rejecting strings with a newline at the end.
This release removes the long deprecated Entity base class in favor of much more narrow interfaces.
- Removed
Entityclass (deprecated since 1.0) ItemandPropertyno longer extendEntity- Removed
getLabel,getDescription,getAliases,getAllAliases,setLabels,setDescriptions,addAliases,setAllAliases,removeLabel,removeDescriptionandremoveAliasesmethods
- Removed
Item::getLabelsandProperty::getLabelsnow return aTermListItem::getDescriptionsandProperty::getDescriptionsnow return aTermList- Removed
clearmethods fromItemandProperty StatementListProvider,LabelsProvider,DescriptionsProvider,AliasesProviderandFingerprintProvidernow give the guarantee to return objects by referenceTermListandAliasGroupListno longer throw anInvalidArgumentExceptionfor invalid language codes.getByLanguagethrows anOutOfBoundsExceptioninstead.removeByLanguagedoes nothing for invalid values.hasTermForLanguageandhasGroupForLanguagereturn false instead.
ItemandPropertynow implementLabelsProvider,DescriptionsProviderandAliasesProvider- Added
Item::getAliasGroupsandProperty::getAliasGroups
This release significantly reduces the memory footprint when entities are cloned.
Item::copyandProperty::copydo not clone immutable objects any more- Deprecated
FingerprintHolderandStatementListHolder
- Fixed regression in
ReferenceList::addReferenceand the constructor possibly adding too many objects
- Fixed regression in
ReferenceList::removeReferenceHashpossibly removing too many objects ReferenceList::unserializeno longer calls the constructor
This release removes the last remaining mentions of claims. Claims are still a concept in the mental data model, but not modelled in code any more.
- Removed
Claimsclass (deprecated since 1.0) - Removed
getClaimsandsetClaimsmethods fromEntity,ItemandProperty(deprecated since 1.0) - Removed
HashableObjectStorageclass (deprecated since 4.4) ReferenceListno longer derives fromSplObjectStorage- Removed
addAll,attach,contains,detach,getHash,getInfo,removeAll,removeAllExceptandsetInfomethods
- Removed
ReferenceListno longer implementsArrayAccess- Removed
offsetExists,offsetGet,offsetSetandoffsetUnsetmethods
- Removed
ReferenceListno longer implementsIterator- Removed
current,key,next,rewindandvalidmethods
- Removed
ReferenceListnow implementsIteratorAggregate- Added
getIteratormethod
- Added
- Removed
ReferenceList::removeDuplicates ReferenceList::addReferencenow throws anInvalidArgumentExceptionfor negative indices- Added
EntityDocument::equals, andEntityDocumentnow implementsComparable - Added
EntityDocument::copy - Fixed
Property::clearnot clearing statements TermListnow skips and removes empty terms- Deprecated
ByPropertyIdArray
- Added
ItemIdParser - Added
ReferenceList::isEmpty - Added
ReferencedStatementFilter::FILTER_TYPEconstant - Added
EntityRedirect::__toString - Deprecated
HashableObjectStorage SnakRoleenum is not an interface any more but a private class
- Added
isEmptytoEntityDocument
- Added
EntityRedirect - Added
EntityIdParserandEntityIdParsingException - Added
BasicEntityIdParser - Added
DispatchingEntityIdParser - Removed no longer needed dependency on
diff/diff
- Added
StatementList::filter - Added
StatementFilterandReferencedStatementFilter - Added
LabelsProvider,DescriptionsProviderandAliasesProvider - Added
FingerprintHolder
The services that resided in this component have been moved to the new Wikibase DataModel Services library. These symbols have been removed:
Entity::getDiffandEntity::patchEntityIdParserand derivativesEntityDifferand associated servicesEntityPatcherand associated servicesEntityDiffand derivativesItemLookupandItemNotFoundExceptionPropertyLookupandPropertyNotFoundExceptionPropertyDataTypeLookupBestStatementsFinderByPropertyIdGrouperStatementGuidParserand aliasClaimGuidParserStatementGuidParsingExceptionand aliasClaimGuidParsingExceptionStatementList::getBestStatementPerProperty
- Added
DerivedPropertyValueSnak
- Fixed out of bounds bug in
SnakList::orderByProperty
The concept of Claim is no longer modelled:
- The
Claimclass itself has been removed, thoughClaimis now a temporary alias forStatement Claim::RANK_TRUTHhave been removedStatementno longer takes aClaimin its constructorStatement::setClaimandStatement::getClaimhave been removed- Removed
ClaimList - Removed
ClaimListAccess - Removed
addClaim,hasClaimsandnewClaimfrom all entity classes
Phasing out of Claims:
Claims::addClaimno longer supports setting an index- Removed
Claims::getBestClaims, useStatementList::getBestStatementsinstead - Removed
Claims::getByRankandClaims::getByRanks, useStatementList::getByRankinstead - Removed
Claims::getMainSnaks, useStatementList::getMainSnaksinstead - Removed
Claims::getClaimsForProperty, useStatementList::getWithPropertyIdinstead - Removed
Claims::getHashes - Removed
Claims::getGuids - Removed
Claims::equals(andClaimsno longer implementsComparable) - Removed
Claims::getHash(andClaimsno longer implementsHashable) - Removed
Claims::hasClaim - Removed
Claims::isEmpty, useStatementList::isEmptyinstead - Removed
Claims::indexOf, useStatementList::getFirstStatementWithGuidorStatementByGuidMapinstead - Removed
Claims::removeClaim
Other breaking changes:
- Removed
Snaksinterface, useSnakListinstead - Removed previously deprecated
Entity::getAllSnaks, useStatementList::getAllSnaksinstead - Removed previously deprecated
EntityId::getPrefixedId, useEntityId::getSerializationinstead - Removed previously deprecated
Property::newEmpty, useProperty::newFromTypeornew Property()instead - Renamed
StatementList::getWithPropertyIdtoStatementList::getByPropertyId - Renamed
StatementList::getWithRanktoStatementList::getByRank - Added
EntityDocument::setId Entity::setLabelandEntity::setDescriptionno longer return anythingReferenceandReferenceLists no longer can be instantiated withnull
- Added
StatementByGuidMap - Added
StatementListHolder - Added
StatementList::getFirstStatementWithGuid - Added
StatementList::removeStatementsWithGuid ReferenceList::addNewReferenceandStatement::addNewReferencesupport an array of Snaks now- Added PHPMD support
- Renamed
Claim\ClaimGuidtoStatement\StatementGuid, leaving a b/c alias in place - Renamed
Claim\ClaimGuidParsertoStatement\StatementGuidParser, leaving a b/c alias in place - Renamed
Claim\ClaimGuidParsingExceptiontoStatement\StatementGuidParsingException, leaving a b/c alias in place - Renamed
StatementListProvidertoStatement\StatementListProvider, leaving a b/c alias in place
Item::setLabel,Item::setDescriptionandItem::setAliasesare no longer deprecatedProperty::setLabel,Property::setDescriptionandProperty::setAliasesare no longer deprecated
- Allow installation together with Diff 2.x.
- Added
Reference::isEmpty - Empty strings are now detected as invalid in the
SiteLinkconstructor - Empty References are now ignored when added to
ReferenceList - The
ReferenceListconstructor now throws anInvalidArgumentExceptionwhen getting a non-iterable input - The
SnakListconstructor now throws anInvalidArgumentExceptionwhen getting a non-iterable input - The
AliasGroup::equalsandTerm::equalsmethods no longer incorrectly return true for fallback objects
- Added
ItemLookupandPropertyLookupinterfaces - Added
ItemNotFoundException - Added
AliasGroupList::getWithLanguages - Added
AliasGroupList::toTextArray - Added
ItemIdSet::getSerializations - Added
SiteLinkList::setNewSiteLink - Added
SiteLinkList::setSiteLink - Added
SiteLinkList::toArray - Added
TermList::getWithLanguages - Empty strings are now detected as invalid language codes in the term classes
- Made all
Fingerprintconstructor parameters optional - Made all
Itemconstructor parameters optional - Made the
Propertyconstructor's fingerprint parameter nullable - The
StatementListconstructor now acceptsStatementobjects in variable-length argument list format - Deprecated
Fingerprint::newEmptyin favour ofnew Fingerprint() - Deprecated
Item::newEmptyin favour ofnew Item() - Added PHPCS support
- Fixed
StatementListnot reindexing array keys
Propertynow implements the deprecated claim related methods defined inEntity- Added
AliasGroupList::isEmpty - Added
StatementList::getBestStatements - Added
StatementList::getWithRank - Added
TermList::isEmpty - Added
AliasGroupFallback - Added
TermFallback
- Added
AliasGroupList::toArray - Added
StatementList::getMainSnaks - Added
StatementList::getWithPropertyId BestStatementsFinder::getBestStatementsForPropertyno longer throws anOutOfBoundsexception
ItemandPropertynow implementStatementListProvider- Introduced the
StatementListProviderinterface for classes containing aStatementList - Added rank comparison to
Statement::equals
ReferenceListnow implementsSerializable- Enhanced 32 bit compatibility for numeric ids
- Fixed handling of numeric ids as string in
LegacyIdInterpreterwhich was broken in 2.0.1.
- Fixed last remaining HHVM issue (caused by calling
reseton anArrayObjectsubclass) EntityIdValue::unserializenow throws the correct type of exception- Improved performance of
BasicEntityIdParserandLegacyIdInterpreter
- Removed all class aliases
- Removed support for deserializing
EntityIdinstances serialized with version 0.4 or earlier - Removed
Referencesinterface in favour ofReferenceList - The
Statementconstructor no longer supports aSnakparameter
- Added
Statement::RANK_enum - Added
Statement::addNewReference
- Deprecated
Claim::RANK_enum in favour ofStatement::RANK_enum - Deprecated
Claim::getRank
- The
Propertyconstructor now accepts an optionalStatementListparameter - Added
Property::getStatementsandProperty::setStatements - Added
PropertyIdProviderinterface - Added
ByPropertyIdGrouper - Added
BestStatementsFinder - Added
EntityPatcherandEntityPatcherStrategy - Added
StatementList::getAllSnaksto use instead ofEntity::getAllSnaks - The
Statementconstructor now also accepts aClaimparameter - Added
Statement::setClaim - The
Referenceconstructor now accepts aSnakarray - Added
ReferenceList::addNewReference
Changes in the Entity hierarchy:
- Changed the constructor signature of
Item - Changed the constructor signature of
Property - Removed
Entity::setClaims(Item::setClaimshas been retained) - Removed
Entity::stub - Removed
Entity::getIdFromClaimGuid Entity::removeLabelno longer accepts an array of language codesEntity::removeDescriptionno longer accepts an array of language codesEntityno longer implementsSerializable- Protected method
Entity::patchSpecificFieldsno longer has a second parameter Entity::getFingerprintis now returned by reference
Removal of toArray and newFromArray:
- Removed
Entity::toArray,Item::newFromArrayandProperty::newFromArray - Removed
Claim::toArrayandStatement::toArray - Removed
Claim::newFromArrayandStatement::newFromArray - Removed
ReferenceList::toArrayandReferenceList::newFromArray - Removed
toArrayfrom theReferencesinterface - Removed
SiteLink::toArrayandSiteLink::newFromArray - Removed
toArrayfrom theSnakandSnaksinterfaces - Removed
PropertyValueSnak::toArray - Removed
SnakList::toArrayandSnakList::newFromArray - Removed
SnakObject::toArrayandSnakObject::newFromArray - Removed
SnakObject::newFromType
Other breaking changes:
Itemnow has an array ofStatementrather than an array ofClaimPropertyno longer has an array ofClaimClaimandStatementno longer implementSerializable- Protected method
Entity::entityToDiffArraygot renamed toEntity::getDiffArray - Removed
Fingerprint::getAliases - Removed
EntityId::newFromPrefixedId - The constructor of
EntityIdis no longer public Claims::getDiffno longer takes a second optional parameterClaims::getDiffnow throws anUnexpectedValueExceptionrather than anInvalidArgumentException- Removed these class aliases deprecated since 0.4:
ItemObject,ReferenceObject,ClaimObject,StatementObject HashArrayandSnakListno longer take an optional parameter ingetHash- Calling
clearon anItemwill now cause its statements to be removed SiteLinkList::addNewSiteLinkno longer returns aSiteLinkListinstance- Removed the global variable
evilDataValueMap - Removed
ClaimAggregateinterface, which is thus no longer implemented byEntity HashableObjectStorage::getValueHashno longer accepts a first optional parameterMapHasherandMapValueHasherare now package private- Removed
Claims::getDiff
- Added
ClaimList - Added
StatementList - Added
StatementListDiffer - Added
PropertyDataTypeLookupand trivial implementationInMemoryDataTypeLookup - Added
PropertyNotFoundException - Added
ItemDifferandPropertyDiffer - Added
EntityDifferandEntityDifferStrategy - Added
Statement::getClaim - Added
Item::getStatements - Added
Item::setStatements
- Deprecated
Entity(but not the derivatives) - Deprecated
Claims - Deprecated
Entity::setId - Deprecated
Entity::newClaim - Deprecated
Entity::getAllSnaks - Deprecated
Entity::getDiffin favour ofEntityDifferand more specific differs - Deprecated
Item::getClaimsin favour ofItem::getStatements - Deprecated
Item::setClaimsin favour ofItem::setStatements - Deprecated
Item::hasClaimsin favour ofItem::getStatements()->count - Deprecated
Item::addClaimin favour ofItem::getStatements()->add*
- Undeprecated passing an integer to
Item::setIdandProperty::setId - The FQN of
Statementis nowWikibase\DataModel\Statement\Statement. The old FQN is deprecated.
- Fixed error caused by redeclaration of getType in
Entity, after it already got defined inEntityDocument
- Changed the signatures of
setLabel,setDescriptionandsetAliasGroupinFingerprint - Added
hasLabel,hasDescriptionandhasAliasGrouptoFingerprint
- Added
EntityDocumentinterface, which is implemented byEntity - Added
LegacyIdInterpreter - Undeprecated
Entity::isEmpty - Undeprecated
Entity::clear
- Fixed fatal error when calling
Item::getSiteLinkListon anItemright after constructing it
Item::removeSiteLinkno longer takes an optional second parameter and no longer returns a boolean- Shallow clones of
Itemwill now share the same list of site links SiteLinkListis now mutable
AliasGroupList::hasGroupForLanguageAliasGroupList::setAliasesForLanguageSiteLinkList::addSiteLinkSiteLinkList::addNewSiteLinkSiteLinkList::removeLinkWithSiteIdSiteLinkList::isEmptySiteLinkList::removeLinkWithSiteIdItem::getSiteLinkListItem::setSiteLinkListTermList::setTextForLanguage
Item::addSiteLinkItem::removeSiteLinkItem::getSiteLinksItem::getSiteLinkItem::hasLinkToSiteItem::hasSiteLinks
- An empty
TermListcan now be constructed with no constructor arguments - An empty
AliasGroupListcan now be constructed with no constructor arguments
- Made these classes implement
Comparable:TermListAliasGroupListFingerprintSiteLinkSiteLinkListClaimClaimsStatement
- Added methods to
Fingerprint:getLabelsetLabelremoveLabelsetLabelsgetDescriptionsetDescriptionremoveDescriptionsetDescriptionsgetAliasGroupsetAliasGroupremoveAliasGroupsetAliasGroupsgetAliasGroupsisEmpty
- Added
ItemIdSet
Entity::clear(to be removed in 1.0)Entity::isEmpty(to be removed in 1.0)Entity::stub(to be removed in 1.0)Fingerprint::getAliases(in favour ofFingerprint::getAliasGroups)
- This library no longer uses the MediaWiki i18n system when MediaWiki is loaded. No description will be shown as part of its entry on Special:Version.
- Added
Wikibase\DataModel\Termnamespace with these constructs:- Term\AliasGroup
- Term\AliasGroupList
- Term\Fingerprint
- Term\FingerprintProvider
- Term\Term
- Term\TermList
- Added
Entity::getFingerprint - Added
Entity::setFingerprint
- Deprecated
Property::newEmptyin favor ofProperty::newFromType - Deprecated old fingerprint related methods in
Entity:- setLabel
- setDescription
- removeLabel
- removeDescription
- getAliases
- getAllAliases
- setAliases
- addAliases
- removeAliases
- getDescriptions
- getLabels
- getDescription
- getLabel
- setLabels
- setDescriptions
- setAllAliases
- Deprecated
SnakList::newFromArray - Deprecated
Statement::newFromArray - Deprecated
Claim::newFromArray - Deprecated
ReferenceList::newFromArray
- Added Claims::getByRanks
- Removed DataValues Geo, DataValues Time and DataValues Number from the dependency list. They where no longer needed.
- Added TypedSnak value object
- Added SiteLinkList value object
- Added Claims::getBestClaims
- Added Claims::getByRank
- The PHPUnit bootstrap file now works again on Windows
- Changed class loading from PSR-0 to PSR-4
- Deprecated SiteLink::toArray(), SiteLink::newFromArray(), SiteLink::getBadgesFromArray()
- Removed PropertySnak interface
- Removed Claims::getObjectType
- Wikibase DataModel now uses the "new" DataValues components. This means binding to other code has decreased and several design issues have been tackled.
- Wikibase DataModel is now PSR-0 compliant.
- All classes and interfaces not yet in the Wikibase\DataModel namespace got moved. The old names remain as aliases, and should be considered as deprecated.
- SimpleSiteLink was renamed to SiteLink. The old name remains as deprecated alias.
- Item::addSimpleSiteLink and Item::getSimpleSiteLinks where renamed to Item::adSiteLink and Item::getSiteLinks. The old names remains as deprecated aliases.
- Entity::getTerms was removed, as it returned objects of type Term, which is defined by a component Wikibase DataModel does not depend upon.
Note that this list is incomplete. In particular, not all breaking changes are listed.
- Added ItemId and PropertyId classes.
- Added BasicEntityIdParser that allows for parsing of serializations of entity ids defined by Wikibase DataModel.
- Added ClaimGuid and ClaimGuidParser.
- EntityId no longer is a DataValue. A new EntityIdValue was added to function as a DataValue representing the identity of an entity.
- ObjectComparer has been removed from the public namespace.
- SnakFactory has been moved out of this component.
- Constructing an EntityId (rather then one of its derivatives) is now deprecated.
- Wikibase\EntityId has been renamed to Wikibase\DataModel\Entity\EntityId. The old name is deprecated.
Initial release as Wikibase DataModel component.
Initial release as part of Wikibase.