Code Monkey home page Code Monkey logo

ckanext-doi's Introduction

ckanext-doi

Tests Coveralls CKAN Python Docs

A CKAN extension for assigning a digital object identifier (DOI) to datasets, using the DataCite DOI service.

Overview

This extension assigns a digital object identifier (DOI) to datasets, using the DataCite DOI service.

When a new dataset is created it is assigned a new DOI. This DOI will be in the format:

https://doi.org/[prefix]/[8 random alphanumeric characters]

If the new dataset is active and public, the DOI and metadata will be registered with DataCite.

If the dataset is draft or private, the DOI will not be registered with DataCite. When the dataset is made active & public, the DOI will be registered. This allows datasets to be embargoed, but still provides a DOI to be referenced in publications.

You will need a DataCite account to use this extension.

DOI Metadata

This extension currently uses DataCite Metadata Schema v4.2.

Dataset package fields and CKAN config settings are mapped to the DataCite Schema with default values, but these can be overwritten by implementing IDoi interface methods.

Required fields

CKAN Field DataCite Schema
dataset:title title
dataset:author creator
config:ckanext.doi.publisher publisher
dataset:metadata_created.year publicationYear
dataset:type resourceType

See metadata.py for full mapping details.

Installation

Path variables used below:

  • $INSTALL_FOLDER (i.e. where CKAN is installed), e.g. /usr/lib/ckan/default
  • $CONFIG_FILE, e.g. /etc/ckan/default/development.ini

Installing from PyPI

pip install ckanext-doi

Installing from source

  1. Clone the repository into the src folder:

    cd $INSTALL_FOLDER/src
    git clone https://github.com/NaturalHistoryMuseum/ckanext-doi.git
  2. Activate the virtual env:

    . $INSTALL_FOLDER/bin/activate
  3. Install via pip:

    pip install $INSTALL_FOLDER/src/ckanext-doi

Installing in editable mode

Installing from a pyproject.toml in editable mode (i.e. pip install -e) requires setuptools>=64; however, CKAN 2.9 requires setuptools==44.1.0. See our CKAN fork for a version of v2.9 that uses an updated setuptools if this functionality is something you need.

Post-install setup

  1. Add 'doi' to the list of plugins in your $CONFIG_FILE:

    ckan.plugins = ... doi
  2. Initialise the database:

    ckan -c $CONFIG_FILE doi initdb
  3. This extension will only work if you have signed up for an account with DataCite. You will need a development/test account to use this plugin in test mode, and a live account to mint active DOIs.

Configuration

These are the options that can be specified in your .ini config file.

DateCite Credentials [REQUIRED]

DataCite Repository account credentials are used to register DOIs. A Repository account is administered by a DataCite Member.

Name Description Example
ckanext.doi.account_name Your DataCite Repository account name ABC.DEFG
ckanext.doi.account_password Your DataCite Repository account password
ckanext.doi.prefix The prefix taken from your DataCite Repository account (from your test account if running in test mode) 10.1234

Institution Name [REQUIRED]

You also need to provide the name of the institution publishing the DOIs (e.g. Natural History Museum).

Name Description
ckanext.doi.publisher The name of the institution publishing the DOI

Test/Debug Mode [REQUIRED]

If test mode is set to true, the DOIs will use the DataCite test site. The test site uses a separate account, so you must also change your credentials and prefix.

Name Description Options
ckanext.doi.test_mode Enable dev/test mode True/False

Note that the DOIs will still display on your web interface as https://doi.org/YOUR-DOI, but they will not resolve. Log in to your test account to view all your minted test DOIs, or replace https://doi.org/ with https://doi.test.datacite.org/dois/ in a single URL to view a specific DOI.

Other options

Name Description Default
ckanext.doi.site_url Used to build the link back to the dataset ckan.site_url
ckanext.doi.site_title Site title to use in the citation None

Usage

Commands

doi

  1. delete-dois: delete all DOIs from the database (not datacite).

    ckan -c $CONFIG_FILE doi delete-dois
  2. update-doi: update the datacite metadata for one or all packages.

    ckan -c $CONFIG_FILE doi update-doi [PACKAGE_ID]

Interfaces

The IDoi interface allows plugins to extend the build_metadata_dict and build_xml_dict methods.

build_metadata_dict(pkg_dict, metadata_dict, errors)

Breaking changes from v1:

  1. previously called build_metadata
  2. new parameter: errors
  3. new return value: tuple of metadata_dict, errors

Extracts metadata from a pkg_dict for use in generating datacite DOIs. The base method from this extension is run first, then the metadata dict is passed through all the implementations of this method. After running these, if any of the required values (see above) are still in the errors dict (i.e. they still could not be handled by any other extension), a DOIMetadataException will be thrown.

Parameter Description
pkg_dict The original package dictionary from which the metadata were extracted.
metadata_dict The current metadata dict, created by the ckanext-doi extension and any previous plugins implementing IDoi.
errors A dictionary of metadata keys and errors generated by previous plugins; this method should remove any keys that it successfully processes and overwrites.

build_xml_dict(metadata_dict, xml_dict)

Breaking changes from v1:

  1. previously called metadata_to_xml
  2. parameters rearranged (previously xml_dict, metadata)

Converts the metadata_dict into an xml_dict that can be passed to the datacite library's schema42.tostring() and schema42.validate() methods. The base method from this extension is run first, then the xml dict is passed through all the implementations of this method.

Parameter Description
metadata_dict The original metadata dictionary from which the xml attributes are extracted.
xml_dict The current xml dict, created by the ckanext-doi extension and any previous plugins implementing IDoi.

Templates

Package citation snippet

{% snippet "doi/snippets/package_citation.html", pkg_dict=g.pkg_dict %}

Resource citation snippet

{% snippet "doi/snippets/resource_citation.html", pkg_dict=g.pkg_dict, res=res %}

Testing

There is a Docker compose configuration available in this repository to make it easier to run tests. The ckan image uses the Dockerfile in the docker/ folder.

To run the tests can be run against ckan 2.9.x and 2.10.x on Python3:

  1. Build the required images:

    docker-compose build
  2. Then run the tests. The root of the repository is mounted into the ckan container as a volume by the Docker compose configuration, so you should only need to rebuild the ckan image if you change the extension's dependencies.

    # run tests against ckan 2.9.x
    docker-compose run latest
    
    # run tests against ckan 2.10.x
    docker-compose run next

Note that the tests mock the DataCite API and therefore don't require an internet connection nor your DataCite credentials to run.

ckanext-doi's People

Contributors

alycejenni avatar benscott avatar bloo-dye avatar frafra avatar github-actions[bot] avatar jrdh avatar paulkiddle avatar t-book avatar

Stargazers

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

Watchers

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

ckanext-doi's Issues

"Creating data sets and citing them" difficulties

This may not be a doi plugin issue and may be a "we haven't done something right in ckan" problem, but I'll see what you think...

We currently have 2 existing datasets created before the plugin was added, neither has the "cite this data" button. I'm assuming this is to be expected.

Next, somewhat fundamental, problem... if I then try and add a new data set after adding the doi plugin this happens:

submitdataset

submission

The ckan error log looks like this:

