Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
vkg-idn
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dikon
vkg-idn
Commits
6e3c7b25
Commit
6e3c7b25
authored
4 years ago
by
Donatus Herre
Browse files
Options
Downloads
Patches
Plain Diff
vd18 updated
parent
4f125088
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
data/vd18-online.json
+9
-9
9 additions, 9 deletions
data/vd18-online.json
view/vd18.py
+45
-2
45 additions, 2 deletions
view/vd18.py
with
54 additions
and
11 deletions
data/vd18-online.json
+
9
−
9
View file @
6e3c7b25
...
...
@@ -4,19 +4,19 @@
null
],
"1735"
:
[
"
005973589
"
,
"
005934303
"
,
"
10812180
"
,
"
10781420
"
,
null
],
"1736"
:
[
"
005181674
"
,
"
025238787
"
,
"
006972160
"
,
"
005934133
"
,
"
005977274
"
,
"
025238795
"
,
"
10294651
"
,
"
10756035
"
,
"
11525584
"
,
"
10781315
"
,
"
10815171
"
,
"
10786686
"
,
null
,
"00
4835662
"
,
"
1
00
97376
"
,
null
]
}
This diff is collapsed.
Click to expand it.
view/vd18.py
+
45
−
2
View file @
6e3c7b25
...
...
@@ -13,6 +13,7 @@ from librair import interfaces
online
=
schemas
.
json
.
reader
(
"
data/vd18-online.json
"
)
vd18
=
interfaces
.
unapi
.
Client
(
"
http://unapi.gbv.de
"
,
"
vd18
"
,
"
ppn
"
)
vd18_sru
=
interfaces
.
sru
.
Client
(
"
http://sru.gbv.de/vd18
"
)
printed_data
=
[]
printed_years
=
[]
...
...
@@ -23,10 +24,52 @@ max_year = -1
FORMAT
=
"
jsmf-json
"
def
vdn_query
(
vd18_nr
):
return
"
pica.vdn={0}
"
.
format
(
vd18_nr
)
def
get_ppn
(
vd18_nr
,
bbg
=
"
O
"
):
items
=
vd18_sru
.
search
(
vdn_query
(
vd18_nr
),
schema
=
"
picaxml
"
,
records
=
5
)
if
type
(
items
)
==
list
:
for
item
in
items
:
bbg_val
=
extract_bbg
(
item
)
if
bbg_val
.
startswith
(
bbg
):
item_ppn
=
extract_ppn
(
item
)
if
item_ppn
!=
""
:
return
item_ppn
else
:
bbg_val
=
extract_bbg
(
items
)
if
bbg_val
.
startswith
(
bbg
):
item_ppn
=
extract_ppn
(
items
)
if
item_ppn
!=
""
:
return
item_ppn
return
None
def
extract_bbg
(
item
):
bbg_val
=
item
.
find
(
"
.//datafield[@tag=
'
002@
'
]/subfield[@code=
'
0
'
]
"
,
namespaces
=
item
.
nsmap
)
if
bbg_val
is
not
None
:
if
bbg_val
.
text
is
not
None
:
return
bbg_val
.
text
return
""
def
extract_ppn
(
item
):
ppn_val
=
item
.
find
(
"
.//datafield[@tag=
'
003@
'
]/subfield[@code=
'
0
'
]
"
,
namespaces
=
item
.
nsmap
)
if
ppn_val
is
not
None
:
if
ppn_val
.
text
is
not
None
:
return
ppn_val
.
text
return
""
for
year
in
online
:
for
ppn
in
online
[
year
]:
if
ppn
is
not
None
:
for
vd18_nr
in
online
[
year
]:
if
vd18_nr
is
not
None
:
counter
+=
1
ppn
=
get_ppn
(
vd18_nr
)
item_data
=
vd18
.
request
(
ppn
,
FORMAT
)
printed_data
.
append
(
item_data
)
item_title
=
"
!NO DATA!
"
...
...
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