Page MenuHomePhabricator

DispatchingValueSnakRdfBuilder::getValueBuilder: No RDF builder defined for data type wikibase-lexeme nor for value type bad.
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error

MediaWiki version: 1.35.0-wmf.10

message
PHP Warning: Wikibase\Rdf\DispatchingValueSnakRdfBuilder::getValueBuilder: No RDF builder defined for data type wikibase-lexeme nor for value type bad. [Called from Wikibase\Rdf\DispatchingValueSnakRdfBuilder::getValueBuilder in /srv/mediawiki/php-1.35.0-wmf.10/extensions/Wikibase/repo/includes/Rdf/DispatchingValueSnakRdfBuilder.php at line 75]

Impact

Notes

Details

Request ID
XfNreQpAAEQAAJXrAVkAAABQ
Request URL
https://www.wikidata.org/wiki/Special:EntityData/Q16502.ttl?flavor=dump&nocache=1576233849693
Stack Trace
exception.trace
#0 [internal function]: MWExceptionHandler::handleError(integer, string, string, integer, array)
#1 /srv/mediawiki/php-1.35.0-wmf.10/includes/debug/MWDebug.php(333): trigger_error(string, integer)
#2 /srv/mediawiki/php-1.35.0-wmf.10/includes/debug/MWDebug.php(188): MWDebug::sendMessage(string, array, string, integer)
#3 /srv/mediawiki/php-1.35.0-wmf.10/includes/GlobalFunctions.php(1079): MWDebug::warning(string, integer, integer, string)
#4 /srv/mediawiki/php-1.35.0-wmf.10/extensions/Wikibase/repo/includes/Rdf/DispatchingValueSnakRdfBuilder.php(75): wfLogWarning(string)
#5 /srv/mediawiki/php-1.35.0-wmf.10/extensions/Wikibase/repo/includes/Rdf/DispatchingValueSnakRdfBuilder.php(50): Wikibase\Rdf\DispatchingValueSnakRdfBuilder->getValueBuilder(string, string)
#6 /srv/mediawiki/php-1.35.0-wmf.10/extensions/Wikibase/repo/includes/Rdf/SnakRdfBuilder.php(133): Wikibase\Rdf\DispatchingValueSnakRdfBuilder->addValue(Wikimedia\Purtle\TurtleRdfWriter, string, string, string, Wikibase\DataModel\Snak\PropertyValueSnak)
#7 /srv/mediawiki/php-1.35.0-wmf.10/extensions/Wikibase/repo/includes/Rdf/SnakRdfBuilder.php(84): Wikibase\Rdf\SnakRdfBuilder->addSnakValue(Wikimedia\Purtle\TurtleRdfWriter, Wikibase\DataModel\Snak\PropertyValueSnak, string)
#8 /srv/mediawiki/php-1.35.0-wmf.10/extensions/Wikibase/repo/includes/Rdf/FullStatementRdfBuilder.php(243): Wikibase\Rdf\SnakRdfBuilder->addSnak(Wikimedia\Purtle\TurtleRdfWriter, Wikibase\DataModel\Snak\PropertyValueSnak, string)
#9 /srv/mediawiki/php-1.35.0-wmf.10/extensions/Wikibase/repo/includes/Rdf/FullStatementRdfBuilder.php(140): Wikibase\Rdf\FullStatementRdfBuilder->addMainSnak(Wikibase\DataModel\Entity\ItemId, string, Wikibase\DataModel\Statement\Statement, boolean)
#10 /srv/mediawiki/php-1.35.0-wmf.10/extensions/Wikibase/repo/includes/Rdf/FullStatementRdfBuilder.php(126): Wikibase\Rdf\FullStatementRdfBuilder->addStatement(Wikibase\DataModel\Entity\ItemId, Wikibase\DataModel\Statement\Statement, boolean)
#11 /srv/mediawiki/php-1.35.0-wmf.10/extensions/Wikibase/repo/includes/Rdf/FullStatementRdfBuilder.php(258): Wikibase\Rdf\FullStatementRdfBuilder->addStatements(Wikibase\DataModel\Entity\ItemId, Wikibase\DataModel\Statement\StatementList)
#12 /srv/mediawiki/php-1.35.0-wmf.10/extensions/Wikibase/repo/includes/Rdf/RdfBuilder.php(430): Wikibase\Rdf\FullStatementRdfBuilder->addEntity(Wikibase\DataModel\Entity\Item)
#13 /srv/mediawiki/php-1.35.0-wmf.10/extensions/Wikibase/repo/includes/Rdf/RdfBuilder.php(411): Wikibase\Rdf\RdfBuilder->addSingleEntity(Wikibase\DataModel\Entity\Item)
#14 /srv/mediawiki/php-1.35.0-wmf.10/extensions/Wikibase/repo/includes/LinkedData/EntityDataSerializationService.php(236): Wikibase\Rdf\RdfBuilder->addEntity(Wikibase\DataModel\Entity\Item)
#15 /srv/mediawiki/php-1.35.0-wmf.10/extensions/Wikibase/repo/includes/LinkedData/EntityDataSerializationService.php(182): Wikibase\Repo\LinkedData\EntityDataSerializationService->rdfSerialize(Wikibase\Lib\Store\EntityRevision, NULL, array, Wikibase\Rdf\RdfBuilder, string)
#16 /srv/mediawiki/php-1.35.0-wmf.10/extensions/Wikibase/repo/includes/LinkedData/EntityDataRequestHandler.php(522): Wikibase\Repo\LinkedData\EntityDataSerializationService->getSerializedData(string, Wikibase\Lib\Store\EntityRevision, NULL, array, string)
#17 /srv/mediawiki/php-1.35.0-wmf.10/extensions/Wikibase/repo/includes/LinkedData/EntityDataRequestHandler.php(268): Wikibase\Repo\LinkedData\EntityDataRequestHandler->showData(WebRequest, OutputPage, string, Wikibase\DataModel\Entity\ItemId, integer)
#18 /srv/mediawiki/php-1.35.0-wmf.10/extensions/Wikibase/repo/includes/Specials/SpecialEntityData.php(156): Wikibase\Repo\LinkedData\EntityDataRequestHandler->handleRequest(string, WebRequest, OutputPage)
#19 /srv/mediawiki/php-1.35.0-wmf.10/includes/specialpage/SpecialPage.php(575): Wikibase\Repo\Specials\SpecialEntityData->execute(string)
#20 /srv/mediawiki/php-1.35.0-wmf.10/includes/specialpage/SpecialPageFactory.php(611): SpecialPage->run(string)
#21 /srv/mediawiki/php-1.35.0-wmf.10/includes/MediaWiki.php(298): MediaWiki\Special\SpecialPageFactory->executePath(Title, RequestContext)
#22 /srv/mediawiki/php-1.35.0-wmf.10/includes/MediaWiki.php(967): MediaWiki->performRequest()
#23 /srv/mediawiki/php-1.35.0-wmf.10/includes/MediaWiki.php(530): MediaWiki->main()
#24 /srv/mediawiki/php-1.35.0-wmf.10/index.php(46): MediaWiki->run()
#25 /srv/mediawiki/w/index.php(3): require(string)
#26 {main}

