Wikibase
MediaWiki Wikibase extension
|
Statement::addNewReference()
and StatementList
constructor with a single array argument, which was deprecated in Version 9.6.0 (2021-03-31)
. These should now be called with a variadic argument list.__serialize()
and __unserialize()
methods to the EntityId
interface, and removed the serialize()
and unserialize()
methods and the Serializable
interface.Statement
and StatementList
classesstrict_types=1
to Statement.php
, StatementList.php
, and related test filesfoo:Q1234
)Snak
now declares getHash()
and equals()
methods again, which it used to inherit from the Hashable
and Immutable
interfaces prior to version 9.6.0. (The methods were never removed from any specific classes, but since Snak
is an interface, Phan started complaining that the methods were unknown.)ReferenceList::addNewReference()
, Statement::addNewReference()
and the StatementList
constructor supported being called with a variadic argument list, with a single array argument, or (in the case of StatementList
) with a single Traversable
argument. 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
, SnakList
and Snak
no longer implement the Hashable
and Immutable
interfaces from DataValues/DataValues
.Comparable
interfacegetGuidPart
to StatementGuid
TermTypes
with term type constantsTermList
now throws InvalidArgumentException
when given non-iterable rather than failing silentlySiteLinkList
now throws InvalidArgumentException
when given non-iterable rather than failing silentlyEntityId::isForeign
Item
and Property
now implement ClearableEntity
againEntityDocument
no longer extends ClearableEntity
(8.0.0 revert)TermList
constructor now takes any iterable
instead of just array
SiteLinkList
constructor now takes any iterable
instead of just array
TermList::addAll
Item::setId
and Property::setId
no longer accept integersItem::getSiteLinks
and Item::hasSiteLinks
HashArray
SnakList
no longer extends HashArray
and no longer has these public and protected methods:addElement
getByElementHash
getNewOffset
getObjectType
hasElement
hasElementHash
hasValidType
preSetElement
removeByElementHash
removeElement
setElement
WIKIBASE_DATAMODEL_VERSION
constantRepositoryNameAssert
EntityDocument
now extends ClearableEntity
StatementListProvidingEntity
Item
:addSiteLink
getSiteLink
hasLinkToSite
removeSiteLink
ClearableEntity
interface.clear
from EntityDocument
. This was a compatibility break of the interface.clear
to EntityDocument
EntityId
:$repositoryName
and $localPart
propertiesextractRepositoryNameAndLocalPart
DispatchingEntityIdParser::parse
SnakList::orderByProperty
EntityIdValue::getArrayValue
to allow it handle foreign entity IDs and entity IDs that do not have a numeric representation.EntityIdValue
not always forwarding the full stack trace.EntityIdValue::newFromArray
StatementGuid::getSerialization
EntityDocument::isEmpty
This release adds support for custom entity types to EntityIdValue
, and thus changes the hashes of snaks, qualifiers, and references.
serialize()
format of several EntityId
related classes. In all cases unserialize()
still supports the previous format.SnakObject
(includes PropertyNoValueSnak
and PropertySomeValueSnak
) does not use numeric IDs any morePropertyValueSnak
(includes DerivedPropertyValueSnak
) does not use numeric IDs any moreEntityIdValue
does not use numeric IDs any moreEntityIdValue
can now serialize and unserialize EntityId
s other than ItemId
and PropertyId
ItemId
and PropertyId
to not include the entity type any moreFingerprintHolder
. Use TermList::clear
and AliasGroupList::clear
instead. Item
and Property
also still implement setFingerprint
.SnakList
constructor that is not compatible with the ArrayList
constructor any more, and does not accept null any more.HashArray::equals
, and HashArray
does not implement Comparable
any moreHashArray::getHash
, and HashArray
does not implement Hashable
any moreHashArray::rebuildIndices
HashArray::indicesAreUpToDate
HashArray::removeDuplicates
$acceptDuplicates
feature from HashArray
clear
to TermList
, AliasGroupList
and StatementList
newFromRepositoryAndNumber
to ItemId
and PropertyId
ReferenceList::addReference
sometimes moving existing references aroundDispatchingEntityIdParser
and ItemIdParser
not forwarding the previous exceptionItemId::getNumericId
and PropertyId::getNumericId
no longer throw exceptions for foreign IDsRepositoryNameAssert
classisForeign
, getRepository
and getLocalPart
to EntityId
EntityId
was made publicEntityId::splitSerialization
and EntityId::joinSerialization
getNumericId
throws an exception for foreign EntityIdsStatement::addStatement
.Int32EntityId
interface.ItemId
and PropertyId
now implement Int32EntityId
.ItemId
and PropertyId
construction now fails for numbers larger than 2147483647.id
element containing the full ID string to the EntityIdValue::getArrayValue
serialization.ByPropertyIdArray
iterating the properties of non-traversable objects.ItemId
and PropertyId
not rejecting strings with a newline at the end.This release removes the long deprecated Entity base class in favor of much more narrow interfaces.
Entity
class (deprecated since 1.0)Item
and Property
no longer extend Entity
getLabel
, getDescription
, getAliases
, getAllAliases
, setLabels
, setDescriptions
, addAliases
, setAllAliases
, removeLabel
, removeDescription
and removeAliases
methodsItem::getLabels
and Property::getLabels
now return a TermList
Item::getDescriptions
and Property::getDescriptions
now return a TermList
clear
methods from Item
and Property
StatementListProvider
, LabelsProvider
, DescriptionsProvider
, AliasesProvider
and FingerprintProvider
now give the guarantee to return objects by referenceTermList
and AliasGroupList
no longer throw an InvalidArgumentException
for invalid language codes.getByLanguage
throws an OutOfBoundsException
instead.removeByLanguage
does nothing for invalid values.hasTermForLanguage
and hasGroupForLanguage
return false instead.Item
and Property
now implement LabelsProvider
, DescriptionsProvider
and AliasesProvider
Item::getAliasGroups
and Property::getAliasGroups
This release significantly reduces the memory footprint when entities are cloned.
Item::copy
and Property::copy
do not clone immutable objects any moreFingerprintHolder
and StatementListHolder
ReferenceList::addReference
and the constructor possibly adding too many objectsReferenceList::removeReferenceHash
possibly removing too many objectsReferenceList::unserialize
no longer calls the constructorThis 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.
Claims
class (deprecated since 1.0)getClaims
and setClaims
methods from Entity
, Item
and Property
(deprecated since 1.0)HashableObjectStorage
class (deprecated since 4.4)ReferenceList
no longer derives from SplObjectStorage
addAll
, attach
, contains
, detach
, getHash
, getInfo
, removeAll
, removeAllExcept
and setInfo
methodsReferenceList
no longer implements ArrayAccess
offsetExists
, offsetGet
, offsetSet
and offsetUnset
methodsReferenceList
no longer implements Iterator
current
, key
, next
, rewind
and valid
methodsReferenceList
now implements IteratorAggregate
getIterator
methodReferenceList::removeDuplicates
ReferenceList::addReference
now throws an InvalidArgumentException
for negative indicesEntityDocument::equals
, and EntityDocument
now implements Comparable
EntityDocument::copy
Property::clear
not clearing statementsTermList
now skips and removes empty termsByPropertyIdArray
ItemIdParser
ReferenceList::isEmpty
ReferencedStatementFilter::FILTER_TYPE
constantEntityRedirect::__toString
HashableObjectStorage
SnakRole
enum is not an interface any more but a private classisEmpty
to EntityDocument
EntityRedirect
EntityIdParser
and EntityIdParsingException
BasicEntityIdParser
DispatchingEntityIdParser
diff/diff
StatementList::filter
StatementFilter
and ReferencedStatementFilter
LabelsProvider
, DescriptionsProvider
and AliasesProvider
FingerprintHolder
The services that resided in this component have been moved to the new Wikibase DataModel Services library. These symbols have been removed:
Entity::getDiff
and Entity::patch
EntityIdParser
and derivativesEntityDiffer
and associated servicesEntityPatcher
and associated servicesEntityDiff
and derivativesItemLookup
and ItemNotFoundException
PropertyLookup
and PropertyNotFoundException
PropertyDataTypeLookup
BestStatementsFinder
ByPropertyIdGrouper
StatementGuidParser
and alias ClaimGuidParser
StatementGuidParsingException
and alias ClaimGuidParsingException
StatementList::getBestStatementPerProperty
DerivedPropertyValueSnak
SnakList::orderByProperty
The concept of Claim
is no longer modelled:
Claim
class itself has been removed, though Claim
is now a temporary alias for Statement
Claim::RANK_TRUTH
have been removedStatement
no longer takes a Claim
in its constructorStatement::setClaim
and Statement::getClaim
have been removedClaimList
ClaimListAccess
addClaim
, hasClaims
and newClaim
from all entity classesPhasing out of Claims
:
Claims::addClaim
no longer supports setting an indexClaims::getBestClaims
, use StatementList::getBestStatements
insteadClaims::getByRank
and Claims::getByRanks
, use StatementList::getByRank
insteadClaims::getMainSnaks
, use StatementList::getMainSnaks
insteadClaims::getClaimsForProperty
, use StatementList::getWithPropertyId
insteadClaims::getHashes
Claims::getGuids
Claims::equals
(and Claims
no longer implements Comparable
)Claims::getHash
(and Claims
no longer implements Hashable
)Claims::hasClaim
Claims::isEmpty
, use StatementList::isEmpty
insteadClaims::indexOf
, use StatementList::getFirstStatementWithGuid
or StatementByGuidMap
insteadClaims::removeClaim
Other breaking changes:
Snaks
interface, use SnakList
insteadEntity::getAllSnaks
, use StatementList::getAllSnaks
insteadEntityId::getPrefixedId
, use EntityId::getSerialization
insteadProperty::newEmpty
, use Property::newFromType
or new Property()
insteadStatementList::getWithPropertyId
to StatementList::getByPropertyId
StatementList::getWithRank
to StatementList::getByRank
EntityDocument::setId
Entity::setLabel
and Entity::setDescription
no longer return anythingReference
and ReferenceList
s no longer can be instantiated with null
StatementByGuidMap
StatementListHolder
StatementList::getFirstStatementWithGuid
StatementList::removeStatementsWithGuid
ReferenceList::addNewReference
and Statement::addNewReference
support an array of Snaks nowClaim\ClaimGuid
to Statement\StatementGuid
, leaving a b/c alias in placeClaim\ClaimGuidParser
to Statement\StatementGuidParser
, leaving a b/c alias in placeClaim\ClaimGuidParsingException
to Statement\StatementGuidParsingException
, leaving a b/c alias in placeStatementListProvider
to Statement\StatementListProvider
, leaving a b/c alias in placeItem::setLabel
, Item::setDescription
and Item::setAliases
are no longer deprecatedProperty::setLabel
, Property::setDescription
and Property::setAliases
are no longer deprecatedReference::isEmpty
SiteLink
constructorReferenceList
ReferenceList
constructor now throws an InvalidArgumentException
when getting a non-iterable inputSnakList
constructor now throws an InvalidArgumentException
when getting a non-iterable inputAliasGroup::equals
and Term::equals
methods no longer incorrectly return true for fallback objectsItemLookup
and PropertyLookup
interfacesItemNotFoundException
AliasGroupList::getWithLanguages
AliasGroupList::toTextArray
ItemIdSet::getSerializations
SiteLinkList::setNewSiteLink
SiteLinkList::setSiteLink
SiteLinkList::toArray
TermList::getWithLanguages
Fingerprint
constructor parameters optionalItem
constructor parameters optionalProperty
constructor's fingerprint parameter nullableStatementList
constructor now accepts Statement
objects in variable-length argument list formatFingerprint::newEmpty
in favour of new Fingerprint()
Item::newEmpty
in favour of new Item()
StatementList
not reindexing array keysProperty
now implements the deprecated claim related methods defined in Entity
AliasGroupList::isEmpty
StatementList::getBestStatements
StatementList::getWithRank
TermList::isEmpty
AliasGroupFallback
TermFallback
AliasGroupList::toArray
StatementList::getMainSnaks
StatementList::getWithPropertyId
BestStatementsFinder::getBestStatementsForProperty
no longer throws an OutOfBounds
exceptionItem
and Property
now implement StatementListProvider
StatementListProvider
interface for classes containing a StatementList
Statement::equals
ReferenceList
now implements Serializable
LegacyIdInterpreter
which was broken in 2.0.1.reset
on an ArrayObject
subclass)EntityIdValue::unserialize
now throws the correct type of exceptionBasicEntityIdParser
and LegacyIdInterpreter
EntityId
instances serialized with version 0.4 or earlierReferences
interface in favour of ReferenceList
Statement
constructor no longer supports a Snak
parameterStatement::RANK_
enumStatement::addNewReference
Claim::RANK_
enum in favour of Statement::RANK_
enumClaim::getRank
Property
constructor now accepts an optional StatementList
parameterProperty::getStatements
and Property::setStatements
PropertyIdProvider
interfaceByPropertyIdGrouper
BestStatementsFinder
EntityPatcher
and EntityPatcherStrategy
StatementList::getAllSnaks
to use instead of Entity::getAllSnaks
Statement
constructor now also accepts a Claim
parameterStatement::setClaim
Reference
constructor now accepts a Snak
arrayReferenceList::addNewReference
Changes in the Entity
hierarchy:
Item
Property
Entity::setClaims
(Item::setClaims
has been retained)Entity::stub
Entity::getIdFromClaimGuid
Entity::removeLabel
no longer accepts an array of language codesEntity::removeDescription
no longer accepts an array of language codesEntity
no longer implements Serializable
Entity::patchSpecificFields
no longer has a second parameterEntity::getFingerprint
is now returned by referenceRemoval of toArray
and newFromArray
:
Entity::toArray
, Item::newFromArray
and Property::newFromArray
Claim::toArray
and Statement::toArray
Claim::newFromArray
and Statement::newFromArray
ReferenceList::toArray
and ReferenceList::newFromArray
toArray
from the References
interfaceSiteLink::toArray
and SiteLink::newFromArray
toArray
from the Snak
and Snaks
interfacesPropertyValueSnak::toArray
SnakList::toArray
and SnakList::newFromArray
SnakObject::toArray
and SnakObject::newFromArray
SnakObject::newFromType
Other breaking changes:
Item
now has an array of Statement
rather than an array of Claim
Property
no longer has an array of Claim
Claim
and Statement
no longer implement Serializable
Entity::entityToDiffArray
got renamed to Entity::getDiffArray
Fingerprint::getAliases
EntityId::newFromPrefixedId
EntityId
is no longer publicClaims::getDiff
no longer takes a second optional parameterClaims::getDiff
now throws an UnexpectedValueException
rather than an InvalidArgumentException
ItemObject
, ReferenceObject
, ClaimObject
, StatementObject
HashArray
and SnakList
no longer take an optional parameter in getHash
clear
on an Item
will now cause its statements to be removedSiteLinkList::addNewSiteLink
no longer returns a SiteLinkList
instanceevilDataValueMap
ClaimAggregate
interface, which is thus no longer implemented by Entity
HashableObjectStorage::getValueHash
no longer accepts a first optional parameterMapHasher
and MapValueHasher
are now package privateClaims::getDiff
ClaimList
StatementList
StatementListDiffer
PropertyDataTypeLookup
and trivial implementation InMemoryDataTypeLookup
PropertyNotFoundException
ItemDiffer
and PropertyDiffer
EntityDiffer
and EntityDifferStrategy
Statement::getClaim
Item::getStatements
Item::setStatements
Entity
(but not the derivatives)Claims
Entity::setId
Entity::newClaim
Entity::getAllSnaks
Entity::getDiff
in favour of EntityDiffer
and more specific differsItem::getClaims
in favour of Item::getStatements
Item::setClaims
in favour of Item::setStatements
Item::hasClaims
in favour of Item::getStatements()->count
Item::addClaim
in favour of Item::getStatements()->add*
Item::setId
and Property::setId
Statement
is now Wikibase\DataModel\Statement\Statement
. The old FQN is deprecated.Entity
, after it already got defined in EntityDocument
setLabel
, setDescription
and setAliasGroup
in Fingerprint
hasLabel
, hasDescription
and hasAliasGroup
to Fingerprint
EntityDocument
interface, which is implemented by Entity
LegacyIdInterpreter
Entity::isEmpty
Entity::clear
Item::getSiteLinkList
on an Item
right after constructing itItem::removeSiteLink
no longer takes an optional second parameter and no longer returns a booleanItem
will now share the same list of site linksSiteLinkList
is now mutableAliasGroupList::hasGroupForLanguage
AliasGroupList::setAliasesForLanguage
SiteLinkList::addSiteLink
SiteLinkList::addNewSiteLink
SiteLinkList::removeLinkWithSiteId
SiteLinkList::isEmpty
SiteLinkList::removeLinkWithSiteId
Item::getSiteLinkList
Item::setSiteLinkList
TermList::setTextForLanguage
Item::addSiteLink
Item::removeSiteLink
Item::getSiteLinks
Item::getSiteLink
Item::hasLinkToSite
Item::hasSiteLinks
TermList
can now be constructed with no constructor argumentsAliasGroupList
can now be constructed with no constructor argumentsComparable
:TermList
AliasGroupList
Fingerprint
SiteLink
SiteLinkList
Claim
Claims
Statement
Fingerprint
:getLabel
setLabel
removeLabel
setLabels
getDescription
setDescription
removeDescription
setDescriptions
getAliasGroup
setAliasGroup
removeAliasGroup
setAliasGroups
getAliasGroups
isEmpty
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 of Fingerprint::getAliasGroups
)Wikibase\DataModel\Term
namespace with these constructs:Entity::getFingerprint
Entity::setFingerprint
Property::newEmpty
in favor of Property::newFromType
Entity
:SnakList::newFromArray
Statement::newFromArray
Claim::newFromArray
ReferenceList::newFromArray
Note that this list is incomplete. In particular, not all breaking changes are listed.
Initial release as Wikibase DataModel component.
Initial release as part of Wikibase.