alaa_wmde created this task.
alaa_wmde added projects: wb_terms - Tool Builders Migration, Wikidata.
Restricted Application added a subscriber: Aklapper.

TASK DESCRIPTION
  In the new schema, top-level tables do not contain full entity ids but only 
numeric ids, as the tables are seprated by type and the prefix was dropped to 
optimize space usage.
  
  The old `wb_terms` containeed full entity ids, allowing it to be joined with 
other tables like pages.
  
  **How do I join terms in the new schema with other tables that store full 
entity ids?**
  
  example query:
  
    SELECT term_text AS painter, COUNT(term_text) AS paintercount FROM page
    JOIN pagelinks AS colllink ON page_id=colllink.pl_from AND
    colllink.pl_from_namespace=0 AND
    colllink.pl_namespace=0 AND colllink.pl_title='Q18600731'
    LEFT JOIN pagelinks AS creatorlink ON page_id=creatorlink.pl_from AND
    creatorlink.pl_from_namespace=0 AND
    creatorlink.pl_namespace=120 AND
    creatorlink.pl_title='P170'
    JOIN wb_terms ON page_title=term_full_entity_id AND
    term_entity_type='item' AND
    term_language='en' AND
    term_type='description' AND term_text LIKE 'painting by %'
    WHERE
    page_namespace=0 AND
    page_is_redirect=0 AND
    creatorlink.pl_from IS NULL
    GROUP BY term_text
    ORDER BY COUNT(term_text) DESC, painter
    LIMIT 300;

TASK DETAIL
  https://phabricator.wikimedia.org/T222602

WORKBOARD
  https://phabricator.wikimedia.org/project/board/4014/

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: alaa_wmde
Cc: Multichill, Aklapper, alaa_wmde, Nandana, Lahi, Gq86, GoranSMilovanovic, 
QZanden, LawExplorer, _jensen, rosalieper, Wikidata-bugs, aude, 
Lydia_Pintscher, JeroenDeDauw, Mbch331
_______________________________________________
Wikidata-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to