Skip to content

Commit 9e4b6ae

Browse files
committed
Updatd DOI generation to generate both validated JSON and XML versions to better support syncing with DataCite and new features.
1 parent e95779d commit 9e4b6ae

File tree

10 files changed

+389
-249
lines changed

10 files changed

+389
-249
lines changed

requirements-freeze.txt

Lines changed: 84 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -2,143 +2,146 @@ airium==0.2.6
22
annotated-types==0.7.0
33
antlr4-python3-runtime==4.9.3
44
appdirs==1.4.4
5-
argcomplete==3.6.2
5+
argcomplete==3.3.0
66
arrow==1.3.0
7-
attrs==25.3.0
7+
attrs==23.2.0
88
bcp47==0.1.0
9-
CacheControl==0.14.2
10-
cattrs==24.1.3
11-
certifi==2025.1.31
9+
CacheControl==0.14.0
10+
cattrs==24.1.0
11+
certifi==2024.6.2
1212
CFGraph==0.2.1
1313
chardet==5.2.0
14-
charset-normalizer==3.4.1
15-
check-jsonschema==0.33.0
16-
class_resolver==0.5.4
17-
click==8.1.8
14+
charset-normalizer==3.3.2
15+
check-jsonschema==0.28.4
16+
class_resolver==0.5.0
17+
click==8.1.7
1818
coloredlogs==15.0.1
19-
curies==0.10.11
20-
cwl-upgrader==1.2.12
21-
cwl-utils==0.37
22-
cwltool==3.1.20250110105449
19+
curies==0.7.9
20+
cwl-upgrader==1.2.11
21+
cwl-utils==0.33
22+
cwltool==3.1.20240508115724
23+
datacite==1.3.1
2324
defusedxml==0.7.1
24-
Deprecated==1.2.18
25+
Deprecated==1.2.14
2526
deprecation==2.1.0
26-
et_xmlfile==2.0.0
27+
et-xmlfile==1.1.0
2728
eutils==0.6.0
28-
fastobo==0.13.0
29-
filelock==3.18.0
29+
exceptiongroup==1.2.1
30+
fastobo==0.12.3
31+
filelock==3.14.0
3032
fqdn==1.5.1
3133
funowl==0.2.3
3234
graphviz==0.20.3
35+
greenlet==3.0.3
3336
hbreader==0.9.1
3437
humanfriendly==10.0
35-
idna==3.10
38+
idna==3.7
39+
idutils==1.5.0
3640
ijson==3.3.0
37-
importlib_resources==6.5.2
38-
iniconfig==2.1.0
39-
isodate==0.7.2
41+
importlib_metadata==8.7.0
42+
importlib_resources==6.4.5
43+
iniconfig==2.0.0
44+
isbnlib==3.10.14
45+
isodate==0.6.1
4046
isoduration==20.11.0
41-
Jinja2==3.1.6
47+
Jinja2==3.1.4
4248
json-flattener==0.1.9
4349
jsonasobj==1.3.1
4450
jsonasobj2==1.0.4
4551
jsonlines==4.0.0
4652
jsonpatch==1.33
47-
jsonpath-ng==1.7.0
48-
jsonpointer==3.0.0
49-
jsonschema==4.23.0
50-
jsonschema-specifications==2024.10.1
53+
jsonpath-ng==1.6.1
54+
jsonpointer==2.4
55+
jsonschema==4.22.0
56+
jsonschema-specifications==2023.12.1
5157
kgcl-rdflib==0.5.0
5258
kgcl_schema==0.6.9
5359
lark==1.2.2
54-
linkml==1.8.7
60+
linkml==1.7.10
5561
linkml-dataops==0.1.0
5662
linkml-renderer==0.3.1
57-
linkml-runtime==1.9.1
63+
linkml-runtime==1.7.6
5864
linkml_owl==0.4.2
59-
lxml==5.3.2
60-
markdown-it-py==3.0.0
61-
MarkupSafe==3.0.2
62-
mdurl==0.1.2
65+
lxml==5.2.2
66+
MarkupSafe==2.1.5
6367
mistune==3.0.2
6468
more-click==0.1.2
65-
msgpack==1.1.0
69+
msgpack==1.0.8
6670
mypy-extensions==1.0.0
67-
ndex2==3.10.0
68-
networkx==3.4.2
71+
ndex2==3.9.0
72+
networkx==3.3
6973
nodeenv==1.9.1
70-
numpy==2.2.4
71-
oaklib==0.6.22
74+
numpy==2.1.1
75+
oaklib==0.6.16
7276
ols-client==0.1.4
7377
ontoportal-client==0.0.4
74-
openpyxl==3.1.5
75-
packaging==24.2
76-
pandas==2.2.3
78+
openpyxl==3.1.3
79+
packaging==24.0
80+
pandas==2.2.2
7781
pansql==0.0.1
78-
parse==1.20.2
79-
platformdirs==4.3.7
82+
parse==1.20.1
83+
platformdirs==4.3.2
8084
pluggy==1.5.0
8185
ply==3.11
8286
prefixcommons==0.1.12
83-
prefixmaps==0.2.6
84-
pronto==2.7.0
87+
prefixmaps==0.2.4
88+
pronto==2.5.7
8589
prov==1.5.1
86-
psutil==7.0.0
87-
pydantic==2.11.3
88-
pydantic_core==2.33.1
90+
psutil==6.0.0
91+
pydantic==2.7.4
92+
pydantic_core==2.18.4
8993
pydot==2.0.0
90-
Pygments==2.19.1
9194
PyJSG==0.11.10
92-
pyparsing==3.2.3
95+
pyparsing==3.1.2
9396
PyShEx==0.8.1
9497
PyShExC==0.9.1
95-
pysolr==3.10.0
96-
pystow==0.7.0
97-
pytest==8.3.5
98+
pysolr==3.9.0
99+
pystow==0.5.5
100+
pytest==8.2.2
98101
pytest-logging==2015.11.4
99102
python-dateutil==2.9.0.post0
100103
PyTrie==0.4.0
101-
pytz==2025.2
102-
PyYAML==6.0.2
104+
pytz==2024.1
105+
PyYAML==6.0.1
103106
ratelimit==2.2.1
104-
rdflib==7.1.4
107+
rdflib==7.0.0
105108
rdflib-jsonld==0.6.1
106109
rdflib-shim==1.0.3
107-
referencing==0.36.2
108-
regress==2025.3.1
110+
referencing==0.35.1
111+
regress==0.4.5
109112
requests==2.32.3
110113
requests-cache==1.2.1
111114
requests-toolbelt==1.0.0
112115
rfc3339-validator==0.1.4
113116
rfc3987==1.3.8
114-
rich==14.0.0
115-
rich-argparse==1.7.0
116-
rpds-py==0.24.0
117-
ruamel.yaml==0.18.10
118-
schema-salad==8.9.20250408123006
119-
scipy==1.15.2
120-
semsql==0.4.0
121-
setuptools==78.1.0
117+
rpds-py==0.18.1
118+
ruamel.yaml==0.18.6
119+
ruamel.yaml.clib==0.2.8
120+
schema-salad==8.5.20240503091721
121+
scipy==1.14.1
122+
semsql==0.3.3
123+
shellescape==3.8.1
122124
ShExJSG==0.8.2
123-
six==1.17.0
125+
six==1.16.0
124126
sortedcontainers==2.4.0
125127
sparqlslurper==0.5.1
126128
SPARQLWrapper==2.0.0
127-
spython==0.3.14
128-
SQLAlchemy==2.0.40
129+
spython==0.3.13
130+
SQLAlchemy==2.0.30
129131
SQLAlchemy-Utils==0.38.3
130-
sssom==0.4.15
131-
sssom-schema==1.0.0
132-
tenacity==9.1.2
133-
tqdm==4.67.1
134-
types-python-dateutil==2.9.0.20241206
135-
typing-inspection==0.4.0
136-
typing_extensions==4.13.2
137-
tzdata==2025.2
132+
sssom==0.4.11
133+
sssom-schema==0.15.2
134+
tenacity==9.0.0
135+
tomli==2.0.1
136+
tqdm==4.66.5
137+
types-python-dateutil==2.9.0.20240316
138+
typing_extensions==4.12.1
139+
tzdata==2024.1
138140
uri-template==1.3.0
139-
url-normalize==2.2.0
140-
urllib3==2.4.0
141+
url-normalize==1.4.3
142+
urllib3==2.2.1
141143
validators==0.34.0
142-
watchdog==6.0.0
143-
webcolors==24.11.1
144-
wrapt==1.17.2
144+
watchdog==4.0.1
145+
webcolors==24.6.0
146+
wrapt==1.16.0
147+
zipp==3.23.0

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ check-jsonschema
44
linkml-owl
55
linkml # use version required by linkml-owl above
66
semsql
7+
datacite

