ScotGovAnalysis / opendatascot

An R package to pull data from statistics.gov.scot into R
https://scotgovanalysis.github.io/opendatascot/
MIT License
47 stars 6 forks source link

Create mechanism to source SPARQL files from external files #82

Closed konradzdeb closed 4 years ago

konradzdeb commented 4 years ago

Hi, I just came across your package today. Actually, I was working on a very similar project that I do as a hobby in the evenings when I get time. For instance, for using SPARQL queries, I have put together C++ import mechanism inserting dynamic query elements via glue package and cleaning comments in C++. This gives quite a lot of flexibility and a nice, cultured, readable code. For instance instead of:

https://github.com/DataScienceScotland/opendatascot/blob/5a37776682ceeabffb3950c66e42acaeb3972add/R/ods_find_lower_geographies.R#L20-L32

I do:

    # Import basic SPARQL query
    query_orig <-
      read_query_file(query_file("qry_get_geography_data"))

Since we have the same goals in those packages, shall we join forces? Would you be open to a PR that would look at sourcing SPARQL files from inst instead of using hard-coded strings in R functions? Let me know what do you think, I think it would be fun to collaborate as it seems that independently and unknowingly we have been pursuing an identical goal.

GordonBryden commented 4 years ago

Thanks, looking into this now. I've sent you an email.

GordonBryden commented 4 years ago

Done, implemented Konradzbeb's method