Interdisciplinary Workflow
Interdisciplinary Workflow Documentation sub-package for MaRDMO.
Provides everything needed to document interdisciplinary research workflows within RDMO:
- :mod:
~MaRDMO.workflow.models— Dataclasses for ProcessStep, Method, Software, Hardware, and DataSet entities from MaRDI Portal / Wikidata, as well as Variables and Parameters. - :mod:
~MaRDMO.workflow.handlers— Signal handlers that populate the questionnaire when a software, hardware, instrument, data set, method, or process-step ID is saved. - :mod:
~MaRDMO.workflow.providers— RDMO optionset providers for searching software, hardware, instruments, data sets, methods, process steps, disciplines, and workflow tasks in external knowledge graphs. - :mod:
~MaRDMO.workflow.worker— Background worker for generating workflow previews and exporting workflow entries to the MaRDI Portal. - :mod:
~MaRDMO.workflow.utils— Helpers for partitioning disciplines, extracting data-set size, reference, and archive metadata. - :mod:
~MaRDMO.workflow.constants— URI-prefix maps, property lists, and reproducibility vocabulary for the workflow catalog.
Handlers
Module containing Handlers for the Interdisciplinary Workflow Documentation.
Information inherits _entry, _collect_existing_ids, _hydrate_relatants, and _fill from BaseInformation (MaRDMO/handler_base.py).
Information
Bases: BaseInformation
Handlers for the Workflow Documentation questionnaire.
Source code in MaRDMO/workflow/handlers.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 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 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 531 532 533 534 535 536 537 538 539 540 541 542 543 | |
__init__()
Load workflow questions, base URI, and RDMO options.
Source code in MaRDMO/workflow/handlers.py
27 28 29 30 31 | |
data_set(instance)
Handle Data Set ID save: hydrate basics and SPARQL data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
instance
|
RDMO :class: |
required |
Source code in MaRDMO/workflow/handlers.py
61 62 63 64 65 66 67 | |
hardware(instance)
Handle Hardware ID save: hydrate basics and SPARQL data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
instance
|
RDMO :class: |
required |
Source code in MaRDMO/workflow/handlers.py
45 46 47 48 49 50 51 | |
instrument(instance)
Handle Instrument ID save: hydrate basics only (no SPARQL data available).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
instance
|
RDMO :class: |
required |
Source code in MaRDMO/workflow/handlers.py
53 54 55 56 57 58 59 | |
method(instance)
Handle Method ID save: hydrate basics and cascade to Software/Instrument.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
instance
|
RDMO :class: |
required |
Source code in MaRDMO/workflow/handlers.py
69 70 71 72 73 74 75 | |
process_step(instance)
Handle Process Step ID save: hydrate basics and cascade to all related entities.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
instance
|
RDMO :class: |
required |
Source code in MaRDMO/workflow/handlers.py
77 78 79 80 81 82 83 | |
software(instance)
Handle Software ID save: hydrate basics and SPARQL data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
instance
|
RDMO :class: |
required |
Source code in MaRDMO/workflow/handlers.py
37 38 39 40 41 42 43 | |
Models
Dataclasses that represent entities in the Interdisciplinary Workflow documentation catalog.
Each class maps to one entity type collected from MaRDI Portal and Wikidata during workflow documentation. Instances are populated from SPARQL query results and carry the fields needed to render questionnaire answers and export entries.
Provides:
- :class:`ModelProperties — properties of model associated with a workflow
- :class:`Variables — variables of model associated with a workflow
- :class:`Parameters — parameters of model associated with a workflow
- :class:
ProcessStep— process steps associated with a workflow - :class: Method — methods associated with a workflow
- :class: Software — software associated with a workflow
- :class: Hardware — hardware associated with a workflow
- :class: DataSet — data sets associated with a workflow
DataSet
dataclass
Metadata and relations of a Data Set entity from MaRDI/Wikidata.
Source code in MaRDMO/workflow/models.py
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 | |
from_query(raw_data)
classmethod
Parse a single-item SPARQL result (backward-compatible).
Source code in MaRDMO/workflow/models.py
323 324 325 326 | |
from_query_batch(raw_data)
classmethod
Parse a batch SPARQL result into {external_id: instance} dict.
Source code in MaRDMO/workflow/models.py
328 329 330 331 332 333 334 335 | |
from_query_single(data)
classmethod
Parse one SPARQL result row into a DataSet instance.
Source code in MaRDMO/workflow/models.py
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 | |
Hardware
dataclass
Node/core counts and CPU relations of a Hardware entity.
Source code in MaRDMO/workflow/models.py
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 | |
from_query(raw_data)
classmethod
Parse a single-item SPARQL result (backward-compatible).
Source code in MaRDMO/workflow/models.py
286 287 288 289 | |
from_query_batch(raw_data)
classmethod
Parse a batch SPARQL result into {external_id: instance} dict.
Source code in MaRDMO/workflow/models.py
291 292 293 294 295 296 297 298 | |
from_query_single(data)
classmethod
Parse one SPARQL result row into a Hardware instance.
Source code in MaRDMO/workflow/models.py
300 301 302 303 304 305 306 307 | |
Method
dataclass
Relations of a Method entity from MaRDI/Wikidata.
Source code in MaRDMO/workflow/models.py
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 | |
from_query(raw_data)
classmethod
Parse a single-item SPARQL result (backward-compatible).
Source code in MaRDMO/workflow/models.py
209 210 211 212 | |
from_query_batch(raw_data)
classmethod
Parse a batch SPARQL result into {external_id: instance} dict.
Source code in MaRDMO/workflow/models.py
214 215 216 217 218 219 220 221 | |
from_query_single(data)
classmethod
Parse one SPARQL result row into a Method instance.
Source code in MaRDMO/workflow/models.py
223 224 225 226 227 228 229 230 231 232 233 | |
ModelProperties
dataclass
Properties (time/space discretisation) of a mathematical model.
Source code in MaRDMO/workflow/models.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 | |
from_query(raw_data)
classmethod
Parse a single SPARQL result row into a ModelProperties instance.
Source code in MaRDMO/workflow/models.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | |
Parameters
dataclass
A single parameter entry from MathModDB.
Source code in MaRDMO/workflow/models.py
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 | |
from_query(data)
classmethod
Parse one SPARQL result row into a Parameters instance.
Source code in MaRDMO/workflow/models.py
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | |
ProcessStep
dataclass
Relations of a Process Step entity from MaRDI/Wikidata.
Source code in MaRDMO/workflow/models.py
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 | |
from_query(raw_data)
classmethod
Parse a single-item SPARQL result (backward-compatible).
Source code in MaRDMO/workflow/models.py
158 159 160 161 | |
from_query_batch(raw_data)
classmethod
Parse a batch SPARQL result into {external_id: instance} dict.
Source code in MaRDMO/workflow/models.py
163 164 165 166 167 168 169 170 | |
from_query_single(data)
classmethod
Parse one SPARQL result row into a ProcessStep instance.
Source code in MaRDMO/workflow/models.py
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 | |
Software
dataclass
References and relations of a Software entity from MaRDI/Wikidata.
Source code in MaRDMO/workflow/models.py
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 | |
from_query(raw_data)
classmethod
Parse a single-item SPARQL result (backward-compatible).
Source code in MaRDMO/workflow/models.py
244 245 246 247 | |
from_query_batch(raw_data)
classmethod
Parse a batch SPARQL result into {external_id: instance} dict.
Source code in MaRDMO/workflow/models.py
249 250 251 252 253 254 255 256 | |
from_query_single(data)
classmethod
Parse one SPARQL result row into a Software instance.
Source code in MaRDMO/workflow/models.py
258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 | |
Variables
dataclass
A single variable entry from MathModDB.
Source code in MaRDMO/workflow/models.py
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 | |
from_query(data)
classmethod
Parse one SPARQL result row into a Variables instance.
Source code in MaRDMO/workflow/models.py
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 | |
Providers
RDMO optionset providers for the Workflow documentation catalog.
Each provider class implements get_options and is referenced from the
workflow catalog configuration. Providers query MaRDI Portal and Wikidata
for entity suggestions covering research disciplines, methods, tasks, hardware,
instruments, data sets, process steps, and related mathematical models.
Provides:
- :class:
MaRDIAndWikidataSearch— generic entity search across MaRDI Portal and Wikidata - :class:
MainMathematicalModel— look up the main mathematical model for a workflow - :class:
Method— numerical/analytical method lookup; refresh on select - :class:
RelatedMethod— method lookup with optional user creation - :class:
WorkflowTask— task/computation step lookup; refresh on select - :class:
Hardware— hardware platform lookup; refresh on select - :class:
Instrument— scientific instrument lookup; refresh on select - :class:
DataSet— data set lookup; refresh on select - :class:
RelatedInstrument— instrument lookup with optional user creation - :class:
RelatedDataSet— data-set lookup with optional user creation - :class:
ProcessStep— workflow process-step lookup; refresh on select - :class:
Discipline— research discipline lookup sourced from questionnaire answers
DataSet
Bases: Provider
Data Set Provider (MaRDI Portal / Wikidata), No User Creation, Refresh Upon Selection
Source code in MaRDMO/workflow/providers.py
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 | |
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 (used for user-entry lookups when applicable). |
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/workflow/providers.py
296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 | |
Discipline
Bases: Provider
Discipline Provider (MaRDI Portal / Wikidata / MSC), No User Creation, Refresh Upon Selection
Source code in MaRDMO/workflow/providers.py
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 | |
get_options(project, search=None, user=None, site=None)
Query knowledge graphs and the MSC 2020 classification for matching disciplines.
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 |
|---|---|
|
Combined, sorted list of up to 30 |
|
|
from MaRDI Portal / Wikidata ( |
Source code in MaRDMO/workflow/providers.py
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 | |
Hardware
Bases: Provider
Hardware Provider (MaRDI Portal / Wikidata), No User Creation, Refresh Upon Selection
Source code in MaRDMO/workflow/providers.py
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 | |
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 (used for user-entry lookups when applicable). |
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/workflow/providers.py
238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 | |
Instrument
Bases: Provider
Instrument Provider (MaRDI Portal / Wikidata), No User Creation, Refresh Upon Selection
Source code in MaRDMO/workflow/providers.py
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 | |
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 (used for user-entry lookups when applicable). |
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/workflow/providers.py
267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 | |
MaRDIAndWikidataSearch
Bases: Provider
General Provider (MaRDI Portal / Wikidata), No User Creation, No Refresh Upon Selection
Source code in MaRDMO/workflow/providers.py
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 | |
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 (used for user-entry lookups when applicable). |
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/workflow/providers.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | |
MainMathematicalModel
Bases: Provider
Main Mathematical Model Provider (MaRDI Portal), No User Creation, No Refresh Upon Selection
Source code in MaRDMO/workflow/providers.py
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 | |
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 (used for user-entry lookups when applicable). |
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/workflow/providers.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | |
Method
Bases: Provider
Method Provider (MaRDI Portal / Wikidata), No User Creation, Refresh Upon Selection
Source code in MaRDMO/workflow/providers.py
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 | |
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 (used for user-entry lookups when applicable). |
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/workflow/providers.py
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | |
ProcessStep
Bases: Provider
Process Step Provider (MaRDI Portal / Wikidata), No User Creation, Refresh Upon Selection
Source code in MaRDMO/workflow/providers.py
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 | |
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 (used for user-entry lookups when applicable). |
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/workflow/providers.py
395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 | |
RelatedDataSet
Bases: Provider
Data Set Provider (MaRDI Portal / Wikidata), User Creation, No Refresh Upon Selection
Source code in MaRDMO/workflow/providers.py
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 | |
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 (used for user-entry lookups when applicable). |
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/workflow/providers.py
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 | |
RelatedInstrument
Bases: Provider
Instrument Provider (MaRDI Portal / Wikidata), User Creation, No Refresh Upon Selection
Source code in MaRDMO/workflow/providers.py
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 | |
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 (used for user-entry lookups when applicable). |
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/workflow/providers.py
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 | |
RelatedMethod
Bases: Provider
Method Provider (MaRDI Portal / Wikidata), User Creation, No Refresh Upon Selection
Source code in MaRDMO/workflow/providers.py
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 | |
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 (used for user-entry lookups when applicable). |
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/workflow/providers.py
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 | |
WorkflowTask
Bases: Provider
Task Provider (MaRDI Portal), User Creation, No Refresh Upon Selection
Source code in MaRDMO/workflow/providers.py
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 | |
get_options(project, search=None, user=None, site=None)
Query the MaRDI Portal for Computational Tasks linked to the currently selected Model.
Reads the Model ID from the questionnaire, fetches associated Task items via SPARQL, and returns them as options.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
project
|
RDMO project instance used to look up the current model ID. |
required | |
search
|
Unused (tasks are filtered by model, not free-text). |
None
|
|
user
|
Requesting user (unused). |
None
|
|
site
|
Current site (unused). |
None
|
Returns:
| Type | Description |
|---|---|
|
List of |
Source code in MaRDMO/workflow/providers.py
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 | |
Workers
Worker module for Interdisciplinary Workflow preview and export.
Provides :class:prepareWorkflow, which assembles RDMO questionnaire answers
into a :class:~MaRDMO.payload.GeneratePayload ready for submission to the
MaRDI Portal Wikibase instance.
prepareWorkflow
Prepare interdisciplinary workflow answers for preview and export.
Loads Wikibase vocabulary (items and properties) on instantiation so
they are available to both :meth:preview and :meth:export.
Source code in MaRDMO/workflow/worker.py
18 19 20 21 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 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 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 531 532 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 1068 1069 | |
__init__()
Initialise with Wikibase items and properties from MaRDMOConfig.
Source code in MaRDMO/workflow/worker.py
25 26 27 28 | |
export(data, title, url)
Assemble and return the complete Wikibase payload for a Workflow documentation export.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
Top-level workflow answers dict produced by |
required | |
title
|
Workflow title string used to seed item labels. |
required | |
url
|
Target Wikibase API URL for the upload. |
required |
Returns:
| Type | Description |
|---|---|
|
Tuple |
|
|
meth: |
Source code in MaRDMO/workflow/worker.py
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 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 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 531 532 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 1068 1069 | |
preview(data)
Enrich workflow answers with supplemental MaRDI Portal data for preview rendering.
Fetches model properties, process-step entities, and research information via SPARQL and merges them into data so the preview template can render a complete picture.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
Top-level workflow answers dict (mutated in place). |
required |
Returns:
| Type | Description |
|---|---|
|
The mutated data dict. |
Source code in MaRDMO/workflow/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 | |
Constants
Compile-time constants and configuration builders for the Workflow catalog.
Centralises the property URIs, question/item mappings, and publication-order
definitions used by the workflow documentation sub-package at runtime.
Values are loaded once from the RDMO database via the getters helpers
and then referenced by handlers, providers, and workers.
Provides:
get_uri_prefix_map()— returns the{prefix: URI}map used to expand compact IDsorder_to_publish()— returns the ordered list of workflow attributes for portal export- Module-level constants built from the above
get_uri_prefix_map()
Build the attribute-URI → section config mapping for the Workflow Documentation.
Maps each relation attribute URI to the corresponding questionnaire section metadata needed to add or hydrate the related entity.
Returns:
| Type | Description |
|---|---|
|
Dict mapping full RDMO attribute URI strings to dicts with keys |
|
|
|
Source code in MaRDMO/workflow/constants.py
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 | |
order_to_publish()
Build an ordered mapping of publishing option keys to (rank, option_value) tuples.
Returns:
| Type | Description |
|---|---|
|
Dict |
|
|
where values are resolved RDMO option strings. |
Source code in MaRDMO/workflow/constants.py
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | |
Utils
Utility functions for extracting and normalising workflow-related data.
Provides helpers that read structured answers from the RDMO questionnaire and derive derived values (discipline labels, data-set sizes, references, archive URLs) needed by the workflow worker and handler layers.
Provides:
get_discipline— derive the research discipline label from questionnaire answersget_size— extract the data-set size value from answer optionsget_reference— extract a data-set or instrument reference identifierget_archive— extract the data-archive URL or identifier
get_archive(data, options)
Extract archival intent and optional end-year from a data-set answer dict.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
Answer sub-dict for the data-set archival questions. |
required | |
options
|
Options dict mapping RDMO option URIs to string values. |
required |
Returns:
| Type | Description |
|---|---|
|
|
|
|
year is the first four characters of the |
|
|
an empty string if no date was given. |
Source code in MaRDMO/workflow/utils.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 | |
get_discipline(answers)
Partition process-step disciplines into non-math and MSC (math subject classification) categories.
Iterates over all processstep discipline entries in answers, deduplicates
them by ID, and adds two new top-level keys to answers:
nonmathdiscipline– items with amardi:orwikidata:prefixmathsubject– items with anmsc:prefix
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
answers
|
Top-level answers dict (mutated in place). |
required |
Returns:
| Type | Description |
|---|---|
|
The mutated answers dict. |
Source code in MaRDMO/workflow/utils.py
17 18 19 20 21 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 | |
get_reference(data, options)
Build the reference dict for a data-set answer dict.
Iterates over the predefined data_set_reference_ids keys and maps
each present value to [option_uri, value] at a numeric index.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
Answer sub-dict for the data-set reference questions. |
required | |
options
|
Options dict mapping RDMO option URIs to string values. |
required |
Returns:
| Type | Description |
|---|---|
|
Dict |
|
|
empty dict if none are set. |
Source code in MaRDMO/workflow/utils.py
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 | |
get_size(data, options)
Extract the size unit and value from a data-set answer dict.
Resolves the unit from either size_unit (RDMO option URI) or falls
back to items when a record count is given.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
Answer sub-dict for the data-set size questions. |
required | |
options
|
Options dict mapping RDMO option URIs to string values. |
required |
Returns:
| Type | Description |
|---|---|
|
|
Source code in MaRDMO/workflow/utils.py
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | |