Publication
Publication Documentation sub-package for MaRDMO.
Provides everything needed to retrieve and document publications within RDMO:
- :mod:
~MaRDMO.publication.models— Dataclasses for Author, Journal, and Publication entities populated from SPARQL results, Crossref, DataCite, DOI resolution, zbMath, and ORCID APIs. - :mod:
~MaRDMO.publication.handlers— Signal handlers that fetch publication metadata and fill the questionnaire when a citation ID is saved. - :mod:
~MaRDMO.publication.providers— RDMO optionset provider for searching publications across MaRDI Portal and Wikidata. - :mod:
~MaRDMO.publication.worker— Background worker that retrieves full publication metadata (authors, journals) and writes it to the questionnaire. - :mod:
~MaRDMO.publication.utils— Helper functions for querying external citation APIs, resolving ORCiDs, and cleaning bibliographic data. - :mod:
~MaRDMO.publication.constants— Field mappings and relation lists used when writing publication data to the questionnaire and the MaRDI Portal.
Handlers
Module containing handlers for the Publication documentation sub-package.
Listens to RDMO model signals to keep publication-related questionnaire state
consistent. For example, cleans up dependent Value objects when a
publication set entry is deleted.
Provides:
- :class:
Information— signal receiver class that wires up publication-set relations in the questionnaire (relationmethod) publication_set_delete—post_deletereceiver that removes orphaned values when a publication value set is removed
Information
Class containing functions, querying external sources for specific entities and integrating the related metadata into the questionnaire.
Source code in MaRDMO/publication/handlers.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 | |
__init__()
Load publication questions, ontology registries, and the base URI.
Source code in MaRDMO/publication/handlers.py
49 50 51 52 53 54 | |
citation(instance)
Handle a Publication ID-field save: populate citation metadata from the MaRDI Portal or Wikidata.
Extracts project, text, external_id, set_index, catalog, and snapshot
from instance and delegates to :meth:fill_citation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
instance
|
RDMO :class: |
required |
Source code in MaRDMO/publication/handlers.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | |
fill_citation(project, text, external_id, set_index, catalog='', snapshot=None)
Populate publication citation metadata from the MaRDI Portal or Wikidata.
Cleans any previously stored background data, then (if text is set
and not "not found") adds basic label/description, fetches SPARQL
citation data, stores references, and writes catalog-specific
Publication–Entity / Publication–Algorithm / Publication–Benchmark/Software
relations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
project
|
RDMO project instance. |
required | |
text
|
Raw ID-field text ( |
required | |
external_id
|
External ID string in |
required | |
set_index
|
Set-index of the publication page. |
required | |
catalog
|
Active catalog URI string (used for relation dispatch). |
''
|
|
snapshot
|
RDMO snapshot ( |
None
|
Source code in MaRDMO/publication/handlers.py
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 | |
publication_set_delete(sender, **kwargs)
Signal handler: delete hidden citation data when a Publication set page is removed.
Connected to the post_delete signal on :class:~rdmo.projects.models.Value.
When the deleted value corresponds to the top-level Publication attribute,
removes all background citation fields (item info, language, journal, author)
for that set index.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sender
|
The :class: |
required | |
**kwargs
|
Signal keyword arguments; |
{}
|
Source code in MaRDMO/publication/handlers.py
183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 | |
Models
Dataclasses that represent bibliographic entities in the Publication catalog.
Each class maps to one entity type retrieved from external sources (Crossref, ZbMATH, Wikidata, ORCID) during publication metadata collection. Instances are populated from API responses and carry all fields needed to fill questionnaire answers and produce export entries.
Provides:
- :class:
Author— person entity with ORCID, ZbMATH, and Wikidata identifiers - :class:
Journal— publication venue with ISSN and portal identifiers - :class:
Publication— central bibliographic record linking authors and journal
Author
dataclass
Data Class For Authors
Source code in MaRDMO/publication/models.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 | |
from_crossref(raw)
classmethod
Build an Author instance from a single Crossref contributor dict.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
raw
|
str
|
Dict-like object from the Crossref |
required |
Returns:
| Type | Description |
|---|---|
Author
|
Author instance; |
Author
|
but no MaRDI Portal entry exists yet. |
Source code in MaRDMO/publication/models.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | |
from_datacite(raw)
classmethod
Build an Author instance from a single DataCite creator dict.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
raw
|
str
|
Dict-like object from the DataCite |
required |
Returns:
| Type | Description |
|---|---|
Author
|
Author instance; |
Author
|
but no MaRDI Portal entry exists yet. |
Source code in MaRDMO/publication/models.py
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 | |
from_doi(raw)
classmethod
Build an Author instance from a single DOI API author dict.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
raw
|
str
|
Dict-like object from the DOI API |
required |
Returns:
| Type | Description |
|---|---|
Author
|
Author instance; |
Author
|
but no MaRDI Portal entry exists yet. |
Source code in MaRDMO/publication/models.py
169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 | |
from_orcid(raw)
classmethod
Build an Author instance from an ORCID API person record.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
raw
|
str
|
Dict-like object from the ORCID API with an optional |
required |
Returns:
| Type | Description |
|---|---|
Author
|
Author instance; |
Author
|
but no MaRDI Portal entry exists yet. |
Source code in MaRDMO/publication/models.py
269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 | |
from_query(raw)
classmethod
Parse a <|>-delimited SPARQL result string into an Author instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
raw
|
str
|
Space-and-pipe-delimited string with six fields: identifier, label, description, orcid_id, zbmath_id, wikidata_id. |
required |
Returns:
| Type | Description |
|---|---|
Author
|
Author instance populated from the parsed fields. |
Source code in MaRDMO/publication/models.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | |
from_zbmath(raw)
classmethod
Build an Author instance from a single zbMath author dict.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
raw
|
str
|
Dict-like object from the zbMath |
required |
Returns:
| Type | Description |
|---|---|
Author
|
Author instance; |
Author
|
but no MaRDI Portal entry exists yet. |
Source code in MaRDMO/publication/models.py
219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 | |
Journal
dataclass
Data Class For Journals
Source code in MaRDMO/publication/models.py
319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 | |
from_crossref(ids, item)
classmethod
Build a Journal instance from Crossref ISSN and title data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ids
|
list
|
List of ISSN strings from the Crossref response (may be empty). |
required |
item
|
list
|
List of container-title strings from the Crossref response (may be empty). |
required |
Returns:
| Type | Description |
|---|---|
Journal
|
Journal instance; |
Journal
|
but no MaRDI Portal entry exists yet. |
Source code in MaRDMO/publication/models.py
361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 | |
from_datacite(ids, item)
classmethod
Build a Journal instance from DataCite related-identifier and related-item data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ids
|
list
|
List of relatedIdentifier dicts from the DataCite response (may be empty). |
required |
item
|
list
|
List of relatedItem dicts from the DataCite response (may be empty). |
required |
Returns:
| Type | Description |
|---|---|
Journal
|
Journal instance; |
Journal
|
but no MaRDI Portal entry exists yet. |
Source code in MaRDMO/publication/models.py
403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 | |
from_doi(ids, item)
classmethod
Build a Journal instance from DOI API ISSN and container-title data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ids
|
list
|
List of ISSN strings from the DOI API response (may be empty). |
required |
item
|
str
|
Container-title string from the DOI API response (may be None). |
required |
Returns:
| Type | Description |
|---|---|
Journal
|
Journal instance; |
Journal
|
but no MaRDI Portal entry exists yet. |
Source code in MaRDMO/publication/models.py
446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 | |
from_query(raw)
classmethod
Parse a <|>-delimited SPARQL result string into a Journal instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
raw
|
str
|
Space-and-pipe-delimited string with three or four fields: identifier, label, description, and optionally issn. |
required |
Returns:
| Type | Description |
|---|---|
Journal
|
Journal instance populated from the parsed fields. |
Source code in MaRDMO/publication/models.py
327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 | |
from_zbmath(raw)
classmethod
Build a Journal instance from a zbMath source dict.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
raw
|
dict
|
The |
required |
Returns:
| Type | Description |
|---|---|
Journal
|
Journal instance; |
Journal
|
but no MaRDI Portal entry exists yet. |
Source code in MaRDMO/publication/models.py
488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 | |
Publication
dataclass
Data Class For Publications
Source code in MaRDMO/publication/models.py
533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 | |
from_crossref(raw_data)
classmethod
Build a Publication instance from a Crossref API response.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
raw_data
|
dict
|
Response object whose |
required |
Returns:
| Type | Description |
|---|---|
Publication
|
Publication instance populated from the Crossref metadata. |
Source code in MaRDMO/publication/models.py
694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 | |
from_datacite(raw_data)
classmethod
Build a Publication instance from a DataCite API response.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
raw_data
|
dict
|
Response object whose |
required |
Returns:
| Type | Description |
|---|---|
Publication
|
Publication instance populated from the DataCite metadata. |
Source code in MaRDMO/publication/models.py
781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 | |
from_doi(raw_data)
classmethod
Build a Publication instance from a DOI resolution API response.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
raw_data
|
dict
|
Response object whose |
required |
Returns:
| Type | Description |
|---|---|
Publication
|
Publication instance populated from the DOI metadata. |
Source code in MaRDMO/publication/models.py
876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 | |
from_query(raw_data)
classmethod
Build a Publication instance from a SPARQL query result list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
raw_data
|
dict
|
List of SPARQL result row dicts; the first element is used.
Expected keys include |
required |
Returns:
| Type | Description |
|---|---|
Publication
|
Publication instance populated from the SPARQL result. |
Source code in MaRDMO/publication/models.py
571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 | |
from_zbmath(raw_data)
classmethod
Build a Publication instance from a zbMath API response.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
raw_data
|
dict
|
Response object whose |
required |
Returns:
| Type | Description |
|---|---|
Publication
|
Publication instance populated from the zbMath metadata. |
Source code in MaRDMO/publication/models.py
963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 | |
get_options()
classmethod
Return the cached option-label mapping used by all class generators.
Returns:
| Type | Description |
|---|---|
dict
|
Dict mapping option keys (e.g. |
dict
|
loaded once and cached as a class variable. |
Source code in MaRDMO/publication/models.py
559 560 561 562 563 564 565 566 567 568 569 | |
Providers
RDMO optionset providers for the Publication documentation catalog.
Implements the provider that searches MaRDI Portal and Wikidata for publication items to let users look up and attach existing publications to their project.
Provides:
- :class:
Publication— searches external sources for publication items; refreshes questionnaire fields upon selection, no creation
Publication
Bases: Provider
Publication Provider (MaRDI Portal / Wikidata), No User Creation, Refresh Upon Selection
Source code in MaRDMO/publication/providers.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | |
get_options(project, search=None, user=None, site=None)
Query external knowledge-graph source(s) and return matching options.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
project
|
RDMO project instance (unused). |
required | |
search
|
Search string entered by the user; returns empty list when fewer than 3 characters. |
None
|
|
user
|
Requesting user (unused). |
None
|
|
site
|
Current site (unused). |
None
|
Returns:
| Type | Description |
|---|---|
|
List of |
Source code in MaRDMO/publication/providers.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | |
Workers
Background workers for collecting and exporting publication metadata.
Two worker classes handle different phases of publication documentation: retrieval (fetching bibliographic data from external APIs) and export (formatting and pushing data to the MaRDI Portal).
Provides:
- :class:
PublicationRetriever— fetches citation metadata for a DOI and writes the results into the questionnaire via the adders module - :class:
PublicationExport— base class for catalog-specific export workers that package questionnaire answers for portal submission
PublicationExport
Base class providing author, journal, and publication export helpers.
Subclassed by :class:~MaRDMO.model.worker.PrepareModel and
:class:~MaRDMO.algorithm.worker.PrepareAlgorithm. Holds the shared
Wikibase vocabulary and the private _export_* helpers that build
publication-related payload entries.
Source code in MaRDMO/publication/worker.py
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 | |
__init__()
Initialise with Wikibase properties and items from MaRDMOConfig.
Source code in MaRDMO/publication/worker.py
164 165 166 167 | |
PublicationRetriever
Retrieve Metadata from MaRDI Portal, Wikidata, and other sources like Crossref, DataCite, zbMath, DOI, and ORCid for Workflow, Model, and Algorithm documentation.
Source code in MaRDMO/publication/worker.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 | |
get_information(project, snapshot, answers, options)
Fetch and store citation metadata for all publications in answers.
Iterates over answers["publication"], skips entries without an ID
or (for workflow catalogs) entries not flagged for export, then resolves
each publication via :func:~.utils.get_citation and writes the
resulting metadata fields (title, year, language, journal, authors,
etc.) back into the questionnaire.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
project
|
RDMO project instance. |
required | |
snapshot
|
RDMO snapshot ( |
required | |
answers
|
Top-level answers dict (mutated in place with citation data). |
required | |
options
|
Global RDMO options dict (used for the |
required |
Source code in MaRDMO/publication/worker.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 | |
Constants
Compile-time constants for the Publication documentation sub-package.
Defines the property-to-predicate mappings (PROPS), item-info dicts
(ITEMINFOS, CITATIONINFOS), and lookup tables for journals, authors,
and languages that the publication worker and handlers consume.
These constants are imported directly; no factory functions are needed because the publication constants do not depend on the live RDMO database state.
Utils
Utility functions for fetching and normalizing publication metadata.
Provides helpers that query external bibliographic APIs (Crossref, DataCite,
ZbMATH, ORCID), parse their responses, and map the results to the internal
:class:~MaRDMO.publication.models.Author, :class:~MaRDMO.publication.models.Journal,
and :class:~MaRDMO.publication.models.Publication dataclasses.
Provides:
get_citation— primary entry point: fetch full citation data for a DOIget_crossref_data— query the Crossref REST APIget_datacite_data— query the DataCite REST APIget_doi_data— DOI resolver wrapperget_zbmath_data— query the ZbMATH Open APIget_orcids— look up ORCID IDs for publication authorsget_author_by_orcid— fetch a single author record from the ORCID APIextract_authors— parse author list from API responseextract_journals— parse journal info from API responseassign_id— attach portal / ZbMATH IDs to entity dictsassign_orcid— attach ORCID identifiers to author dictsclean_background_data— remove stale pre-existing answers before filling new onesadditional_queries— run supplementary SPARQL queries for linked entities
additional_queries(publication, choice, key, parameter, function)
Run supplemental Wikidata and MaRDI Portal SPARQL queries for a sub-entity type.
Queries first Wikidata, then MaRDI Portal, using the results of the first
to refine the second. Calls function to parse raw SPARQL results into
model instances, then calls :func:assign_id to back-fill any missing IDs
on publication[choice].<key>.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
publication
|
Dict mapping source keys to :class: |
required | |
choice
|
Active source key (e.g. |
required | |
key
|
Sub-entity attribute name and query file stem
( |
required | |
parameter
|
Dict with |
required | |
function
|
Callable that parses raw SPARQL results into a |
required |
Source code in MaRDMO/publication/utils.py
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | |
assign_id(entities, target, prefix)
Back-fill missing or placeholder IDs on entities from target.
Matches entities by label (case-insensitive) and overwrites the id,
label, and description fields when the entity currently has no ID
or a placeholder such as "not found".
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entities
|
Iterable of entity dataclass instances to update. |
required | |
target
|
Dict of resolved entities (from SPARQL results) to match against. |
required | |
prefix
|
Source prefix prepended to the resolved ID (e.g. |
required |
Source code in MaRDMO/publication/utils.py
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | |
assign_orcid(publication, source, id_type='orcid')
Back-fill missing ORCID iDs on authors from the orcid lookup result.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
publication
|
Dict mapping source keys to :class: |
required | |
source
|
Key of the publication entry whose authors are updated. |
required | |
id_type
|
Key for the ORCID lookup result dict (default |
'orcid'
|
Source code in MaRDMO/publication/utils.py
135 136 137 138 139 140 141 142 143 144 145 146 147 148 | |
clean_background_data(key_dict, questions, project, snapshot, set_index)
Delete questionnaire values that were temporarily saved during background processing.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key_dict
|
Iterable of question-dict keys to delete. |
required | |
questions
|
Questions dict mapping keys to attribute URI fragments. |
required | |
project
|
RDMO project instance. |
required | |
snapshot
|
RDMO snapshot ( |
required | |
set_index
|
Set-index of the entries to delete. |
required |
Source code in MaRDMO/publication/utils.py
150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | |
extract_authors(data)
Parse SPARQL result rows into a dict of :class:~.models.Author instances.
Expects data[0]["author_info"]["value"] as a " || "-delimited
string of author records.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
Raw SPARQL result list (may be empty). |
required |
Returns:
| Type | Description |
|---|---|
|
Dict |
|
|
data is falsy. |
Source code in MaRDMO/publication/utils.py
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 | |
extract_journals(data)
Parse SPARQL result rows into a dict of :class:~.models.Journal instances.
Expects data[0]["journal_info"]["value"] as a " || "-delimited
string of journal records.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
Raw SPARQL result list (may be empty). |
required |
Returns:
| Type | Description |
|---|---|
|
Dict |
|
|
data is falsy. |
Source code in MaRDMO/publication/utils.py
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 | |
get_author_by_orcid(orcid_id)
Fetch personal-details for a researcher from the ORCID public API.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
orcid_id
|
ORCID iD string (e.g. |
required |
Returns:
| Type | Description |
|---|---|
|
class: |
|
|
the researcher's personal details on success, or the caught |
|
|
class: |
Source code in MaRDMO/publication/utils.py
489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 | |
get_citation(doi)
Retrieve full citation metadata for a DOI from multiple sources.
Queries MaRDI Portal and Wikidata via SPARQL in parallel. If neither yields a result, falls back to CrossRef, DataCite, zbMath, and the DOI metadata service. Then enriches authors with ORCID iDs and runs supplemental author/journal queries against MaRDI Portal and Wikidata.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
doi
|
DOI string (e.g. |
required |
Returns:
| Type | Description |
|---|---|
|
Dict mapping source keys ( |
|
|
etc.) to :class: |
|
|
dict if doi does not match the expected format. |
Source code in MaRDMO/publication/utils.py
210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 | |
get_crossref_data(doi)
Fetch citation metadata for doi from the CrossRef REST API.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
doi
|
DOI string. |
required |
Returns:
| Type | Description |
|---|---|
|
class: |
|
|
class: |
Source code in MaRDMO/publication/utils.py
386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 | |
get_datacite_data(doi)
Fetch citation metadata for doi from the DataCite REST API.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
doi
|
DOI string. |
required |
Returns:
| Type | Description |
|---|---|
|
class: |
|
|
class: |
Source code in MaRDMO/publication/utils.py
406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 | |
get_doi_data(doi)
Fetch citation metadata for doi from the DOI metadata service.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
doi
|
DOI string. |
required |
Returns:
| Type | Description |
|---|---|
|
class: |
|
|
class: |
Source code in MaRDMO/publication/utils.py
426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 | |
get_orcids(doi)
Query the ORCID public API for researchers associated with doi.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
doi
|
DOI string used as the |
required |
Returns:
| Type | Description |
|---|---|
|
class: |
|
|
an |
|
|
class: |
Source code in MaRDMO/publication/utils.py
467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 | |
get_zbmath_data(doi)
Fetch citation metadata for doi from the zbMath Open API.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
doi
|
DOI string. |
required |
Returns:
| Type | Description |
|---|---|
|
class: |
|
|
class: |
Source code in MaRDMO/publication/utils.py
447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 | |