fuddl / wd

a browser extension for wikidata
https://wikidata.org/wiki/Wikidata:Tools/Wikidata_for_Firefox
GNU General Public License v3.0
36 stars 6 forks source link

setting `instance of` to `writer` isn't recommended. #129

Closed davidscotson closed 10 months ago

davidscotson commented 10 months ago

The code will suggest to set instance of to writer (but needs opted in, it's not automatically ticked) based on an og:type of books.author in the metadata.

Ideally this would an option to set occupation to writer instead, but I'm not sure if that's a small change or not.

fuddl commented 10 months ago

where exactly did you find it?

davidscotson commented 10 months ago

The line here seems to be setting Q36180 on the basis of the opengraph info.

https://github.com/fuddl/wd/blob/aeb049f571ae72af31f719e96b8bd9c17a3a08fa/src/content/content__collect-meta.js#L17

davidscotson commented 10 months ago

I'm thinking that something like this might work

    {
        name: 'og:type',
        prop: 'P106',
        type: 'WikibaseItem',
        options: {
            'books.author': 36180,      
        },
        suggested: true,
    },

Though not sure without trying it wether repeating the name og:type would cause issues.

fuddl commented 10 months ago

I mean, on which website?

fuddl commented 10 months ago

I guess you found it on openlibray like here: https://openlibrary.org/authors/OL8373276A/irukandji_sd

in this case we shoud just change this line to 5, don't you agree?

davidscotson commented 10 months ago

Yep, 5 makes sense. Tested and it's working as expected.

fuddl commented 10 months ago

thanks for making me aware of this. I actually forgot about this opengraph class matching 😅

fuddl commented 10 months ago

But it would be better if we'd get both:

davidscotson commented 10 months ago

Ah very nice. I actually tried to do this myself, got as far as the changes in the first 8 lines of the diff, but it didn't work, presumably needing the more extensive changes.

I'll do some testing, but this looks great.

fuddl commented 10 months ago

@davidscotson should be in the latest firefox version .318. let me know if you notice any issues with this. You can just reopen this ticket. 🙂