magnusmanske / quickstatements Goto Github PK
View Code? Open in Web Editor NEWThe official repo for the QuickStatements PHP/HTML/JS interface
Home Page: https://quickstatements.toolforge.org/
License: GNU General Public License v3.0
The official repo for the QuickStatements PHP/HTML/JS interface
Home Page: https://quickstatements.toolforge.org/
License: GNU General Public License v3.0
Using addwiki: https://github.com/addwiki/mediawiki-api Copy public_html/config.json.template to config.json and modify for your needs
It is not possible to add/change P6375 through quickstatement because it goes to error even with correct input statement.
Sample to test:
Q4115189|P6375|"Sunset Road"
My best guessing is that QS fails because Wikidata has a constrain to specificy the language code of the address for property P6375. To the best of my knowledge QS does not yet have a sintax to specifiy the language of a property value. Can someone implement it? A possible approach would be to specify the language code as a tail of the property code (e.g. P6375de for german)
For some reason my latest batches on Commons are not working. See https://quickstatements.toolforge.org/#/batch/220087 for an example
I tried to use SourceMD, but it cannot connect to quickstatements due to missing CORS-headers. Could you please add them?
(see that issue for more details magnusmanske/papers#9 )
v1 syntax says that I can make multiple reference groups by doing something like this: Qxxx|Pxxx|Value|!Sxxx|blah|!Syyy|other
, but it puts them all into one reference group.
Hi Magnus, in a custom Wikibase I was trying to create new items with a property value somevalue
. It works when I do this in two separate steps like
qid,P1,Len
,Q1,"some label"
followed by
qid,P8
Qxxx,somevalue
But when I do:
qid,Len,P8
,"some label",somevalue
the statements error out with a message that somevalue
is not known.
Hi I tried QS in palemoon on parabola linux and it did not work. On the same machine in Google Chrome it worked fine. Can anyone reproduce this?
As can be seen in this version of a photo of Angela Merkel, QuickStatements has created a duplicate Depicts (P180) statement there. Maybe this is related to the fact that the already-existing statement had the 'prominent' flag and the QuickStatements batch was not instructed to assign these.
In any case, preferred behavior would be that QuickStatements would not create a new statement in such a case.
Hello,
I have QS activities that I would like to stop, but I'm having trouble with how QuickStatements recognizes my recently changed username. Because it's different from the username QS has for me, it's not letting me stop the runs.
Is it possible to stop all the runs for this account? https://quickstatements.toolforge.org/#/batches/Jacobmgreer
If I unauthorize QS and then log back in, will that recognize the new handle? (old handle: Jacobmgreer, new handle: Jakeob9000)
Thanks,
Jacob
Hi,
I see a lot of lines like this function:
public function getBatch ( $id ) {
$id *= 1 ;
$ret = array('commands'=>array()) ;
$db = $this->getDB() ;
$sql = "SELECT * FROM command WHERE batch_id=$id" ;
if(!$result = $db->query($sql)) return $this->setErrorMessage ( 'There was an error running the query [' . $db->error . ']'."\n$sql" ) ;
while ( $o = $result->fetch_object() ) {
$j = json_decode ( $o->json ) ;
$j->_meta = $o ;
unset ( $j->_meta->json ) ;
$ret['commands'][$o->num] = $j ;
}
return $ret ;
}
If one would simply set $id to 0;DROP TABLE COMMAND;
, the command table will be gone. Easy as that.. Please, for the love of god; use SQL prepared statements. See: https://www.w3schools.com/php/php_mysql_prepared_statements.asp
Hi, may I know where the localization of QuickStatements tool is happening.
When creating a batch by visiting a URL, autoconfirmed message isn't shown, but the query can't be run, the Run button is missing
The message
You can't create a new batch, because you are not autoconfirmed
is shown always when relevant
Open in QuickStatements
buttonHello,
Thank you Magnus for this amazing tool.
I am wondering if it's possible to make quickstatements (QS) not require you to log in again to use it, if you're already logged in to the Wikibase it connects to.
It would save time, and reduce the hassle when using social logins through PluggableAuth.
Hi.
I wrote this today in the wikidata telegram channel at https://t.me/c/1224298920/45236 and as I don't like people talking behind my back, I post it here. (this was a reaction to another post)
`😅 ok, interesting.
I guess I will have to live with that as I have no way to change others thoughts. 😜
I have seen no one joining me until now that I know of so you might be right that I am wasting my time here.
People have al kinds of thoughts about each other, it's none of my business. What I do care about is my thoughts and finding a way forward in harmony with my needs.
Using Magnus Manskes tools is not in harmony with my needs (for connection, for feeling sure that he values feedback from me and others), so I avoid them (I could also fork the ones I would like to maintain but I found no candidates yet) and encourage others to do the same. Together we can build good tools in good connection with each other for the best of everyone and Wikidata.
Relying on tools from a person who does not seem to want to communicate with the community at all is a really bad idea IMO no matter the quality/niceness of the tool itself. When/If Magnus decides to clean up his mess of unanswered interactions (see #10 where he actually reacted 26 days ago, but generally he does not seem to be active in the issues section of his repos, on-wiki, or here which is a big problem if you are maintainer of something) in the repos of his tools I have no problem with starting to use his tools again.
If he askes someone for help taking over maintaining or communicating with the community that would probably work fine, but I would prefer a responsive maintainer like @smyst (wikibaseintegrator) or @Dvorak (daty).`
I encourage you to start engaging when people open issues or to delegate to someone else who can have your ear so we can avoid a situation where no one knows how to contact you, you don't answer on Twitter, nor on Wikidata nor anywhere else that I'm aware of. I personally opened an issue in the end of november that I have not got a single response to, see #9
Thanks in advance.
Hi:
I have a big (>300k) batch for SDC. I want to use QS api.php but it doesn't work to me. Not only for SDC but Wikidata too. Always get the same message:
{"status":"Problem generating OAuth signature; user '{}' needs to have submitted a batch namually at least once before","debug":{"format":"v1","temporary":false,"openpage":0},"site":"wikidata"}
I have lot of Wikidata editions (see my batches) and I my token configured.
I'm invoking the api as this:
curl https://quickstatements.toolforge.org/api.php \
-d action=import \
-d submit=1 \
-d username=Olea \
-d format=v1 \
-d "batchname=test" \
-d site=wikidata \
--data-raw 'token=TOKENTOKENTOKEN.' \
--data-urlencode [email protected]
I don't know if I'm missing something or there is a bug. I've been asking for other people using the api and got no answer. Is it deprecated maybe?
Thx.
When I try to import commands to create new items with the CSV syntax, and those items have a statement, such as
qid,Lko,Len,P1343
,"해요체","polite style",Q115683766
the following HTML appears in the API response immediately prior to the JSON output:
<br />
<b>Notice</b>: Undefined index: new_statement in <b>/data/project/quickstatements/public_html/quickstatements.php</b> on line <b>640</b><br />
Because of this extra output, the screen does not proceed to where I can start the resultant batch.
This error does not appear when trying to add statements in CSV syntax to existing items, and this error HTML appears in the API response each time a new statement is detected to be added--if there were two statement columns and two items being created in the above command sample, then the 'undefined index' error would appear four times.
My initial thought is that this has been broken since 8d516de but I am not entirely certain.
Steps to reproduce:
Your connection is not private
Attackers might be trying to steal your information from iw.toolforge.org (for example, passwords, messages, or credit cards). Learn more
NET::ERR_CERT_DATE_INVALID
Incognito doesn't work. There's no option to bypass this error message. All other versions ("V2 original" and "V1") have the same issue. The page had worked for me about 3 weeks ago.
EDIT: So I'm on my Macbook Air 2015, Version 10.11.6, and your website is not working. But on my newer Chromebook, running Chrome Version 93.0.4577.85, your website works!
I'm not sure if this is related, but this issue may coincide with me getting permissions rights via https://www.wikidata.org/wiki/Wikidata:Requests_for_permissions/Other_rights#Confirmed .
When I try to create a new item in a local wikibase with one statement and two equal values, for instance:
CREATE
LAST P137 Q63 P49 +1176-01-00T00:00:00Z/10 P787 "ad quem" P50 +1873-03-09T00:00:00Z/11 P721 "<i>DHEE</i>"
LAST P137 Q63 P49 +1874-04-14T00:00:00Z/11 P50 +1931-04-29T00:00:00Z/11 P721 "<i>DHEE</i>"
But when I try to update an item with the same case, for instance:
Q103 P137 Q63 P49 +1176-01-00T00:00:00Z/10 P787 "ad quem" P50 +1873-03-09T00:00:00Z/11 P721 "<i>DHEE</i>"
Q103 P137 Q63 P49 +1874-04-14T00:00:00Z/11 P50 +1931-04-29T00:00:00Z/11 P721 "<i>DHEE</i>"
The statement only has one value with merged qualifiers.
Is it possible to configure quickstatements somehow to not reuse statements when adding?
It looks like when used by admins, QuickStatements can send API requests too rapidly.
(Reported at https://www.wikidata.org/wiki/Wikidata:Administrators%27_noticeboard#batch_49266_by_User:Bovlb_ignores_maxlag) (permalink)
The solution might be using maxlag and pausing and retrying upon a failure. The suggested value is 5 seconds.
https://quickstatements.toolforge.org/#/batches/Thibaultmol
I have done atleast one wikidata batch and two commons batches. neither of them show up here. And if I click on the button to discuss the batch after I ran it, I just get an error: https://editgroups.toolforge.org/b/QSv2T/1658766310749/
Hello, I have a batch for QuickStatement to create 90 new items for cultural monuments:
https://quickstatements.toolforge.org/#/batch/215767
Since 31st of October 2023 I get the error message:
Cannot automatically assign ID: Im Rahmen einer Anti-Missbrauchs-Maßnahme kann diese Aktion in einem kurzen Zeitabstand nur begrenzt oft ausgeführt werden. Diese Grenze hast du überschritten. Bitte versuche es in ein paar Minuten erneut.
which translates to
Cannot automatically assign ID: As part of an anti-abuse measure, this action can only be carried out a limited number of times within a short period of time. You have exceeded this limit. Please try again in a few minutes.
Even if I try to execute the batch several hours later (instead of a few minutes), the error message persists.
The error persists, independent if the statements are executed in foreground or as a background batch.
Thanks a lot!
Also see:
https://www.wikidata.org/wiki/Wikidata:Project_chat#QuickStatement_anti-abuse_measure_(rate_limit?)
https://www.wikidata.org/wiki/Help_talk:QuickStatements#QuickStatement_anti-abuse_measure_(rate_limit?)
https://www.wikidata.org/wiki/Help_talk:QuickStatements#Quickstatements_CSV_import_shows_too_many_errors
https://www.wikidata.org/w/index.php?title=Help_talk%3AQuickStatements&diff=2002178245&oldid=1985112525
https://www.wikidata.org/w/index.php?title=Wikidata%3AProject_chat&diff=2002178436&oldid=2001903648
@magnusmanske, I have a custom Wikibase and the following QuickStatement:
CREATE
LAST P1 Q2
LAST Den "chemical compound"
LAST P7 "CCCCCOC1=C2C3=C(C(=O)CC3)C(=O)OC2=C4[C@@H]5C=CO[C@@H]5OC4=C1" S14 Q5
LAST P3 "C₂₁H₂₀O₆" S14 Q5
LAST P2 368.3807U3 S14 Q5
LAST Len "foo"
LAST P9 "InChI=1S/C21H20O6/c1-2-3-4-8-24-14-10-15-18(12-7-9-25-21(12)26-15)19-17(14)11-5-6-13(22)16(11)20(23)27-19/h7,9-10,12,21H,2-6,8H2,1H3/t12-,21+/m0/s1" S14 Q5
LAST P10 "VQBNVFKQPPPAER-LAJNKCICSA-N"
It works well, except for the line with 368.3807U3
. When I include that I get the error it does not know about http://compoundcloud.wikibase.cloud/entity/Q3 not existing. This makes sense, because it should be https://compoundcloud.wikibase.cloud/entity/Q3 instead. With the 's'.
I am guessing the problem is that wikidata.org actually uses http
in the URLs. I cannot see where in the code the translation to U3
to http://compoundcloud.wikibase.cloud/entity/Q3
.
But since it is working as expected for other part of the QS, I am hoping the fix should be simple.
When some user gets renamed in wikidata, the batches are still assigned to the old username.
When the Gregorian calendar was first introduced to replace the Julian calendar, Thursday 4 October 1582 was followed by Friday 15 October 1582. Therefore, we can safely assume that any date in this format before 5 October 1582 is in the Julian calendar and not the Gregorian calendar.
(Note that the final country to transition from the Julian calendar to the Gregorian calendar was Greece, with 15 Feb 1923 followed by 1 Mar 1923. Thus we can safely assume that any date 16 February 1923 or later is a Gregorian date. Any date in between could potentially be either calendar, depending on the country).
I would like to see QuickStatements default to the Julian calendar for all dates before 5 October 1582. A configuration option to specify a calendar type would be even better, but is not strictly necessary for this issue.
When using csv syntax in Quickstatements, is would be nice to be able to skip a value for a certain property. I know you can enter "somevalue" or "novalue" but this means that the property will always be visible for this certain item. In my spreadsheet I sometimes have values for this property and sometimes I don't. The only workaround now is doing it in several batches but that's a timeconsuming workaround.
To use the CSV format with EDTF-style dates.
Can you add to the README how to install this a local installation of wikibase? I've gone so far as to clone, configure, replace "/data/tools/" with my own paths, and a few other things, but the page doesn't load. Vue.js just hangs with a "loading" message.
Also, I see references to .ini files that don't exist in the repo. Can you provide examples of those?
I have tried the following csv commands. Everytime I attempt a run, I get an error.
qid,Len,#
Q16314398,Pedduru,Update English label for AP villages as per official data from https://lgdirectory.gov.in/
Q16313714,Peddamadi,Update English label for AP villages as per official data from https://lgdirectory.gov.in/
Q16344486,Ramachandrapuram,Update English label for AP villages as per official data from https://lgdirectory.gov.in/
Hi @magnusmanske,
For some weird reason, since approx 48h, it looks like I cannot launch background jobs.
They are stuck in init
mode (see https://quickstatements.toolforge.org/#/batches/AdrianoRutz).
Online jobs are working (see https://editgroups.toolforge.org/?user=AdrianoRutz&tool=QSv2T).
I tried with another account and same issue.
Also tried logging on a VPN, does not change.
Any idea?
After having my Wikimedia-SUL renamed I'm no longer able to properly manage my batches.
Steps to reproduce
Expected behaviour
I should be able to manage my batches as it was possible before having my Wikimedia-SUL renamed. This especially includes being able to view a list of my batches and being able to stop them.
Actual behaviour
Batches created by me are actually created under my old username which leads to me not being able to manage them and them being not properly associated with my identity in QuickStatements. Edits made in Wikidata are nevertheless properly associated with my identity (and new username).
Also, there are now some inconsistencies in the GUI which brings me to the assumption that for identification purposes QuickStatements uses my current username except when creating batches. I'm not familiar with the design of QuickStatements so I suppose QuickStatements keeps its own database on users and uses this one to associate batches to their creators.
Inconsistency:
https://quickstatements.toolforge.org/#/batches/$NEW_USERNAME
.https://quickstatements.toolforge.org/#/batch/$BATCH_ID
) the meta data of the batch displays my old username, links to my old Wikidata-userpage and to a batch overview with my old username (https://quickstatements.toolforge.org/#/batches/$OLD_USERNAME
). However, after the batch has finished I can still Reset errors
Missing functionality:
Version
Version deployed to quickstatements.toolforge.org as of 2021-01-22
Note: I previously reported this issue somewhere on BitBucket (cannot find it anymore) but received no reaction whatsoever. There are still issues related to QuickStatements under magnusmanske/wikidata-todo which might be worth migrating if GitHub is the new home for issue reports.
A batch involving a cancelled item remains stuck. To resume it, you have to stop and restart manually.
QS could skip a cancelled item.
Many times , this issue occurs in sync operations from Mix-n-match. Thx.
QuickStatements should always use the bot flag whenever possible. The MediaWiki API will only make the request a bot request if the account has a bot flag, so it can't be abused by normal users.
When creating a new claim or modifying an existing one using QuickStatements add a way to check constraints in the modified claims and add an indicator (like the one for the status of the row) to indicate the ones that have constraint violations. That way it will be easier to fix errors added while using QuickStatements that could be detected with the existing constraints.
Currently, given the lack of an ability to add via quickstatement Q53569537 has to be used which then creates extra edits to be replaced by . It would be great if QuickStatements would support directly. The same goes for .
The implementation of this currently holds back the RfC https://www.wikidata.org/wiki/Wikidata:Requests_for_comment/Cleaning_up_the_ontology_of_anonymous#Discussion
Redirects, which are not connected to an wikidata object
can also be found using PetScan with Page Properties -> (Soft) Redirects
Is there a way to connect resp. create objects for redirects with redirect-badge using QuickStatements/PetScan, for example like
Also see
Content I've attempted:
qid,Len,Den,P31,P170,P1476,P571,P276
,Il Penseroso,Watercolour painting by Julian Rossi Ashton,Q18761202,Q6306955,"en:""Il Penseroso""",+1894-01-01T00:00:00Z/9,Q63468534
I tried uploading this content to "Wikidata-test" and it failed. There's no information as to why it failed, or how I could continue debugging my issue. Screenshot:
When I hover over the red "error" text, the tooltip only has empty curly braces "{}". (Note that this same content was successfully uploaded when I tried "Wikidata" instead.)
Wondering why error_reporting
is hardcoded in api.php
?
error_reporting(E_ERROR|E_CORE_ERROR|E_ALL|E_COMPILE_ERROR); //
ini_set('display_errors', 'On');
I spent quite some time wondering why my settings in php.ini
weren't working to finally figure out they were overwritten.
Trouble is, your composer.json
does not fix a PHP version, e.g. 7.4
and so we end up with dependencies that require 8.1
in some situations (Think docker multi-stage builds…).
With 8.1 and the level of error_reporting
hard-coded in api.php
, the result on an API call is:
<br />
<b>Deprecated</b>: Implicit conversion from float 0.1 to int loses precision in <b>/var/www/html/quickstatements/public_html/quickstatements.php</b> on line <b>1096</b><br />
{"status":"OK","command":{"action":"create","type":"item","data":{"claims":[{"mainsnak":{"snaktype":"value","property":"P1","datavalue":{"type":"wikibase-entityid","value":{"entity-type":"item","id":"Q17"}}},"type":"statement","rank":"normal"},{"mainsnak":{"snaktype":"value","property":"P18","datavalue":{"type":"string","value":"I made a second attempt of a QS"}},"type":"statement","rank":"normal"}]},"meta":{"message":"","status":"RUN","id":0},"summary":"#temporary_batch_1660059860160","status":"done","run":{"action":"wbeditentity","new":"item","data":"{\"claims\":[{\"mainsnak\":{\"snaktype\":\"value\",\"property\":\"P1\",\"datavalue\":{\"type\":\"wikibase-entityid\",\"value\":{\"entity-type\":\"item\",\"id\":\"Q17\"}}},\"type\":\"statement\",\"rank\":\"normal\"},{\"mainsnak\":{\"snaktype\":\"value\",\"property\":\"P18\",\"datavalue\":{\"type\":\"string\",\"value\":\"I made a second attempt of a QS\"}},\"type\":\"statement\",\"rank\":\"normal\"}]}","summary":"#quickstatements; #temporary_batch_1660059860160","bot":1,"token":"************************+\\","format":"json"},"item":"Q1162"},"last_item":"Q1162"}
Steps to replicate the issue:
I want to remove a set of aliases from different items in different languages using QuickStatements, so I:
-Q745 Ahy "մորի"
-Q17592 Aast "Avestruz"
-Q7045 Aast "Samartín"
-Q11575 Azh "玉米"
What happens?:
An example batch is here.
As you can see, all the commands produce an error.
What should have happened instead?:
All the aliases should have been removed.
Other information
If I try to click on "Run" instead of ("Run in background"), then everything is fine.
Note that it is not a Unicode-related problem, since it occurs even when only the second row is specified (see e.g. this batch).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.