src/finalizing/misc-files.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,26 @@ import { resolve } from 'path';
22
import { listDeployed } from '../list.js';
33
import { readMetadata, readNormalizedMetadata } from '../normalization/utils.js';
44
import { getDigitalObjectInformation } from '../utils/digital-object.js';
5-
import { writeDoiXml } from './utils/generate-doi-xml.js';
5+
import { writeDoiFiles } from './utils/generate-doi-files.js';
66
import { writeIndexHtml } from './utils/generate-index-html.js';
77
import { writeReadmeMd } from './utils/generate-readme-md.js';
88

99
export function miscDoFiles(context) {
10-
const metadata = readMetadata(context);
11-
writeDoiXml(context, metadata);
12-
10+
deployDoiXml(context);
1311
const normalizedMetadata = readNormalizedMetadata(context);
1412
writeReadmeMd(context, normalizedMetadata);
1513
writeIndexHtml(context, normalizedMetadata);
1614
}
1715

1816
export function miscFiles(context) {
19-
for (const dataset of listDeployed(context).filter(doName => !doName.endsWith('/latest'))) {
17+
for (const dataset of listDeployed(context).filter((doName) => !doName.endsWith('/latest'))) {
2018
const doPath = resolve(context.doHome, dataset);
2119
const selectedDigitalObject = getDigitalObjectInformation(doPath, context.purlIri);
2220
miscDoFiles({ ...context, selectedDigitalObject });
2321
}
2422
}
2523

26-
2724
export function deployDoiXml(context) {
2825
const metadata = readMetadata(context);
29-
writeDoiXml(context, metadata);
26+
writeDoiFiles(context, metadata);
3027
}

src/finalizing/templates/doi-xml.njk

Lines changed: 0 additions & 77 deletions
This file was deleted.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import json
2+
import sys
3+
4+
from datacite import schema45
5+
6+
if __name__ == "__main__":
7+
input = sys.argv[1]
8+
output = sys.argv[2]
9+
10+
json_data = json.load(open(input, "r", encoding="utf8"))
11+
data = json_data["data"]["attributes"]
12+
13+
schema45.validator.validate(data)
14+
15+
doc = schema45.tostring(data)
16+
17+
with open(output, "w") as out:
18+
out.write(doc)

0 commit comments

Comments
 (0)