Skip to content
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

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

Open
pe3 opened this issue Mar 3, 2017 · 8 comments
Open

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

pe3 opened this issue Mar 3, 2017 · 8 comments
Assignees

Comments

@pe3
Copy link

pe3 commented Mar 3, 2017

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
Copy link
Author

pe3 commented Mar 3, 2017

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

@antagomir
Copy link
Member

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
Copy link
Member

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
Copy link
Author

pe3 commented Mar 3, 2017

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
Copy link
Member

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
Copy link
Member

@pitkant could we utilize this here or in geofi?

Let us check & then close the issue.

@pitkant
Copy link
Member

pitkant commented May 15, 2023

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
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants