Download presentation
Presentation is loading. Please wait.
Published byIsaac Spencer Modified over 6 years ago
1
Loading Records Through the Registry’s REST Interface
Ray Plante National Institute of Standards and Technology (NIST) NIST Software Development Team: Mary Brady, Alden Dima, Guillaume Sousa Amaral, Ben Long, Pierre Francois Rigodiat, Xavier Schmitt, Sharief Youssef
2
Why use the REST Interface?
You have more than a few records you would like to publish You have the metadata describing your data assets already stored in a local data management system You wish to programmatically to convert that metadata into the format appropriate for loading into the registry. You want to automatically update or create resource descriptions as you holdings evolve 5 April 2017 RDA Plenary 9 -- Barcelona
3
Overview of the Process
Create a login account with the registry Create a script to format resource metadata into XML using the resource description XML Schema used by the registry Validate that the generated records comply with the schema Upload each record into the registry through its REST interface Use our Python client module Review the records through web browser interface; make any desired changes Publish the results Makes them discoverable to the search interface Records are shared with other registries through the harvesting interface 5 April 2017 RDA Plenary 9 -- Barcelona
4
Documentation and tools
Will post tutorial documentation and pointers to tools to WG RDA web page rd-alliance.org -> Groups -> Working Groups -> Materials Resource Registries How-to XML Schema, example records XML validater Python Client (script and library) 5 April 2017 RDA Plenary 9 -- Barcelona
5
RDA Plenary 9 -- Barcelona
XML Schema Schema is available from GitHub github.com/usnistgov/mgi-resmd Master branch = aspirational, standards-oriented, extensible Branch feb2017 contains version currently in use schemas/xml/res-md.xsd Example records: examples/xml XML Validation If you work with XML, you probably already have a tool that validates XML against a schema If not, try Junx github.com/RayPlante/junx – a library of XML utilities that includes a Schema validater Based Java Xerxes validating parser Type: validate –S schemaLocation.txt yourfile.xml schemaLocation.txt gives the location of the res-md.xml on your local disk 5 April 2017 RDA Plenary 9 -- Barcelona
6
The Registry’s REST Interface
See /docs/api 5 April 2017 RDA Plenary 9 -- Barcelona
7
Using the curate operation
Inputs title – a unique name to give to the record schema – internal id for the resource type Available from the /rest/templates/select/all operation For public registry at NIST, we will include these in the documentation Bake the look-up into the Python client content – XML text of the record as a string POST as form-encoded parameters Use username, password authentication curl –F title=myfile –F schema= 58e3b0febd2a3d29d –F ‘content=<myfile.xml’ \ --user mylogin 5 April 2017 RDA Plenary 9 -- Barcelona
8
RDA Plenary 9 -- Barcelona
Using a Python client (Registry is based on the Materials Data Curation System application) Zachary Trautt’s MDCS-api-tools: a general Python client for MDCS Provides a Python library and command line script for more easily working with the REST interface: At GitHub: github.com/MDCS-community/MDCS-api-tools Will be posting a branch for specifically interacting with Registry Don’t need to know IDs or indicate the type of resource registry-api -u mylogin –url –curate myfile.xml 5 April 2017 RDA Plenary 9 -- Barcelona
9
Check results through the browser
Browse your unpublished records through the Dashboard 5 April 2017 RDA Plenary 9 -- Barcelona
10
RDA Plenary 9 -- Barcelona
Click “Publish” At the moment, it’s not possible to ”publish” from the REST API 5 April 2017 RDA Plenary 9 -- Barcelona
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.