API Reference¶
Auto-generated from source docstrings via mkdocstrings.
GenericLinkedBaseModel¶
Base class for all linked data models. Provides JSON-LD serialization, type registry, and the to_jsonld() / to_json() methods.
Source code in src/oold/static.py
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 | |
export_schema(mode=SchemaExportMode.FULL, cutoff_base_cls=None, partial_mode=PartialSchemaExportMode.BASE_CLASS_CUTOFF, serialize=None)
classmethod
¶
Export the schema of the model as a dictionary.
Source code in src/oold/static.py
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 | |
from_json(json_dict)
abstractmethod
classmethod
¶
Constructs a model instance from a JSON representation. Note: the given JSON must contain a field to identify the model class, default is 'type'.
Source code in src/oold/static.py
227 228 229 230 231 232 233 | |
from_jsonld(jsonld)
abstractmethod
classmethod
¶
Constructs a model instance from a JSON-LD representation.
Source code in src/oold/static.py
216 217 218 219 220 | |
get_cls_iri()
abstractmethod
classmethod
¶
Get the IRI of the model itself. It will be used as key for a type registry and should be stored in the type field of the JSON(-LD) representation. May return both a expanded and a compacted IRI as list of strings.
Source code in src/oold/static.py
245 246 247 248 249 250 251 252 | |
get_type_field()
classmethod
¶
Get the name of the field that stores the type information. It is expected to be aliased or mapped to '@type' in JSON-LD. Defaults to 'type'.
Source code in src/oold/static.py
254 255 256 257 258 259 | |
remove_none(d)
staticmethod
¶
Remove None values from a dictionary recursively.
Source code in src/oold/static.py
186 187 188 189 190 191 192 193 194 | |
store_jsonld()
abstractmethod
¶
Store the model instance in a backend matching its IRI.
Source code in src/oold/static.py
240 241 242 243 | |
to_json()
abstractmethod
¶
Return the JSON representation of the object as a dictionary.
Source code in src/oold/static.py
235 236 237 238 | |
to_jsonld()
abstractmethod
¶
Returns the JSON-LD representation of the model instance as a dictionary.
Source code in src/oold/static.py
222 223 224 225 | |
LinkedBaseModel (v2)¶
Pydantic v2 implementation. Adds IRI-transparent field resolution, lazy loading, cast(), and the [] subscript operator.
Bases: BaseModel, GenericLinkedBaseModel
LinkedBaseModel for pydantic v2
Source code in src/oold/model/__init__.py
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 | |
cast(cls, none_to_default=False, remove_extra=False, silent=True, **kwargs)
¶
Cast this instance to a different model class.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cls
|
Target class to cast to. |
required | |
none_to_default
|
If True, attributes that are None or empty lists are removed so the target class uses its defaults. |
False
|
|
remove_extra
|
If True, drop fields not defined on the target class. |
False
|
|
silent
|
If True, suppress warnings about dropped fields. |
True
|
|
kwargs
|
Additional fields to set on the new instance. |
{}
|
Source code in src/oold/model/__init__.py
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 | |
cast_none_to_default(cls, **kwargs)
¶
Cast to target class, dropping None/empty list attributes.
Source code in src/oold/model/__init__.py
939 940 941 | |
from_json(data)
classmethod
¶
Constructs a model instance from a JSON representation.
Source code in src/oold/model/__init__.py
979 980 981 982 | |
from_jsonld(jsonld)
classmethod
¶
Constructs a model instance from a JSON-LD representation.
Source code in src/oold/model/__init__.py
947 948 949 950 | |
get_cls_iri()
classmethod
¶
Return the unique IRI of the class. Overwrite this method in the subclass.
Source code in src/oold/model/__init__.py
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_iri()
¶
Return the unique IRI of the object. Overwrite this method in the subclass.
Source code in src/oold/model/__init__.py
387 388 389 390 | |
get_iri_ref(field_name)
¶
Return the stored IRI reference string(s) for a field without triggering resolution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
field_name
|
str
|
The name of the field to retrieve the IRI reference for. |
required |
Returns:
| Type | Description |
|---|---|
A string IRI, a list of string IRIs, or ``None`` if no IRI is
|
stored for the given field. |
Source code in src/oold/model/__init__.py
694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 | |
get_raw(field_name)
¶
Return the raw value of a field without triggering IRI resolution.
Unlike normal attribute access which may trigger network calls to
resolve IRI references, this returns the Python object as stored
internally (None for unresolved IRIs, the model instance if
already resolved, or a plain value for non-IRI fields).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
field_name
|
str
|
The name of the field to retrieve. |
required |
Returns:
| Type | Description |
|---|---|
The raw field value, or ``None`` if the field is unresolved or
|
does not exist. |
Source code in src/oold/model/__init__.py
715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 | |
model_dump_json(*, indent=None, include=None, exclude=None, context=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False, round_trip=False, warnings=True, serialize_as_any=False, **dumps_kwargs)
¶
Usage docs: https://docs.pydantic.dev/2.10/concepts/serialization/#modelmodel_dump_json
Generates a JSON representation of the model using Pydantic's to_json method.
Args:
indent: Indentation to use in the JSON output.
If None is passed, the output will be compact.
include: Field(s) to include in the JSON output.
exclude: Field(s) to exclude from the JSON output.
context: Additional context to pass to the serializer.
by_alias: Whether to serialize using field aliases.
exclude_unset: Whether to exclude fields that have not been explicitly set.
exclude_defaults: Whether to exclude fields that are set to
their default value.
exclude_none: Whether to exclude fields that have a value of None.
round_trip: If True, dumped values should be valid as input
for non-idempotent types such as Json[T].
warnings: How to handle serialization errors. False/"none" ignores them,
True/"warn" logs errors, "error" raises a
[PydanticSerializationError][pydantic_core.PydanticSerializationError].
serialize_as_any: Whether to serialize fields with duck-typing serialization
behavior.
Returns: A JSON string representation of the model.
Source code in src/oold/model/__init__.py
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 | |
model_validate(obj, *, strict=None, from_attributes=None, context=None)
classmethod
¶
Validate a pydantic model instance.
Args: obj: The object to validate. strict: Whether to enforce types strictly. from_attributes: Whether to extract data from object attributes. context: Additional context to pass to the validator.
Raises: ValidationError: If the object could not be validated.
Returns: The validated model instance.
Source code in src/oold/model/__init__.py
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 | |
oold_query(item)
classmethod
¶
oold_query(item: str) -> Self
oold_query(item: list[str]) -> LinkedBaseModelList[Self]
oold_query(
item: Query | Condition | bool,
) -> Optional[LinkedBaseModelList[Self]]
Allow access to the class by its IRI.
Source code in src/oold/model/__init__.py
789 790 791 792 793 794 | |
store_jsonld()
¶
Store the model instance in a backend matching its IRI.
Source code in src/oold/model/__init__.py
745 746 747 | |
to_json(exclude_defaults=False)
¶
Return the JSON representation of the object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
exclude_defaults
|
bool
|
If True, fields with default values are excluded from the output. Useful for compact storage where defaults can be re-populated on deserialization via from_json(). |
False
|
Source code in src/oold/model/__init__.py
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 | |
to_jsonld()
¶
Return the RDF representation of the object as JSON-LD.
Source code in src/oold/model/__init__.py
943 944 945 | |
BaseController¶
Mixin for adding runtime behavior to a LinkedBaseModel subclass without polluting the data model or the type registry.
Base mixin for controllers that extend LinkedBaseModel data classes.
Overrides to_json() and to_jsonld() to serialize only the pure data model fields, stripping controller-only fields (e.g. archive_database, auto_archive, connection state).
The data model class is auto-detected from the MRO: the first LinkedBaseModel subclass that is not also a BaseController subclass.
Controllers are excluded from oold's type IRI registry (_types) so they don't replace their pure data model counterparts during backend resolution.
Source code in src/oold/model/__init__.py
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 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 | |
__setattr__(name, value, internal=False)
¶
Route private attrs through object.setattr to bypass Pydantic's field validation for controller state fields.
Source code in src/oold/model/__init__.py
1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 | |
LinkedBaseModel (v1 - legacy)¶
Pydantic v1 implementation. Use oold.model.LinkedBaseModel for new projects.
Bases: _LinkedBaseModel
LinkedBaseModel for pydantic v1
Source code in src/oold/model/v1/__init__.py
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 | |
cast(cls, none_to_default=False, remove_extra=False, silent=True, **kwargs)
¶
Cast this instance to a different model class.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cls
|
Target class to cast to. |
required | |
none_to_default
|
If True, attributes that are None or empty lists are removed so the target class uses its defaults. |
False
|
|
remove_extra
|
If True, drop fields not defined on the target class. |
False
|
|
silent
|
If True, suppress warnings about dropped fields. |
True
|
|
kwargs
|
Additional fields to set on the new instance. |
{}
|
Source code in src/oold/model/v1/__init__.py
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 | |
cast_none_to_default(cls, **kwargs)
¶
Cast to target class, dropping None/empty list attributes.
Source code in src/oold/model/v1/__init__.py
822 823 824 | |
dict(**kwargs)
¶
Override Pydantic v1 dict() to include iris values.
Ensures IRI-only fields (value=None, IRI in iris) are included in the output, including for nested model objects.
Source code in src/oold/model/v1/__init__.py
700 701 702 703 704 705 706 707 708 709 710 711 712 713 | |
from_json(json_dict)
classmethod
¶
Constructs a model instance from a JSON representation.
Source code in src/oold/model/v1/__init__.py
862 863 864 865 | |
from_jsonld(jsonld)
classmethod
¶
Constructs a model instance from a JSON-LD representation.
Source code in src/oold/model/v1/__init__.py
830 831 832 833 | |
get_cls_iri()
classmethod
¶
Return the unique IRI of the class. Overwrite this method in the subclass.
Source code in src/oold/model/v1/__init__.py
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 | |
get_iri()
¶
Return the unique IRI of the object. Overwrite this method in the subclass.
Source code in src/oold/model/v1/__init__.py
333 334 335 336 | |
get_iri_ref(field_name)
¶
Return the stored IRI reference string(s) for a field without triggering resolution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
field_name
|
str
|
The name of the field to retrieve the IRI reference for. |
required |
Returns:
| Type | Description |
|---|---|
A string IRI, a list of string IRIs, or ``None`` if no IRI is
|
stored for the given field. |
Source code in src/oold/model/v1/__init__.py
552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 | |
get_raw(field_name)
¶
Return the raw value of a field without triggering IRI resolution.
Unlike normal attribute access which may trigger network calls to
resolve IRI references, this returns the Python object as stored
internally (None for unresolved IRIs, the model instance if
already resolved, or a plain value for non-IRI fields).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
field_name
|
str
|
The name of the field to retrieve. |
required |
Returns:
| Type | Description |
|---|---|
The raw field value, or ``None`` if the field is unresolved or
|
does not exist. |
Source code in src/oold/model/v1/__init__.py
573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 | |
json(*, include=None, exclude=None, by_alias=False, skip_defaults=None, exclude_unset=False, exclude_defaults=False, exclude_none=False, encoder=None, models_as_dict=True, **dumps_kwargs)
¶
Generate a JSON representation of the model,
include and exclude arguments as per dict().
encoder is an optional function to supply as default to json.dumps(),
other arguments as per json.dumps().
Source code in src/oold/model/v1/__init__.py
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 | |
oold_query(item)
classmethod
¶
oold_query(item: str) -> Self
oold_query(item: list[str]) -> LinkedBaseModelList[Self]
oold_query(
item: Query | Condition | bool,
) -> Optional[LinkedBaseModelList[Self]]
Allow access to the class by its IRI.
Source code in src/oold/model/v1/__init__.py
644 645 646 647 648 649 | |
parse_obj(obj)
classmethod
¶
Parse the object and return a LinkedBaseModel instance. This method is called by pydantic when creating a new (default) instance of the model.
Source code in src/oold/model/v1/__init__.py
338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 | |
store_jsonld()
¶
Store the model instance in a backend matching its IRI.
Source code in src/oold/model/v1/__init__.py
603 604 605 | |
to_json(exclude_defaults=False)
¶
Return the JSON representation of the object as dict.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
exclude_defaults
|
bool
|
If True, fields with default values are excluded from the output. Useful for compact storage where defaults can be re-populated on deserialization via from_json(). |
False
|
Source code in src/oold/model/v1/__init__.py
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 | |
to_jsonld()
¶
Return the RDF representation of the object as JSON-LD.
Source code in src/oold/model/v1/__init__.py
826 827 828 | |
Backend interface¶
Abstract interface implemented by all backends.
Bases: Resolver
Source code in src/oold/backend/interface.py
174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 | |
Generator¶
Code generation from OO-LD / JSON Schema definitions.
Source code in src/oold/generator.py
15 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 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 | |
GenerateParams
¶
Bases: BaseModel
Source code in src/oold/generator.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | |
generate_init_py_files = True
class-attribute
instance-attribute
¶
Generate init.py files along the output_model_path
json_schemas
instance-attribute
¶
JSON SCHEMA source(s)
main_schema = None
class-attribute
instance-attribute
¶
File name of the main schema
output_model_path = Path(__file__).parent / 'model' / 'example.py'
class-attribute
instance-attribute
¶
Output model path, if not set the model will be generated in the current directory
output_model_type = (DataModelType.PydanticV2BaseModel,)
class-attribute
instance-attribute
¶
Output model type, e.g. PydanticV2BaseModel or PydanticBaseModel
preprocess = True
class-attribute
instance-attribute
¶
Preprocess the JSON schemas before generating the models
working_dir_path = None
class-attribute
instance-attribute
¶
Working directory to store intermedia files and the generated partial models