Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LOD
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
labs-team
LOD
Commits
3cb4c630
Commit
3cb4c630
authored
6 years ago
by
Georg Petz
Browse files
Options
Downloads
Patches
Plain Diff
requirements and OAI-PMH
parent
844131e0
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
OAI-PMH.ipynb
+76
-0
76 additions, 0 deletions
OAI-PMH.ipynb
with
76 additions
and
0 deletions
OAI-PMH.ipynb
0 → 100644
+
76
−
0
View file @
3cb4c630
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"from sickle import Sickle"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"sickle = Sickle('https://eu02.alma.exlibrisgroup.com/view/oai/43ACC_ONB/request')\n",
"records = sickle.ListRecords(metadataPrefix='oai_dc', set='ABODC')\n",
"meta = records.next().metadata\n",
"ids = meta.get('identifier')"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'9957805251203338'"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"mms = [i for i in ids if i.startswith('alma:43ACC_ONB/bibs/')]\n",
"mms[0].strip('alma:43ACC_ONB/bibs/')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
%% Cell type:code id: tags:
```
python
from
sickle
import
Sickle
```
%% Cell type:code id: tags:
```
python
sickle
=
Sickle
(
'
https://eu02.alma.exlibrisgroup.com/view/oai/43ACC_ONB/request
'
)
records
=
sickle
.
ListRecords
(
metadataPrefix
=
'
oai_dc
'
,
set
=
'
ABODC
'
)
meta
=
records
.
next
().
metadata
ids
=
meta
.
get
(
'
identifier
'
)
```
%% Cell type:code id: tags:
```
python
mms
=
[
i
for
i
in
ids
if
i
.
startswith
(
'
alma:43ACC_ONB/bibs/
'
)]
mms
[
0
].
strip
(
'
alma:43ACC_ONB/bibs/
'
)
```
%% Output
'9957805251203338'
%% Cell type:code id: tags:
```
python
```
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