Page MenuHomePhabricator

Define extension point for mapping custom entity types to RDF.
Closed, ResolvedPublic

Description

Custom entity types need a mechanism to hook into RdfBuilder to provide mappings of parts of such entities that are not covered by the default code. The handlers for mapping entities to RDF should be defined in the Xxx.entitytypes.php, similar to the way that handlers for mapping custom data types are defined in Xxx.datatypes.php.

Just as for data types, the entity type definition could contain a 'rdf-builder-factory-callback' field, which could then be used to construct an EntityRdfBuilderFactory, simmilar to the ValueSnakRdfBuilderFactory.

EntityRdfBuilderFactory would provide EntityRdfBuilder instances for an entity type. Note that the current signature of addEntity defined by EntityRdfBuilder may be a bit awkward for the purpose, but it should be possibel to use it without changing much.

Details

Related Gerrit Patches:
mediawiki/extensions/Wikibase : masterChange docs of extending entities to show support for RdfBuilder
mediawiki/extensions/WikibaseLexeme : masterUsing DispatchingEntityRdfBuilder in action
mediawiki/extensions/Wikibase : masterIntroduce EntityRdfBuilderFactory interface
mediawiki/extensions/Wikibase : masterPlug EntityRdfBuilderFactory to RdfBuilder
mediawiki/extensions/Wikibase : masterAdd EntityRdfBuilderFactory
mediawiki/extensions/Wikibase : master[Code experiment] Make RdfBuilder injectable

Event Timeline

daniel created this task.Feb 6 2017, 12:41 PM

Change 335616 had a related patch set uploaded (by Daniel Kinzler):
[Code experiment] Make RdfBuilder injectable

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

Change 336382 had a related patch set uploaded (by Ladsgroup):
Introduce EntityRdfBuilderFactory interface

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

Change 340696 had a related patch set uploaded (by Ladsgroup; owner: Amir Sarabadani):
[mediawiki/extensions/Wikibase] Add EntityRdfBuilderFactory and DispatchingEntityRdfBuilder.

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

Ladsgroup claimed this task.Mar 2 2017, 9:11 AM
Restricted Application added a project: User-Ladsgroup. · View Herald TranscriptMar 2 2017, 9:11 AM
Ladsgroup moved this task from Incoming to Blocked on others on the User-Ladsgroup board.

Change 335616 abandoned by Ladsgroup:
[Code experiment] Make RdfBuilder injectable

Reason:
Not needed anymore.

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

Change 340696 merged by jenkins-bot:
[mediawiki/extensions/Wikibase] Add EntityRdfBuilderFactory

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

Change 340930 merged by jenkins-bot:
[mediawiki/extensions/Wikibase] Plug EntityRdfBuilderFactory to RdfBuilder

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

WMDE-leszek closed this task as Resolved.Mar 8 2017, 4:39 PM
WMDE-leszek moved this task from Review to Done on the Wikidata-Former-Sprint-Board board.

Change 336382 abandoned by Ladsgroup:
Introduce EntityRdfBuilderFactory interface

Reason:
Not needed

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

Change 340936 abandoned by Ladsgroup:
Using DispatchingEntityRdfBuilder in action

Reason:
Only POC. The proper patch will be done soon-ish

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

Change 342092 merged by jenkins-bot:
[mediawiki/extensions/Wikibase] Change docs of extending entities to show support for RdfBuilder

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