-
Notifications
You must be signed in to change notification settings - Fork 1
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
API - Expose complete url:s including domain #3
Comments
Hi @august54, The reason I shortened it is because I want the files to be as small as possible. As you might have seen on the repo, this is not a "real" dynamic API, there is no server producing the content on the fly when the API is called. It's just static files generated every night. Do you think it should be clearer in the documentation how to add the domain and the file extension to get the regeringen.se or g0v.se version of the resources? That is why I put a little converter field on g0v.se. |
Maybe a good idea would be to add a code example to convert a url in Python in the README? What do you think? Would you be able to make such a PR? I will not have access to a computer for the coming few weeks, I am on parental leave. 🙂 |
I think the documentation is good at the moment, on how to add one of the two domains and the file extension. However. I find that it presumes some technical skill, which not all users might have. I think for the general user, having the complete url:s in the API would lower the bar for understanding the value of the API. As for performance reasons, I made some checks on what this would mean for file size: With current approach, the example (one object from https://g0v.se/rapporter.json) has 1106 tokens The first option, with completed uri:s (domain + filextension for "uri" & domain for "attachment/uri"), it would have 1143 tokens (increase of 3.3%) As a second option, there could also be added both domain options for "url". So something like: "url_original": "https://regeringen.se/rapporter/2024/11/ai-kommissionens-fardplan-for-sverige/" This second option would have 1242 tokens (increase of 12%). To my understanding, the goal of the API is to make it easier to re-use government data, and I think making the API more user-friendly in this way increases the chances that the audience/users understands the value of this approach. Trade-offs in performance would not be that considerable, especially for the first option. The second option would make it even more clear that there is a original url for the html-page, and corresponding markdown page from the g0v-domain. If there is not a high traffic in terms of machines that read the files from the API programmatically, a 12% increase in file size could be worth it, since it benefits the experience for human users. I would also expect that an API provides the complete links, something that may confuse users currently. |
For "url" and "attachments/url" - why not expose complete url:s including domain name?
For instance:
"url"
/rattsliga-dokument/departementsserien-och-promemorior/2024/12/justering-i-lagen-om-sarskild-inkomstskatt-for-utomlands-bosatta/
->
g0v.se/rattsliga-dokument/departementsserien-och-promemorior/2024/12/justering-i-lagen-om-sarskild-inkomstskatt-for-utomlands-bosatta.md
"attachments/url"
/contentassets/4cfdbb1323324ef6acee6fd2a7879723/justering-i-lagen-om-sarskild-inkomstskatt-for-utomlands-bosatta.pdf
->
regeringen.se/contentassets/4cfdbb1323324ef6acee6fd2a7879723/justering-i-lagen-om-sarskild-inkomstskatt-for-utomlands-bosatta.pdf
The text was updated successfully, but these errors were encountered: