Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use new syntax for creating multiple references in QuickStatements export #6149

Open
wetneb opened this issue Nov 9, 2023 · 13 comments
Open
Labels
Type: Feature Request Identifies requests for new features or enhancements. These involve proposing new improvements. wikibase Related to wikidata/wikibase integration

Comments

@wetneb
Copy link
Sponsor Member

wetneb commented Nov 9, 2023

QuickStatements has introduced a new syntax to let people add multiple references to a statement, using exclamation marks to separate distinct references.

OpenRefine's Wikibase extension should be updated to use this syntax.

Proposed solution

When creating a statement with multiple references, instead of creating a QuickStatements script of the form

Qaaa Pbbb Qccc Sddd Qeee
Qaaa Pbbb Qccc Sfff Qggg

we should rather output a script of the form

Qaaa Pbbb Qccc Sddd Qeee !Sfff Qggg

Alternatives considered

None

Additional context

Reported on the OpenRefine-Wikimedia telegram Group by @SannitaSSJ.
See the previous issue which introduced support for multiple references: #2320,
and its resolution #2340.

@wetneb wetneb added Type: Feature Request Identifies requests for new features or enhancements. These involve proposing new improvements. Good First Issue Indicates issues suitable for newcomers to design or coding, providing a gentle introduction. wikibase Related to wikidata/wikibase integration labels Nov 9, 2023
@payalsaraljain
Copy link
Contributor

payalsaraljain commented Feb 15, 2024

Hi, I am interested in checking out this issue, is it assigned to someone?

@wetneb
Copy link
Sponsor Member Author

wetneb commented Feb 15, 2024

Amazing, it is yours @payalsaraljain :)

@payalsaraljain
Copy link
Contributor

Thank you, I will start looking into this

@payalsaraljain
Copy link
Contributor

Quick question there should be no tab space between the ! and reference right?

@wetneb
Copy link
Sponsor Member Author

wetneb commented Feb 16, 2024

Yes, that's also my understanding of the docs. You could double-check that by making some sample edits on the Wikidata Sandbox via QuickStatements, trying to add multiple references at once.

@payalsaraljain
Copy link
Contributor

payalsaraljain commented Feb 17, 2024

Hi, can you elaborate a little on how to do that I am unable to do it

@wetneb
Copy link
Sponsor Member Author

wetneb commented Feb 17, 2024

Sure. First, you'll need to create a Wikidata account. It's useful if you learn how to edit Wikidata manually first, for instance by following the Wikidata tours. That will help you get familiar with the different parts of Wikidata's data model (importantly, for this issue: items, properties, statements and references).

Then, you need to learn how to make Wikidata edits via QuickStatements. To do so, you could try to follow the docs or watch some video tutorial.

Once you have made a few edits with QuickStatements, you could experiment with the specific syntax that is available to create statements with multiple references. You should try and craft a small QuickStatements script that uses this syntax (using the ! character). Because you will be making a test edit, I recommend that the subject Wikidata item you use is a so-called "sandbox item", which is a particular Wikidata item where it's okay to make gibberish edits. One such item is https://www.wikidata.org/wiki/Q4115189

Check that your script works by running it in QuickStatements. If it does not create two references as expected, you could try getting some help, for instance by starting a new discussion over at https://www.wikidata.org/wiki/Help_talk:QuickStatements.

If your script does work, then you should be ready to implement support for this syntax in OpenRefine. For that part, you should be able to follow this guide: https://openrefine.org/docs/technical-reference/code-contributions

@payalsaraljain
Copy link
Contributor

payalsaraljain commented Feb 17, 2024

Hi @wetneb, I followed the steps, up until making few edits via QuickStatements, it is saying "You can't create a new batch, because you are not autoconfirmed", on probing on this I found that it has some restriction on running certain commads for newly created wikidata account, if that is the case is there another way of validating?

@wetneb
Copy link
Sponsor Member Author

wetneb commented Feb 18, 2024

That's a good point! You could either do a few more edits to reach the autoconfirmed status (https://www.wikidata.org/wiki/Wikidata:Autoconfirmed_users) or run your test statements on another wiki. For instance, there are a number of test Wikibase instances listed at https://www.wikibase.cloud/discovery, such as https://naf-test.wikibase.cloud/wiki/NAF_Test or https://metadata-test2023-rbx.wikibase.cloud/wiki/Main_Page. You could try using one of them (and reverting your edits afterwards)

@wetneb
Copy link
Sponsor Member Author

wetneb commented Mar 10, 2024

@payalsaraljain I am assuming you stopped working on this by now, so I am de-assigning you from this for now. If you are still working on this, let me know what is holding you back and I'll happily re-assign you.

@Ahmed-Elgamel
Copy link
Contributor

Hi @wetneb can you assign me this issue?

@Ahmed-Elgamel
Copy link
Contributor

Hi @wetneb , I have gone through the Wikidata tours and made a Wikidata account.I am doing edits on a test Wikibase instance as you mentioned earlier(I am not auto confirmed on WikiData yet).I am trying to enter the command that creates a statement with multiple references but it does not seem to understand this syntax and behaves unexpectedly.

The command was worked correctly when we added multiple references in the same group
Screenshot 2024-03-11 at 1 25 59 AM
Screenshot 2024-03-11 at 1 26 12 AM

But when I try to put each reference in a separate group it does not recognize the exclamation mark.
Screenshot 2024-03-11 at 1 27 41 AM
Screenshot 2024-03-11 at 1 27 46 AM
In the last photo it just recognizes the first source/reference while the second one is not recognized.

Is there something that I am misunderstanding or doing wrong?

@wetneb
Copy link
Sponsor Member Author

wetneb commented Mar 11, 2024

Hi @Ahmed-Elgamel,

You're totally right, I also cannot get it to work on my side either. Weird! Thanks for checking.
@SannitaSSJ can you confirm how to use this syntax?

Removing the "good first issue" label in the meantime.

@wetneb wetneb removed the Good First Issue Indicates issues suitable for newcomers to design or coding, providing a gentle introduction. label Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature Request Identifies requests for new features or enhancements. These involve proposing new improvements. wikibase Related to wikidata/wikibase integration
Projects
None yet
Development

No branches or pull requests

3 participants