Page MenuHomePhabricator

Automatically matching new Wikipedia articles with Wikidata items using Python - Task 3
Closed, ResolvedPublic

Description

This is the third task for T290718, Automatically matching new Wikipedia articles with Wikidata items using Python, aimed at getting you familiar with searching for Wikidata items and finding the QIDs.

  1. You should already have a Wikimedia account and set up pywikibot (if not, do Tasks 1 and 2 first).
  1. Find some terms to search for. This could be name strings identified in previous tasks, or article titles (e.g., those not yet connected to Wikidata),
  1. Set up a script that connects to Wikidata, searches for the term, and returns the QID. Make sure it is the correct QID!
  1. Bonus: Explore how to identify the correct item when multiple terms are returned, and how to identify false matches.
  1. Bonus: Think of other ways of finding the right Wikidata item that doesn't depend on Wikidata labels, based on other information in the article and potential Wikidata item matches.

Save your code to a repository, or create a page like https://www.wikidata.org/wiki/User:Mike_Peel/Outreachy_2 (under your username - and change the ending to '3'.)

Once you are happy, send me a link to your page (by email, on my talk page, or replying to this ticket as you prefer). Make sure to also register it as a contribution on the Outreachy website ( https://www.outreachy.org/outreachy-december-2021-internship-round/communities/wikimedia/automatically-matching-new-wikipedia-articles-with/contributions/ )!

Hints:

Event Timeline

Hello @Mike_Peel, sorry for the inconvenience, as far as I am understanding, the task is searching for Wikidata items, finding the QIDs and finally printing those.
But you asked, " Add the links to the edits at the end of the code as a comment". I am confused about what edit should my script make? It would be really helpful if you would clarify this.

Hello @Mike_Peel, sorry for the inconvenience, as far as I am understanding, the task is searching for Wikidata items, finding the QIDs and finally printing those.
But you asked, " Add the links to the edits at the end of the code as a comment". I am confused about what edit should my script make? It would be really helpful if you would clarify this.

Hi, you're right in your understanding. That comment about edits was misplaced (must have been copied in from another starter task), I've removed it.

Hi @Mike_Peel , I have just added the extra code regarding the points you mentioned in the description. Would appreciate if you can review it https://www.wikidata.org/wiki/User:Osamaahmed17/Outreachy-3

@Mike_Peel I started doing this task, please check if I am on the right track or not...https://www.wikidata.org/wiki/User:Nafiya_Ahmed/Outreachy-3

Yes, you seem to be going in the right direction. You have a nice function to do the search, which you're then calling with a list of things to look for. Keep going! :-)

Dear @Mike_Peel I just posted my first draft of this task. Kindly review and let me know if headed in the right direction.
https://www.wikidata.org/wiki/User:Nancy_Sal/Outreachy_3

Dear @Mike_Peel I just posted my first draft of this task. Kindly review and let me know if headed in the right direction.
https://www.wikidata.org/wiki/User:Nancy_Sal/Outreachy_3

Yes, you're going in the right direction. How do you identify which of the search results you're getting is the correct one?

Hello @Mike_Peel I have edited my code a bit and added a function. Looking forward to your review
https://www.wikidata.org/wiki/User:Nancy_Sal/Outreachy_3

@Mike_Peel in point 5 you mentioned finding the right Wikidata item that doesn't depend on Wikidata labels, in my code I gave an article lebel as input then searched for its qid. But did you mean I should give something else like a description of the article to find its QID or lebels?

Hi @Mike_Peel here is a link to my task 3 implementation https://www.wikidata.org/wiki/User:Kelvin_wachira/Outreachy-3 . I also have the same question as Nafiya_Ahmed in regards to the fifth point.

Best, Kelvin

Hi all. Sorry for the delay, I've now given feedback on the talk pages.

@Mike_Peel in point 5 you mentioned finding the right Wikidata item that doesn't depend on Wikidata labels, in my code I gave an article lebel as input then searched for its qid. But did you mean I should give something else like a description of the article to find its QID or lebels?

You can use any information that is in the Wikipedia article (like you found in Task 1) to try to determine if the Wikidata item that the search has returned actually matches the article or not (and where you have multiple search results, which one best matches). Description/labels are fine, but there are also other things that might be in common that you might want to look at.

Dear @Mike_Peel,
Please find below a link to my third task:
https://www.wikidata.org/wiki/User:Pandamasha/Outreachy_3 . No function again, but still ... the main task was completed or wasn't it?
With kindest regards, Masha

Dear @Mike_Peel,
Please find below a link to my third task:
https://www.wikidata.org/wiki/User:Pandamasha/Outreachy_3 . No function again, but still ... the main task was completed or wasn't it?
With kindest regards, Masha

You have a reply on the talk page.

Dear @Mike_Peel,
Please take a look on the re-done task 3:
https://www.wikidata.org/wiki/User:Pandamasha/Outreachy_3.
With kindest regards,
Masha

Dear @Mike_Peel,
Please take a look on the re-done task 3:
https://www.wikidata.org/wiki/User:Pandamasha/Outreachy_3.
With kindest regards,
Masha

Reply on the talk page. :-)

Dear Mr @Mike_Peel , below is the link to my Task 3.
Kindly review my task.
Earnestly awaiting your reply.
thank you.
Suhasini

https://www.wikidata.org/wiki/User:Suha_098/Outreachy_3

Hi @Mike_Peel,

Kindly find the link to my third task - https://www.wikidata.org/wiki/User:Odohemma/Outreachy_3

Replied on the talk page. Remember that the deadline for applications is in about 30 minutes!

Hi @Mike_Peel, I know that the final application ends today, but I want to know if we can continue working on this task until November 22? Thank you

Dear @Mike_Peel, sorry to bother you again, but please take a look on my revised code: https://www.wikidata.org/wiki/User:Pandamasha/Outreachy_3

Hi @Mike_Peel, I know that the final application ends today, but I want to know if we can continue working on this task until November 22? Thank you

You can carry on if you want, but I'm not sure how much time I'll have for reviewing things in the next few weeks.

Dear @Mike_Peel, sorry to bother you again, but please take a look on my revised code: https://www.wikidata.org/wiki/User:Pandamasha/Outreachy_3

Feedback left on your talk page.