Event Timeline

Most likely due to the “subject lexeme” statements on Q16502; and indeed, in the generated TTL the values for these statements are missing:

wd:Q16502 p:P6254 s:Q16502-c103fdc1-42b3-4acd-ae27-f89dcb5efcfd .

s:Q16502-c103fdc1-42b3-4acd-ae27-f89dcb5efcfd a wikibase:Statement,
                wikibase:BestRank ;
        wikibase:rank wikibase:NormalRank ;
        pq:P407 wd:Q1860 .

There’s no wdt:P6254 triple on the subject entity nor a ps:P6254 triple on the statement node. Affects not just the “dump” flavor (request URL) but normal TTL as well.

The query service currently knows no statements for [wdt:P6254](https://query.wikidata.org/#DESCRIBE%20wdt%3AP6254) or [ps:P6254](https://query.wikidata.org/#DESCRIBE%20ps%3AP6254)… is it possible that this bug has been there all the time?

Looks like lexicographical data types are missing from the data type definititions:

lucaswerkmeister-wmde@mwdebug1001:~$ mwscript eval.php wikidatawiki <<< 'var_export( array_keys( \Wikibase\Repo\WikibaseRepo::getDefaultInstance()->getDataTypeDefinitions()->getRdfBuilderFactoryCallbacks( "prefixed" ) ) )'
array (
  0 => 'PT:commonsMedia',
  1 => 'PT:geo-shape',
  2 => 'PT:tabular-data',
  3 => 'PT:url',
  4 => 'PT:external-id',
  5 => 'VT:globecoordinate',
  6 => 'VT:monolingualtext',
  7 => 'VT:quantity',
  8 => 'VT:string',
  9 => 'VT:time',
  10 => 'VT:wikibase-entityid',
  11 => 'PT:musical-notation',
  12 => 'PT:math',
)

And yet, on https://www.wikidata.org/wiki/Special:EntityData/L123.ttl, they’re working just fine.

\Wikibase\Rdf\DispatchingValueSnakRdfBuilder::addValue seems to get an UnDeserializableValue

This is hard to reproduce, as apparently https://www.wikidata.org/wiki/Special:EntityData/Q16502.ttl?flavor=dump&nocache=1576233849693 was one of the affected urls, but it now works fine and doesn't cause any more errors?

Looks like lexicographical data types are missing from the data type definititions:

I think this was a red herring, sorry. WikibaseLexeme defines that the value-type corresponding to PT:wikibase-lexeme (and form, sense) is wikibase-entityid, and VT:wikibase-entityid is defined. The problem is that the actual value type is bad rather than wikibase-entityid, which as @Michael said comes from an UnDeserializableValue.

This also affects the JSON output:

$ curl -s 'https://www.wikidata.org/wiki/Special:EntityData/Q16502.json' | jq '.entities.Q16502.claims.P6254[0].mainsnak.datavalue'
{
  "value": {
    "entity-type": "lexeme",
    "numeric-id": 5203,
    "id": "L5203"
  },
  "type": "wikibase-entityid",
  "error": "Can not parse id 'L5203' to build EntityIdValue with"
}

I guess an entity ID parser for Lexemes is for some reason only registered when viewing Lexeme entities?

Change 616167 had a related patch set uploaded (by Ladsgroup; owner: Ladsgroup):
[mediawiki/extensions/WikibaseLexeme@master] [WIP] Add rdf-data-type for entity property types

https://gerrit.wikimedia.org/r/616167

This seems to work now, though I’m not aware of any specific change that would have made it work.

Edit:

$ curl -s 'https://www.wikidata.org/wiki/Special:EntityData/Q16502.json' | jq '.entities.Q16502.claims.P6254[0].mainsnak.datavalue'
{
  "value": {
    "entity-type": "lexeme",
    "numeric-id": 5203,
    "id": "L5203"
  },
  "type": "wikibase-entityid"
}