CKAN | Ruby Client for Comprehensive Knowledge Archive Network | Wiki library
kandi X-RAY | CKAN Summary
kandi X-RAY | CKAN Summary
'CKAN' is a Ruby client of the Comprehensive Knowledge Archive Network.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Upload a file
- Initializes a new Storage instance .
- Generate the body for the post body
- Reads data from the object .
- returns a hash of all resources in the collection
- Returns a hash representation of this object .
- Request authentication for the storage account
- Returns hash for attribute names
- Get the hash of the metadata for a resource .
- Perform a GET request .
CKAN Key Features
CKAN Examples and Code Snippets
Community Discussions
Trending Discussions on CKAN
QUESTION
Is there a way to disable users (other than Sysadmins) from setting datasets/packages as Public (or delete the dataset) in CKAN (basically and Editor that can't delete or set Public)? Somewhere in the source files I can see the logic related to this? Any extensions that would require user edits be approved by data stewards of a dataset before it is actually displayed to anyone on the platform (so that we could just include checking that the edit did no include setting the data/package as Public in the moderation process)?
We want to give as much editing control to Editor-privileged users as possible while still preventing them from editing the Public/Private setting for data/packages as we want only sysadmins to have this control for certain data privacy and responsibility reasons.
From the moderation route, saw this extension, but unsure if the moderation is before it is displayed (and don't have a server to test this on atm). Unsure if there are any other packages like this as the CKAN extension searchbar seems to only hit on exact words, so seems easy to miss extension that are conceptually similar but titled very differently.
Anyone with more CKAN experience know how this could be achieved (else where approximately in the CKAN source code I could start looking into adding a new extension for this)?
...ANSWER
Answered 2021-Mar-26 at 08:53Made my own extension to do what I needed: https://github.com/reedv/ckanext-publicrestrictiondatasets
Adds restrictions to datasets so that only sysadmin users can set visibility to Public. This is in order to make CKAN's behavior match closer how it is described here (https://ckan.org/portfolio/publish-and-manage-data/).
Admins can approve datasets for publication with our bulk editing tool which let’s you search, facets and pick datasets to become public or private.
QUESTION
My company is using a CKAN instance configured with Data Store and DataPusher. When a CSV file is uploaded to CKAN, DataPusher sends it to the DataStore and creates a default Data Dictionary for the resource. The Data Dictionary is a very nice feature to display the description of data fields for the users. Here is an example:
I can update the Data Dictionary using the UI, or it can be sent as part of the Fields passed to datastore_create()
.
My problem, is that I don't control the call of datastore_create()
because this method is automatically called buy the DataPusher service.
I want to programatically set the values of the Data Dictionary, but I can't find and api call that allow me to do it. An api call that update the Fields metadata. Can I do it using the Api? Or maybe it is possible create it when I create the data resource. I'd like a code example.
...ANSWER
Answered 2021-Mar-22 at 14:19You can use the API call datastore_create on top of an existing table. This will not impact the data in the table.
You should use the datastore_search to check the format of how the dictionary is saved in one of your resources (result->fields->info). Use that as your base, make the desired changes, and use it in the body of the datastore_create
call.
Unfortunately, the API call datastore_info
does not give you back that information.
The majority of the CKAN UI functionalities can be made through the API as well. In this case, you can make use of the "datastore_create" by the controller --> See Code here.
QUESTION
Basically, I want to totally disable API access for all user other than sysadmins (v2.9.1).
- Where in the code can I see the logic related to this? Closest I could find was via
ANSWER
Answered 2021-Mar-19 at 01:17Currently just hiding the API token generation tab from non sysadmin users in the web UI html (https://github.com/ckan/ckan/blob/cc000d3acf7401957d8321be53e8cabc2d9ebf3a/ckan/templates/user/api_tokens.html) by a similar mechanism that html templates can control visibility of the Visibility functionality of packages here (https://github.com/ckan/ckan/blob/master/ckan/templates/package/snippets/package_basic_fields.html#L72)...
QUESTION
I'm having problem with loading from local storage.
Here's a part of the code
...ANSWER
Answered 2021-Feb-24 at 10:37Alright, as @Yoshi stated, it was insequential promise error. I managed to fix it by using reduce().
Here are the threads that helped me
QUESTION
I want to load the data from a JSON file into R to make a new dataframe. However the JSON file consists out of other links with data, so i can't seem to find the actual data from the JSON file. I got the JSON file from this website: https://ckan.dataplatform.nl/dataset/467dc230-20e0-4c3a-8240-dccbfc20807a/resource/531cc276-b88e-49bb-a97f-443707936a12/download/p-route-autoparkeren.json
This is the code i used.
...ANSWER
Answered 2020-Dec-08 at 15:31Maybe try fromJSON
from package jsonlite
QUESTION
I am trying to access data.gov.au datasets through their CKAN data API. Unfortunately, the data API instructions are slightly outdated and do not seem to work. Instructions found here.
So far, I've worked out that I am meant to query the dataset using urllib.request
.
ANSWER
Answered 2020-Nov-22 at 13:32Here is a solution that works:
QUESTION
When looking at the API for updating Packages, Groups, Organizations, or Users, I see that one of the input args is
id (string) – the name or id of the user to update
(https://docs.ckan.org/en/2.9/api/index.html#ckan.logic.action.update.package_update). What are the different ways that I can see the "id" of a CKAN user/org/package? The "name"?
Are the IDs just the URL component of the CKAN object that I see when I am, say, updating an Organization? Eg...
Just from looking at the API docs here (https://docs.ckan.org/en/2.9/api/index.html#ckan.logic.action.update.resource_update) and older examples here (https://docs.ckan.org/en/ckan-1.7.2/api-tutorial.html), the IDs appear to be UUIDs, but I don't know how I would know these values from the CKAN web UI. And is the "name" the name as shown when I, say, view the dataset/Package in the web UI or is it as shown in the URL when looking at the Package (as in the image shown above)?
Could anyone provide more clarity on this? Is this explained somewhere in the docs?
...ANSWER
Answered 2020-Oct-16 at 12:08It depends on what Id/Name you looking, you can query or list them I use rest api like this on ckan 2.8+
:
QUESTION
I have been trying for several days now to run CKAN as a docker image. The official CKAN documentation explains in detail how to create your own docker image via "docker-compose". The basic workflow is:
- Clone the CKAN source files from GitHub
- Make some changes in the "docker-compose.yml" file (custom passwords, extensions, etc)
- Run "docker-compose"
This gives you a running CKAN docker container together with all the necessary databases and search engines.
My ultimate goal however is to push this CKAN docker image to Docker-Hub and to run it on other machines via "docker run". I want to use this apporach because I want to extensively modify the original CKAN installation, and also add custom datasets, groups and organizations to the running catalog before pushing it to docker hub. "Docker run" seems to be much easier and more convenient compared to using "Docker compose".
The problem is: Whenever I try to run the CKAN container using the commands below I end up with the following error:
...ANSWER
Answered 2020-Oct-15 at 17:28run it as a docker compose command if you want to run it from docker you need to split away docker files and send some arguments from .env file like error says SQL_ALCHEMY is not being sent.
i would recommend to execute it as docker compose. then once you build from docker compose you can just execute docker run and send missing arguments like SQL_ALCHEMY.
QUESTION
My simple python script to create a dataset and to that dataset add a single PDF file as a resource is failing with "{file} is not json serializable".
...ANSWER
Answered 2020-Sep-25 at 17:09I copied your code and ran a modified version against a local dev copy of CKAN and had it work without issue AFTER my mods which are included below.
Most notably:
- payload_r -> All that extra stuff isn't needed but you can include other resource metadata such as description, name, etc if desired just
- req_r -> 1) pass the payload here as
data
instead ofjson
as it'smultipart-form-data
. 2) send the file here with thefiles
param.
Docs: https://docs.ckan.org/en/2.9/maintaining/filestore.html#filestore-api
IMO this is less of a CKAN issue and more of an understanding of the library chosen (i.e. requests). there are many ways to do this with different tools.
I also had to update the payloads to align with my schema but assuming that's correct for yours this should work.
QUESTION
We use CKAN as open data portal software. The search engine is powered by Solr.
When using the API for searches tags can be specified.
Is it possible to enter tags in the search box and make a search exclusively for tags?
I tried to enter
...ANSWER
Answered 2020-Jun-21 at 13:16Yes, to limit the dataset search you can use faceted search by using the tags. When you search with tags, CKAN will use fq(filter query) to restrict the superset of data returned. Check this Search API call example Tags. Also, you can check the search settings configuration. You can also customize the search facets by using IFacets interface.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install CKAN
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page