hbz / geodata

Microservice for geo information enrichment. Deprecated in favor of https://github.com/pelias.
Other
1 stars 2 forks source link

Implement Wikidata Query #21

Closed philboeselager closed 8 years ago

philboeselager commented 8 years ago

Coming from https://github.com/hbz/nwbib/issues/83 , we need an additional query technique, collecting geo data from Wikidata.

fsteeg commented 8 years ago

Deployed to gaia, see: http://gaia.hbz-nrw.de:7400/geodata?q=K%C3%B6ln

acka47 commented 8 years ago

We also need the wikidata ID (Q365 in this case) or entity URI (http://www.wikidata.org/entity/Q365) for the spatial field, see https://github.com/hbz/nwbib/issues/83#issuecomment-155806824.

acka47 commented 8 years ago

Also, the response doesn't look correct for the entries we need an imporvement for: part sof a town like "Köln-Ehrenfeld". Köln (wikidata entity), Köln-Ehrenfeld (wikidata entity), and Köln-Mülheim (wikidata entity) all deliver the same geo coordinates though they have different ones in wikidata.

acka47 commented 8 years ago

Is the query template I provided in https://github.com/hbz/nwbib/issues/83#issuecomment-65620502 actually used here: https://www.wikidata.org/w/api.php?action=query&list=search&format=json&srsearch=$place_name ?

philboeselager commented 8 years ago

We also need the wikidata ID (Q365 in this case) or entity URI (http://www.wikidata.org/entity/Q365) for the spatial field, see hbz/nwbib#83 (comment).

So how do you want the result to look like then?

Also, the response doesn't look correct for the entries we need an imporvement for: part sof a town like "Köln-Ehrenfeld". Köln (wikidata entity), Köln-Ehrenfeld (wikidata entity), and Köln-Mülheim (wikidata entity) all deliver the same geo coordinates though they have different ones in wikidata.

This looks like a mismatch in the local buffer. I'm gonna investigate it.

Is the query template I provided in hbz/nwbib#83 (comment) actually used here: https://www.wikidata.org/w/api.php?action=query&list=search&format=json&srsearch=$place_name ?

Yes, this is step 1 of the 2-step wikidata query. Step 2 is like: https://www.wikidata.org/wiki/Special:EntityData/my_id.json

acka47 commented 8 years ago

So how do you want the result to look like then?

I suggest something like this, taking the label from labels.de.value:

{
   "id": "Q897382",
   "label": "Köln-Ehrenfeld",
   "latitude": 50.9464,
   "longitude": 6.91833
}
acka47 commented 8 years ago

Nothing has changed, nothing to review. Unassigning myself.

acka47 commented 8 years ago

...and moving to Ready as @philboeselager won't have time to work on this until the end of January.

philboeselager commented 8 years ago

Since our workshop didn't last until eob today, I can deploy that now.

philboeselager commented 8 years ago

Deployed now on server. But not working for search terms with special chars (umlauts), see #35.

acka47 commented 8 years ago

+1

acka47 commented 8 years ago

Can this be closed now?

acka47 commented 8 years ago

As we don't have a staging server yet for geodata (will be implemented with #34) this is already on production. Closing.

acka47 commented 8 years ago

(We might have to adjust the JSON a bit when working on #27.)