{
“cells”: [
{

“cell_type”: “markdown”, “metadata”: {}, “source”: [

“# Basic MDF Connect Submission Example”

]

}, {

“cell_type”: “code”, “execution_count”: 1, “metadata”: {}, “outputs”: [], “source”: [

“from mdf_connect_client import MDFConnectClient”

]

}, {

“cell_type”: “markdown”, “metadata”: {}, “source”: [

“## Simple Examplen”, “This is a simple example of submitting a dataset to MDF Connect using the MDF Connect Client.”

]

}, {

“cell_type”: “code”, “execution_count”: 2, “metadata”: {}, “outputs”: [], “source”: [

“# First, we instantiate the client.n”, “mdfcc = MDFConnectClient()”

]

}, {

“cell_type”: “markdown”, “metadata”: {}, “source”: [

“### Creating the submission”

]

}, {

“cell_type”: “code”, “execution_count”: 3, “metadata”: {}, “outputs”: [], “source”: [

“# Then, we set the mandatory minimum metadata (the DataCite block and the data location).n”, “# The DC block only requires a title and author.n”, “mdfcc.create_dc_block(title=”Connect Sample Dataset”, authors=”A. Person”)n”, “# The data field requires one data location.n”, “mdfcc.add_data_source(”https://app.globus.org/file-manager?origin_id=e38ee745-6d04-11e5-ba46-22000b92c6ec&origin_path=%2Fcitrine_mdf_demo%2Falloy.pbe%2FAgAl%2F”)”

]

}, {

“cell_type”: “code”, “execution_count”: 4, “metadata”: {}, “outputs”: [], “source”: [

“# Next, we’ll add some optional settings.n”, “# The ‘mdf_publish’ service will get us a publication and a DOI.n”, “mdfcc.add_service(“mdf_publish”)n”, “# Since this is just an example and not a real submission, we’ll set the ‘test’ flag to True.n”, “# The DOI we will get with a test submission is a sandbox DOI, which is not permanent.n”, “mdfcc.set_test(True)”

]

}, {

“cell_type”: “code”, “execution_count”: 5, “metadata”: {}, “outputs”: [

{
“data”: {
“text/plain”: [
“{‘dc’: {‘titles’: [{‘title’: ‘Connect Sample Dataset’}],n”, ” ‘creators’: [{‘creatorName’: ‘Person, A.’,n”, ” ‘familyName’: ‘Person’,n”, ” ‘givenName’: ‘A.’}],n”, ” ‘publisher’: ‘Materials Data Facility’,n”, ” ‘publicationYear’: ‘2020’,n”, ” ‘resourceType’: {‘resourceTypeGeneral’: ‘Dataset’,n”, ” ‘resourceType’: ‘Dataset’}},n”, ” ‘data_sources’: [’https://app.globus.org/file-manager?origin_id=e38ee745-6d04-11e5-ba46-22000b92c6ec&origin_path=%2Fcitrine_mdf_demo%2Falloy.pbe%2FAgAl%2F’],n”, ” ‘test’: True,n”, ” ‘update’: False,n”, ” ‘services’: {‘mdf_publish’: True}}”

]

}, “execution_count”: 5, “metadata”: {}, “output_type”: “execute_result”

}

], “source”: [

“# Let’s look at the submission.n”, “mdfcc.get_submission()”

]

}, {

“cell_type”: “markdown”, “metadata”: {}, “source”: [

“### Submitting the dataset”

]

}, {

“cell_type”: “code”, “execution_count”: 6, “metadata”: {}, “outputs”: [

{
“data”: {
“text/plain”: [
“{‘source_id’: ‘_test_person_connect_sample_v1.1’,n”, ” ‘success’: True,n”, ” ‘error’: None,n”, ” ‘status_code’: 202}”

]

}, “execution_count”: 6, “metadata”: {}, “output_type”: “execute_result”

}

], “source”: [

“# NBVAL_SKIPn”, “n”, “# Let’s submit the dataset.n”, “mdfcc.submit_dataset()”

]

}, {

“cell_type”: “code”, “execution_count”: 7, “metadata”: {}, “outputs”: [

{

“name”: “stdout”, “output_type”: “stream”, “text”: [

“n”, “Status of TEST submission _test_person_connect_sample_v1.1 (Connect Sample Dataset)n”, “Submitted by Jonathon Gaff at 2020-01-14T16:40:37.823519Zn”, “n”, “Submission initialization was successful.n”, “Connect data download is in progress.n”, “Data transfer to primary destination has not started yet.n”, “Metadata extraction has not started yet.n”, “Dataset curation has not started yet.n”, “MDF Search ingestion has not started yet.n”, “Data transfer to secondary destinations has not started yet.n”, “MDF Publish publication has not started yet.n”, “Citrine upload has not started yet.n”, “Materials Resource Registration has not started yet.n”, “Post-processing cleanup has not started yet.n”, “n”, “This submission is still processing.n”, “n”

]

}

], “source”: [

“# NBVAL_SKIPn”, “n”, “# Now we can check the status of our submission.n”, “mdfcc.check_status()”

]

}, {

“cell_type”: “code”, “execution_count”: null, “metadata”: {}, “outputs”: [], “source”: []

}

], “metadata”: {

“kernelspec”: {
“display_name”: “Python 3”, “language”: “python”, “name”: “python3”

}, “language_info”: {

“codemirror_mode”: {
“name”: “ipython”, “version”: 3

}, “file_extension”: “.py”, “mimetype”: “text/x-python”, “name”: “python”, “nbconvert_exporter”: “python”, “pygments_lexer”: “ipython3”, “version”: “3.8.1”

}

}, “nbformat”: 4, “nbformat_minor”: 2

}