-
Notifications
You must be signed in to change notification settings - Fork 8
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
Setting up csv-reconcile-geo #3
Comments
Hi there. The last part of the error mentions a
To fix this, you'll need to make sure you have at most one coordinate for each id. You can do this by loading this file into OpenRefine and removing duplicates. Checking your query it looks like these items have more than one
Ideally each of these would only have one coordinate location with preferred rank. The good news is it looks like you're very close to getting this working. |
Alternatively, you could use select ?item (SAMPLE(?coord1) as ?coord) with {
select * where {
?item wdt:P31/wdt:P279* wd:Q1746392 .
?item wdt:P17 wd:Q213 .
}
} as %pamatky where {
INCLUDE %pamatky .
?item wdt:P131|wdt:P131/wdt:P131|wdt:P131/wdt:P131/wdt:P131 wd:Q1085 .
?item wdt:P625 ?coord1 .
} GROUP BY ?item |
@gitonthescene Thanks so much! I was suspecting that something much more serious was going on in the error log. I am now able to run the reconciliation service, load it into OpenRefine and successfully run it from there on my OpenRefine project. I can see the correct item QIDs when I use the "cell.recon.match.id" command on the reconciled column. The only thing that's a bit impractical is that I don't see QIDs in the default view. I gathered from https://github.com/gitonthescene/csv-reconcile that I should create a config file and use the MANIFEST command to be able to see those. I thus created a "config.txt" file with this contents:
I've put the file into the same folder and query.tsv and pointed to it using: $ csv-reconcile --init-db query.tsv item coord --scorer geo --config config.txt That did create a reconciliation service but did not help with the default view. Could you please help with that last step? thank you very much. |
I'm not sure what you mean by "the default view". Usually, when something reconciles, what's shown is the value it got reconciled to. In this case it would show the matching coordinates. It looks like you grabbed the part of the manifest which makes this clickable to take you to the Wikidata page. If you want the preview from hovering over a candidate, you'll want to copy the preview section of the manifest. Namely Maybe posting a screenshot would help. |
I'd like to display QID in the reconciled suggestions (instead of the values it got reconciled to) and make it clickable to go to respective Wikidata item... This is because I usually need to go through some of the suggestions manually and it's practical to just have a clickable link to Wikidata. I tried to put your text into my config file, instead of the original contents, but it produced the following error:
|
Oh, okay. Like I said what you had originally should make the link clickable once an entry is reconciled and what’s displayed is the value that matched not the id. That first value in your screenshot should be clickable. I believe you’ll need to make a choice on the second for it to be clickable but maybe the candidates are already clickable. That code for The reconciliation service always shows the value you reconcile to and not the id, but the link should still work. If you really want the id, you can add a column with |
@gitonthescene Alas, it's working now. I did two mistakes - 1) I did not remove and readd the service from OpenRefine after I changed the config file, 2) I had a wrong formatting of the URL formatter in the config file (the default outcome from the Query service is not QID, but full url with http and everything). So, just for my future reference, the steps are:
http://127.0.0.1:5000/reconcile thank you again @gitonthescene and I'll spread the word about this great tool and plugin in the Czech Wikidata community :) |
@VojtechDostal Hey. Just a heads up. It looks like I swapped latitude and longitude in my distance calculation. I'll be publishing a fix later today. Sorry for the mix up. |
I think I swapped them in my table to compensate for that. It hadn't surprised me because lat and lon are sometimes deliberately swapped in some tools for some reason. I noticed that sometimes your reconciliation service may not find the best match which it is supposed to find, one which it is really close to the input object and is included in the query results. Are you interested in examples of cases like that if I discover them in future? |
Yes, please. You can open a new issue for anything strange you see. Just to be clear, in the most recent version uploaded to PyPI you shouldn’t need to swap lat and longitude. I probably should have updated the minor version. |
The correct wording is now seemingly:
Then I need to do the following:
Then it works. |
I’m traveling currently but will have a look at this when I’m back. |
@gitonthescene Please could you assist me with this? I am a bit disoriented and I am not sure if I understand the overall idea of 'my own' reconciliation service correctly. Am I right in assuming that I need to load File number 1 into openrefine, load File number 2 into command line via the commands above, add a reconciliation service "http://127.0.0.1:5000/reconcile" to OpenRefine and reconcile?
I think I was able to start virtualenv on my system (I am on Windows and "source" did not work, but I think I was able to find a solution at https://stackoverflow.com/questions/8921188/issue-with-virtualenv-cannot-activate) and then I was able to install csv-reconcile and csv-reconcile-geo. However, this is what I get when I run the program:
My query.tsv is from https://w.wiki/3BV9
What do you think is happening? Sorry to spam the issue with my questions
Originally posted by @VojtechDostal in wetneb/openrefine-wikibase#101 (comment)
The text was updated successfully, but these errors were encountered: