Monday, March 6, 2017

Upload a PDF and publish with many metadata to ZENODO. JSON template.



For a long introduction see
http://stephane-mottin.blogspot.fr/2017/01/zenodo-github-research-data-repository.html
see also the posts with the tag "zenodo"

Here we will focus on the process and on the metadata.

4 methods
  • manual
  • python or cURL
  • tools

manual via upload user interface

Invenio and Zenodo uses the tool "json editor"
  https://github.com/jdorn/json-editor


11 fields

  1. Upload type 
    1. Book section 
    2. ... Journal article, etc
  2. Basic Info
    1. date
    2. Title
    3. Authors (one by one)!!!
    4. Description (only text (and math formula) without link!!!)
      https://zenodo.org/dev#collapse-list16
      description String Abstract or description for deposition.
      Following HTML tags are allowed: a, p, br, blockquote, strong, b, u, i, em, ul, ol, li, sub, sup, div, strike.
    5. Keyword
    6. Additional notes, for example sommaire
  3. License
    1. Open
    2. CC 4.0; you must add its category
  4. Communities
    1. integrations (for example)
  5. Funding
    1. CNRS (for exemple)
  6. related/alt identif
    1. ISSN, ISBN, URL
  7. Contributors for example the dir of collection
  8. reference
    witch appear on the bottom of the page
  9. journal
  10. c
  11. Book
    1. Publisher
    2. Place
    3. ISBN
    4. Book Title
    5. Page (of this book)

METADATA


schema JSON ZENODO

description Abstract or description for deposition. 

Following HTML tags are allowed: 
a, p, br, blockquote, strong, b, u, i, em, ul, ol, li, sub, sup, div, strike.

<ul>
  <li>prem</li>
  <li>second</li>
  <li>thrird</li>
</ul>

En outre attention à ce que votre texte ne contienne pas de ' ou de " comme  d'avantage ;)

code GitHub

code analyse metadata

python or cURL

Create a new deposition resource with cURL

http://developers.zenodo.org/?shell#list
curl -i -H "Content-Type: application/json" -X POST
     --data '{"metadata": {"title": "My first upload", "upload_type": "poster", "description": "This is my first upload", "creators": [{"name": "Doe, John", "affiliation": "Zenodo"}]}}' /api/deposit/depositions/?access_token=ACCESS_TOKEN


other example:
curl -i -H "Content-Type: application/json" -X POST --data '{"metadata":{"access_right": "open","creators": [{"affiliation": "Brain Catalogue", "name": "Toro, Roberto"}],"description": "Brain MRI","keywords": ["MRI", "Brain"],"license": "cc-by-nc-4.0", "title": "Brain MRI", "upload_type": "dataset"}}' https://zenodo.org/api/deposit/depositions/?access_token=$token |tee zenodo.json

http://siphonophore.org/blog/2016/01/16/at-brain-catalogue-we-love-zenodo/

curl  is  a  tool  to transfer data from or to a server, using one of the supported protocols
       (DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP,  LDAPS,  POP3,  POP3S,  RTMP, RTSP,  SCP,  SFTP,  SMB, SMBS, SMTP, SMTPS, TELNET and TFTP).
The command is designed to work without user interaction.

Create a new deposition resource with python

It's easier to publish with python:
http://developers.zenodo.org/?python#quickstart-upload
This short guide will give a quick overview of how to upload and publish on Zenodo, and will be using Python together with the Requests package.

more info

http://zenodo.readthedocs.io/en/latest/api/records.html
http://zenodo.readthedocs.io/en/latest/api/deposit.html

Testing

We provide a sandbox environment where you can test your API integration during development. The sandbox environment is available at http://sandbox.zenodo.org.

Please note that the sandbox environment can be cleaned at anytime. Also, the sandbox environment will issue test DOIs using the 10.5072 prefix instead of Zenodo’s normal prefix (10.5281).


Tools Zenodio

Zenodo I/O
Zenodio is a simple Python interface for getting data into and out of Zenodo, the digital archive developed by CERN. Zenodo is an awesome tool for scientists to archive the products of research, including datasets, codes, and documents. Zenodio adds a layer of mechanization to Zenodo, allowing you to grab metadata about records in a Zenodo collection, or upload new artifacts to Zenodo with a smart Python API.

We’re still designing the upload API, but metadata harvesting is ready to go.

The zenodio.metadata sub package provides a Python representation of Zenodo metadata (but not File or Zenodo deposition metadata).

https://github.com/lsst-sqre/zenodio/tree/metadata_api
http://zenodio.lsst.io/en/latest/
https://jira.lsstcorp.org/browse/DM-4852

Python template

zenodo JSON format
example for a book section (in french).

see the details of each field

see how to use at

see the page of this record:

JSON


