stuppie / pmidtool

Allow you to create or retrieve a wikidata item that represents a scientific journal article given a pubmed ID
Apache License 2.0
0 stars 2 forks source link

Item creation does not work #1

Open Daniel-Mietchen opened 7 years ago

Daniel-Mietchen commented 7 years ago

I tried to create two items via https://tools.wmflabs.org/pmidtool/get_or_create/27935596 and https://tools.wmflabs.org/pmidtool/get_or_create/24526591 and got

{
  "success": false
}

in both cases.

I then started an item (Q28735074) for the latter by way of https://tools.wmflabs.org/sourcemd/?id=24526591&doit=Check+source .

When I then re-ran https://tools.wmflabs.org/pmidtool/get_or_create/24526591 , I got the expected

{
  "result": "Q28735074", 
  "success": true
}

So it seems the creation is not working properly. I suspect it may have to do with authentication, since I did not see any OAuth or similar.

stuppie commented 7 years ago

I've seen this issue, as has @andrawaag, and I'm not sure what it causing it. Some percentage (20% ??) of items fail to be created using the wmflabs endpoint, however, if I run pmidtool locally, it works just fine and creates the item. Can you try out running this locally, and see if it works? I can't figure out why it doesn't work right on wmflabs. I don't see anything different between the ones that work and the ones that don't. Maybe some caching issue?

Also, it is set up to use the ProteinBoxBot account (on wmflabs). I haven't figured out oath yet. To run it locally, just create a local.py folder in the same dir containing WDUSER and WDPASS

Daniel-Mietchen commented 7 years ago

Now that I ran it locally (for 27935596), no edit seems to have been made either but I got

{
  "result": {
    "": null
  },
  "success": true
}

.

Daniel-Mietchen commented 7 years ago

Forgot to add that what I posted above is what I got in the browser.

Here's what I got on stdout:

$ python3 app.py 
Successully logged id as Daniel Mietchen
 * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
error getting metadata: 
127.0.0.1 - - [11/Feb/2017 05:00:20] "GET /get_or_create?pmid=1234 HTTP/1.1" 200 -
stuppie commented 7 years ago

For your last comment, "/get_or_create?pmid=1234" should be "/get_or_create?pmids=1234" I'll change it to work for either (or give an better error message!)

For 27935596, I ran it locally and it created the item just fine. I still can't figure out why it won't work on wmflabs....