Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
DBRepo
Manage
Activity
Members
Labels
Plan
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FAIR Data Austria DB Repository
DBRepo
Commits
91b01dd9
Commit
91b01dd9
authored
Jul 21, 2022
by
Martin Weise
Browse files
Options
Downloads
Patches
Plain Diff
As presented
parent
5dd5da46
No related branches found
No related tags found
2 merge requests
!81
New stable release
,
!80
Multiple features connected with user management and ownership of databases
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
.jupyter/deposit.ipynb
+96
-104
96 additions, 104 deletions
.jupyter/deposit.ipynb
.jupyter/feature_extract.ipynb
+1
-1
1 addition, 1 deletion
.jupyter/feature_extract.ipynb
.jupyter/tuple_publish.ipynb
+84
-109
84 additions, 109 deletions
.jupyter/tuple_publish.ipynb
with
181 additions
and
214 deletions
.jupyter/deposit.ipynb
+
96
−
104
View file @
91b01dd9
...
@@ -2,21 +2,24 @@
...
@@ -2,21 +2,24 @@
"cells": [
"cells": [
{
{
"cell_type": "markdown",
"cell_type": "markdown",
"source": [
"# Deposit\n",
"\n"
],
"metadata": {
"metadata": {
"collapsed": false,
"pycharm": {
"pycharm": {
"name": "#%% md\n"
"name": "#%% md\n"
}
}
},
},
"outputs": []
"source": [
"# Deposit\n",
"\n"
]
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count": 1,
"execution_count": 1,
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"outputs": [],
"source": [
"source": [
"import re\n",
"import re\n",
...
@@ -25,52 +28,49 @@
...
@@ -25,52 +28,49 @@
"host = \"https://test.researchdata.tuwien.ac.at\"\n",
"host = \"https://test.researchdata.tuwien.ac.at\"\n",
"file = \"./resources/audio.wav\"\n",
"file = \"./resources/audio.wav\"\n",
"token = \"kJTJMtRKzmA0S92A9Jks7Y1OQbtRWElzgUrldXehDbeXESxIGQ0BQ6JFEFyg\""
"token = \"kJTJMtRKzmA0S92A9Jks7Y1OQbtRWElzgUrldXehDbeXESxIGQ0BQ6JFEFyg\""
],
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"metadata": {
"collapsed": false,
"pycharm": {
"pycharm": {
"name": "#%%\n"
"name": "#%%\n"
}
}
}
},
},
{
"cell_type": "code",
"execution_count": 2,
"outputs": [],
"outputs": [],
"source": [
"source": [
"headers = {\n",
"headers = {\n",
" \"Authorization\": \"Bearer \" + token\n",
" \"Authorization\": \"Bearer \" + token\n",
"}\n",
"}\n",
"filename = re.findall(\"([a-zA-z0-9_-]+\\\\.wav)\", file)[0]"
"filename = re.findall(\"([a-zA-z0-9_-]+\\\\.wav)\", file)[0]"
],
]
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
}
},
},
{
{
"cell_type": "markdown",
"cell_type": "markdown",
"source": [
"Create Record"
],
"metadata": {
"metadata": {
"collapsed": false,
"pycharm": {
"pycharm": {
"name": "#%% md\n"
"name": "#%% md\n"
}
}
}
},
"source": [
"Create Record"
]
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count": 3,
"execution_count": 4,
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [
"outputs": [
{
{
"name": "stdout",
"name": "stdout",
"output_type": "stream",
"output_type": "stream",
"text": [
"text": [
"{'links': {'self': 'https://test.researchdata.tuwien.ac.at/api/records/
xksnz-cfg98
/draft', 'self_html': 'https://test.researchdata.tuwien.ac.at/uploads/
xksnz-cfg98
', 'files': 'https://test.researchdata.tuwien.ac.at/api/records/
xksnz-cfg98
/draft/files', 'record': 'https://test.researchdata.tuwien.ac.at/api/records/
xksnz-cfg98
', 'record_html': 'https://test.researchdata.tuwien.ac.at/records/
xksnz-cfg98
', 'publish': 'https://test.researchdata.tuwien.ac.at/api/records/
xksnz-cfg98
/draft/actions/publish', 'review': 'https://test.researchdata.tuwien.ac.at/api/records/
xksnz-cfg98
/draft/review', 'versions': 'https://test.researchdata.tuwien.ac.at/api/records/
xksnz-cfg98
/versions', 'access_links': 'https://test.researchdata.tuwien.ac.at/api/records/
xksnz-cfg98
/access/links', 'reserve_doi': 'https://test.researchdata.tuwien.ac.at/api/records/
xksnz-cfg98
/draft/pids/doi'}, 'created': '2022-07-1
5
T07:
53:05.367485
+00:00', 'is_draft': True, 'expires_at': '2022-07-1
5
07:
53:05.367509
', 'is_published': False, 'metadata': {'title': 'The SeFiRe field recording dataset', 'resource_type': {'title': {'de': 'Audio', 'en': 'Audio'}, 'id': 'sound'}, 'creators': [{'affiliations': [{'name': 'University of Ljubljana'}], 'person_or_org': {'given_name': 'Matija', 'name': 'Marolt, Matija', 'identifiers': [{'scheme': 'orcid', 'identifier': '0000-0002-0619-8789'}], 'type': 'personal', 'family_name': 'Marolt'}}, {'affiliations': [{'name': 'University of Ljubljana'}], 'person_or_org': {'given_name': 'Ciril', 'name': 'Bohak, Ciril', 'identifiers': [{'scheme': 'orcid', 'identifier': '0000-0002-9015-2897'}], 'type': 'personal', 'family_name': 'Bohak'}}, {'affiliations': [{'name': 'University of Ljubljana'}], 'person_or_org': {'given_name': 'Alenka', 'name': 'Kavčič, Alenka', 'type': 'personal', 'family_name': 'Kavčič'}}, {'affiliations': [{'name': 'University of Ljubljana'}], 'person_or_org': {'given_name': 'Matevž', 'name': 'Pesek, Matevž', 'identifiers': [{'scheme': 'orcid', 'identifier': '0000-0001-9101-0471'}], 'type': 'personal', 'family_name': 'Pesek'}}], 'publication_date': '2019-01-28'}, 'id': '
xksnz-cfg98
', 'updated': '2022-07-1
5
T07:
53:05.385833
+00:00', 'pids': {}, 'parent': {'communities': {}, 'id': '
r7wqx-mt922
', 'access': {'links': [], 'owned_by': [{'user': 47}]}}, 'revision_id': 4, 'files': {'enabled': True, 'order': []}, 'versions': {'index': 1, 'is_latest': False, 'is_latest_draft': True}, 'access': {'files': 'public', 'record': 'public', 'embargo': {'reason': None, 'active': False}, 'status': 'metadata-only'}, 'errors': [{'field': 'access.embargo', 'messages': ['Field may not be null.']}]}\n"
"{'links': {'self': 'https://test.researchdata.tuwien.ac.at/api/records/
pqb7y-mtf49
/draft', 'self_html': 'https://test.researchdata.tuwien.ac.at/uploads/
pqb7y-mtf49
', 'files': 'https://test.researchdata.tuwien.ac.at/api/records/
pqb7y-mtf49
/draft/files', 'record': 'https://test.researchdata.tuwien.ac.at/api/records/
pqb7y-mtf49
', 'record_html': 'https://test.researchdata.tuwien.ac.at/records/
pqb7y-mtf49
', 'publish': 'https://test.researchdata.tuwien.ac.at/api/records/
pqb7y-mtf49
/draft/actions/publish', 'review': 'https://test.researchdata.tuwien.ac.at/api/records/
pqb7y-mtf49
/draft/review', 'versions': 'https://test.researchdata.tuwien.ac.at/api/records/
pqb7y-mtf49
/versions', 'access_links': 'https://test.researchdata.tuwien.ac.at/api/records/
pqb7y-mtf49
/access/links', 'reserve_doi': 'https://test.researchdata.tuwien.ac.at/api/records/
pqb7y-mtf49
/draft/pids/doi'}, 'created': '2022-07-1
9
T07:
39:42.344631
+00:00', 'is_draft': True, 'expires_at': '2022-07-1
9
07:
39:42.344656
', 'is_published': False, 'metadata': {'title': 'The SeFiRe field recording dataset', 'resource_type': {'title': {'de': 'Audio', 'en': 'Audio'}, 'id': 'sound'}, 'creators': [{'affiliations': [{'name': 'University of Ljubljana'}], 'person_or_org': {'given_name': 'Matija', 'name': 'Marolt, Matija', 'identifiers': [{'scheme': 'orcid', 'identifier': '0000-0002-0619-8789'}], 'type': 'personal', 'family_name': 'Marolt'}}, {'affiliations': [{'name': 'University of Ljubljana'}], 'person_or_org': {'given_name': 'Ciril', 'name': 'Bohak, Ciril', 'identifiers': [{'scheme': 'orcid', 'identifier': '0000-0002-9015-2897'}], 'type': 'personal', 'family_name': 'Bohak'}}, {'affiliations': [{'name': 'University of Ljubljana'}], 'person_or_org': {'given_name': 'Alenka', 'name': 'Kavčič, Alenka', 'type': 'personal', 'family_name': 'Kavčič'}}, {'affiliations': [{'name': 'University of Ljubljana'}], 'person_or_org': {'given_name': 'Matevž', 'name': 'Pesek, Matevž', 'identifiers': [{'scheme': 'orcid', 'identifier': '0000-0001-9101-0471'}], 'type': 'personal', 'family_name': 'Pesek'}}], 'publication_date': '2019-01-28'}, 'id': '
pqb7y-mtf49
', 'updated': '2022-07-1
9
T07:
39:42.362952
+00:00', 'pids': {}, 'parent': {'communities': {}, 'id': '
3yzsn-zkn15
', 'access': {'links': [], 'owned_by': [{'user': 47}]}}, 'revision_id': 4, 'files': {'enabled': True, 'order': []}, 'versions': {'index': 1, 'is_latest': False, 'is_latest_draft': True}, 'access': {'files': 'public', 'record': 'public', 'embargo': {'reason': None, 'active': False}, 'status': 'metadata-only'}, 'errors': [{'field': 'access.embargo', 'messages': ['Field may not be null.']}]}\n"
]
]
}
}
],
],
...
@@ -162,35 +162,33 @@
...
@@ -162,35 +162,33 @@
"}, headers=headers).json()\n",
"}, headers=headers).json()\n",
"print(response)\n",
"print(response)\n",
"record_id = response[\"id\"]"
"record_id = response[\"id\"]"
],
]
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
}
},
},
{
{
"cell_type": "markdown",
"cell_type": "markdown",
"source": [
"Announce"
],
"metadata": {
"metadata": {
"collapsed": false,
"pycharm": {
"pycharm": {
"name": "#%% md\n"
"name": "#%% md\n"
}
}
}
},
"source": [
"Announce"
]
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count": 4,
"execution_count": 5,
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [
"outputs": [
{
{
"name": "stdout",
"name": "stdout",
"output_type": "stream",
"output_type": "stream",
"text": [
"text": [
"{'enabled': True, 'links': {'self': 'https://test.researchdata.tuwien.ac.at/api/records/
xksnz-cfg98
/draft/files'}, 'entries': [{'links': {'self': 'https://test.researchdata.tuwien.ac.at/api/records/
xksnz-cfg98
/draft/files/audio.wav', 'content': 'https://test.researchdata.tuwien.ac.at/api/records/
xksnz-cfg98
/draft/files/audio.wav/content', 'commit': 'https://test.researchdata.tuwien.ac.at/api/records/
xksnz-cfg98
/draft/files/audio.wav/commit'}, 'created': '2022-07-1
5
T07:
53:06.580131
+00:00', 'metadata': None, 'updated': '2022-07-1
5
T07:
53:06.581418
+00:00', 'key': 'audio.wav', 'status': 'pending'}], 'default_preview': None, 'order': []}\n"
"{'enabled': True, 'links': {'self': 'https://test.researchdata.tuwien.ac.at/api/records/
pqb7y-mtf49
/draft/files'}, 'entries': [{'links': {'self': 'https://test.researchdata.tuwien.ac.at/api/records/
pqb7y-mtf49
/draft/files/audio.wav', 'content': 'https://test.researchdata.tuwien.ac.at/api/records/
pqb7y-mtf49
/draft/files/audio.wav/content', 'commit': 'https://test.researchdata.tuwien.ac.at/api/records/
pqb7y-mtf49
/draft/files/audio.wav/commit'}, 'created': '2022-07-1
9
T07:
39:48.031184
+00:00', 'metadata': None, 'updated': '2022-07-1
9
T07:
39:48.032401
+00:00', 'key': 'audio.wav', 'status': 'pending'}], 'default_preview': None, 'order': []}\n"
]
]
}
}
],
],
...
@@ -199,35 +197,33 @@
...
@@ -199,35 +197,33 @@
" \"key\": filename\n",
" \"key\": filename\n",
"}], headers=headers).json()\n",
"}], headers=headers).json()\n",
"print(response)"
"print(response)"
],
]
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
}
},
},
{
{
"cell_type": "markdown",
"cell_type": "markdown",
"source": [
"Upload"
],
"metadata": {
"metadata": {
"collapsed": false,
"pycharm": {
"pycharm": {
"name": "#%% md\n"
"name": "#%% md\n"
}
}
}
},
"source": [
"Upload"
]
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count": 5,
"execution_count": 6,
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [
"outputs": [
{
{
"name": "stdout",
"name": "stdout",
"output_type": "stream",
"output_type": "stream",
"text": [
"text": [
"{'links': {'self': 'https://test.researchdata.tuwien.ac.at/api/records/
xksnz-cfg98
/draft/files/audio.wav', 'content': 'https://test.researchdata.tuwien.ac.at/api/records/
xksnz-cfg98
/draft/files/audio.wav/content', 'commit': 'https://test.researchdata.tuwien.ac.at/api/records/
xksnz-cfg98
/draft/files/audio.wav/commit'}, 'created': '2022-07-1
5
T07:
53:06.580131
+00:00', 'metadata': None, 'updated': '2022-07-1
5
T07:
53:06.581418
+00:00', 'key': 'audio.wav', 'status': 'pending'}\n"
"{'links': {'self': 'https://test.researchdata.tuwien.ac.at/api/records/
pqb7y-mtf49
/draft/files/audio.wav', 'content': 'https://test.researchdata.tuwien.ac.at/api/records/
pqb7y-mtf49
/draft/files/audio.wav/content', 'commit': 'https://test.researchdata.tuwien.ac.at/api/records/
pqb7y-mtf49
/draft/files/audio.wav/commit'}, 'created': '2022-07-1
9
T07:
39:48.031184
+00:00', 'metadata': None, 'updated': '2022-07-1
9
T07:
39:48.032401
+00:00', 'key': 'audio.wav', 'status': 'pending'}\n"
]
]
}
}
],
],
...
@@ -236,126 +232,122 @@
...
@@ -236,126 +232,122 @@
" response = rq.put(host + \"/api/records/\" + record_id + \"/draft/files/\" + filename + \"/content\", data=f.read(),\n",
" response = rq.put(host + \"/api/records/\" + record_id + \"/draft/files/\" + filename + \"/content\", data=f.read(),\n",
" headers=headers).json()\n",
" headers=headers).json()\n",
"print(response)"
"print(response)"
],
]
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
}
},
},
{
{
"cell_type": "markdown",
"cell_type": "markdown",
"source": [
"Commit"
],
"metadata": {
"metadata": {
"collapsed": false,
"pycharm": {
"pycharm": {
"name": "#%% md\n"
"name": "#%% md\n"
}
}
}
},
"source": [
"Commit"
]
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count": 6,
"execution_count": 7,
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [
"outputs": [
{
{
"name": "stdout",
"name": "stdout",
"output_type": "stream",
"output_type": "stream",
"text": [
"text": [
"{'links': {'self': 'https://test.researchdata.tuwien.ac.at/api/records/
xksnz-cfg98
/draft/files/audio.wav', 'content': 'https://test.researchdata.tuwien.ac.at/api/records/
xksnz-cfg98
/draft/files/audio.wav/content', 'commit': 'https://test.researchdata.tuwien.ac.at/api/records/
xksnz-cfg98
/draft/files/audio.wav/commit'}, 'created': '2022-07-1
5
T07:
53:06.580131
+00:00', 'checksum': 'md5:1e9f213a91e95bc4c54eac7c9ea7564d', 'mimetype': 'audio/x-wav', 'metadata': None, 'storage_class': 'S', 'updated': '2022-07-1
5
T07:
53:09.611298
+00:00', 'file_id': '
73bc7ae9-f0d
d-
4
48d-
aaed-c6f17e3dd4df
', 'key': 'audio.wav', 'size': 1792556, 'version_id': '
53523650-5e95-44c9-a768-95f4d52aaaf0
', 'status': 'completed', 'bucket_id': '
95a527be-90d7-4372-a55b-da813d118ae2
'}\n"
"{'links': {'self': 'https://test.researchdata.tuwien.ac.at/api/records/
pqb7y-mtf49
/draft/files/audio.wav', 'content': 'https://test.researchdata.tuwien.ac.at/api/records/
pqb7y-mtf49
/draft/files/audio.wav/content', 'commit': 'https://test.researchdata.tuwien.ac.at/api/records/
pqb7y-mtf49
/draft/files/audio.wav/commit'}, 'created': '2022-07-1
9
T07:
39:48.031184
+00:00', 'checksum': 'md5:1e9f213a91e95bc4c54eac7c9ea7564d', 'mimetype': 'audio/x-wav', 'metadata': None, 'storage_class': 'S', 'updated': '2022-07-1
9
T07:
40:02.377175
+00:00', 'file_id': '
06493a5
d-
5
48d-
4f7e-a27a-fd6f554d7687
', 'key': 'audio.wav', 'size': 1792556, 'version_id': '
17721b99-107d-49f9-b186-28fcd38cb495
', 'status': 'completed', 'bucket_id': '
a0478dfa-23b6-434f-b0dd-2cedc2691c69
'}\n"
]
]
}
}
],
],
"source": [
"source": [
"response = rq.post(host + \"/api/records/\" + record_id + \"/draft/files/\" + filename + \"/commit\", headers=headers).json()\n",
"response = rq.post(host + \"/api/records/\" + record_id + \"/draft/files/\" + filename + \"/commit\", headers=headers).json()\n",
"print(response)"
"print(response)"
],
]
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
}
},
},
{
{
"cell_type": "markdown",
"cell_type": "markdown",
"source": [
"Publish"
],
"metadata": {
"metadata": {
"collapsed": false,
"pycharm": {
"pycharm": {
"name": "#%% md\n"
"name": "#%% md\n"
}
}
}
},
"source": [
"Publish"
]
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count": 7,
"execution_count": 8,
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [
"outputs": [
{
{
"name": "stdout",
"name": "stdout",
"output_type": "stream",
"output_type": "stream",
"text": [
"text": [
"{'links': {'self': 'https://test.researchdata.tuwien.ac.at/api/records/
xksnz-cfg98
', 'self_html': 'https://test.researchdata.tuwien.ac.at/records/
xksnz-cfg98
', 'self_doi': 'https://test.researchdata.tuwien.ac.at/doi/10.70124/
xksnz-cfg98
', 'doi': 'https://doi.org/10.70124/
xksnz-cfg98
', 'files': 'https://test.researchdata.tuwien.ac.at/api/records/
xksnz-cfg98
/files', 'latest': 'https://test.researchdata.tuwien.ac.at/api/records/
xksnz-cfg98
/versions/latest', 'latest_html': 'https://test.researchdata.tuwien.ac.at/records/
xksnz-cfg98
/latest', 'draft': 'https://test.researchdata.tuwien.ac.at/api/records/
xksnz-cfg98
/draft', 'versions': 'https://test.researchdata.tuwien.ac.at/api/records/
xksnz-cfg98
/versions', 'access_links': 'https://test.researchdata.tuwien.ac.at/api/records/
xksnz-cfg98
/access/links', 'reserve_doi': 'https://test.researchdata.tuwien.ac.at/api/records/
xksnz-cfg98
/draft/pids/doi'}, 'created': '2022-07-1
5
T07:
53:10.44691
4+00:00', 'is_draft': False, 'is_published': True, 'metadata': {'title': 'The SeFiRe field recording dataset', 'resource_type': {'title': {'de': 'Audio', 'en': 'Audio'}, 'id': 'sound'}, 'creators': [{'affiliations': [{'name': 'University of Ljubljana'}], 'person_or_org': {'given_name': 'Matija', 'name': 'Marolt, Matija', 'identifiers': [{'scheme': 'orcid', 'identifier': '0000-0002-0619-8789'}], 'type': 'personal', 'family_name': 'Marolt'}}, {'affiliations': [{'name': 'University of Ljubljana'}], 'person_or_org': {'given_name': 'Ciril', 'name': 'Bohak, Ciril', 'identifiers': [{'scheme': 'orcid', 'identifier': '0000-0002-9015-2897'}], 'type': 'personal', 'family_name': 'Bohak'}}, {'affiliations': [{'name': 'University of Ljubljana'}], 'person_or_org': {'given_name': 'Alenka', 'name': 'Kavčič, Alenka', 'type': 'personal', 'family_name': 'Kavčič'}}, {'affiliations': [{'name': 'University of Ljubljana'}], 'person_or_org': {'given_name': 'Matevž', 'name': 'Pesek, Matevž', 'identifiers': [{'scheme': 'orcid', 'identifier': '0000-0001-9101-0471'}], 'type': 'personal', 'family_name': 'Pesek'}}], 'publication_date': '2019-01-28'}, 'id': '
xksnz-cfg98
', 'updated': '2022-07-1
5
T07:
53:10.493420
+00:00', 'pids': {'oai': {'provider': 'oai', 'identifier': 'oai:test.researchdata.tuwien.ac.at:
xksnz-cfg98
'}, 'doi': {'client': 'datacite', 'provider': 'datacite', 'identifier': '10.70124/
xksnz-cfg98
'}}, 'parent': {'communities': {}, 'id': '
r7wqx-mt922
', 'access': {'links': [], 'owned_by': [{'user': 47}]}}, 'revision_id': 3, 'files': {'enabled': True, 'order': []}, 'versions': {'index': 1, 'is_latest': True, 'is_latest_draft': True}, 'access': {'files': 'public', 'record': 'public', 'embargo': {'reason': None, 'active': False}, 'status': 'open'}}\n"
"{'links': {'self': 'https://test.researchdata.tuwien.ac.at/api/records/
pqb7y-mtf49
', 'self_html': 'https://test.researchdata.tuwien.ac.at/records/
pqb7y-mtf49
', 'self_doi': 'https://test.researchdata.tuwien.ac.at/doi/10.70124/
pqb7y-mtf49
', 'doi': 'https://doi.org/10.70124/
pqb7y-mtf49
', 'files': 'https://test.researchdata.tuwien.ac.at/api/records/
pqb7y-mtf49
/files', 'latest': 'https://test.researchdata.tuwien.ac.at/api/records/
pqb7y-mtf49
/versions/latest', 'latest_html': 'https://test.researchdata.tuwien.ac.at/records/
pqb7y-mtf49
/latest', 'draft': 'https://test.researchdata.tuwien.ac.at/api/records/
pqb7y-mtf49
/draft', 'versions': 'https://test.researchdata.tuwien.ac.at/api/records/
pqb7y-mtf49
/versions', 'access_links': 'https://test.researchdata.tuwien.ac.at/api/records/
pqb7y-mtf49
/access/links', 'reserve_doi': 'https://test.researchdata.tuwien.ac.at/api/records/
pqb7y-mtf49
/draft/pids/doi'}, 'created': '2022-07-1
9
T07:
40:07.92223
4+00:00', 'is_draft': False, 'is_published': True, 'metadata': {'title': 'The SeFiRe field recording dataset', 'resource_type': {'title': {'de': 'Audio', 'en': 'Audio'}, 'id': 'sound'}, 'creators': [{'affiliations': [{'name': 'University of Ljubljana'}], 'person_or_org': {'given_name': 'Matija', 'name': 'Marolt, Matija', 'identifiers': [{'scheme': 'orcid', 'identifier': '0000-0002-0619-8789'}], 'type': 'personal', 'family_name': 'Marolt'}}, {'affiliations': [{'name': 'University of Ljubljana'}], 'person_or_org': {'given_name': 'Ciril', 'name': 'Bohak, Ciril', 'identifiers': [{'scheme': 'orcid', 'identifier': '0000-0002-9015-2897'}], 'type': 'personal', 'family_name': 'Bohak'}}, {'affiliations': [{'name': 'University of Ljubljana'}], 'person_or_org': {'given_name': 'Alenka', 'name': 'Kavčič, Alenka', 'type': 'personal', 'family_name': 'Kavčič'}}, {'affiliations': [{'name': 'University of Ljubljana'}], 'person_or_org': {'given_name': 'Matevž', 'name': 'Pesek, Matevž', 'identifiers': [{'scheme': 'orcid', 'identifier': '0000-0001-9101-0471'}], 'type': 'personal', 'family_name': 'Pesek'}}], 'publication_date': '2019-01-28'}, 'id': '
pqb7y-mtf49
', 'updated': '2022-07-1
9
T07:
40:07.966322
+00:00', 'pids': {'oai': {'provider': 'oai', 'identifier': 'oai:test.researchdata.tuwien.ac.at:
pqb7y-mtf49
'}, 'doi': {'client': 'datacite', 'provider': 'datacite', 'identifier': '10.70124/
pqb7y-mtf49
'}}, 'parent': {'communities': {}, 'id': '
3yzsn-zkn15
', 'access': {'links': [], 'owned_by': [{'user': 47}]}}, 'revision_id': 3, 'files': {'enabled': True, 'order': []}, 'versions': {'index': 1, 'is_latest': True, 'is_latest_draft': True}, 'access': {'files': 'public', 'record': 'public', 'embargo': {'reason': None, 'active': False}, 'status': 'open'}}\n"
]
]
}
}
],
],
"source": [
"source": [
"response = rq.post(host + \"/api/records/\" + record_id + \"/draft/actions/publish\", headers=headers).json()\n",
"response = rq.post(host + \"/api/records/\" + record_id + \"/draft/actions/publish\", headers=headers).json()\n",
"print(response)"
"print(response)"
],
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {
"metadata": {
"collapsed": false,
"pycharm": {
"pycharm": {
"name": "#%%\n"
"name": "#%%\n"
}
}
}
},
},
{
"cell_type": "code",
"execution_count": 8,
"outputs": [
"outputs": [
{
{
"name": "stdout",
"name": "stdout",
"output_type": "stream",
"output_type": "stream",
"text": [
"text": [
"https://test.researchdata.tuwien.ac.at/doi/10.70124/
xksnz-cfg98
\n"
"https://test.researchdata.tuwien.ac.at/doi/10.70124/
pqb7y-mtf49
\n"
]
]
}
}
],
],
"source": [
"source": [
"print(response[\"links\"][\"self_doi\"])"
"print(response[\"links\"][\"self_doi\"])"
],
]
"metadata": {
},
"collapsed": false,
{
"pycharm": {
"cell_type": "code",
"name": "#%%\n"
"execution_count": null,
}
"metadata": {},
}
"outputs": [],
"source": []
}
}
],
],
"metadata": {
"metadata": {
"kernelspec": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3
(ipykernel)
",
"language": "python",
"language": "python",
"name": "python3"
"name": "python3"
},
},
"language_info": {
"language_info": {
"codemirror_mode": {
"codemirror_mode": {
"name": "ipython",
"name": "ipython",
"version":
2
"version":
3
},
},
"file_extension": ".py",
"file_extension": ".py",
"mimetype": "text/x-python",
"mimetype": "text/x-python",
"name": "python",
"name": "python",
"nbconvert_exporter": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython
2
",
"pygments_lexer": "ipython
3
",
"version": "
2.7.6
"
"version": "
3.10.4
"
}
}
},
},
"nbformat": 4,
"nbformat": 4,
"nbformat_minor":
0
"nbformat_minor":
1
}
}
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
# Deposit
# Deposit
%% Cell type:code id: tags:
%% Cell type:code id: tags:
```
python
```
python
import
re
import
re
import
requests
as
rq
import
requests
as
rq
host
=
"
https://test.researchdata.tuwien.ac.at
"
host
=
"
https://test.researchdata.tuwien.ac.at
"
file
=
"
./resources/audio.wav
"
file
=
"
./resources/audio.wav
"
token
=
"
kJTJMtRKzmA0S92A9Jks7Y1OQbtRWElzgUrldXehDbeXESxIGQ0BQ6JFEFyg
"
token
=
"
kJTJMtRKzmA0S92A9Jks7Y1OQbtRWElzgUrldXehDbeXESxIGQ0BQ6JFEFyg
"
```
```
%% Cell type:code id: tags:
%% Cell type:code id: tags:
```
python
```
python
headers
=
{
headers
=
{
"
Authorization
"
:
"
Bearer
"
+
token
"
Authorization
"
:
"
Bearer
"
+
token
}
}
filename
=
re
.
findall
(
"
([a-zA-z0-9_-]+
\\
.wav)
"
,
file
)[
0
]
filename
=
re
.
findall
(
"
([a-zA-z0-9_-]+
\\
.wav)
"
,
file
)[
0
]
```
```
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
Create Record
Create Record
%% Cell type:code id: tags:
%% Cell type:code id: tags:
```
python
```
python
response
=
rq
.
post
(
host
+
"
/api/records
"
,
json
=
{
response
=
rq
.
post
(
host
+
"
/api/records
"
,
json
=
{
"
access
"
:
{
"
access
"
:
{
"
record
"
:
"
public
"
,
"
record
"
:
"
public
"
,
"
files
"
:
"
public
"
,
"
files
"
:
"
public
"
,
"
embargo
"
:
None
"
embargo
"
:
None
},
},
"
files
"
:
{
"
files
"
:
{
"
enabled
"
:
True
,
"
enabled
"
:
True
,
"
default_preview
"
:
None
"
default_preview
"
:
None
},
},
"
metadata
"
:
{
"
metadata
"
:
{
"
creators
"
:
[{
"
creators
"
:
[{
"
affiliations
"
:
[
"
affiliations
"
:
[
{
{
"
name
"
:
"
University of Ljubljana
"
"
name
"
:
"
University of Ljubljana
"
}
}
],
],
"
person_or_org
"
:
{
"
person_or_org
"
:
{
"
type
"
:
"
personal
"
,
"
type
"
:
"
personal
"
,
"
name
"
:
"
M. Marolt
"
,
"
name
"
:
"
M. Marolt
"
,
"
identifiers
"
:
[
"
identifiers
"
:
[
{
{
"
scheme
"
:
"
orcid
"
,
"
scheme
"
:
"
orcid
"
,
"
identifier
"
:
"
0000-0002-0619-8789
"
"
identifier
"
:
"
0000-0002-0619-8789
"
}
}
],
],
"
given_name
"
:
"
Matija
"
,
"
given_name
"
:
"
Matija
"
,
"
family_name
"
:
"
Marolt
"
"
family_name
"
:
"
Marolt
"
}
}
},
{
},
{
"
affiliations
"
:
[
"
affiliations
"
:
[
{
{
"
name
"
:
"
University of Ljubljana
"
"
name
"
:
"
University of Ljubljana
"
}
}
],
],
"
person_or_org
"
:
{
"
person_or_org
"
:
{
"
type
"
:
"
personal
"
,
"
type
"
:
"
personal
"
,
"
name
"
:
"
C. Bohak
"
,
"
name
"
:
"
C. Bohak
"
,
"
identifiers
"
:
[
"
identifiers
"
:
[
{
{
"
scheme
"
:
"
orcid
"
,
"
scheme
"
:
"
orcid
"
,
"
identifier
"
:
"
0000-0002-9015-2897
"
"
identifier
"
:
"
0000-0002-9015-2897
"
}
}
],
],
"
given_name
"
:
"
Ciril
"
,
"
given_name
"
:
"
Ciril
"
,
"
family_name
"
:
"
Bohak
"
"
family_name
"
:
"
Bohak
"
}
}
},
{
},
{
"
affiliations
"
:
[
"
affiliations
"
:
[
{
{
"
name
"
:
"
University of Ljubljana
"
"
name
"
:
"
University of Ljubljana
"
}
}
],
],
"
person_or_org
"
:
{
"
person_or_org
"
:
{
"
type
"
:
"
personal
"
,
"
type
"
:
"
personal
"
,
"
name
"
:
"
A. Kavčič
"
,
"
name
"
:
"
A. Kavčič
"
,
"
given_name
"
:
"
Alenka
"
,
"
given_name
"
:
"
Alenka
"
,
"
family_name
"
:
"
Kavčič
"
"
family_name
"
:
"
Kavčič
"
}
}
},
{
},
{
"
affiliations
"
:
[
"
affiliations
"
:
[
{
{
"
name
"
:
"
University of Ljubljana
"
"
name
"
:
"
University of Ljubljana
"
}
}
],
],
"
person_or_org
"
:
{
"
person_or_org
"
:
{
"
type
"
:
"
personal
"
,
"
type
"
:
"
personal
"
,
"
name
"
:
"
M. Pesek
"
,
"
name
"
:
"
M. Pesek
"
,
"
identifiers
"
:
[
"
identifiers
"
:
[
{
{
"
scheme
"
:
"
orcid
"
,
"
scheme
"
:
"
orcid
"
,
"
identifier
"
:
"
0000-0001-9101-0471
"
"
identifier
"
:
"
0000-0001-9101-0471
"
}
}
],
],
"
given_name
"
:
"
Matevž
"
,
"
given_name
"
:
"
Matevž
"
,
"
family_name
"
:
"
Pesek
"
"
family_name
"
:
"
Pesek
"
}
}
}],
}],
"
title
"
:
"
The SeFiRe field recording dataset
"
,
"
title
"
:
"
The SeFiRe field recording dataset
"
,
"
resource_type
"
:
{
"
resource_type
"
:
{
"
id
"
:
"
sound
"
"
id
"
:
"
sound
"
},
},
"
publication_date
"
:
"
2019-01-28
"
"
publication_date
"
:
"
2019-01-28
"
}
}
},
headers
=
headers
).
json
()
},
headers
=
headers
).
json
()
print
(
response
)
print
(
response
)
record_id
=
response
[
"
id
"
]
record_id
=
response
[
"
id
"
]
```
```
%% Output
%% Output
{'links': {'self': 'https://test.researchdata.tuwien.ac.at/api/records/
xksnz-cfg98
/draft', 'self_html': 'https://test.researchdata.tuwien.ac.at/uploads/
xksnz-cfg98
', 'files': 'https://test.researchdata.tuwien.ac.at/api/records/
xksnz-cfg98
/draft/files', 'record': 'https://test.researchdata.tuwien.ac.at/api/records/
xksnz-cfg98
', 'record_html': 'https://test.researchdata.tuwien.ac.at/records/
xksnz-cfg98
', 'publish': 'https://test.researchdata.tuwien.ac.at/api/records/
xksnz-cfg98
/draft/actions/publish', 'review': 'https://test.researchdata.tuwien.ac.at/api/records/
xksnz-cfg98
/draft/review', 'versions': 'https://test.researchdata.tuwien.ac.at/api/records/
xksnz-cfg98
/versions', 'access_links': 'https://test.researchdata.tuwien.ac.at/api/records/
xksnz-cfg98
/access/links', 'reserve_doi': 'https://test.researchdata.tuwien.ac.at/api/records/
xksnz-cfg98
/draft/pids/doi'}, 'created': '2022-07-1
5
T07:
53:05.367485
+00:00', 'is_draft': True, 'expires_at': '2022-07-1
5
07:
53:05.367509
', 'is_published': False, 'metadata': {'title': 'The SeFiRe field recording dataset', 'resource_type': {'title': {'de': 'Audio', 'en': 'Audio'}, 'id': 'sound'}, 'creators': [{'affiliations': [{'name': 'University of Ljubljana'}], 'person_or_org': {'given_name': 'Matija', 'name': 'Marolt, Matija', 'identifiers': [{'scheme': 'orcid', 'identifier': '0000-0002-0619-8789'}], 'type': 'personal', 'family_name': 'Marolt'}}, {'affiliations': [{'name': 'University of Ljubljana'}], 'person_or_org': {'given_name': 'Ciril', 'name': 'Bohak, Ciril', 'identifiers': [{'scheme': 'orcid', 'identifier': '0000-0002-9015-2897'}], 'type': 'personal', 'family_name': 'Bohak'}}, {'affiliations': [{'name': 'University of Ljubljana'}], 'person_or_org': {'given_name': 'Alenka', 'name': 'Kavčič, Alenka', 'type': 'personal', 'family_name': 'Kavčič'}}, {'affiliations': [{'name': 'University of Ljubljana'}], 'person_or_org': {'given_name': 'Matevž', 'name': 'Pesek, Matevž', 'identifiers': [{'scheme': 'orcid', 'identifier': '0000-0001-9101-0471'}], 'type': 'personal', 'family_name': 'Pesek'}}], 'publication_date': '2019-01-28'}, 'id': '
xksnz-cfg98
', 'updated': '2022-07-1
5
T07:
53:05.385833
+00:00', 'pids': {}, 'parent': {'communities': {}, 'id': '
r7wqx-mt922
', 'access': {'links': [], 'owned_by': [{'user': 47}]}}, 'revision_id': 4, 'files': {'enabled': True, 'order': []}, 'versions': {'index': 1, 'is_latest': False, 'is_latest_draft': True}, 'access': {'files': 'public', 'record': 'public', 'embargo': {'reason': None, 'active': False}, 'status': 'metadata-only'}, 'errors': [{'field': 'access.embargo', 'messages': ['Field may not be null.']}]}
{'links': {'self': 'https://test.researchdata.tuwien.ac.at/api/records/
pqb7y-mtf49
/draft', 'self_html': 'https://test.researchdata.tuwien.ac.at/uploads/
pqb7y-mtf49
', 'files': 'https://test.researchdata.tuwien.ac.at/api/records/
pqb7y-mtf49
/draft/files', 'record': 'https://test.researchdata.tuwien.ac.at/api/records/
pqb7y-mtf49
', 'record_html': 'https://test.researchdata.tuwien.ac.at/records/
pqb7y-mtf49
', 'publish': 'https://test.researchdata.tuwien.ac.at/api/records/
pqb7y-mtf49
/draft/actions/publish', 'review': 'https://test.researchdata.tuwien.ac.at/api/records/
pqb7y-mtf49
/draft/review', 'versions': 'https://test.researchdata.tuwien.ac.at/api/records/
pqb7y-mtf49
/versions', 'access_links': 'https://test.researchdata.tuwien.ac.at/api/records/
pqb7y-mtf49
/access/links', 'reserve_doi': 'https://test.researchdata.tuwien.ac.at/api/records/
pqb7y-mtf49
/draft/pids/doi'}, 'created': '2022-07-1
9
T07:
39:42.344631
+00:00', 'is_draft': True, 'expires_at': '2022-07-1
9
07:
39:42.344656
', 'is_published': False, 'metadata': {'title': 'The SeFiRe field recording dataset', 'resource_type': {'title': {'de': 'Audio', 'en': 'Audio'}, 'id': 'sound'}, 'creators': [{'affiliations': [{'name': 'University of Ljubljana'}], 'person_or_org': {'given_name': 'Matija', 'name': 'Marolt, Matija', 'identifiers': [{'scheme': 'orcid', 'identifier': '0000-0002-0619-8789'}], 'type': 'personal', 'family_name': 'Marolt'}}, {'affiliations': [{'name': 'University of Ljubljana'}], 'person_or_org': {'given_name': 'Ciril', 'name': 'Bohak, Ciril', 'identifiers': [{'scheme': 'orcid', 'identifier': '0000-0002-9015-2897'}], 'type': 'personal', 'family_name': 'Bohak'}}, {'affiliations': [{'name': 'University of Ljubljana'}], 'person_or_org': {'given_name': 'Alenka', 'name': 'Kavčič, Alenka', 'type': 'personal', 'family_name': 'Kavčič'}}, {'affiliations': [{'name': 'University of Ljubljana'}], 'person_or_org': {'given_name': 'Matevž', 'name': 'Pesek, Matevž', 'identifiers': [{'scheme': 'orcid', 'identifier': '0000-0001-9101-0471'}], 'type': 'personal', 'family_name': 'Pesek'}}], 'publication_date': '2019-01-28'}, 'id': '
pqb7y-mtf49
', 'updated': '2022-07-1
9
T07:
39:42.362952
+00:00', 'pids': {}, 'parent': {'communities': {}, 'id': '
3yzsn-zkn15
', 'access': {'links': [], 'owned_by': [{'user': 47}]}}, 'revision_id': 4, 'files': {'enabled': True, 'order': []}, 'versions': {'index': 1, 'is_latest': False, 'is_latest_draft': True}, 'access': {'files': 'public', 'record': 'public', 'embargo': {'reason': None, 'active': False}, 'status': 'metadata-only'}, 'errors': [{'field': 'access.embargo', 'messages': ['Field may not be null.']}]}
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
Announce
Announce
%% Cell type:code id: tags:
%% Cell type:code id: tags:
```
python
```
python
response
=
rq
.
post
(
host
+
"
/api/records/
"
+
record_id
+
"
/draft/files
"
,
json
=
[{
response
=
rq
.
post
(
host
+
"
/api/records/
"
+
record_id
+
"
/draft/files
"
,
json
=
[{
"
key
"
:
filename
"
key
"
:
filename
}],
headers
=
headers
).
json
()
}],
headers
=
headers
).
json
()
print
(
response
)
print
(
response
)
```
```
%% Output
%% Output
{'enabled': True, 'links': {'self': 'https://test.researchdata.tuwien.ac.at/api/records/
xksnz-cfg98
/draft/files'}, 'entries': [{'links': {'self': 'https://test.researchdata.tuwien.ac.at/api/records/
xksnz-cfg98
/draft/files/audio.wav', 'content': 'https://test.researchdata.tuwien.ac.at/api/records/
xksnz-cfg98
/draft/files/audio.wav/content', 'commit': 'https://test.researchdata.tuwien.ac.at/api/records/
xksnz-cfg98
/draft/files/audio.wav/commit'}, 'created': '2022-07-1
5
T07:
53:06.580131
+00:00', 'metadata': None, 'updated': '2022-07-1
5
T07:
53:06.581418
+00:00', 'key': 'audio.wav', 'status': 'pending'}], 'default_preview': None, 'order': []}
{'enabled': True, 'links': {'self': 'https://test.researchdata.tuwien.ac.at/api/records/
pqb7y-mtf49
/draft/files'}, 'entries': [{'links': {'self': 'https://test.researchdata.tuwien.ac.at/api/records/
pqb7y-mtf49
/draft/files/audio.wav', 'content': 'https://test.researchdata.tuwien.ac.at/api/records/
pqb7y-mtf49
/draft/files/audio.wav/content', 'commit': 'https://test.researchdata.tuwien.ac.at/api/records/
pqb7y-mtf49
/draft/files/audio.wav/commit'}, 'created': '2022-07-1
9
T07:
39:48.031184
+00:00', 'metadata': None, 'updated': '2022-07-1
9
T07:
39:48.032401
+00:00', 'key': 'audio.wav', 'status': 'pending'}], 'default_preview': None, 'order': []}
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
Upload
Upload
%% Cell type:code id: tags:
%% Cell type:code id: tags:
```
python
```
python
with
open
(
file
,
mode
=
'
rb
'
)
as
f
:
with
open
(
file
,
mode
=
'
rb
'
)
as
f
:
response
=
rq
.
put
(
host
+
"
/api/records/
"
+
record_id
+
"
/draft/files/
"
+
filename
+
"
/content
"
,
data
=
f
.
read
(),
response
=
rq
.
put
(
host
+
"
/api/records/
"
+
record_id
+
"
/draft/files/
"
+
filename
+
"
/content
"
,
data
=
f
.
read
(),
headers
=
headers
).
json
()
headers
=
headers
).
json
()
print
(
response
)
print
(
response
)
```
```
%% Output
%% Output
{'links': {'self': 'https://test.researchdata.tuwien.ac.at/api/records/
xksnz-cfg98
/draft/files/audio.wav', 'content': 'https://test.researchdata.tuwien.ac.at/api/records/
xksnz-cfg98
/draft/files/audio.wav/content', 'commit': 'https://test.researchdata.tuwien.ac.at/api/records/
xksnz-cfg98
/draft/files/audio.wav/commit'}, 'created': '2022-07-1
5
T07:
53:06.580131
+00:00', 'metadata': None, 'updated': '2022-07-1
5
T07:
53:06.581418
+00:00', 'key': 'audio.wav', 'status': 'pending'}
{'links': {'self': 'https://test.researchdata.tuwien.ac.at/api/records/
pqb7y-mtf49
/draft/files/audio.wav', 'content': 'https://test.researchdata.tuwien.ac.at/api/records/
pqb7y-mtf49
/draft/files/audio.wav/content', 'commit': 'https://test.researchdata.tuwien.ac.at/api/records/
pqb7y-mtf49
/draft/files/audio.wav/commit'}, 'created': '2022-07-1
9
T07:
39:48.031184
+00:00', 'metadata': None, 'updated': '2022-07-1
9
T07:
39:48.032401
+00:00', 'key': 'audio.wav', 'status': 'pending'}
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
Commit
Commit
%% Cell type:code id: tags:
%% Cell type:code id: tags:
```
python
```
python
response
=
rq
.
post
(
host
+
"
/api/records/
"
+
record_id
+
"
/draft/files/
"
+
filename
+
"
/commit
"
,
headers
=
headers
).
json
()
response
=
rq
.
post
(
host
+
"
/api/records/
"
+
record_id
+
"
/draft/files/
"
+
filename
+
"
/commit
"
,
headers
=
headers
).
json
()
print
(
response
)
print
(
response
)
```
```
%% Output
%% Output
{'links': {'self': 'https://test.researchdata.tuwien.ac.at/api/records/
xksnz-cfg98
/draft/files/audio.wav', 'content': 'https://test.researchdata.tuwien.ac.at/api/records/
xksnz-cfg98
/draft/files/audio.wav/content', 'commit': 'https://test.researchdata.tuwien.ac.at/api/records/
xksnz-cfg98
/draft/files/audio.wav/commit'}, 'created': '2022-07-1
5
T07:
53:06.580131
+00:00', 'checksum': 'md5:1e9f213a91e95bc4c54eac7c9ea7564d', 'mimetype': 'audio/x-wav', 'metadata': None, 'storage_class': 'S', 'updated': '2022-07-1
5
T07:
53:09.611298
+00:00', 'file_id': '
73bc7ae9-f0d
d-
4
48d-
aaed-c6f17e3dd4df
', 'key': 'audio.wav', 'size': 1792556, 'version_id': '
53523650-5e95-44c9-a768-95f4d52aaaf0
', 'status': 'completed', 'bucket_id': '
95a527be-90d7-4372-a55b-da813d118ae2
'}
{'links': {'self': 'https://test.researchdata.tuwien.ac.at/api/records/
pqb7y-mtf49
/draft/files/audio.wav', 'content': 'https://test.researchdata.tuwien.ac.at/api/records/
pqb7y-mtf49
/draft/files/audio.wav/content', 'commit': 'https://test.researchdata.tuwien.ac.at/api/records/
pqb7y-mtf49
/draft/files/audio.wav/commit'}, 'created': '2022-07-1
9
T07:
39:48.031184
+00:00', 'checksum': 'md5:1e9f213a91e95bc4c54eac7c9ea7564d', 'mimetype': 'audio/x-wav', 'metadata': None, 'storage_class': 'S', 'updated': '2022-07-1
9
T07:
40:02.377175
+00:00', 'file_id': '
06493a5
d-
5
48d-
4f7e-a27a-fd6f554d7687
', 'key': 'audio.wav', 'size': 1792556, 'version_id': '
17721b99-107d-49f9-b186-28fcd38cb495
', 'status': 'completed', 'bucket_id': '
a0478dfa-23b6-434f-b0dd-2cedc2691c69
'}
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
Publish
Publish
%% Cell type:code id: tags:
%% Cell type:code id: tags:
```
python
```
python
response
=
rq
.
post
(
host
+
"
/api/records/
"
+
record_id
+
"
/draft/actions/publish
"
,
headers
=
headers
).
json
()
response
=
rq
.
post
(
host
+
"
/api/records/
"
+
record_id
+
"
/draft/actions/publish
"
,
headers
=
headers
).
json
()
print
(
response
)
print
(
response
)
```
```
%% Output
%% Output
{'links': {'self': 'https://test.researchdata.tuwien.ac.at/api/records/
xksnz-cfg98
', 'self_html': 'https://test.researchdata.tuwien.ac.at/records/
xksnz-cfg98
', 'self_doi': 'https://test.researchdata.tuwien.ac.at/doi/10.70124/
xksnz-cfg98
', 'doi': 'https://doi.org/10.70124/
xksnz-cfg98
', 'files': 'https://test.researchdata.tuwien.ac.at/api/records/
xksnz-cfg98
/files', 'latest': 'https://test.researchdata.tuwien.ac.at/api/records/
xksnz-cfg98
/versions/latest', 'latest_html': 'https://test.researchdata.tuwien.ac.at/records/
xksnz-cfg98
/latest', 'draft': 'https://test.researchdata.tuwien.ac.at/api/records/
xksnz-cfg98
/draft', 'versions': 'https://test.researchdata.tuwien.ac.at/api/records/
xksnz-cfg98
/versions', 'access_links': 'https://test.researchdata.tuwien.ac.at/api/records/
xksnz-cfg98
/access/links', 'reserve_doi': 'https://test.researchdata.tuwien.ac.at/api/records/
xksnz-cfg98
/draft/pids/doi'}, 'created': '2022-07-1
5
T07:
53:10.44691
4+00:00', 'is_draft': False, 'is_published': True, 'metadata': {'title': 'The SeFiRe field recording dataset', 'resource_type': {'title': {'de': 'Audio', 'en': 'Audio'}, 'id': 'sound'}, 'creators': [{'affiliations': [{'name': 'University of Ljubljana'}], 'person_or_org': {'given_name': 'Matija', 'name': 'Marolt, Matija', 'identifiers': [{'scheme': 'orcid', 'identifier': '0000-0002-0619-8789'}], 'type': 'personal', 'family_name': 'Marolt'}}, {'affiliations': [{'name': 'University of Ljubljana'}], 'person_or_org': {'given_name': 'Ciril', 'name': 'Bohak, Ciril', 'identifiers': [{'scheme': 'orcid', 'identifier': '0000-0002-9015-2897'}], 'type': 'personal', 'family_name': 'Bohak'}}, {'affiliations': [{'name': 'University of Ljubljana'}], 'person_or_org': {'given_name': 'Alenka', 'name': 'Kavčič, Alenka', 'type': 'personal', 'family_name': 'Kavčič'}}, {'affiliations': [{'name': 'University of Ljubljana'}], 'person_or_org': {'given_name': 'Matevž', 'name': 'Pesek, Matevž', 'identifiers': [{'scheme': 'orcid', 'identifier': '0000-0001-9101-0471'}], 'type': 'personal', 'family_name': 'Pesek'}}], 'publication_date': '2019-01-28'}, 'id': '
xksnz-cfg98
', 'updated': '2022-07-1
5
T07:
53:10.493420
+00:00', 'pids': {'oai': {'provider': 'oai', 'identifier': 'oai:test.researchdata.tuwien.ac.at:
xksnz-cfg98
'}, 'doi': {'client': 'datacite', 'provider': 'datacite', 'identifier': '10.70124/
xksnz-cfg98
'}}, 'parent': {'communities': {}, 'id': '
r7wqx-mt922
', 'access': {'links': [], 'owned_by': [{'user': 47}]}}, 'revision_id': 3, 'files': {'enabled': True, 'order': []}, 'versions': {'index': 1, 'is_latest': True, 'is_latest_draft': True}, 'access': {'files': 'public', 'record': 'public', 'embargo': {'reason': None, 'active': False}, 'status': 'open'}}
{'links': {'self': 'https://test.researchdata.tuwien.ac.at/api/records/
pqb7y-mtf49
', 'self_html': 'https://test.researchdata.tuwien.ac.at/records/
pqb7y-mtf49
', 'self_doi': 'https://test.researchdata.tuwien.ac.at/doi/10.70124/
pqb7y-mtf49
', 'doi': 'https://doi.org/10.70124/
pqb7y-mtf49
', 'files': 'https://test.researchdata.tuwien.ac.at/api/records/
pqb7y-mtf49
/files', 'latest': 'https://test.researchdata.tuwien.ac.at/api/records/
pqb7y-mtf49
/versions/latest', 'latest_html': 'https://test.researchdata.tuwien.ac.at/records/
pqb7y-mtf49
/latest', 'draft': 'https://test.researchdata.tuwien.ac.at/api/records/
pqb7y-mtf49
/draft', 'versions': 'https://test.researchdata.tuwien.ac.at/api/records/
pqb7y-mtf49
/versions', 'access_links': 'https://test.researchdata.tuwien.ac.at/api/records/
pqb7y-mtf49
/access/links', 'reserve_doi': 'https://test.researchdata.tuwien.ac.at/api/records/
pqb7y-mtf49
/draft/pids/doi'}, 'created': '2022-07-1
9
T07:
40:07.92223
4+00:00', 'is_draft': False, 'is_published': True, 'metadata': {'title': 'The SeFiRe field recording dataset', 'resource_type': {'title': {'de': 'Audio', 'en': 'Audio'}, 'id': 'sound'}, 'creators': [{'affiliations': [{'name': 'University of Ljubljana'}], 'person_or_org': {'given_name': 'Matija', 'name': 'Marolt, Matija', 'identifiers': [{'scheme': 'orcid', 'identifier': '0000-0002-0619-8789'}], 'type': 'personal', 'family_name': 'Marolt'}}, {'affiliations': [{'name': 'University of Ljubljana'}], 'person_or_org': {'given_name': 'Ciril', 'name': 'Bohak, Ciril', 'identifiers': [{'scheme': 'orcid', 'identifier': '0000-0002-9015-2897'}], 'type': 'personal', 'family_name': 'Bohak'}}, {'affiliations': [{'name': 'University of Ljubljana'}], 'person_or_org': {'given_name': 'Alenka', 'name': 'Kavčič, Alenka', 'type': 'personal', 'family_name': 'Kavčič'}}, {'affiliations': [{'name': 'University of Ljubljana'}], 'person_or_org': {'given_name': 'Matevž', 'name': 'Pesek, Matevž', 'identifiers': [{'scheme': 'orcid', 'identifier': '0000-0001-9101-0471'}], 'type': 'personal', 'family_name': 'Pesek'}}], 'publication_date': '2019-01-28'}, 'id': '
pqb7y-mtf49
', 'updated': '2022-07-1
9
T07:
40:07.966322
+00:00', 'pids': {'oai': {'provider': 'oai', 'identifier': 'oai:test.researchdata.tuwien.ac.at:
pqb7y-mtf49
'}, 'doi': {'client': 'datacite', 'provider': 'datacite', 'identifier': '10.70124/
pqb7y-mtf49
'}}, 'parent': {'communities': {}, 'id': '
3yzsn-zkn15
', 'access': {'links': [], 'owned_by': [{'user': 47}]}}, 'revision_id': 3, 'files': {'enabled': True, 'order': []}, 'versions': {'index': 1, 'is_latest': True, 'is_latest_draft': True}, 'access': {'files': 'public', 'record': 'public', 'embargo': {'reason': None, 'active': False}, 'status': 'open'}}
%% Cell type:code id: tags:
%% Cell type:code id: tags:
```
python
```
python
print
(
response
[
"
links
"
][
"
self_doi
"
])
print
(
response
[
"
links
"
][
"
self_doi
"
])
```
```
%% Output
%% Output
https://test.researchdata.tuwien.ac.at/doi/10.70124/xksnz-cfg98
https://test.researchdata.tuwien.ac.at/doi/10.70124/pqb7y-mtf49
%% Cell type:code id: tags:
```
python
```
...
...
This diff is collapsed.
Click to expand it.
.jupyter/feature_extract.ipynb
+
1
−
1
View file @
91b01dd9
This diff is collapsed.
Click to expand it.
.jupyter/tuple_publish.ipynb
+
84
−
109
View file @
91b01dd9
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment