Page MenuHomePhabricator

Add field "inception" to work page
Closed, ResolvedPublicFeature

Description

Feature summary: Add the property "inception" (P 571) to the work's page. Looking at task T370173 can be helpful while developing this task.

Benefits: The work's page on Paulina was designed primarily with written works in mind, which use the "publication date" property. However, many visual artworks don't use the "publication date" property, but rather the "inception" property, which is equivalent for this type of work. Adding this property will add value to the work's page.

Event Timeline

@Oluwatumininu.m two observations:

  1. Your changes are incomplete: just modifying the jinja template will always show "inception" field as "unknown", as you're not passing the value of "inception" field to the template.
  2. All your changes are in a single merge request. Each change should be on a separate PR.

That being said, @Pepe_piton @Nat_WDU I've implemented the changes:
PR: https://gitlab.wikimedia.org/toolforge-repos/paulina/-/merge_requests/26

Kindly review and merge. Thanks!

Screenshot from 2025-10-10 11-48-27.png (925×1 px, 137 KB)

Thank you @shreya-bhagat
I was making the mistake of pushing to just one PR.

I have now corrected that.

Thank you for also checking through. I am going to correct the changes and make a new PR.

Whew!!!

I fixed my mistakes. Took me a while but I did. It's my first time getting familiar with git and actively writing codes.
https://gitlab.wikimedia.org/toolforge-repos/paulina/-/merge_requests/22

Screen Shot 2025-10-10 at 1.11.12 PM.png (1×2 px, 477 KB)

@Pepe_piton @Nat_WDU I have updated the changes. Each change is now on a separate PR. Took out the irrelevant commits. Everything works perfectly.

Thank you again for your help @shreya-bhagat

I've been looking into this task for quite some time now and studying the Paulina codebase to gain some clarity, but I have some questions and I'd appreciate your thoughts on them @Pepe_piton, @Nat_WDU, other mentors and colleagues.

I noticed that we have a category for authors with a defined set of roles, as shown below:

keys_for_types_of_author = {

"creator": "P170",
"author": "P50",
"director": "P57",
"screenwriter": "P58",
"architect": "P84",
"composer": "P86",
"librettist": "P87",
"illustrator": "P110",
"lyrics_by": "P676",
"programmer": "P943"

}

Can both publication date and inception date appear on the same work’s page?

  • Is it possible for a work to display both the publication date and inception date (for example, a film or book)? Or should we decide between the two based on the type of work?

Do we have a comprehensive list of work types?

  • If so, would it be helpful to map each type of work to a corresponding property (either inception date or publication date)?

@Sopzy Hi! Good questions.

Can both publication date and inception date appear on the same work’s page?

Generally not. But there is another microtask for addressing this issue: T406994

Do we have a comprehensive list of work types?

Not yet. We only have a very basic filter for searching by type of work, that you can find in filters.py, and it's not comprehensive. But that's because, currently, for Paulina, a "work" is just any item that has one or more of the properties in the dictionary keys_for_types_of_author. The logic is that if an item has any kind of author, it's a work. Anyway, I think that with task T406994, it won't be necessary to map each type of work with their corresponding property (inception or publication date). Just by showing the property only when it is present should be enough.

Thank you for this clarification @Pepe_piton

@Sopzy Hi! Good questions.

Can both publication date and inception date appear on the same work’s page?

Generally not. But there is another microtask for addressing this issue: T406994

Do we have a comprehensive list of work types?

Not yet. We only have a very basic filter for searching by type of work, that you can find in filters.py, and it's not comprehensive. But that's because, currently, for Paulina, a "work" is just any item that has one or more of the properties in the dictionary keys_for_types_of_author. The logic is that if an item has any kind of author, it's a work. Anyway, I think that with task T406994, it won't be necessary to map each type of work with their corresponding property (inception or publication date). Just by showing the property only when it is present should be enough.

@Oluwatumininu.m Thanks for your contribution! I think there are some changes from other tasks included in the MR diff and the commit diff, but I was easy to identify the changes corresponding to this task, so don't worry. You did a good job, finally identifying the necessary changes to the Work class in pdclasses.py, the work route in app.py, and the template. I tried your code and it works fine.

@shreya-bhagat I think you catched very well the logic by which new Wikidata properties are added to Paulina pages. The solution you applied works very well.

Thanks for your work!

@Oluwatumininu.m Thanks for your contribution! I think there are some changes from other tasks included in the MR diff and the commit diff, but I was easy to identify the changes corresponding to this task, so don't worry. You did a good job, finally identifying the necessary changes to the Work class in pdclasses.py, the work route in app.py, and the template. I tried your code and it works fine.

Thank you very much for the feedback. @Pepe_piton

@Sopzy Hi! Good questions.

Can both publication date and inception date appear on the same work’s page?

Generally not. But there is another microtask for addressing this issue: T406994

Do we have a comprehensive list of work types?

Not yet. We only have a very basic filter for searching by type of work, that you can find in filters.py, and it's not comprehensive. But that's because, currently, for Paulina, a "work" is just any item that has one or more of the properties in the dictionary keys_for_types_of_author. The logic is that if an item has any kind of author, it's a work. Anyway, I think that with task T406994, it won't be necessary to map each type of work with their corresponding property (inception or publication date). Just by showing the property only when it is present should be enough.

Finally, @Pepe_piton

Here's my submission to this task: https://gitlab.wikimedia.org/toolforge-repos/paulina/-/merge_requests/150

I'd appreciate your feedback. Thanks!

Good evening @Pepe_piton and @Nat_WDU
i made a merge request related this issue:-https://gitlab.wikimedia.org/toolforge-repos/paulina/-/merge_requests/151
changes made:-

  • Added inception_date to pdclass.py
  • Added work_inception_date to template in app.py
  • showed inception date in work.html with fallback "Unknown"

Please check my work and share feedback so I can improve.

@Afanyulionel @Sopzy Excellent work. You catched the logic of the task.

@Dipanshu1223 You also did a good job, but it seems to me that when you added the work_inception_date field to the HTML template, you inadvertently removed the work_language field.

@Pepe_piton
Thank you for catching this! You're right, I accidentally removed the work_language line when I was adding the work_inception_date. I have just pushed the fix for it.
https://gitlab.wikimedia.org/toolforge-repos/paulina/-/merge_requests/151/diffs#ef1b805b6792d39c7fb9b97a0fbf54dc1e780410

@Afanyulionel @Sopzy Excellent work. You catched the logic of the task.

@Dipanshu1223 You also did a good job, but it seems to me that when you added the work_inception_date field to the HTML template, you inadvertently removed the work_language field.

Thank you @Pepe_piton

Pepe_piton claimed this task.

I merged @Sopzy 's solution. Thanks!!