Hi,
I’m trying to add additional statements to Wikidata properties when the item already exists in Wikidata.
For example… What’s the value of a house: wait, struggle, and improvement in a militia-controlled(?) area in Rio de Janeiro - Wikidata I added the article using https://bhl2wiki.herokuapp.com/ (because it will add cites works statements for the article).
It doesn’t include all the statements I want in the resulting Qid for the article, so I used a spreadsheet of the DOIs in OpenRefine and created a schema that would add the additional statements I wanted. Some things have worked - eg adding statements that didn’t previously exist, such as main subject or copyright licence.
But where the property already existed, eg instance of or published in, and I wanted to add a second value, that hasn’t worked. Initially I tried using configure–add, and when that didn’t work I tried configure–add or merge, but that added a 2nd reference without actually adding the value.
Can anyone see what I’m doing wrong?
I also wanted to change the label to sentence case (which I’ve done successfully), and split title into title (also transform to sentence case) and subtitle. I’ve successfully added the subtitle, but can’t see how to overwrite the title - again, I’ve tried both the add and add or merge options, and also tried just matching on property.
Any advice would be appreciated!
Thanks
Helen
But where the property already existed, eg instance of or published in, and I wanted to add a second value, that hasn’t worked. Initially I tried using configure–add, and when that didn’t work I tried configure–add or merge, but that added a 2nd reference without actually adding the value.
Can anyone see what I’m doing wrong?
Beyond the "Add" or "Add or merge" setting, it is important that you configure the matching strategy as well. The stricter this strategy is (meaning, the more bits of information it considers when comparing two statements), the more likely OpenRefine will be to create an additional statement even though there is one already. For instance, the "Qualifiers" strategy with either the "Add" or "Add or merge" editing mode should always create a new statement unless you are adding one with the exact same value and qualifiers as an existing one:
When you change those settings, it might be worth making sure the changes you made are properly saved, by hitting the "Save schema" button in the top right corner of the schema editor (if it is greyed out, it means that it is already saved).
If that still does not work, you could export your schema (in the Wikidata/Wikibase menu in the top right corner) and share it with us so that we can see what exact settings you are using.
Thanks for taking a look at this Antonin. That’s really helpful info… I hadn’t previously grasped that that by using the strategy with qualifiers included I should always get a new statement. However, in practice I still seem to be having the same issue I described above and despite following your guidance the changes have not appeared on Wikidata. The plot thickens as I also notice this afternoon that the revisions I’ve applied aren’t showing in the Wikidata view history tab - that’s showing JIED vol 4ꓹ issue 3 revision 1 as the latest edit, but in an attempt to get it to work I’ve just uploaded revision 2, 3 and 4 - none of which are showing in the history. I’ve exported my schema to share, but get a message here to say new users cannot upload files… perhaps there is an alternative method I could use to share it with you?
Thanks again
Best wishes
Helen
JIED - edits revision schema.tar.gz (4.0 KB)
Had an email that suggested I might now be able to upload…
Thanks for following up! Looking at your schema, I cannot see any obvious problem: only the last statement (publication date) uses the “Property and value” merging strategy, but that is probably fine.
It’s hard to say what is going on here without looking at the data you are trying to upload too and the state of the corresponding items. It could be that edits are not made at all because of some other issue. You could find that out by looking at the server logs of OpenRefine (after a session with an attempted upload), which could contain errors that might put you on the right track.
The documentation to see those logs is here:
Thanks Antonin,
Can I check I’ve understood the ‘property and value’ merging strategy, as I thought I had applied that to each statement… but you mention you can only see it on publication date, so I’m wondering if I’m not looking at quite the right thing. This is what I see on publication date
but I see the same on each of my other statements too - the only thing missing is the tick in ‘lax value matching’ - would that make a difference? I’ve tried ticking that on the other statements and uploading again. It looks as if it’s working as usual, but yet again no edits are showing in the item histories on Wikidata. This is what I see in my OpenRefine log
09:28:37.147 [ refine] POST /command/wikidata/perform-wikibase-edits (19ms)
09:28:37.165 […mWikibaseEditsOperation] Performing edits (18ms)
09:28:37.165 […ting.EditBatchProcessor] Requesting documents (0ms)
09:28:41.093 […baseapi.WbEditingAction] We are editing too fast. Pausing for 5969 milliseconds. (3928ms)
09:28:47.436 […baseapi.WbEditingAction] We are editing too fast. Pausing for 34 milliseconds. (6343ms)
09:28:48.080 […baseapi.WbEditingAction] We are editing too fast. Pausing for 57 milliseconds. (644ms)
09:28:48.708 [ refine] GET /command/core/get-history (628ms)
09:28:48.740 [ refine] GET /command/core/get-project-metadata (32ms)
09:28:48.749 [ refine] GET /command/core/get-models (9ms)
09:28:48.765 [ refine] POST /command/core/get-all-preferences (16ms)
09:28:48.780 [ refine] POST /command/core/get-rows (15ms)
09:28:48.829 [ refine] POST /command/core/compute-facets (49ms)
09:28:48.854 [ refine] GET /command/core/get-preference (25ms)
Does that give any clues about what might be going wrong?
Thanks
Helen
Hi, I am still having problems with this issue. New data was just published, so I tried again with that new data. However I am still seeing the same issues:
I am able to successfully add new statements, but where a statement already exists and I want to add a second value - eg instance of, published in the second value is not added, though my reference for that value is added.
Also the title is not overwritten with the updated sentence case metadata, and remains in upper case, with a second reference added. Example: Russia’s networked authoritarianism in Ukraine’s occupied territories during the full-scale invasion: control and resilience - Wikidata I've tried the suggestions above. Is anyone able to help?
Thanks, Helen
I don't know what's going wrong, but I can suggest at least for the title property, for which there should only exist one statement, that you might try explicitly telling OR to delete the existing statement and replace it with a new statement.
Thanks @DrThneed... success with the title aspect! I wasn't quite sure yesterday if I could delete and re-add a title statement in one OR schema, but fresh to it this morning, and with the encouragement of your message I've worked out how to do that. One problem resolved - thank you! If anyone can shed any light on the issue of being unable to add a second value to an existing statement I'd be really grateful. Thanks!
Helen
I've had another go this morning at adding a second value to a statement that already exists on the Wikidata item. I experimented with After Merkel: Germany from peace to war - Wikidata. It already contains an instance of scholarly article statement. And I also want to add a value of academic journal article.
I've created a schema just for this one value, and to edit just the one item - screenshot below.
When I upload to Wikidadta it adds the stated in reference I've provided, but not the value. In the view history tab it doesn't show that I've done anything... even though the reference has been added without the value.
If anyone can shed light on this, or a solution, that would be wonderful! Thanks!
Hi @HelsKRW
If no new entry shows up in the "View history" tab of the item, that means no change has been done on the item. It looks like the reference you are referring to had already been added by a previous edit of yours to that statement - so it is not adding it again.
Can you show which settings you are using for this statement you want to add, by clicking on the "configure" link in the right-hand part of the statement? I suspect this is configured to match only based on the property, not the statement value. Because there is already a statement with "instance of" as a property, OpenRefine would therefore ignore the addition of your new statement.
Thanks @antonin_d
This is the configure setting I'm using
I thought that because the matching strategy includes the value this should work, but it doesn't seem to. Have I used the wrong setting or is something more complex going on?
Thanks
Helen
Just following up to see if my issue is related to the one @DrThneed shared Incomprehensible behaviour on trying to add new (and not merge) statements in Wikidata - #9 by antonin_d - I can see a Github issue is being created for that one - or whether my issue is related to incorrect use of configure settings (though I think I've followed advice on the settings correctly).
Thanks, Helen
I am not sure if both problems have the same root cause, so I think it would also be worth opening an issue about your problem.
Thanks @antonin_d, is that something that I should do, or that you or @ostephens will do? Thanks again for your help with this,
Helen
If you have a GitHub account already then you could go ahead and create one here, otherwise we can try creating it based on what you wrote here later.
Thanks @antonin_d I'm a complete novice with Github, but have created the issue - hopefully it contains all the necessary info. Thanks!
Helen
Amazing, that helps a lot, thank you! For the record it's here: Unable to add additional values to statements on existing Qids when uploading via OR schema · Issue #6064 · OpenRefine/OpenRefine · GitHub
Thanks @antonin_d I had a Github message suggesting the issue was resolved, so I tried again, but am still experiencing the same problem. I've updated to OR 3.7.5 in case that was causing a problem - but that hasn't solved it either. Have I just tested too soon or might there still be an issue?
Thanks again
Helen
It will take a little longer before the resolution of this bug reaches you: first we need to "merge the pull request" (meaning accepting the fix as valid), and then release the fix in a new version (which you'll need to download and install). Alternatively, once the pull request is merged you should be able to try out the resolution by downloading our snapshot releases (which removes the need to wait for an official release).