Page MenuHomePhabricator

Add creation date of item to wikibase RDF (schema:dateCreated )
Open, MediumPublic

Description

The RDF output for an item currently contains only schema:dateModified (https://schema.org/dateModified). For example a recently created almost empty item.

SELECT ?property ?value WHERE {
  wd:Q27895261 ?property ?value
}

Gives

property value
schema:version	409884566
schema:dateModified	Nov 21, 2016
rdfs:label	Washington (sigarenmerk)

Would be nice to also have the creation date of each item (and probably property too) in RDF as schema:dateCreated (https://schema.org/dateCreated). That way it's easier to make statistics.

I guess just asking the database for the first revision should be enough:

MariaDB [wikidatawiki_p]> SELECT rev_timestamp FROM page JOIN revision ON page_id=rev_page AND rev_parent_id=0 WHERE page_namespace=0 AND page_is_redirect=0 AND page_title='Q27895261';
+----------------+
| rev_timestamp  |
+----------------+
| 20161121034010 |
+----------------+
1 row in set (0.01 sec)

MariaDB [wikidatawiki_p]> SELECT rev_timestamp FROM page JOIN revision ON page_id=rev_page AND rev_parent_id=0 WHERE page_namespace=0 AND page_is_redirect=0 AND page_title='Q42'; 
+----------------+
| rev_timestamp  |
+----------------+
| 20121029181848 |
+----------------+
1 row in set (0.64 sec)

Or should this task be preceded with a task to add the creation date as a page_prop ( https://www.mediawiki.org/wiki/Manual:Page_props_table ) and use that in the RDF dump? Having an easy and efficient way to get the creation date of a page might be of benefit for more use cases.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Smalyshev renamed this task from Add creation date of item to wikibase RDF (schema:datedateCreated ) to Add creation date of item to wikibase RDF (schema:dateCreated ).Jan 4 2017, 6:49 PM
Smalyshev subscribed.

I think page prop would be the best way to do it. Just set it on article creation and that's it. Old data can be backfilled by a bot/script then.

Smalyshev raised the priority of this task from Low to Medium.Dec 21 2017, 2:13 AM