Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
limbra
limbra
Commits
29066b3d
Commit
29066b3d
authored
Jan 07, 2021
by
LE GAC Renaud
Browse files
Update store_tools/factory.py to remove obsolete add_affiliation_keys
parent
5742c84e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
37 deletions
+0
-37
modules/store_tools/factory.py
modules/store_tools/factory.py
+0
-37
No files found.
modules/store_tools/factory.py
View file @
29066b3d
""" store_tools.factory
"""
import
re
from
.base
import
(
CDS
,
INS
,
is_conference
,
...
...
@@ -27,40 +25,6 @@ REX_T = "\$\$t([\w, ]+)"
REX_U
=
"\$\$u([\w, ]+)"
def
add_affiliation_keys
(
recjson
):
"""A the affiliation keys to the record describing an institute:
* The XML record contains the affiliation keys used by inspirehep.net.
They are located in the field 110__u and 110__t (future).
* The JSON record does not contains this information.
* This tool add the affiliation keys to the JSON record.
They are located:
+----------------+------------------------------------+
| field (limbra) | subfield |
+----------------+------------------------------------+
| corporate_note | identifier, futur_identifier, name |
+----------------+------------------------------------+
Args:
recjson (dict):
record data (MarcJSON)
"""
store
=
InvenioStore
(
"inspirehep"
,
shelf
=
"institutions"
)
url
=
f
"https://old.inspirehep.net/record/
{
recjson
[
'recid'
]
}
"
rep
=
store
.
interrogate
(
url
,
ot
=
"110"
,
of
=
"txt"
)
txt
=
rep
.
text
recjson
[
"corporate_note"
]
=
{
"identifier"
:
re
.
search
(
REX_U
,
txt
).
group
(
1
),
"future_identifier"
:
re
.
search
(
REX_T
,
txt
).
group
(
1
)}
def
add_conference_data
(
recjson
):
"""Add the conference data to the recjson.
...
...
@@ -212,7 +176,6 @@ def build_record(recjson):
upcast_record
=
RecordConf
(
recjson
)
elif
is_institute
(
recjson
):
add_affiliation_keys
(
recjson
)
upcast_record
=
RecordInst
(
recjson
)
elif
is_thesis
(
recjson
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment