Page MenuHomePhabricator

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


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.

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

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

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

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

Not needed anymore.

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

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

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

Not needed

Change 340936 abandoned by Ladsgroup:
Using DispatchingEntityRdfBuilder in action

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

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