rOpenGov / sorvi

Algorithms for Finnish open goverment data
http://ropengov.github.io/sorvi
Other
13 stars 4 forks source link

unable to resolve 'data.okf.fi' #14

Open pe3 opened 7 years ago

pe3 commented 7 years ago

Followed the instructions on sorvi_tutorial.md:

translations <- load_sorvi_data("translations")
print(head(translations))

Got an error:

> translations <- load_sorvi_data("translations")
Loading http://data.okf.fi/ropengov/avoindata//louhos/translations.rda
Error in load(url(filepath)) : cannot open the connection
In addition: Warning message:
In load(url(filepath)) : unable to resolve 'data.okf.fi'

Where is the code for producing translations.rda?

pe3 commented 7 years ago

I would be interested to research if we could move Sorvi towards more reliable dependencies like Wikidata.

antagomir commented 7 years ago

In fact we just fixed this yesterday in issue #11 . Update sorvi with devtools::install_github("ropengov/sorvi") and the above example should work.

Regarding data source, yes a permanent solution would be good. The OKF data server is now down and we are using github directly instead. That may not have the optimal sharing capacities. Other solutions could do as long as there is someone has can afford the time to implement them.

antagomir commented 7 years ago

The translations.rda contains just very few English-Finnish translations for municipalities. If I recall correctly, I once manually prepared it with the idea of later implementing and documenting a proper code - that would be appropriate but not available (yet). In any case the translations provide a handy converter if one needs to map between the two languages.

If someone has real use for this particular case, I could implement a better and more permanent solution fast (including more generic conversion tools), otherwise I postponing this for later.

pe3 commented 7 years ago

I'm interested to see if I can be of any help. Here is a query and results for fetching fi/sv/en names and coordinates for Finnish municipalities

SELECT ?muni ?muniLabelFi ?muniLabelSv ?muniLabelEn ?latitude ?longitude ?coordinates ?population WHERE {
  ?muni wdt:P31 wd:Q856076 .  # municipality of finland
  ?muni p:P625 ?statement .   # coordinate-location statement
  OPTIONAL {
    ?muni wdt:P1082 ?population.
  }
  ?muni wdt:P625 ?coordinates.
  ?statement psv:P625 ?coordinate_node .
  ?coordinate_node wikibase:geoLatitude ?latitude .
  ?coordinate_node wikibase:geoLongitude ?longitude .

  OPTIONAL {
    ?muni rdfs:label ?muniLabelFi.
    FILTER(LANG(?muniLabelFi) = "fi").
  }
  OPTIONAL {
    ?muni rdfs:label ?muniLabelSv.
    FILTER(LANG(?muniLabelSv) = "sv").
  }
  OPTIONAL {
    ?muni rdfs:label ?muniLabelEn.
    FILTER(LANG(?muniLabelEn) = "en").
  }
}
antagomir commented 7 years ago

Nice ! It might be quite handy to have examples and perhaps some handy wrappers on these in sorvi. But then it might be good to also think a bit more widely what could be the overall plan - just a few examples, or a more comprehensive suite of tools (assuming the time is available).

antagomir commented 2 years ago

@pitkant could we utilize this here or in geofi?

Let us check & then close the issue.

pitkant commented 1 year ago

Thanks @pe3 for opening this issue, 6 years later this is now again topical (although it must be noted that the original issue of having trouble downloading data from an external website is not relevant any more). :) Municipality related functions were moved to the geofi package but now we're experimenting again with historical municipality data.

In experimental version of sorvi package 0.8.20.9000 included dataset data(kunnat1865_2021) contains translations for municipalities. If I recall correctly the old translations file contained translations also for regions (maakunta) but that is not unfortunately included here. It could be in the future though! And we're also interested in mapping out different types of municipality - larger region relationships and including translations for those would be very natural.

I will leave this issue open for a while in case there is some further discussion related to this larger issue of regional name translations.

antagomir commented 1 year ago

If the translations can be easily added (and I think they can?) for different levels/entities, it could definitely be worth it.