data = {'metadata':{'upload_type': 'publication','publication_type': 'section','title': 'Introduction au dimensionnement', 'creators': [{'name': 'Pádua, Agílio'}],'partof_pages':'17-25','contributors': [{'name': 'Boissinot, Patrick ', 'type': 'DataCollector'},{'name': 'Langlois, Patrick ', 'type': 'DataCollector'},{'name': 'Pádua, Agílio', 'type': 'DataCollector'},{'name':'Lelièvre, Gérard', 'affiliation': 'CNRS', 'type': 'Editor'},{'name':'Mottin, Stéphane', 'affiliation': 'CNRS', 'type': 'Editor', 'orcid': '0000-0002-7088-4353'},{'name':'Mottin, Stéphane', 'affiliation': 'CNRS', 'type': 'RightsHolder', 'orcid': '0000-0002-7088-4353'}],'notes': ' licence CC-BY-NC-ND; Ce volume est une 3ième édition. Collection -- Intégrations des savoirs et savoir faire-- dirigée par Stéphane MOTTIN; http://www.sudoc.fr/155436619 (voir SUDOC pour trouver cet ouvrage en bibliothèque); ce PDF contient des metadata bibliographiques directement utilisables par exemple par Jabref (logiciel open source pour bibTeX). Ce PDF est structuré.','partof_title': 'Matériaux et joints d étanchéité pour les hautes pressions','publication_date': '2011-04-15','description': ' <b>  Sommaire de ce volume 18 de la Collection Intégrations des savoirs et savoir faire </b> <ul> <li>Préface / Dominique Leguillon</li><li>P. 13; Introduction générale / Patrick Boissinot, Patrick Langlois, Agílio A.H. Pádua</li><li>P. 17; Introduction au dimensionnement / Agílio A.H. Pádua; <br /> 1 Définition du problème; 2 Dimensionnement; 3 Obturateurs; 4 Conclusion</li><li>P. 27; Frettage et autofrettage / Patrick Langlois;<br /> 1 Considérations préliminaires au frettage; 2 Frettage d une enceinte bibloc; 3 Frettage d une enceinte multibloc; 4 Formulation de l autofrettage; 5 Modes de réalisation de l autofrettage; 6 Conclusion</li><li>P. 51; Méthodes d éléments finis en calcul de structures élastiques / Joël Frelat;<br /> 1 Introduction; 2 Rappel de la formule théorique; 3 Formulation variationnelle; 4 Formulation numérique; 5 Etapes d une mise en oeuvre pratique; 6 Conclusion Extension aux problèmes non linéaires</li><li>P. 61; Les matériaux sidérurgiques et les hautes pressions / Jean-Paul Dichtel; <br /> 1 Caractérisation mécanique des aciers; 2 Métallurgie des aciers et superalliages; 3 Commentaires : la Directive Européenne Appareils à Pression</li><li>P. 73; Les métaux non ferreux Alliage cuivre-béryllium et titane / Jean-Pierre Petitet; <br /> 1 Introduction; 2 Le cuivre-béryllium; 3 Le titane</li><li>P. 81; Les Carbures cémentés WC-Co / Emmanuel Pauty;<br />  1 Les procédés de fabrication; 2 Les propriétés des carbures cémentés; 3 Conclusions</li><li>P. 95; Choix et usinage des carbures de tungstène / Jacques Calzas;<br />  1 Choix des carbures de tungstène; 2 Usinage du carbure de tungstène</li><li>P. 107; Céramiques et matériaux pour l optique / Jean-Claude Chervin;<br />  1 Céramiques; 2 Matériaux pour l optique</li><li>P. 137; Types de joints et de montage / Roger Argoud et Jacques Roux;<br />  1 Introduction; 2 Généralités; 3 Joints à basse pression; 4 Joints cône sur cône; 5 Joints Bridgman Champignon; 6 Joints annulaires auto-serrés; 7 Joints coniques d Amagat; 8 Autres joints; 9 Conclusion</li><li>P. 157; Joints hautes pressions pour la compression de gros volumes solides / Sylvie Le Floch;<br />  1 Joints solides utilisés dans les différents types d enceintes hautes pressions; 2 Matières premières des joints; 3 Assemblages HP-HT</li><li>P. 169; Le matériel standard / Jean-Pierre Petitet;<br />  1 Tubes, conduites et raccords; 2 Les vannes; 3 Quelques types d enceintes commercialisées; 4 Les générateurs de pression; 5 Le matériel moins standard</li><li>P. 183; Assemblages haute pression / Gérard Hamel;<br />  1 Montage des raccords de pressions; 2 Montage de quelques passages électriques; 3 Les passages de thermocouple; 4 Les passages optiques, montage des fenêtres; 5 Montage des joints et des obturateurs sur une cellule haute pression</li><li>P. 193; Usinage / Jean-Pierre Michel;<br />  1 Introduction; 2 Les joints de faible épaisseur; 3 Les bagues anti-extrusion à 45; 4 Les joints à 45; 5 Les joints  double Bridgman ; 6 Les joints plats en élastomères; 7 Les joints en indium (étanchéité en hélium et azote liquide; 8 Joints métal-métal type Lens ring; 9 Les passages du courant; 10 Usinage de matériaux exotiques</li><li>P. 207; Les règles de sécurité / Patrick Boissinot;<br />  1 Dangers présentés par les appareils à pression; 2 Appareils à pression rencontrés dans les laboratoires et facteurs de risques; 3 Principes généraux de prévention et réglementation; 4 Moyens de protection; 5 Conclusion</li> </ul> ','keywords': ['Hautes pressions - Matériaux', 'Joints d étanchéité', 'Matériaux - Effets des hautes pressions'],'imprint_isbn': '2862723304','subjects': [{'term': ' Physical sciences ', 'identifier': ' http://id.loc.gov/authorities/subjects/sh89005705.html ', 'scheme': 'url'}],'related_identifiers': [{'relation': 'isCitedBy', 'identifier': 'http://www.sudoc.fr/078023866'}, {'relation': 'isCitedBy', 'identifier': 'https://hal.archives-ouvertes.fr/INTEGRATIONS/page/materiaux-et-joints-etancheite-pour-les-hautes-pressions'}],'communities': [{'identifier':'integrations'}],'access_right': 'open','license': 'cc-by-nc-4.0', 'imprint_publisher': 'MRCT-CNRS','imprint_place': 'Meudon, France',}}

No comments:

Post a Comment