[Wed Mar 25 12:24:52 2015] [error] /usr/lib/ckan/default/lib/python2.7/site-packages/sqlalchemy/orm/unitofwork.py:79: SAWarning: Usage of the 'related attribute set' operation is not currently supported within the execution stage of the flush process. Results may not be consistent.  Consider using alternative event listeners or connection-level operations instead.
[Wed Mar 25 12:24:52 2015] [error]   sess._flush_warning("related attribute set")
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] Error - <type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'endswith'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] URL: http://<removed>/dataset/new
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/weberror/errormiddleware.py', line 162 in __call__
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   app_iter = self.application(environ, sr_checker)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/dec.py', line 147 in __call__
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   resp = self.call_func(req, *args, **self.kwargs)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/dec.py', line 208 in call_func
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   return self.func(req, *args, **kwargs)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/fanstatic/publisher.py', line 234 in __call__
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   return request.get_response(self.app)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/request.py', line 1053 in get_response
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   application, catch_exc_info=False)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/request.py', line 1022 in call_application
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   app_iter = application(self.environ, start_response)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/dec.py', line 147 in __call__
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   resp = self.call_func(req, *args, **self.kwargs)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/dec.py', line 208 in call_func
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   return self.func(req, *args, **kwargs)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/fanstatic/injector.py', line 54 in __call__
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   response = request.get_response(self.app)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/request.py', line 1053 in get_response
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   application, catch_exc_info=False)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/request.py', line 1022 in call_application
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   app_iter = application(self.environ, start_response)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/beaker/middleware.py', line 73 in __call__
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   return self.app(environ, start_response)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/beaker/middleware.py', line 155 in __call__
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   return self.wrap_app(environ, session_start_response)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/routes/middleware.py', line 131 in __call__
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   response = self.app(environ, start_response)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/pylons/wsgiapp.py', line 125 in __call__
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   response = self.dispatch(controller, environ, start_response)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/pylons/wsgiapp.py', line 324 in dispatch
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   return controller(environ, start_response)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/src/ckan/ckan/lib/base.py', line 338 in __call__
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   res = WSGIController.__call__(self, environ, start_response)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/pylons/controllers/core.py', line 221 in __call__
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   response = self._dispatch_call()
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/pylons/controllers/core.py', line 172 in _dispatch_call
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   response = self._inspect_call(func)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/pylons/controllers/core.py', line 107 in _inspect_call
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   result = self._perform_call(func, args)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/pylons/controllers/core.py', line 60 in _perform_call
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   return func(**args)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/src/ckan/ckan/controllers/package.py', line 535 in new
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   return self._save_new(context, package_type=package_type)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/src/ckan/ckan/controllers/package.py', line 952 in _save_new
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   pkg_dict = get_action('package_create')(context, data_dict)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/src/ckan/ckan/logic/__init__.py', line 424 in wrapped
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   result = _action(context, data_dict, **kw)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/src/ckan/ckan/logic/action/create.py', line 207 in package_create
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   item.after_create(context, data)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/local/lib/python2.7/dist-packages/ckanext_doi-0.2-py2.7.egg/ckanext/doi/plugin.py', line 54 in after_create
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   create_unique_identifier(pkg_dict['id'])
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/local/lib/python2.7/dist-packages/ckanext_doi-0.2-py2.7.egg/ckanext/doi/lib.py', line 33 in create_unique_identifier
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   identifier = os.path.join(get_prefix(), '{0:07}'.format(random.randint(1, 100000)))
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/python2.7/posixpath.py', line 68 in join
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   elif path == '' or path.endswith('/'):
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] AttributeError: 'NoneType' object has no attribute 'endswith'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] CGI Variables
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] -------------
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   AUTH_TYPE: 'cookie'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   CKAN_CURRENT_URL: '/dataset/new'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   CKAN_LANG: 'en'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   CKAN_LANG_IS_DEFAULT: True
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   CONTENT_TYPE: 'application/x-www-form-urlencoded; charset=utf-8'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   DOCUMENT_ROOT: '/etc/apache2/htdocs'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   GATEWAY_INTERFACE: 'CGI/1.1'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   HTTP_ACCEPT: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   HTTP_ACCEPT_ENCODING: 'gzip, deflate'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   HTTP_ACCEPT_LANGUAGE: 'en-US,en;q=0.8,en-GB;q=0.6'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   HTTP_CACHE_CONTROL: 'max-age=0'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   HTTP_CONNECTION: 'close'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   HTTP_COOKIE: 'auth_tkt="7952cf5e11301fd24a7b61e73fc51258550aaa0e<removed>!userid_type:unicode"; ckan=f7e23d8d984755112da64e6297bf6cfefaa07faa275d5ed345c9420a8d8068b8e40fd11b'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   HTTP_HOST: '<removed>'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   HTTP_ORIGIN: 'http://<removed>'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   HTTP_REFERER: 'http://<removed>/dataset/new'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   HTTP_USER_AGENT: 'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.101 Safari/537.36'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   PATH_INFO: '/dataset/new'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   PATH_TRANSLATED: '/etc/ckan/default/apache.wsgi/dataset/new'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   REMOTE_ADDR: '127.0.0.1'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   REMOTE_PORT: '39456'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   REMOTE_USER: u'<removed>'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   REMOTE_USER_DATA: 'userid_type:unicode'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   REMOTE_USER_TOKENS: ['']
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   REQUEST_METHOD: 'POST'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   REQUEST_URI: '/dataset/new'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   SCRIPT_FILENAME: '/etc/ckan/default/apache.wsgi'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   SERVER_ADDR: '127.0.0.1'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   SERVER_ADMIN: '[no address given]'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   SERVER_NAME: '<removed>'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   SERVER_PORT: '80'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   SERVER_PROTOCOL: 'HTTP/1.0'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   SERVER_SIGNATURE: '<address>Apache/2.2.22 (Ubuntu) Server at <removed> Port 80</address>\\n'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   SERVER_SOFTWARE: 'Apache/2.2.22 (Ubuntu)'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] WSGI Variables
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] --------------
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   application: <fanstatic.publisher.Delegator object at 0x7f421af1cdd0>
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   beaker.cache: <beaker.cache.CacheManager object at 0x7f421af1c050>
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   beaker.get_session: <bound method SessionMiddleware._get_session of <beaker.middleware.SessionMiddleware object at 0x7f421b54dfd0>>
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   beaker.session: {'_accessed_time': 1427286292.06159, '_creation_time': 1427210729.204602}
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   fanstatic.needed: <fanstatic.core.NeededResources object at 0x7f421af1c290>
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   mod_wsgi.application_group: 'default.ckanhosted.com|'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   mod_wsgi.callable_object: 'application'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   mod_wsgi.handler_script: ''
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   mod_wsgi.input_chunked: '0'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   mod_wsgi.listener_host: ''
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   mod_wsgi.listener_port: '8080'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   mod_wsgi.process_group: 'ckan_default'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   mod_wsgi.request_handler: 'wsgi-script'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   mod_wsgi.script_reloading: '1'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   mod_wsgi.version: (3, 3)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   paste.cookies: (<SimpleCookie: auth_tkt='7952cf5e11301fd24a7b61e73fc51258550aaa0e<removed>!userid_type:unicode' ckan='f7e23d8d984755112da64e6297bf6cfefaa07faa275d5ed345c9420a8d8068b8e40fd11b'>, 'auth_tkt="7952cf5e11301fd24a7b61e73fc51258550aaa0e<removed>!userid_type:unicode"; ckan=f7e23d8d984755112da64e6297bf6cfefaa07faa275d5ed345c9420a8d8068b8e40fd11b')
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   paste.registry: <paste.registry.Registry object at 0x7f421b2f8490>
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   paste.throw_errors: True
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   pylons.action_method: <bound method PackageController.new of <ckan.controllers.package.PackageController object at 0x7f421ae10f90>>
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   pylons.controller: <ckan.controllers.package.PackageController object at 0x7f421ae10f90>
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   pylons.environ_config: {'session': 'beaker.session', 'cache': 'beaker.cache'}
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   pylons.pylons: <pylons.util.PylonsContext object at 0x7f421af21450>
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   pylons.routes_dict: {'action': u'new', 'controller': u'package'}
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   repoze.who.api: <repoze.who.api.API object at 0x7f421b2f3410>
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   repoze.who.identity: <repoze.who identity (hidden, dict-like) at 139921895957488>
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   repoze.who.logger: <logging.Logger object at 0x7f421af1ce50>
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   repoze.who.plugins: {'ckan.lib.authenticator:UsernamePasswordAuthenticator': <ckan.lib.authenticator.UsernamePasswordAuthenticator object at 0x7f421b2f8b50>, 'friendlyform': <FriendlyFormPlugin 139921900667664>, 'auth_tkt': <CkanAuthTktCookiePlugin 139921900667600>}
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   routes.route: <routes.route.Route object at 0x7f421b403150>
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   routes.url: <routes.util.URLGenerator object at 0x7f421af21490>
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   webob._parsed_post_vars: (MultiDict([('_ckan_phase', 'dataset_new_1'), ('pkg_name', ''), ('title', 'testing'), ('name', 'testing'), ('notes', 'blah'), ('tag_string', ''), ('license_id', 'notspecified'), ('url', 'dfgdfg'), ('version', 'dg'), ('author', 'dfg'), ('author_email', 'dfgdf'), ('maintainer', 'dgffd'), ('maintainer_email', 'dfgfd'), ('extras__0__key', ''), ('extras__0__value', ''), ('extras__1__key', ''), ('extras__1__value', ''), ('extras__2__key', ''), ('extras__2__value', ''), ('save', '')]), <FakeCGIBody at 0x7f421af1c850 viewing MultiDict([('_c...'')])>)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   webob._parsed_query_vars: (GET([]), '')
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   webob.adhoc_attrs: {'errors': 'ignore', 'response': <Response at 0x7f421af1c150 200 OK>, 'language': 'en-us'}
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   webob.is_body_readable: True
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   webob.is_body_seekable: False
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   wsgi process: 'Multi process AND threads (?)'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   wsgi.file_wrapper: <built-in method file_wrapper of mod_wsgi.Adapter object at 0x7f421b2f4300>
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   wsgi.version: (1, 1)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]   wsgiorg.routing_args: (<routes.util.URLGenerator object at 0x7f421af21490>, {'action': u'new', 'controller': u'package'})
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] ------------------------------------------------------------
[Wed Mar 25 12:24:52 2015] [error] 2015-03-25 12:24:52,830 INFO  [ckan.lib.base]  /dataset/new render time 0.762 seconds
[Wed Mar 25 12:24:52 2015] [error] 2015-03-25 12:24:52,958 INFO  [ckan.lib.base]  /api/i18n/en render time 0.001 seconds

The closest I can find to something referencing this is: ckan/ckan#2017, but have no idea what it means?

Avoiding duplicate DOIs when a dataset has a pre-existing DOI

Hi all,

We've set up this extension in our test environment and have been trying it out for a bit now. Some of our datasets already have DOIs and we don't want new ones to be created when we update them (or in some cases when adding new datasets). I saw #4 which I think is relevant, but is there currently a way to indicate that we don't want a new DOI for a given dataset?

Thanks in advance.

CKAN 2.9 compatibility?

Dear all,

I tried to install and activate the DOI plugin in CKAN 2.9, but it failed. I executed the "2to3" script on the cloned Git repository, after that, CKAN came up without errors. Unfortunately, creating a dataset was then no more possible, it crashes with a "Internal Server Error" message.

Are there any plans to make the DOI plugin compatible with CKAN 2.9?

Upgrade to schema43

Overview

https://schema.datacite.org/meta/kernel-4.3/

Changes
Addition of optional โ€œaffiliationIdentifierโ€, โ€œaffiliationIdentifierSchemeโ€, and โ€œschemeURIโ€ for affiliation
Addition of optional โ€œschemeURIโ€ for funderIdentifier
Addition of โ€œRORโ€ to allowed values for funderIdentifierType

Since schema43 affilations can look like

<contributor contributorType="Researcher">
      <contributorName>Huber-Bert, Manfred</contributorName>
      <affiliation affiliationIdentifier="https://ror.org/idkfa3" affiliationIdentifierScheme="ROR" schemeURI="https://ror.org">Something</affiliation>
  </contributor>

Instead of with scheme42

<affiliation>Something</affiliation>

Hence, my feature request is to upgrade the plugin to use schema43

Possible Solutions
From my tests it works to just bump to schema42 and use it in later code lines

from datacite import DataCiteMDSClient, schema42

CKAN background jobs will throw an exception when publishing DOI

Description
CKAN background jobs can update datasets (e.g. embargo releases), which trigger the after_dataset_update interface.
Flash messages will fail in background jobs and only work from web requests.

Expected Behaviour
No exceptions thrown when a DOI is published from a CKAN background job.

To Reproduce
Create a CKAN background job to update a dataset from private to public

Error Log
Paste any relevant error logs below:

Working outside of request context

Your Setup

  • CKAN version: [e.g. 2.10.3]

Anything Else?
Proposed solution #102

New Datasets with DOI - DOI Failed - error code 404

CKAN Version if known (or site URL)
Ckan 2.8. WIth DataCite (DOI), datastore, datapusher

Please describe the expected behaviour

I can add new resources to public of an organisation.

Please describe the actual behaviour

I have an organisation and i add first time a ressource. It works, but after i try to add a new dataset with a new resource i got a error: Creating DOI Failed - error code 404
What steps can be taken to reproduce the issue?

Install Ckan 2.8 with the plugins DOI, datastore, datapusher and a test-account by datacite.
Create a organisation and add new datasets.

Compatibility with CKAN 2.10

Description
Doesn't work with ckan 2.10

First steps
Modify Plugin.py to adapt the new function's names of IPackageController

Is there other thing to do ?

Your Setup

  • CKAN version: 2.10.1
  • Commit/version of this repo: 3.1.8

Is DOI added to dataset view template?

I have installed this extension and successfully created a DOI on the https://mds.datacite.org site
by making a dataset public.
But the DOI value does not appear anywhere among the metadata on CKAN.
Is it supposed to?
Or do I need to add it to my dataset schema?

Thanks!

DOI on Ckan 2.8.3 shows an error

Description
Install the Ckan 2.8.3 Version, install the ckanext-doi like this:
git:
version: master
repo: https://github.com/NaturalHistoryMuseum/ckanext-doi.git
dest: /usr/lib/ckan/default/src/ckan/ckanext/datacite/
Installed as root on Debian Buster
Then:
. /usr/lib/ckan/default/bin/activate
cd /usr/lib/ckan/default/src/ckan/ckanext/datacite/
pip install -r requirements.txt
python setup.py develop
as root
At least I give ckan the user rights for the directory.
I activate the plugin in the dev.ini
I tried to add a new dataset an error occured something like "ckanAuthTktCookiePlugin...." Internal Error on the webside.

Expected Behaviour
Creating DOI's with a new dataset

To Reproduce
follow my install instructions.

Error Log
Paste any relevant error logs below:

WSGI Variables
[Thu May 14 10:56:23.331641 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586] --------------
[Thu May 14 10:56:23.331642 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   apache.version: (2, 4, 38)
[Thu May 14 10:56:23.331644 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   application: <fanstatic.publisher.Delegator object at 0x7f974a276190>
[Thu May 14 10:56:23.331646 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   beaker.cache: <beaker.cache.CacheManager object at 0x7f974a2760d0>
[Thu May 14 10:56:23.331648 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   beaker.get_session: <bound method SessionMiddleware._get_session of <beaker.middleware.SessionMiddleware object at 0x7f974a276050>>
[Thu May 14 10:56:23.331650 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   beaker.session: {'_accessed_time': 1589446583.32838, '_creation_time': 1589446573.858948}
[Thu May 14 10:56:23.331652 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   ckan.app: 'pylons_app'
[Thu May 14 10:56:23.331654 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   fanstatic.needed: <fanstatic.core.NeededResources object at 0x7f9749f59dd0>
[Thu May 14 10:56:23.331656 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   mod_wsgi.application_group: 'localhost|'
[Thu May 14 10:56:23.331658 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   mod_wsgi.callable_object: 'application'
[Thu May 14 10:56:23.331660 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   mod_wsgi.daemon_connects: '1'
[Thu May 14 10:56:23.331661 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   mod_wsgi.daemon_restarts: '0'
[Thu May 14 10:56:23.331663 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   mod_wsgi.daemon_start: '1589446583279015'
[Thu May 14 10:56:23.331665 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   mod_wsgi.enable_sendfile: '0'
[Thu May 14 10:56:23.331667 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   mod_wsgi.handler_script: ''
[Thu May 14 10:56:23.331668 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   mod_wsgi.ignore_activity: '0'
[Thu May 14 10:56:23.331670 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   mod_wsgi.listener_host: ''
[Thu May 14 10:56:23.331672 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   mod_wsgi.listener_port: '8080'
[Thu May 14 10:56:23.331674 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   mod_wsgi.path_info: '/dataset/noch-ein-test/resource_edit/54e16968-a468-4cec-9cf2-fc754b78691c'
[Thu May 14 10:56:23.331676 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   mod_wsgi.process_group: 'ckan_default'
[Thu May 14 10:56:23.331678 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   mod_wsgi.queue_start: '1589446583278914'
[Thu May 14 10:56:23.331679 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   mod_wsgi.request_handler: 'wsgi-script'
[Thu May 14 10:56:23.331681 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   mod_wsgi.request_id: 'tlz83l+/OVw'
[Thu May 14 10:56:23.331683 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   mod_wsgi.request_start: '1589446583278774'
[Thu May 14 10:56:23.331688 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   mod_wsgi.script_name: ''
[Thu May 14 10:56:23.331689 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   mod_wsgi.script_reloading: '1'
[Thu May 14 10:56:23.331691 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   mod_wsgi.script_start: '1589446583279095'
[Thu May 14 10:56:23.331693 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   mod_wsgi.thread_id: 2
[Thu May 14 10:56:23.331695 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   mod_wsgi.thread_requests: 0L
[Thu May 14 10:56:23.331696 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   mod_wsgi.total_requests: 1L
[Thu May 14 10:56:23.331698 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   mod_wsgi.version: (4, 6, 5)
[Thu May 14 10:56:23.331700 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   paste.cookies: (<SimpleCookie: auth_tkt='996aaa954e33167ecfd48331342640745ebcf50eckan!userid_type=unicode' ckan='81a69aea5bf109304a39c6600eb5a28da88e61d7fa7a06c09cd8470a88d41d912701f2f0'>, 'auth_tkt="996aaa954e33167ecfd48331342640745ebcf50eckan!userid_type=unicode"; auth_tkt="996aaa954e33167ecfd48331342640745ebcf50eckan!userid_type=unicode"; ckan=81a69aea5bf109304a39c6600eb5a28da88e61d7fa7a06c09cd8470a88d41d912701f2f0')
[Thu May 14 10:56:23.331704 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   paste.registry: <paste.registry.Registry object at 0x7f9749edae10>
[Thu May 14 10:56:23.331706 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   paste.throw_errors: True
[Thu May 14 10:56:23.331707 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   pylons.action_method: <bound method PackageController.resource_edit of <ckan.controllers.package.PackageController object at 0x7f974981ab50>>
[Thu May 14 10:56:23.331709 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   pylons.controller: <ckan.controllers.package.PackageController object at 0x7f974981ab50>
[Thu May 14 10:56:23.331711 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   pylons.environ_config: {'session': 'beaker.session', 'cache': 'beaker.cache'}
[Thu May 14 10:56:23.331713 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   pylons.pylons: <pylons.util.PylonsContext object at 0x7f974981ac50>
[Thu May 14 10:56:23.331716 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   pylons.routes_dict: {'action': u'resource_edit', 'controller': u'package', 'id': u'noch-ein-test', 'resource_id': u'54e16968-a468-4cec-9cf2-fc754b78691c'}
[Thu May 14 10:56:23.331718 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   repoze.who.api: <repoze.who.api.API object at 0x7f974a39fd50>
[Thu May 14 10:56:23.331720 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   repoze.who.identity: <repoze.who identity (hidden, dict-like) at 140287756688352>
[Thu May 14 10:56:23.331722 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   repoze.who.logger: <logging.Logger object at 0x7f974a276290>
[Thu May 14 10:56:23.331724 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   repoze.who.plugins: {'ckan.lib.authenticator:UsernamePasswordAuthenticator': <ckan.lib.authenticator.UsernamePasswordAuthenticator object at 0x7f974a215790>, 'friendlyform': <FriendlyFormPlugin 140287760885776>, 'auth_tkt': <CkanAuthTktCookiePlugin 140287760884240>}
[Thu May 14 10:56:23.331726 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   routes.route: <routes.route.Route object at 0x7f974a385690>
[Thu May 14 10:56:23.331728 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   routes.url: <routes.util.URLGenerator object at 0x7f974981ab90>
[Thu May 14 10:56:23.331733 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   webob._parsed_post_vars: (MultiDict([('id', '54e16968-a468-4cec-9cf2-fc754b78691c'), ('url', 'dbsus-uebersicht_aufzuege-stand2018-11_v2.csv'), ('upload', ''), ('clear_upload', ''), ('name', 'DBSuS-Uebersicht_Aufzuege-Stand2018-11_V2.csv'), ('description', ''), ('format', 'CSV'), ('save', 'go-metadata')]), <FakeCGIBody at 0x7f974981ae90 viewing MultiDict([('id...a')])>)
[Thu May 14 10:56:23.331736 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   webob._parsed_query_vars: (GET([]), '')
[Thu May 14 10:56:23.331737 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   webob.adhoc_attrs: {'errors': 'ignore', 'response': <Response at 0x7f974a1457d0 200 OK>, 'language': 'en-us'}
[Thu May 14 10:56:23.331739 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   webob.is_body_readable: True
[Thu May 14 10:56:23.331741 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   webob.is_body_seekable: False
[Thu May 14 10:56:23.331743 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   wsgi process: 'Multi process AND threads (?)'
[Thu May 14 10:56:23.331745 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   wsgi.file_wrapper: <type 'mod_wsgi.FileWrapper'>
[Thu May 14 10:56:23.331747 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   wsgi.input_terminated: True
[Thu May 14 10:56:23.331749 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586]   wsgiorg.routing_args: (<routes.util.URLGenerator object at 0x7f974981ab90>, {'action': u'resource_edit', 'controller': u'package', 'id': u'noch-ein-test', 'resource_id': u'54e16968-a468-4cec-9cf2-fc754b78691c'})
[Thu May 14 10:56:23.331751 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586] ------------------------------------------------------------
[Thu May 14 10:56:23.428115 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586] 2020-05-14 10:56:23,428 INFO  [ckan.lib.base]  /dataset/noch-ein-test/resource_edit/54e16968-a468-4cec-9cf2-fc754b78691c render time 0.095 seconds
[Thu May 14 10:56:23.429280 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586] 2020-05-14 10:56:23,429 INFO  [repoze.who] no challenge required
[Thu May 14 10:56:23.429403 2020] [wsgi:error] [pid 27031:tid 140287936304896] [remote 127.0.0.1:37586] 2020-05-14 10:56:23,429 INFO  [repoze.who] -- repoze.who request ended (/dataset/noch-ein-test/resource_edit/54e16968-a468-4cec-9cf2-fc754b78691c) --
[Thu May 14 10:56:23.656607 2020] [wsgi:error] [pid 27031:tid 140287995053824] [remote 127.0.0.1:37590] 2020-05-14 10:56:23,656 INFO  [repoze.who] request classification: browser
[Thu May 14 10:56:23.656655 2020] [wsgi:error] [pid 27031:tid 140287995053824] [remote 127.0.0.1:37590] 2020-05-14 10:56:23,656 INFO  [repoze.who] -- repoze.who request started (/api/i18n/de) --
[Thu May 14 10:56:23.661142 2020] [wsgi:error] [pid 27031:tid 140287995053824] [remote 127.0.0.1:37590] 2020-05-14 10:56:23,661 INFO  [repoze.who] no challenge required
[Thu May 14 10:56:23.661250 2020] [wsgi:error] [pid 27031:tid 140287995053824] [remote 127.0.0.1:37590] 2020-05-14 10:56:23,661 INFO  [repoze.who] -- repoze.who request ended (/api/i18n/de) --

Screenshots
Add screenshots to illustrate the bug if you want.

Your Setup

  • CKAN version: [e.g. 2.8.3]
  • Commit/version of this repo:
  • Browser (if relevant): [e.g. chrome, safari]

Anything Else?
...

Locked down mandatory fields

After a DOI has been created, the mandatory fields should not be changed, unless they absolutely have to.

Also, OK to change within a few days, not after a year.

Dataset update

After x amount of time, core metadata fields should not be updated.

DataCite metadata

Ensure data portal meets British Library /DataCite metadata requirements.

Plugin interfaces

Allow other modules to customise metadata & move NHM specific fields out of the DOI plugin.

ckan plugin-info crashes if doi is installed

Hello,

If I install this doi plugin using "python setup.py install" all seems to go through correctly.

If I run "ckan" I get a listing of all commands including the "doi" ckan command

If I run "ckan plugin-info" I get the following error:

doi:
----

    CKAN DOI Extension

Implements:
    IConfigurer
    IPackageController
    IConfigurable
Traceback (most recent call last):
  File "/usr/bin/ckan", line 45, in <module>
    load_entry_point('PasteScript', 'console_scripts', 'paster')()
  File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/script/command.py", line 104, in run
    invoke(command, command_name, options, args[1:])
  File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/script/command.py", line 143, in invoke
    exit_code = runner.run(args)
  File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/script/command.py", line 238, in run
    result = self.command()
  File "/usr/lib/ckan/default/src/ckan/ckan/lib/cli.py", line 1326, in command
    self.get_info()
  File "/usr/lib/ckan/default/src/ckan/ckan/lib/cli.py", line 1361, in get_info
    extra = self.template_helpers(p['class'])
  File "/usr/lib/ckan/default/src/ckan/ckan/lib/cli.py", line 1378, in template_helpers
    return self.function_info(helpers)
  File "/usr/lib/ckan/default/src/ckan/ckan/lib/cli.py", line 1386, in function_info
    args_info = inspect.getargspec(fn)
  File "/usr/lib/python2.7/inspect.py", line 815, in getargspec
    raise TypeError('{!r} is not a Python function'.format(func))
TypeError: <built-in method now of type object at 0x7f1ecaaa2c40> is not a Python function

What am I doing wrong??

Embargoes

Allow private datasets to be assigned a DOI

BibTeX link doesn't work correctly

Looks like it's linking to the test DataCite API which presumably is down to some funky outcome of the logic here: https://github.com/NaturalHistoryMuseum/ckanext-doi/blob/main/ckanext/doi/theme/templates/doi/snippets/package_citation.html#L49?

As an example, the dataset: https://doi.org/10.5519/zi6w507p has a BibTeX link to https://api.test.datacite.org/dois/application/x-bibtex/10.5519/zi6w507p when it should be https://api.datacite.org/dois/application/x-bibtex/10.5519/zi6w507p (note the lack of "test" in the URL's domain).

Update "Cite as" text

Dataset:

Natural History Museum (2015). Dataset: Collection specimens. Natural History Museum Data Portal (data.nhm.ac.uk).
http://dx.doi.org/10.5519/0002965
Retrieved: 10:40 24 Mar 2015 (GMT)

Record level:

Natural History Museum (2014). Dataset: Collection specimens. Natural History Museum Data Portal (data.nhm.ac.uk). Record: http://data.nhm.ac.uk/specimen/db770d9f-8456-44dd-a6d1-77a252b8be9c
http://dx.doi.org/10.5519/0002965
Retrieved: 10:40 24 Mar 2015 (GMT)

@mswoodburn to confirm.

Break API

This is breaking the datastore create API.

Add DOIs for resources too

Currently we only provide DOIs for entire packages (datasets), would be good if we had DOIs for resources too.

Enabling DataCite

Hi,

I installed the datacite plugin in ckan. Under ckannext is the cloned repro of this datacite plugin. I run python setup.py develop
Directory structure is ckannext/datacite/setup.py
In the ini-file i wrote my config down:
ckanext.doi.account_name = xxx
ckanext.doi.account_password = pass
ckanext.doi.prefix = 1111
ckanext.doi.publisher = xxx
ckanext.doi.test_mode = True
#ckanext.doi.site_url = # Defaults to ckan.site_url if not set
#ckanext.doi.site_title = # Optional - site title to use in the citation - eg Natural History Museum Data Portal (data.nhm.ac.uk)

But nothing i can see under the Dataset of ckan, there no DOI.
What i did wrong?

Add a Licence

Could you add a licence to the extension, so it's clear we can us it? Perhaps the GNU Affero General Public License that CKAN itself uses.

schemeURI is never generated in the XML payload

Description
The schemeURI is never generated in the XML payload

Expected Behaviour
The generated XML schould respect the schemeURI

<nameIdentifier schemeURI="https://orcid.org/" nameIdentifierScheme="ORCID">0000-0001-5000-0007</nameIdentifier>

To Reproduce
Include the ORCID ID for a contributor in a plugin implementation of the build_xml_dict interface

            # Including ORCID identifiers if available
            if contributor.get('orcid'):
                contributor_dict['nameIdentifiers'] = [{
                    'nameIdentifier': contributor['orcid'],
                    'nameIdentifierScheme': 'ORCID',
                    'scheme_uri': 'http://orcid.org',
                }]

Your Setup

  • CKAN version: [e.g. 2.10.3]

Solution
The Solution is simple

id_dict['schemeUri'] = _id['scheme_uri']

should read

        if 'scheme_uri' in _id:
            id_dict['schemeURI'] = _id['scheme_uri'] <-- Uppercase URI

So that the datacite wrapper can get/set the key correctly

https://github.com/inveniosoftware/datacite/blob/52f2e7dfaaa1bad44c091fa0b05ee3ed1090b279/datacite/xmlutils.py#L52-L55

Deleted datasets

Do not delete DOI record. Keep landing page saying, "This dataset has been deleted"

Connection refused

Hi Ben,

I am getting a connection refused message. I can log into Datacite with my details - any thoughts? Isaw that the test server had a new DNS and have those changes applied.

Thanks Tim

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.