Page MenuHomePhabricator

Create a service to query Common-hosted tabular data
Closed, DuplicatePublic

Description

Data table such as https://commons.wikimedia.org/wiki/Data:Emoji/List.tab may be queryable in WDQS.

Possible format 1 (each row in becomes an item, each column a relation, the contents of each cell a value):

SELECT * WHERE {
  ?emoji wdt:P487 ?char.
  ?link schema:about ?emoji; schema:isPartOf <https://en.wikipedia.org/>; schema:name ?title .
  SERVICE wikibase:tabular {
	 bd:serviceParam wikibase:data "https://commons.wikimedia.org/wiki/Data:Emoji/List.tab" .
     ?line tabfields:emoji ?emoji.
     ?line tabfields:name ?name.
     ?line tabfields:keywords ?keywords.
  }
}

Possible format 2 (similar to existing MWAPI):

SELECT * WHERE {
  ?emoji wdt:P487 ?char.
  ?link schema:about ?emoji; schema:isPartOf <https://en.wikipedia.org/>; schema:name ?title .
  SERVICE wikibase:tabular {
	 bd:serviceParam wikibase:data "https://commons.wikimedia.org/wiki/Data:Emoji/List.tab" .
     ?emoji wikibase:apiOutput "emoji".
     ?name wikibase:apiOutput "name".
     ?keywords wikibase:apiOutput "keywords".
  }
}

All tabular data are in public domain or a free license.