Git Product home page Git Product logo

dkan_datastore's Introduction

Circle CI

DEPRECATED: This module has been moved into DKAN core for release 7.x-1.13. To maintain backward compatibility with DKAN 7.x-1.12 and subsequent patch releases this project will remain on Github but new features will be applied directly to the DKAN core folder modules/dkan/dkan_datastore.

DKAN Datastore

DKAN Datastore bundles a number of modules and configuration to allow users to upload CSV files, parse them and save them into the native database as flat tables, and query them through a public API.

DKAN Datastore is part of the DKAN distribution which makes it easy to create an Open Data Portal.

DKAN Datastore is part of the DKAN project which includes the DKAN profile which creates a standalone Open Data portal, and DKAN Dataset.

DKAN Datastore is currently managed in code on Github but is mirrored on Drupal.org.

INSTALLATION

This module REQUIRES implementers to use "drush make". If you only use "drush download" you will miss key dependencies for required modules and libraries.

The following will download the required libraries and patched modules:

drush dl dkan_datastore
cd dkan_datastore
drush make --no-core dkan_datastore.make

Managing datastores with Drush

The DKAN Datastore API module provides the functionality needed to manage the datastores using Drush. The available commands are:

To create a datastore from a local file:

drush dsc (path-to-local-file)

To update a datastore from a local file:

drush dsu (datastore-id) (path-to-local-file)

To delete a datastore file (imported items will be deleted as well):

drush dsfd (datastore-id)

To get the URI of the datastore file:

drush dsfuri (datastore-id)

Using without DKAN

This module can be used without DKAN. It requires a node and either file or link field to supply a file. By default it looks for a "resource" node with a "field_upload" field.

To change this default, use "hook_dkan_datastore_file_upload_field_alter()" and / or "hook_dkan_datastore_node_type_alter()". For example the following will change the expected node and file field to "article" and "file_myfile":


/**
 * Implements  hook_dkan_datastore_file_upload_field_alter().
 */
function MY_MODULE_dkan_datastore_file_upload_field_alter(&$field) {
  $field = 'field_myfile';
}

/**
 * Implements  hook_dkan_datastore_node_type_alter().
 */
function MY_MODULE_dkan_datastore_node_type_alter(&$node_type) {
  $node_type = 'article';
}

Now "article" nodes will have "Manage Datastore" and "Data API" tabs. CSV files uploaded with the "file_myfile" field can be imported into the datastore and queried via the DKAN Datastore API.

Design

Adding new Datastores

Managing datastores with Drush

The DKAN Datastore API module provides the functionality needed to manage the datastores using Drush. The available commands are:

To create a datastore from a local file:

drush dsc (path-to-local-file)

To update a datastore from a local file:

drush dsu (datastore-id) (path-to-local-file)

To delete a datastore file (imported items will be deleted as well):

drush dsfd (datastore-id)

To get the URI of the datastore file:

drush dsfuri (datastore-id)

Contributing

We are accepting issues in the dkan issue thread only -> https://github.com/NuCivic/dkan/issues -> Please label your issue as "component: dkan_datastore" after submitting so we can identify problems and feature requests faster.

If you can, please cross reference commits in this repo to the corresponding issue in the dkan issue thread. You can do that easily adding this text:

NuCivic/dkan#issue_id

to any commit message or comment replacing issue_id with the corresponding issue id.

dkan_datastore's People

Contributors

acouch avatar dafeder avatar dkinzer avatar frankcarey avatar jacintocapote avatar janette avatar kevg avatar msolv avatar starsinmypockets avatar teosibileau avatar topicus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.