from __future__ import annotations

from datetime import date, datetime, timedelta
from enum import Enum
from typing import Any
from uuid import UUID, uuid4

from pydantic.v1 import AnyUrl, EmailStr, Field, confloat, constr

from opensemantic.v1 import OswBaseModel

# generated by datamodel-codegen:
#   filename:  Category.json
#   timestamp: 2026-01-05T17:29:36+00:00


class LangCode(str, Enum):
    en = "en"
    de = "de"


class Label(OswBaseModel):
    class Config:
        schema_extra = {
            "@context": {
                "rdf": "http://www.w3.org/2000/01/rdf-schema#",
                "text": {"@id": "@value"},
                "lang": {"@id": "@language"},
            },
            "title": "Label",
            "title*": {"de": "Bezeichnung"},
            "eval_template": [
                {"type": "wikitext", "mode": "store", "value": "{{{text}}}@{{{lang}}}"}
            ],
        }

    text: constr(min_length=1) = Field(
        ...,
        options={
            "input_width": "800px",
            "inputAttributes": {"placeholder": "Title of the entry"},
            "inputAttributes*": {"de": {"placeholder": "Titel dieses Eintrags"}},
        },
        title="Text",
        title_={"de": "Text"},
    )
    lang: LangCode | None = Field(
        LangCode.en,
        default_={"en": "en", "de": "de"},
        options={"input_width": "100px"},
        title="Lang code",
        title_={"de": "Sprache"},
    )


class ShortName(OswBaseModel):
    class Config:
        schema_extra = {
            "@context": {
                "rdf": "http://www.w3.org/2000/01/rdf-schema#",
                "text": {"@id": "@value"},
                "lang": {"@id": "@language"},
            },
            "title": "Short name",
            "title*": {"de": "Kurzname"},
            "eval_template": [
                {"type": "wikitext", "mode": "store", "value": "{{{text}}}@{{{lang}}}"}
            ],
        }

    text: constr(min_length=1) = Field(
        ...,
        options={
            "input_width": "800px",
            "inputAttributes": {"placeholder": "Title of the entry"},
            "inputAttributes*": {"de": {"placeholder": "Titel dieses Eintrags"}},
        },
        title="Text",
        title_={"de": "Text"},
    )
    lang: LangCode | None = Field(
        LangCode.en,
        default_={"en": "en", "de": "de"},
        options={"input_width": "100px"},
        title="Lang code",
        title_={"de": "Sprache"},
    )


class Description(OswBaseModel):
    class Config:
        schema_extra = {
            "@context": {
                "rdf": "http://www.w3.org/2000/01/rdf-schema#",
                "text": {"@id": "@value"},
                "lang": {"@id": "@language"},
            },
            "title": "Description",
            "title*": {"de": "Beschreibung"},
            "eval_template": [
                {"type": "wikitext", "mode": "store", "value": "{{{text}}}@{{{lang}}}"}
            ],
        }

    text: constr(min_length=1) = Field(
        ..., options={"input_width": "800px"}, title="Text", title_={"de": "Text"}
    )
    lang: LangCode | None = Field(
        LangCode.en,
        default_={"en": "en", "de": "de"},
        options={"input_width": "100px"},
        title="Lang code",
        title_={"de": "Sprache"},
    )


class Action(str, Enum):
    odrl_read = "odrl:read"
    """
    read
    """
    odrl_write = "odrl:write"
    """
    edit
    """


class WikiPage(OswBaseModel):
    """
    The wiki page containing this entity
    """

    class Config:
        schema_extra = {
            "title": "Wiki page",
            "description": "The wiki page containing this entity",
        }

    title: str | None = Field(None, title="Title")
    """
    The page title
    """
    namespace: str | None = Field(None, example="Category", title="Namespace")
    """
    The page namespace
    """


class Meta(OswBaseModel):
    class Config:
        schema_extra = {
            "@context": {
                "change_id": {"@id": "Property:HasChangeId", "@type": "xsd:string"}
            },
            "title": "Meta",
            "options": {"hidden": True},
        }

    uuid: UUID = Field(default_factory=uuid4, options={"hidden": True}, title="UUID")
    wiki_page: WikiPage | None = Field(None, title="Wiki page")
    """
    The wiki page containing this entity
    """
    change_id: list[str] | None = Field(None, title="Change IDs")
    """
    To keep track of concerted changes
    """


class LabelModel(OswBaseModel):
    class Config:
        schema_extra = {
            "@context": {
                "rdf": "http://www.w3.org/2000/01/rdf-schema#",
                "text": {"@id": "@value"},
                "lang": {"@id": "@language"},
            },
            "title": "Label",
        }

    text: constr(min_length=1) = Field(
        ...,
        options={
            "input_width": "800px",
            "inputAttributes": {"placeholder": "Title of the entry"},
            "inputAttributes*": {"de": {"placeholder": "Titel dieses Eintrags"}},
        },
        title="Text",
        title_={"de": "Text"},
    )
    lang: LangCode | None = Field(
        LangCode.en,
        default_={"en": "en", "de": "de"},
        options={"input_width": "100px"},
        title="Lang code",
        title_={"de": "Sprache"},
    )


class DescriptionModel(OswBaseModel):
    class Config:
        schema_extra = {
            "@context": {
                "rdf": "http://www.w3.org/2000/01/rdf-schema#",
                "text": {"@id": "@value"},
                "lang": {"@id": "@language"},
            },
            "title": "Description",
        }

    text: constr(min_length=1) = Field(
        ..., options={"input_width": "800px"}, title="Text", title_={"de": "Text"}
    )
    lang: LangCode | None = Field(
        LangCode.en,
        default_={"en": "en", "de": "de"},
        options={"input_width": "100px"},
        title="Lang code",
        title_={"de": "Sprache"},
    )


class Label1(OswBaseModel):
    class Config:
        schema_extra = {
            "@context": {
                "rdf": "http://www.w3.org/2000/01/rdf-schema#",
                "text": {"@id": "@value"},
                "lang": {"@id": "@language"},
            },
            "title": "Label",
            "title*": {"de": "Name"},
            "eval_template": [
                {"type": "wikitext", "mode": "store", "value": "{{{text}}}@{{{lang}}}"}
            ],
        }

    text: constr(min_length=1) = Field(
        ...,
        options={
            "input_width": "800px",
            "inputAttributes": {"placeholder": "Title of the entry"},
            "inputAttributes*": {"de": {"placeholder": "Titel dieses Eintrags"}},
        },
        title="Text",
        title_={"de": "Text"},
    )
    lang: LangCode | None = Field(
        LangCode.en,
        default_={"en": "en", "de": "de"},
        options={"input_width": "100px"},
        title="Lang code",
        title_={"de": "Sprache"},
    )


class Label2(Label1):
    pass


class Label3(Label1):
    pass


class MetaModel(OswBaseModel):
    class Config:
        schema_extra = {
            "@context": {
                "change_id": {"@id": "Property:HasChangeId", "@type": "xsd:string"}
            },
            "title": "Meta",
        }

    uuid: UUID = Field(default_factory=uuid4, options={"hidden": True}, title="UUID")
    wiki_page: WikiPage | None = Field(None, title="Wiki page")
    """
    The wiki page containing this entity
    """
    change_id: list[str] | None = Field(None, title="Change IDs")
    """
    To keep track of concerted changes
    """


class GroupPermission(OswBaseModel):
    class Config:
        schema_extra = {
            "title": "GroupPermission",
            "title*": {"en": "Permission", "de": "Erlaubnis"},
        }

    assignee_usergroup: UserGroup | None = Field(
        None,
        options={
            "autocomplete": {
                "$commment": "user should not create new or edit existing groups here",
                "create_inline": False,
            }
        },
        range="Category:OSWb24f37ada8d043c194e7036df5d86b39",
        title="User group",
        title_={"de": "Nutzergruppe"},
        x_oold_required_iri=True,
    )
    action: Action = Field(
        ...,
        options={
            "enum_titles": ["read", "edit"],
            "enum_titles*": ["Lesen", "Bearbeiten"],
        },
        title="Action",
        title_={"de": "Aktion"},
    )


class Permission(OswBaseModel):
    class Config:
        schema_extra = {
            "title": "Permission",
            "title*": {"en": "Permission", "de": "Erlaubnis"},
        }

    assignee_user: UserAccount | None = Field(
        None,
        options={
            "autocomplete": {
                "$commment": "user should not create new or edit existing accounts here",
                "create_inline": False,
            }
        },
        range="Category:OSW8b3e627eb76b46d68fce3a12ff220c8e",
        title="Specific user",
        title_={"de": "Bestimmter Nutzer"},
        x_oold_required_iri=True,
    )
    action: Action = Field(
        ...,
        options={
            "enum_titles": ["read", "edit"],
            "enum_titles*": ["Lesen", "Bearbeiten"],
        },
        title="Action",
        title_={"de": "Aktion"},
    )


class AccessAndUsagePolicy(OswBaseModel):
    """
    Defines access control rules (who can read/write this entity).
    """

    class Config:
        schema_extra = {
            "title": "AccessAndUsagePolicy",
            "title*": {"en": "Access policy", "de": "Zugriffsbeschränkungen"},
            "description": "Defines access control rules (who can read/write this entity).",
            "description*": {
                "de": "Definiert Zugriffsregeln (wer darf diese Entität lesen/bearbeiten)."
            },
            "defaultProperties": ["usergroup_permissions"],
            "$comment": "See also https://www.w3.org/TR/odrl-vocab/#term-hasPolicy and https://w3c.github.io/odrl/bp/#. For interoperability with DSP/DCAT see https://docs.internationaldataspaces.org/ids-knowledgebase/dataspace-protocol/catalog/catalog.protocol#id-1.2-dcat-and-odrl-profiles.",
            "eval_template": {
                "$comment": "See https://www.mediawiki.org/wiki/Extension:Semantic_ACL",
                "type": "mustache-wikitext",
                "mode": "render",
                "value": "{{=<% %>=}} <%#access_policy.usergroup_permissions%> {{#if: <%assignee_usergroup%> | [[<%assignee_usergroup%>]] {{#switch: <%action%> |odrl:read= {{#set: |Visible to=whitelist |Visible to group= {{#ask: [[<%assignee_usergroup%>]]|?HasGroupname=|mainlabel=-|link=none|format=plain}} }} (read) |odrl:write= {{#set: |Editable by=whitelist |Editable by group= {{#ask: [[<%assignee_usergroup%>]]|?HasGroupname=|mainlabel=-|link=none|format=plain}} }} (write) |#default=}} <br> |}} <%/access_policy.usergroup_permissions%> <%#access_policy.user_permissions%> {{#if: <%assignee_user%> | [[<%assignee_user%>]] {{#switch: <%action%> |odrl:read= {{#set: |Visible to=whitelist |Visible to user= User:{{#ask: [[<%assignee_user%>]]|?HasUsername=|mainlabel=-|link=none|format=plain}} }} (read) |odrl:write= {{#set: |Editable by=whitelist |Editable by user= User:{{#ask: [[<%assignee_user%>]]|?HasUsername=|mainlabel=-|link=none|format=plain}} }} (write) |#default=}} <br> |}} <%/access_policy.user_permissions%>",
            },
        }

    usergroup_permissions: list[GroupPermission] | None = Field(
        None,
        title="GroupPermissions",
        title_={"en": "Group permissions", "de": "Gruppen-Erlaubnisse"},
    )
    user_permissions: list[Permission] | None = Field(
        None,
        title="UserPermissions",
        title_={"en": "User permissions", "de": "Nutzer-Erlaubnisse"},
    )


class Entity(OswBaseModel):
    class Config:
        schema_extra = {
            "@context": {
                "owl": "http://www.w3.org/2002/07/owl#",
                "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
                "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
                "schema": "https://schema.org/",
                "skos": "https://www.w3.org/TR/skos-reference/",
                "wiki": "https://wiki-dev.open-semantic-lab.org/id/",
                "xsd": "http://www.w3.org/2001/XMLSchema#",
                "odrl": "http://www.w3.org/ns/odrl/2/",
                "Category": {"@id": "wiki:Category-3A", "@prefix": True},
                "File": {
                    "@id": "https://wiki-dev.open-semantic-lab.org/wiki/Special:Redirect/file/",
                    "@prefix": True,
                },
                "Item": {"@id": "wiki:Item-3A", "@prefix": True},
                "Property": {"@id": "wiki:Property-3A", "@prefix": True},
                "attachments*": {"@id": "Property:HasFileAttachment", "@type": "@id"},
                "based_on": {"@id": "skos:isBasedOn", "@type": "@id"},
                "based_on*": {"@id": "Property:IsBasedOn", "@type": "@id"},
                "close_ontology_match": {"@id": "skos:closeMatch", "@type": "@id"},
                "close_ontology_match*": {
                    "@id": "Property:Equivalent_URI",
                    "@type": "@id",
                },
                "close_ontology_match**": {
                    "@id": "Property:HasCloseOntologyMatch",
                    "@type": "@id",
                },
                "description": {"@id": "skos:definition"},
                "description*": {"@id": "Property:HasDescription"},
                "exact_ontology_match": {"@id": "skos:exactMatch", "@type": "@id"},
                "exact_ontology_match*": {
                    "@id": "Property:Equivalent_URI",
                    "@type": "@id",
                },
                "exact_ontology_match**": {
                    "@id": "Property:HasExactOntologyMatch",
                    "@type": "@id",
                },
                "image": {"@id": "schema:image", "@type": "@id"},
                "image*": {"@id": "Property:HasImage", "@type": "@id"},
                "keywords": {"@id": "schema:keywords", "@type": "@id"},
                "keywords*": {"@id": "Property:HasKeyword", "@type": "@id"},
                "label": {"@id": "skos:prefLabel"},
                "label*": {"@id": "Property:HasLabel"},
                "lang": {"@id": "@language"},
                "meta": {
                    "@id": "Property:HasMeta",
                    "@type": "@id",
                    "@context": {
                        "change_id": {
                            "@id": "Property:HasChangeId",
                            "@type": "xsd:string",
                        }
                    },
                },
                "name*": {"@id": "Property:HasName"},
                "classification_categories": {
                    "@id": "Property:Category",
                    "@type": "@id",
                },
                "classification_categories*": {
                    "@id": "Property:HasClassificationCategory",
                    "@type": "@id",
                },
                "query_label": {"@id": "Property:HasLabel", "@type": "@id"},
                "rdf_type": {"@id": "@type", "@type": "@id"},
                "short_name": {"@id": "Property:HasShortName"},
                "access_policy": {
                    "@id": "odrl:hasPolicy",
                    "@type": "@id",
                    "@context": {
                        "usergroup_permissions": {
                            "@id": "odrl:permission",
                            "@type": "@id",
                            "@context": {
                                "assignee_usergroup": {
                                    "@id": "odrl:assignee",
                                    "@type": "@id",
                                },
                                "action": {"@id": "odrl:action", "@type": "@id"},
                            },
                        },
                        "user_permissions": {
                            "@id": "odrl:permission",
                            "@type": "@id",
                            "@context": {
                                "assignee_user": {
                                    "@id": "odrl:assignee",
                                    "@type": "@id",
                                },
                                "action": {"@id": "odrl:action", "@type": "@id"},
                            },
                        },
                    },
                },
                "statements": {"@id": "Property:HasStatement", "@type": "@id"},
                "text": {"@id": "@value"},
                "type": {"@id": "Property:HasType", "@type": "@id"},
                "type*": {"@id": "Property:HasSchema", "@type": "@id"},
                "uuid*": {"@id": "Property:HasUuid"},
            },
            "uuid": "ce353767-c628-45bd-9d88-d6eb3009aec0",
            "title": "Entity",
            "defaultProperties": ["description"],
        }

    type: list[str] | None = Field(
        ["Category:Entity"],
        eval_template=[
            {
                "type": "mustache-wikitext",
                "mode": "render",
                "value": "{{=<% %>=}} <%#type%> {{Viewer/Link |page=<%.%> }} <br><%/type%>",
            }
        ],
        min_items=1,
        propertyOrder=-1010,
        title="Types/Categories",
        title_={"de": "Typen/Kategorien"},
    )
    rdf_type: set[str] | None = Field(
        None,
        description_={
            "de": 'Deklariert zusätzliche(n) Typ(en) für diese Entität und gibt damit an, dass diese Entität eine Instanz einer zusätzlichen RDF-Klasse ist. Siehe auch https://schema.org/additionalType. Category:Entity wird nicht direkt instanziiert. Daher entscheiden die erbenden Klassen (Category:Category, Category:Item, Category:Property) über die Implementierung und das Mapping innerhalb des "@context". Der Wert muss eine vollständige IRI sein, z.B. https://schema.org/Person'
        },
        eval_template=[
            {
                "type": "mustache-wikitext",
                "mode": "render",
                "value": "{{#rdf_type}} {{=<% %>=}} {{Viewer/Link |url= <%={{ }}=%> {{{.}}} {{=<% %>=}} }} <br><%={{ }}=%>{{/rdf_type}}",
            }
        ],
        title="Additional RDF type(s)",
        title_={"de": "Zusätzliche(r) RDF-Typ(en)"},
    )
    """
    Declares additional type(s) for this entity, thereby stating that this entity is an instance of an additional RDF class. See also https://schema.org/additionalType. Category:Entity is not directly instantiated. Therefor the inheriting classes (Category:Category, Category:Item, Category:Property) decide on the implementation and mapping within the "@context". The value must be a full IRI, e.g. https://schema.org/Person
    """
    exact_ontology_match: set[str] | None = Field(
        None,
        description_={
            "de": "Verwenden Sie diese Eigenschaft nur, wenn alle in der Ontologie definierten Eigenschaften auf dieses Objekt übertragen werden können."
        },
        eval_template=[
            {
                "type": "mustache-wikitext",
                "mode": "render",
                "value": "{{#exact_ontology_match}} {{=<% %>=}} {{Viewer/Link |url= <%={{ }}=%> {{{.}}} {{=<% %>=}} }} <br><%={{ }}=%>{{/exact_ontology_match}}",
            }
        ],
        titel_={"de": "Ontologieübereinstimmung (exakt)"},
        title="Ontology Match (Exact)",
    )
    """
    Only use this property if all properties defined in the Ontology can be asserted to this object.
    """
    close_ontology_match: set[str] | None = Field(
        None,
        description_={
            "de": "Verwenden Sie diese Eigenschaft, wenn Sie nicht sicher sind, ob alle Eigenschaften aus der Ontologie für dieses Objekt geltend gemacht werden können, die Bedeutung aber sehr nahe liegt."
        },
        eval_template=[
            {
                "type": "mustache-wikitext",
                "mode": "render",
                "value": "{{#close_ontology_match}} {{=<% %>=}} {{Viewer/Link |url= <%={{ }}=%> {{{.}}} {{=<% %>=}} }} <br><%={{ }}=%>{{/close_ontology_match}}",
            }
        ],
        titel_={"de": "Ontologieübereinstimmung (ähnlich)"},
        title="Ontology Match (Close)",
    )
    """
    Use this property if you are not sure if all properties from the ontology can be asserted to this object but the meaning is very close.
    """
    uuid: UUID = Field(default_factory=uuid4, options={"hidden": True}, title="UUID")
    iri: str | None = Field(
        None,
        description_={
            "de": "Der internationalisierte Ressourcenbezeichner (IRI) dieser Entität"
        },
        options={"hidden": True},
        title="IRI",
    )
    """
    The Internationalized Resource Identifier (IRI) of this entity
    """
    name: str | None = Field(
        None,
        description_={"de": "Technischer / Maschinenkompatibler Name"},
        options={"hidden": True},
        title="Technical name",
        title_={"de": "Technischer Name"},
    )
    """
    Technical / Machine compatible name
    """
    label: list[Label] = Field(
        ...,
        description_={"de": "Mindestens eine Bezeichnung ist erforderlich."},
        eval_template=[
            {
                "type": "mustache-wikitext",
                "mode": "render",
                "$comment": "Displays value according to user language with eng as fallback option. Note: {{=<% %>=}} changes mustache expression from {{..}} to <% %> for mixing with wikitext templates",
                "value": "{{=<% %>=}} {{#switch:{{USERLANGUAGECODE}} <%#label%> | {{#ifeq: <%lang%>|en|#default|<%lang%>}} = <%text%> <%/label%> }}",
            }
        ],
        min_items=1,
        title="Label(s)",
        title_={"de": "Bezeichnung(en)"},
    )
    """
    At least one label is required.
    """
    short_name: list[ShortName] | None = Field(
        None,
        description_={"de": "Abkürzung, Akronym, etc."},
        eval_template={
            "type": "mustache-wikitext",
            "mode": "render",
            "$comment": "Displays value according to user language with eng as fallback option. Note: {{=<% %>=}} changes mustache expression from {{..}} to <% %> for mixing with wikitext templates",
            "value": "{{=<% %>=}} {{#switch:{{USERLANGUAGECODE}} <%#short_name%> | {{#ifeq: <%lang%>|en|#default|<%lang%>}} = <%text%> <%/short_name%> }}",
        },
        title="Short name(s)",
        title_={"de": "Kurzname(n)"},
    )
    """
    Abbreviation, Acronym, etc.
    """
    query_label: str | None = Field(
        None,
        options={"hidden": True, "conditional_visible": {"modes": ["query"]}},
        title="Query label",
        title_={"de": "Abfrage-Bezeichnung"},
    )
    description: list[Description] | None = Field(
        None,
        eval_template={
            "type": "mustache-wikitext",
            "mode": "render",
            "$comment": "Displays value according to user language with eng as fallback option. Note: {{=<% %>=}} changes mustache expression from {{..}} to <% %> for mixing with wikitext templates",
            "value": "{{=<% %>=}} {{#switch:{{USERLANGUAGECODE}} <%#description%> | {{#ifeq: <%lang%>|en|#default|<%lang%>}} = <%text%> <%/description%> }}",
        },
        title="Description",
        title_={"de": "Beschreibung"},
    )
    image: str | None = Field(
        None,
        links=[
            {
                "href": "{{#if self}}/w/index.php?title=Special:Redirect/file/{{self}}&width=200&height=200{{/if}}",
                "mediaType": "image",
            },
            {
                "href": "{{#if self}}/w/index.php?title=Special:Redirect/file/{{self}}{{/if}}",
                "rel": "{{#if self}}download{{/if}}",
                "download": True,
            },
        ],
        options={"upload": {}},
        propertyOrder=1020,
        title="Image",
        title_={"de": "Bild"},
    )
    classification_categories: list[str] | None = Field(
        None,
        description_={
            "de": "Ordnungskategorien werden verwendet, um Instanzen zu kategorisieren, z. B. nach ihrer Verwendung, nicht aber nach ihren Eigenschaften. Bei der Abfrage nach Instanzen einer hier aufgeführten Ordnungskategorie wird diese Instanz zurückgegeben. Hinweis: Ordnungskategorien definieren keine Eigenschaften, während 'normale' Kategorien Eigenschaften definieren, denen eine Instanz Werte zuweist."
        },
        eval_template=[
            {
                "type": "mustache-wikitext",
                "mode": "render",
                "value": "{{=<% %>=}} <%#classification_categories%> {{Viewer/Link |page=<%.%> }} <br><%/classification_categories%>",
            }
        ],
        title="Classification categories",
        title_={"de": "Ordnungskategorien"},
    )
    """
    Classification categories are used to categorize instances, e.g., according to their use but not their properties. When querying for instances of a here listed classification category, this instance will be returned. Note: Classification categories define no properties, while 'regular' categories define properties, which an instance assigns values to.
    """
    keywords: list[Keyword] | None = Field(
        None,
        description_={"de": "Dient der nutzerdefinierten Kategorisierung des Elements"},
        eval_template=[
            {
                "type": "mustache-wikitext",
                "mode": "render",
                "value": "{{=<% %>=}} <%#keywords%> {{Viewer/Link |page=<%.%> }} <br><%/keywords%>",
            }
        ],
        range="Category:OSW09f6cdd54bc54de786eafced5f675cbe",
        title="Keywords / Tags",
        title_={"de": "Schlagworte / Tags"},
    )
    """
    Designated to the user defined categorization of this element
    """
    based_on: list[str] | None = Field(
        None,
        description_={
            "de": "Andere Entitäten auf die diese basiert, z. B. wenn sie durch Kopieren entstanden ist"
        },
        eval_template=[
            {
                "type": "mustache-wikitext",
                "mode": "render",
                "value": "{{=<% %>=}} <%#based_on%> {{Viewer/Link |page=<%.%> }} <br><%/based_on%>",
            }
        ],
        options={"hidden": "true"},
        title="Based on",
        title_={"de": "Basierend auf"},
    )
    """
    Other entities on which this one is based, e.g. when it is created by copying
    """
    access_policy: AccessAndUsagePolicy | None = Field(
        None,
        defaultProperties=["usergroup_permissions"],
        description_={
            "de": "Definiert Zugriffsregeln (wer darf diese Entität lesen/bearbeiten)."
        },
        eval_template={
            "$comment": "See https://www.mediawiki.org/wiki/Extension:Semantic_ACL",
            "type": "mustache-wikitext",
            "mode": "render",
            "value": "{{=<% %>=}} <%#access_policy.usergroup_permissions%> {{#if: <%assignee_usergroup%> | [[<%assignee_usergroup%>]] {{#switch: <%action%> |odrl:read= {{#set: |Visible to=whitelist |Visible to group= {{#ask: [[<%assignee_usergroup%>]]|?HasGroupname=|mainlabel=-|link=none|format=plain}} }} (read) |odrl:write= {{#set: |Editable by=whitelist |Editable by group= {{#ask: [[<%assignee_usergroup%>]]|?HasGroupname=|mainlabel=-|link=none|format=plain}} }} (write) |#default=}} <br> |}} <%/access_policy.usergroup_permissions%> <%#access_policy.user_permissions%> {{#if: <%assignee_user%> | [[<%assignee_user%>]] {{#switch: <%action%> |odrl:read= {{#set: |Visible to=whitelist |Visible to user= User:{{#ask: [[<%assignee_user%>]]|?HasUsername=|mainlabel=-|link=none|format=plain}} }} (read) |odrl:write= {{#set: |Editable by=whitelist |Editable by user= User:{{#ask: [[<%assignee_user%>]]|?HasUsername=|mainlabel=-|link=none|format=plain}} }} (write) |#default=}} <br> |}} <%/access_policy.user_permissions%>",
        },
        field_comment="See also https://www.w3.org/TR/odrl-vocab/#term-hasPolicy and https://w3c.github.io/odrl/bp/#. For interoperability with DSP/DCAT see https://docs.internationaldataspaces.org/ids-knowledgebase/dataspace-protocol/catalog/catalog.protocol#id-1.2-dcat-and-odrl-profiles.",
        title="AccessAndUsagePolicy",
        title_={"en": "Access policy", "de": "Zugriffsbeschränkungen"},
    )
    """
    Defines access control rules (who can read/write this entity).
    """
    statements: list[ObjectStatement | DataStatement | QuantityStatement] | None = (
        Field(
            None,
            eval_template={
                "type": "mustache-wikitext",
                "mode": "render",
                "value": "{{=<% %>=}} <%#statements%>.. {{Viewer/Link |page=<%#predicate%><%predicate%><%/predicate%><%#property%><%property%><%/property%><%#quantity%><%quantity%><%/quantity%>}} <%#object%>{{Viewer/Link |page=<%object%>}}<%/object%><%#value%><%value%><%/value%><br><%/statements%>",
            },
            propertyOrder=1010,
            title="Statements",
            title_={"de": "Aussagen"},
        )
    )
    attachments: list[str] | None = Field(
        None,
        eval_template={
            "type": "mustache-wikitext",
            "mode": "render",
            "value": "{{=<% %>=}} <%={{ }}=%>  {{#attachments}}{{{.}}};{{/attachments}} {{=<% %>=}} <%={{ }}=%>",
        },
        options={"collapsed": True},
        propertyOrder=1030,
        title="File attachments",
        title_={"de": "Dateianhänge"},
    )
    meta: Meta | None = Field(None, options={"hidden": True})


class ObjectStatement(OswBaseModel):
    class Config:
        schema_extra = {
            "@context": {
                "Property": "https://wiki-dev.open-semantic-lab.org/id/Property-3A",
                "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
                "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
                "subject*": "Property:HasSubject",
                "subject": "rdf:subject",
                "predicate*": "Property:HasProperty",
                "predicate": "rdf:predicate",
                "property*": "Property:HasProperty",
                "property": "rdf:predicate",
                "quantity*": "Property:HasProperty",
                "quantity": "rdf:predicate",
                "object*": "Property:HasObject",
                "object": "rdf:object",
                "value*": "Property:HasObject",
                "value": "rdf:object",
                "unit": "Property:HasUnit",
                "substatements": "Property:HasStatement",
                "label*": "Property:HasLabel",
                "label": "rdfs:label",
            },
            "headerTemplate": "... {{#if self.predicate}}{{self.predicate}}{{/if}}{{#if self.property}}{{self.property}}{{/if}}{{#if self.quantity}}{{self.quantity}}{{/if}} ...",
            "options": {"display_required_only": True},
            "title": "Object Statement",
        }

    rdf_type: Any | None = Field("rdf:Statement", options={"hidden": True})
    uuid: UUID = Field(default_factory=uuid4, options={"hidden": True}, title="UUID")
    label: list[Label1] | None = Field(
        None, options={"collapsed": True, "grid_columns": 12}, title="Label"
    )
    """
    Human readable name
    """
    subject: str | None = Field(
        None,
        options={
            "grid_columns": 4,
            "autocomplete": {"query": "[[Category:Entity]]OR[[:Category:%2B]]"},
        },
        title="Subject",
        title_={"de": "Subjekt"},
    )
    substatements: list[ObjectStatement | DataStatement | QuantityStatement] | None = (
        Field(
            None,
            options={"grid_columns": 12},
            propertyOrder=3010,
            title="Substatements",
        )
    )
    predicate: str = Field(
        ...,
        options={"grid_columns": 4, "autocomplete": {"category": "Category:Property"}},
        title="Predicate",
        title_={"de": "Prädikat"},
    )
    object: str = Field(
        ...,
        options={
            "grid_columns": 4,
            "autocomplete": {"query": "[[Category:Entity]]OR[[:Category:%2B]]"},
        },
        title="Object",
        title_={"de": "Objekt"},
    )


class DataStatement(OswBaseModel):
    class Config:
        schema_extra = {
            "@context": {
                "Property": "https://wiki-dev.open-semantic-lab.org/id/Property-3A",
                "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
                "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
                "subject*": "Property:HasSubject",
                "subject": "rdf:subject",
                "predicate*": "Property:HasProperty",
                "predicate": "rdf:predicate",
                "property*": "Property:HasProperty",
                "property": "rdf:predicate",
                "quantity*": "Property:HasProperty",
                "quantity": "rdf:predicate",
                "object*": "Property:HasObject",
                "object": "rdf:object",
                "value*": "Property:HasObject",
                "value": "rdf:object",
                "unit": "Property:HasUnit",
                "substatements": "Property:HasStatement",
                "label*": "Property:HasLabel",
                "label": "rdfs:label",
            },
            "headerTemplate": "... {{#if self.predicate}}{{self.predicate}}{{/if}}{{#if self.property}}{{self.property}}{{/if}}{{#if self.quantity}}{{self.quantity}}{{/if}} ...",
            "options": {"display_required_only": True},
            "title": "Data Statement",
            "title*": {"de": "Datenangabe"},
        }

    rdf_type: Any | None = Field("rdf:Statement", options={"hidden": True})
    uuid: UUID = Field(default_factory=uuid4, options={"hidden": True}, title="UUID")
    label: list[Label2] | None = Field(
        None, options={"collapsed": True, "grid_columns": 12}, title="Label"
    )
    """
    Human readable name
    """
    subject: str | None = Field(
        None,
        options={
            "grid_columns": 4,
            "autocomplete": {"query": "[[Category:Entity]]OR[[:Category:%2B]]"},
        },
        title="Subject",
        title_={"de": "Subjekt"},
    )
    substatements: list[ObjectStatement | DataStatement | QuantityStatement] | None = (
        Field(
            None,
            options={"grid_columns": 12},
            propertyOrder=3010,
            title="Substatements",
        )
    )
    property: str = Field(
        ...,
        options={
            "grid_columns": 4,
            "autocomplete": {"category": "Category:DataProperty"},
        },
        title="Property",
        title_={"de": "Attribut"},
    )
    value: str = Field(
        ..., options={"grid_columns": 4}, title="Value", title_={"de": "Wert"}
    )


class QuantityStatement(OswBaseModel):
    class Config:
        schema_extra = {
            "@context": {
                "Property": "https://wiki-dev.open-semantic-lab.org/id/Property-3A",
                "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
                "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
                "subject*": "Property:HasSubject",
                "subject": "rdf:subject",
                "predicate*": "Property:HasProperty",
                "predicate": "rdf:predicate",
                "property*": "Property:HasProperty",
                "property": "rdf:predicate",
                "quantity*": "Property:HasProperty",
                "quantity": "rdf:predicate",
                "object*": "Property:HasObject",
                "object": "rdf:object",
                "value*": "Property:HasObject",
                "value": "rdf:object",
                "unit": "Property:HasUnit",
                "substatements": "Property:HasStatement",
                "label*": "Property:HasLabel",
                "label": "rdfs:label",
            },
            "headerTemplate": "... {{#if self.predicate}}{{self.predicate}}{{/if}}{{#if self.property}}{{self.property}}{{/if}}{{#if self.quantity}}{{self.quantity}}{{/if}} ...",
            "options": {"display_required_only": True},
            "title": "Quantity Statement",
            "title*": {"de": "Größenangabe"},
        }

    rdf_type: Any | None = Field("rdf:Statement", options={"hidden": True})
    uuid: UUID = Field(default_factory=uuid4, options={"hidden": True}, title="UUID")
    label: list[Label3] | None = Field(
        None, options={"collapsed": True, "grid_columns": 12}, title="Label"
    )
    """
    Human readable name
    """
    subject: str | None = Field(
        None,
        options={
            "grid_columns": 4,
            "autocomplete": {"query": "[[Category:Entity]]OR[[:Category:%2B]]"},
        },
        title="Subject",
        title_={"de": "Subjekt"},
    )
    substatements: list[ObjectStatement | DataStatement | QuantityStatement] | None = (
        Field(
            None,
            options={"grid_columns": 12},
            propertyOrder=3010,
            title="Substatements",
        )
    )
    quantity: str = Field(
        ...,
        options={
            "grid_columns": 4,
            "autocomplete": {"category": "Category:QuantityProperty"},
        },
        title="Property",
        title_={"de": "Attribut"},
    )
    numerical_value: str = Field(
        ..., options={"grid_columns": 2}, title="Value", title_={"de": "Wert"}
    )
    unit: str = Field(
        ...,
        options={
            "grid_columns": 2,
            "autocomplete": {
                "query": "[[-HasInputUnit::{{$(quantity)}}]][[Display_title_of::like:*{{_user_input}}*]]|?Display_title_of=label",
                "render_template": {
                    "type": ["handlebars", "handlebars"],
                    "value": "{{result.printouts.label.[0]}}",
                },
                "field_maps": [
                    {
                        "source_path": "$",
                        "template": "{{{result.printouts.label.[0]}}}",
                        "target_path": "$(unit_symbol)",
                    },
                    {
                        "source_path": "$",
                        "template": "{{{result.printouts.label.[0]}}}",
                        "target_path": "$(unit_symbol)",
                    },
                ],
            },
        },
        propertyOrder=1010,
        title="Unit",
        title_={"de": "Einheit"},
        watch={
            "quantity": "statement.quantity",
            "unit_symbol": "statement.unit_symbol",
        },
    )
    unit_symbol: str = Field(..., options={"hidden": True})
    value: str = Field(
        ...,
        options={"hidden": True},
        template="{{{numerical_value}}} {{{unit_symbol}}}",
        title="Value",
        title_={"de": "Wert"},
        watch={
            "numerical_value": "statement.numerical_value",
            "unit_symbol": "statement.unit_symbol",
        },
    )


class Category(Entity):
    class Config:
        schema_extra = {
            "@context": [
                {
                    "exact_ontology_match***": {
                        "@id": "owl:equivalentClass",
                        "@type": "@id",
                    },
                    "metaclass": {"@id": "Property:HasMetaCategory", "@type": "@id"},
                    "subclass_of": {"@id": "rdfs:subClassOf", "@type": "@id"},
                    "subclass_of*": {"@id": "Property:SubClassOf", "@type": "@id"},
                    "utf8_icon": "Property:HasUtf8Icon",
                },
                "/wiki/Category:Entity?action=raw&slot=jsonschema",
            ],
            "uuid": "89aafe6d-ae5a-4f29-97ff-df7736d4cab6",
            "title": "Category",
            "title*": {"de": "Kategorie (Klasse)", "en": "Category (Class)"},
        }

    type: list[str] | None = Field(["Category:Category"], options={"hidden": True})
    subclass_of: list[str] | None = Field(
        ["Category:Entity"],
        options={"hidden": False},
        propertyOrder=-1009,
        title="Supercategories",
        title_={"de": "Überkategorien"},
    )
    metaclass: list[str] | None = Field(
        None,
        propertyOrder=-1008,
        title="Metaclasses/-categories",
        title_={"de": "Metaklassen/-kategorien"},
    )
    utf8_icon: list[constr(min_length=1, max_length=2)] | None = Field(
        None,
        description_={
            "de": "siehe https://www.unicode.org/cldr/charts/latest/annotations/germanic.html"
        },
        title="UTF8-Icons",
        title_={"de": "UTF8-Symbole"},
    )
    """
    see https://www.unicode.org/cldr/charts/latest/annotations/romance.html
    """


class Item(Entity):
    class Config:
        schema_extra = {
            "@context": [
                "/wiki/Category:Entity?action=raw&slot=jsonschema",
                {
                    "exact_ontology_match***": {"@id": "owl:sameAs", "@type": "@id"},
                    "rdf_type*": {"@id": "schema:additionalType"},
                },
            ],
            "title": "Item",
            "title*": {"de": "Item"},
        }

    type: list[str] | None = Field(
        ["Category:Item"],
        min_items=1,
        options={
            "collapsed": True,
            "conditional_visible": {"modes": ["default", "query"]},
        },
    )


class IntangibleItem(Item):
    """
    A utility class that serves as the umbrella for a number of 'intangible' things such as terms, quantities, structured values, etc.
    """

    class Config:
        schema_extra = {
            "@context": ["/wiki/Category:Item?action=raw&slot=jsonschema"],
            "uuid": "cbb09a36-3367-40c6-a2cd-62db9bf647ec",
            "title": "IntangibleItem",
            "title*": {"en": "Intangible Item", "de": "Immaterieller Gegenstand"},
            "description": "A utility class that serves as the umbrella for a number of 'intangible' things such as terms, quantities, structured values, etc.",
            "description*": {
                "en": "A utility class that serves as the umbrella for a number of 'intangible' things such as terms, quantities, structured values, etc.",
                "de": 'Eine Gebrauchsklasse, die als Dach für eine Reihe von "immateriellen" Dingen wie Begriffe, Mengen, strukturierte Werte usw. dient.',
            },
        }

    type: list[str] | None = ["Category:OSWcbb09a36336740c6a2cd62db9bf647ec"]


class UserGroup(Item):
    """
    Organizes system users as backbone of the permissions system
    """

    class Config:
        schema_extra = {
            "@context": [
                "/wiki/Category:Item?action=raw&slot=jsonschema",
                {"groupname": "Property:HasGroupname"},
            ],
            "uuid": "b24f37ad-a8d0-43c1-94e7-036df5d86b39",
            "title": "UserGroup",
            "title*": {"en": "User group", "de": "Nutzergruppe"},
            "description": "Organizes system users as backbone of the permissions system",
            "description*": {
                "en": "Organizes system users as backbone of the permissions system",
                "de": "Organisiert die System-Benutzer zur Implementierung des Berechtigungssystems",
            },
            "defaultProperties": ["groupname"],
        }

    type: list[str] | None = ["Category:OSWb24f37ada8d043c194e7036df5d86b39"]
    groupname: str | None = Field(
        None,
        eval_template={
            "$comment": "See https://www.mediawiki.org/wiki/Extension:Semantic_ACL",
            "type": "mustache-wikitext",
            "mode": "render",
            "value": "{{=<% %>=}} <%groupname%> {{#set: |Editable by=whitelist |Editable by group= sysop;<%groupname%> |+sep=; }}",
        },
        options={
            "autocomplete": {
                "search": "search_sysinfo",
                "getResultValue": "getResultValue_sysinfo",
                "renderResult": "renderResult_sysinfo",
                "onUpdate": "onUpdate_sysinfo",
                "onSubmit": "onSubmit_sysinfo",
                "sysinfo": "usergroups",
            }
        },
        title="Group name",
        title_={"de": "Gruppenname"},
    )


class UserAccount(Item):
    """
    Allows a user to authenticate to a system
    """

    class Config:
        schema_extra = {
            "@context": [
                "/wiki/Category:Item?action=raw&slot=jsonschema",
                {"username": {"@id": "Property:HasUsername", "@type": "xsd:string"}},
            ],
            "uuid": "8b3e627e-b76b-46d6-8fce-3a12ff220c8e",
            "title": "UserAccount",
            "title*": {"en": "User account", "de": "Nutzerkonto"},
            "description": "Allows a user to authenticate to a system",
            "description*": {
                "en": "Allows a user to authenticate to a system",
                "de": "Ermöglicht einem Benutzer, sich bei einem System zu authentifizieren",
            },
        }

    type: list[str] | None = ["Category:OSW8b3e627eb76b46d68fce3a12ff220c8e"]
    username: str = Field(
        ...,
        description_={"de": "Organization-User-ID"},
        eval_template=[
            {
                "type": "mustache-wikitext",
                "mode": "render",
                "$comment": "Displays a link to the system user page, preventing redirect to the user entity page",
                "value": "{{=<% %>=}} [{{fullurl:User:<%username%>|redirect=no}} <%username%>]",
            }
        ],
        title="Username",
        title_={"de": "Nutzername"},
    )
    """
    Organization user ID
    """


class DefinedTerm(IntangibleItem):
    """
    Definition of a noun or compound word describing a specific concept
    """

    class Config:
        schema_extra = {
            "@context": [
                "/wiki/Category:OSWcbb09a36336740c6a2cd62db9bf647ec?action=raw&slot=jsonschema"
            ],
            "uuid": "a5812d3b-5119-416c-8da1-606cbe7054eb",
            "title": "DefinedTerm",
            "title*": {"en": "Defined Term", "de": "Definierter Begriff"},
            "description": "Definition of a noun or compound word describing a specific concept",
            "description*": {
                "en": "Definition of a noun or compound word describing a specific concept",
                "de": "Definition eines Ausdruckes der ein spezifisches Konzept repräsentiert",
            },
        }

    type: list[str] | None = ["Category:OSWa5812d3b5119416c8da1606cbe7054eb"]


class Keyword(DefinedTerm):
    """
    Used as a user defined tag to label entitites
    """

    class Config:
        schema_extra = {
            "@context": [
                "/wiki/Category:OSWa5812d3b5119416c8da1606cbe7054eb?action=raw&slot=jsonschema"
            ],
            "uuid": "09f6cdd5-4bc5-4de7-86ea-fced5f675cbe",
            "title": "Keyword",
            "title*": {"en": "Keyword", "de": "Schlüsselwort"},
            "description": "Used as a user defined tag to label entitites",
            "description*": {
                "en": "Used as a user defined tag to label entitites",
                "de": "Wird als nutzerdefiniertes Etikett / Tag genutzt um Entitäten zu labeln",
            },
        }

    type: list[str] | None = ["Category:OSW09f6cdd54bc54de786eafced5f675cbe"]


# generated by datamodel-codegen:
#   filename:  Entity.json
#   timestamp: 2026-01-05T17:29:37+00:00


# generated by datamodel-codegen:
#   filename:  Item.json
#   timestamp: 2026-01-05T17:29:38+00:00


# generated by datamodel-codegen:
#   filename:  OSW31a9c96c1f444f84b944d49afbce409b.json
#   timestamp: 2026-01-05T17:29:39+00:00


class PagePackage(Item):
    """
    A collection of wiki pages
    """

    class Config:
        schema_extra = {
            "@context": [
                "/wiki/Category:Item?action=raw&slot=jsonschema",
                {
                    "url*": "Property:HasUrl",
                    "version*": "Property:HasVersion",
                    "global_id": {"@id": "Property:HasId"},
                    "parts": {"@id": "Property:HasPart", "@type": "@id"},
                },
            ],
            "uuid": "31a9c96c-1f44-4f84-b944-d49afbce409b",
            "title": "PagePackage",
            "title*": {"en": "Page Package", "de": "Seitenpaket"},
            "description": "A collection of wiki pages",
            "description*": {
                "en": "A collection of wiki pages",
                "de": "Eine Samlung von Wiki-Seiten",
            },
            "defaultProperties": ["global_id", "version", "url", "parts"],
        }

    type: list[str] | None = ["Category:OSW31a9c96c1f444f84b944d49afbce409b"]
    global_id: str | None = Field(None, title="ID")
    """
    e.g. world.opensemantic.core
    """
    version: str | None = Field(None, title="Version")
    """
    e.g. 'v1.0.1
    """
    url: list[str] | None = Field(None, title="URL / Websites")
    parts: set[str] | None = Field(
        None,
        title="Included page(s)",
        title_={"de": "Enthaltene Seite(n)"},
    )


# generated by datamodel-codegen:
#   filename:  OSWb24f37ada8d043c194e7036df5d86b39.json
#   timestamp: 2026-01-05T17:29:39+00:00


# generated by datamodel-codegen:
#   filename:  OSW8b3e627eb76b46d68fce3a12ff220c8e.json
#   timestamp: 2026-01-05T17:29:40+00:00


# generated by datamodel-codegen:
#   filename:  Term.json
#   timestamp: 2026-01-05T17:29:40+00:00


class Model(OswBaseModel):
    class Config:
        schema_extra = {}

    __root__: Any


# generated by datamodel-codegen:
#   filename:  OSW379d5a1589c74c82bc0de47938264d00.json
#   timestamp: 2026-01-05T17:29:41+00:00


class OwlThing(Category):
    """
    Represents the set of all individuals. In the DL literature this is often called the top concept.
    """

    class Config:
        schema_extra = {
            "@context": ["/wiki/Category:Category?action=raw&slot=jsonschema"],
            "uuid": "379d5a15-89c7-4c82-bc0d-e47938264d00",
            "title": "OwlThing",
            "title*": {"en": "OwlThing"},
            "description": "Represents the set of all individuals. In the DL literature this is often called the top concept.",
            "description*": {
                "en": "Represents the set of all individuals. In the DL literature this is often called the top concept."
            },
        }

    type: list[str] | None = ["Category:OSW379d5a1589c74c82bc0de47938264d00"]


# generated by datamodel-codegen:
#   filename:  OSW5f0dff1c477e45e7ad45e4e247e28f35.json
#   timestamp: 2026-01-05T17:29:42+00:00


class DocumentationExtension(Item):
    """
    Instances of this category can be used to extend the documentation of a page. Instances select a Category page to be extended by its content. Category pages in turn, within their footer, invoke a query on pages with the Property:ExtendsDocumentationOf pointing to them.
    """

    class Config:
        schema_extra = {
            "@context": [
                "/wiki/Category:Item?action=raw&slot=jsonschema",
                {
                    "extends_documentation_of": {
                        "@id": "Property:ExtendsDocumentationOf",
                        "@type": "@id",
                    }
                },
            ],
            "uuid": "5f0dff1c-477e-45e7-ad45-e4e247e28f35",
            "title": "DocumentationExtension",
            "title*": {
                "en": "Documentation Extension",
                "de": "Dokumentations-Erweiterung",
            },
            "description": "Instances of this category can be used to extend the documentation of a page. Instances select a Category page to be extended by its content. Category pages in turn, within their footer, invoke a query on pages with the Property:ExtendsDocumentationOf pointing to them. ",
            "description*": {
                "en": "Instances of this category can be used to extend the documentation of a page. Instances select a Category page to be extended by its content. Category pages in turn, within their footer, invoke a query on pages with the Property:ExtendsDocumentationOf pointing to them. ",
                "de": "Instanzen dieser Kategorie können verwendet werden, um die Dokumentation einer Seite zu erweitern. Instanzen wählen eine Kategorieseite aus, die durch ihren Inhalt erweitert werden soll. Kategorieseiten wiederum rufen in ihrer Fußzeile eine Abfrage auf Seiten auf, die mit Property:ExtendsDocumentationOf auf sie zeigt.",
            },
            "defaultProperties": ["extends_documentation_of"],
        }

    type: list[str] | None = ["Category:OSW5f0dff1c477e45e7ad45e4e247e28f35"]
    extends_documentation_of: list[str] | None = Field(
        None,
        description_={
            "de": "Der Inhalt dieses Eintrags wird in die ausgewählte(n) Seite(n) (Fußzeile) eingebettet"
        },
        title="Extends documentation of",
        title_={"de": "Ergänzt die Dokumentation von"},
    )
    """
    The content of this entry will be embedded into the selected page(s) (footer)
    """


# generated by datamodel-codegen:
#   filename:  OSW2ac4493f8635481eaf1db961b63c8325.json
#   timestamp: 2026-01-05T17:29:42+00:00


class Data(Item):
    class Config:
        schema_extra = {"title": "Data"}

    type: list[str] | None = ["Category:OSW2ac4493f8635481eaf1db961b63c8325"]


# generated by datamodel-codegen:
#   filename:  OSWff333fd349af4f65a69100405a9e60c7.json
#   timestamp: 2026-01-05T17:29:43+00:00


class File(Data):
    class Config:
        schema_extra = {
            "title": "File",
            "@context": [
                "/wiki/Category:OSW2ac4493f8635481eaf1db961b63c8325?action=raw&slot=jsonschema",
                {
                    "dcterms": "http://purl.org/dc/terms/",
                    "creator": {"@id": "dcterms:creator", "@type": "@id"},
                    "creator*": {"@id": "Property:HasCreator", "@type": "@id"},
                    "editor": {"@id": "dcterms:creator", "@type": "@id"},
                    "editor*": {"@id": "Property:HasEditor", "@type": "@id"},
                    "creation_context": {
                        "@id": "Property:HasCreationContext",
                        "@type": "@id",
                    },
                    "editing_context": {
                        "@id": "Property:HasEditingContext",
                        "@type": "@id",
                    },
                    "local_path": {"@id": "Property:HasLocalPath", "@type": "@id"},
                },
            ],
            "uuid": "ff333fd3-49af-4f65-a691-00405a9e60c7",
            "title*": {"en": "File", "de": "Datei"},
            "description": "",
            "description*": {},
            "defaultProperties": ["local_path"],
        }

    type: list[str] | None = ["Category:OSWff333fd349af4f65a69100405a9e60c7"]
    creator: list[str] | None = Field(None, title="Creator", title_={"de": "Ersteller"})
    editor: list[str] | None = Field(None, title="Editor", title_={"de": "Bearbeiter"})
    creation_context: list[str] | None = Field(
        None, title="Creation Context", title_={"de": "Erstellungskontext"}
    )
    editing_context: list[str] | None = Field(
        None, title="Editing Context", title_={"de": "Bearbeitungskontext"}
    )
    local_path: str | None = Field(
        None,
        description_={"de": "Der Pfad einer lokalen Datei, z.B. S:...."},
        title="Local Path",
        title_={"de": "Lokaler Dateipfad"},
    )
    """
    The local file path of a file, e.g. S:....
    """


# generated by datamodel-codegen:
#   filename:  OSW3e3f5dd4f71842fbb8f270e511af8031.json
#   timestamp: 2026-01-05T17:29:44+00:00


class LocalFile(File):
    """
    A file stored on a local file system
    """

    class Config:
        schema_extra = {
            "@context": [
                "/wiki/Category:OSWff333fd349af4f65a69100405a9e60c7?action=raw&slot=jsonschema"
            ],
            "uuid": "3e3f5dd4-f718-42fb-b8f2-70e511af8031",
            "title": "LocalFile",
            "title*": {"en": "Local File"},
            "description": "A file stored on a local file system",
            "description*": {"en": "A file stored on a local file system"},
        }

    type: list[str] | None = ["Category:OSW3e3f5dd4f71842fbb8f270e511af8031"]


# generated by datamodel-codegen:
#   filename:  OSW05b244d0a669436e96fe4e1631d5a171.json
#   timestamp: 2026-01-05T17:29:45+00:00


class RemoteFile(File):
    """
    A file stored on a remote location, e. g. on a web server
    """

    class Config:
        schema_extra = {
            "@context": [
                "/wiki/Category:OSWff333fd349af4f65a69100405a9e60c7?action=raw&slot=jsonschema"
            ],
            "uuid": "05b244d0-a669-436e-96fe-4e1631d5a171",
            "title": "RemoteFile",
            "title*": {"en": "Remote File"},
            "description": "A file stored on a remote location, e. g. on a web server",
            "description*": {
                "en": "A file stored on a remote location, e. g. on a web server"
            },
        }

    type: list[str] | None = ["Category:OSW05b244d0a669436e96fe4e1631d5a171"]


# generated by datamodel-codegen:
#   filename:  OSW11a53cdfbdc24524bf8ac435cbf65d9d.json
#   timestamp: 2026-01-05T17:29:46+00:00


class WikiFile(RemoteFile):
    """
    A file stored directy in the file namespace
    """

    class Config:
        schema_extra = {
            "@context": [
                "/wiki/Category:OSW05b244d0a669436e96fe4e1631d5a171?action=raw&slot=jsonschema"
            ],
            "uuid": "11a53cdf-bdc2-4524-bf8a-c435cbf65d9d",
            "title": "WikiFile",
            "title*": {"en": "Wiki File", "de": "Wiki Datei"},
            "description": "A file stored directy in the file namespace",
            "description*": {
                "en": "A file stored directy in the file namespace",
                "de": "Eine direkt im Datei-Namensraum gespeicherte Datei",
            },
            "defaultProperties": ["file"],
        }

    type: list[str] | None = ["Category:OSW11a53cdfbdc24524bf8ac435cbf65d9d"]
    file: str | None = Field(
        None,
        links=[
            {
                "href": "{{#if self}}/w/index.php?title=Special:Redirect/file/{{self}}{{/if}}",
                "rel": "{{#if self}}download{{/if}}",
                "download": True,
            }
        ],
        options={"upload": {"create_inline": False}},
        title="File",
        title_={"de": "Datei"},
    )


# generated by datamodel-codegen:
#   filename:  OSWc11438cd6c814ed1a5a253555ee351b4.json
#   timestamp: 2026-01-05T17:29:47+00:00


class LabelItem(OswBaseModel):
    class Config:
        schema_extra = {
            "@context": {
                "rdf": "http://www.w3.org/2000/01/rdf-schema#",
                "text": {"@id": "@value"},
                "lang": {"@id": "@language"},
            },
            "title": "Label",
            "eval_template": [
                {"type": "wikitext", "mode": "store", "value": "{{{text}}}@{{{lang}}}"}
            ],
        }

    text: constr(min_length=1) = Field(
        ...,
        options={
            "input_width": "800px",
            "inputAttributes": {"placeholder": "Title of the entry"},
            "inputAttributes*": {"de": {"placeholder": "Titel dieses Eintrags"}},
        },
        title="Text",
        title_={"de": "Text"},
    )
    lang: LangCode | None = Field(
        LangCode.en,
        default_={"en": "en", "de": "de"},
        options={"input_width": "100px"},
        title="Lang code",
        title_={"de": "Sprache"},
    )


class DescriptionItem(OswBaseModel):
    class Config:
        schema_extra = {
            "@context": {
                "rdf": "http://www.w3.org/2000/01/rdf-schema#",
                "text": {"@id": "@value"},
                "lang": {"@id": "@language"},
            },
            "title": "Description",
            "eval_template": [
                {"type": "wikitext", "mode": "store", "value": "{{{text}}}@{{{lang}}}"}
            ],
        }

    text: constr(min_length=1) = Field(
        ..., options={"input_width": "800px"}, title="Text", title_={"de": "Text"}
    )
    lang: LangCode | None = Field(
        LangCode.en,
        default_={"en": "en", "de": "de"},
        options={"input_width": "100px"},
        title="Lang code",
        title_={"de": "Sprache"},
    )


class Duration(OswBaseModel):
    """
    Fields accept only a certain range of values. If you would like to enter a value that exceeds the maximum, please split the value into the corresponding fields. For convenience, it is possible to enter, e.g., 1.5 hours instead of 1 hour and 30 minutes.
    """

    class Config:
        schema_extra = {
            "title": "Duration",
            "title*": {"de": "Dauer"},
            "description": "Fields accept only a certain range of values. If you would like to enter a value that exceeds the maximum, please split the value into the corresponding fields. For convenience, it is possible to enter, e.g., 1.5 hours instead of 1 hour and 30 minutes.",
            "description*": {
                "de": "Die Felder lassen nur einen bestimmten Wertebereich zu. Wenn Sie einen Wert eingeben möchten, der über das Maximum hinausgeht, teilen Sie den Wert bitte in die entsprechenden Felder auf. Der Einfachheit halber können Sie z. B. 1,5 Stunden anstelle von 1 Stunde und 30 Minuten eingeben."
            },
            "@context": {
                "Property": "/id/Property-3A",
                "year": {"@id": "Property:HasYear", "@type": "xs:decimal"},
                "month": {"@id": "Property:HasMonth", "@type": "xs:decimal"},
                "day": {"@id": "Property:HasDay", "@type": "xs:decimal"},
                "hour": {"@id": "Property:HasHour", "@type": "xs:decimal"},
                "minute": {"@id": "Property:HasMinute", "@type": "xs:decimal"},
                "second": {"@id": "Property:HasSecond", "@type": "xs:decimal"},
                "iso_8601_representation": {
                    "@id": "Property:HasIso8601Representation",
                    "@type": "xs:string",
                },
                "value_in_seconds": {"@id": "Property:HasObject"},
            },
            "eval_template": {
                "type": "wikitext",
                "mode": "render",
                "value": "{{#if: {{{year|}}} | {{{year|}}}\xa0a,\xa0}}{{#if: {{{month|}}} | {{{month|}}}\xa0mo,\xa0}}{{#if: {{{day|}}} | {{{day|}}}\xa0d,\xa0}}{{#if: {{{hour|}}} | {{{hour|}}}\xa0h,\xa0}}{{#if: {{{minute|}}} | {{{minute|}}}\xa0min,\xa0}}{{#if: {{{second|}}} | {{{second|}}}\xa0s}}<br>{{{iso_8601_representation|}}} (ISO 8601)<br>≈ {{{numerical_value_in_seconds|}}} s",
            },
            "defaultProperties": [
                "year",
                "month",
                "day",
                "hour",
                "minute",
                "second",
                "iso_8601_representation",
            ],
        }

    uuid: UUID = Field(default_factory=uuid4, options={"hidden": True})
    year: confloat(ge=0.0) | None = Field(0, title="Year", title_={"de": "Jahr"})
    month: confloat(ge=0.0, le=12.0) | None = Field(
        0, description_={"de": "0 - 12"}, title="Month", title_={"de": "Monat"}
    )
    """
    0 - 12
    """
    day: confloat(ge=0.0, le=31.0) | None = Field(
        0, description_={"de": "0 - 31"}, title="Day", title_={"de": "Tag"}
    )
    """
    0 - 31
    """
    hour: confloat(ge=0.0, le=24.0) | None = Field(
        0, description_={"de": "0 - 24"}, title="Hour", title_={"de": "Stunde"}
    )
    """
    0 - 24
    """
    minute: confloat(ge=0.0, le=60.0) | None = Field(
        0, description_={"de": "0 - 60"}, title="Minute", title_={"de": "Minute"}
    )
    """
    0 - 60
    """
    second: confloat(ge=0.0, le=60.0) | None = Field(
        0, description_={"de": "0 - 60"}, title="Second", title_={"de": "Sekunde"}
    )
    """
    0 - 60
    """
    iso_8601_representation: timedelta = Field(
        ...,
        options={"hidden": True},
        template="P{{#if year}}{{{year}}}Y{{/if}}{{#if month}}{{{month}}}M{{/if}}{{#if day}}{{{day}}}D{{/if}}{{#if (calc year '+' (calc month '+' day))}}{{#unless (calc hour '+' (calc minute '+' second ))}}{{/unless}}{{else}}T{{/if}}{{#if hour}}{{{hour}}}H{{/if}}{{#if minute}}{{{minute}}}M{{/if}}{{#if second}}{{{second}}}S{{else}}{{#unless (calc year '+' (calc month '+' (calc day '+' (calc hour '+' (calc minute '+' second )))))}}0S{{/unless}}{{/if}}",
        title="ISO 8601 representation",
        title_={"de": "ISO 8601 Darstellung"},
        watch={
            "year": "duration_root.year",
            "month": "duration_root.month",
            "day": "duration_root.day",
            "hour": "duration_root.hour",
            "minute": "duration_root.minute",
            "second": "duration_root.second",
        },
    )
    numerical_value_in_seconds: float = Field(
        ...,
        description_={
            "de": "Dieser Wert ist nicht genau! Die tatsächliche Dauer einer Spanne von (Kalender-)Jahren und Monaten hängt von den jeweiligen Daten ab. Daher ist dieser Wert nur ein Näherungswert."
        },
        options={"hidden": True},
        template="{{calc (calc (calc year '*' 31557600) '+' (calc (calc month '*' 2629800) '+' (calc (calc day '*' 86400) '+' (calc (calc hour '*' 3600) '+' (calc minute '*' 60 ))))) '+' second }}",
        title="Duration in seconds",
        title_={"de": "Dauer in Sekunden"},
        watch={
            "year": "duration_root.year",
            "month": "duration_root.month",
            "day": "duration_root.day",
            "hour": "duration_root.hour",
            "minute": "duration_root.minute",
            "second": "duration_root.second",
        },
    )
    """
    This value is not accurate! The actual duration of a span of (calendar) years and months depends on the specific dates involved. Therefore, this value is only an approximation.
    """
    value_in_seconds: str = Field(
        ...,
        options={"hidden": True},
        template="{{{numerical_value_in_seconds}}} s",
        title="Duration converted to seconds as string",
        title_={"de": "Dauer in Sekunden als String"},
        watch={"numerical_value": "duration_root.numerical_value_in_seconds"},
    )


class Tool(OswBaseModel):
    class Config:
        schema_extra = {
            "title": "Tool",
            "title*": {"de": "Werkzeug"},
            "defaultProperties": ["tool_type", "tool_default"],
            "eval_template": [
                {
                    "type": "wikitext",
                    "mode": "render",
                    "value": "{{#switch:{{USERLANGUAGECODE}}|en=Type|de=Typ|#default=Type}}: [[:{{{tool_type}}}]] {{#if: {{{tool_default}}} | ({{#switch:{{USERLANGUAGECODE}}|en=default|de=Default|#default=default}}: [[{{{tool_default}}}]]) | ({{#switch:{{USERLANGUAGECODE}}|en=no default|de=Kein Default|#default=no default}})}} ",
                }
            ],
        }

    uuid: UUID = Field(default_factory=uuid4, options={"hidden": True}, title="UUID")
    tool_type: str = Field(
        ...,
        options={
            "autocomplete": {
                "$comment": "todo: we need an any-subcategory-of shortcut",
                "query": "[[SubClassOf::Category:OSWe427aafafbac4262955b9f690a83405d]]OR[[SubClassOf.SubClassOf::Category:OSWe427aafafbac4262955b9f690a83405d]]OR[[SubClassOf.SubClassOf.SubClassOf::Category:OSWe427aafafbac4262955b9f690a83405d]]OR[[SubClassOf.SubClassOf.SubClassOf.SubClassOf::Category:OSWe427aafafbac4262955b9f690a83405d]]OR[[SubClassOf.SubClassOf.SubClassOf.SubClassOf.SubClassOf::Category:OSWe427aafafbac4262955b9f690a83405d]]",
            }
        },
        title="Type",
        title_={"de": "Typ"},
    )
    tool_default: Tool1 | None = Field(
        None,
        options={"autocomplete": {"query": "[[$(tool_type_w)]]"}},
        range="Category:OSWe427aafafbac4262955b9f690a83405d",
        title="Default",
        title_={"de": "Standardwert"},
        watch={"tool_type_w": "tool_.tool_type"},
    )


class Input(OswBaseModel):
    class Config:
        schema_extra = {
            "title": "Input",
            "title*": {"de": "Ressource"},
            "defaultProperties": ["input_type", "input_default"],
            "eval_template": [
                {
                    "type": "wikitext",
                    "mode": "render",
                    "value": "{{#switch:{{USERLANGUAGECODE}}|en=Type|de=Typ|#default=Type}}: [[:{{{input_type}}}]] {{#if: {{{input_default}}} | ({{#switch:{{USERLANGUAGECODE}}|en=default|de=Default|#default=default}}: [[{{{input_default}}}]]) | ({{#switch:{{USERLANGUAGECODE}}|en=no default|de=Kein Default|#default=no default}})}} ",
                }
            ],
        }

    uuid: UUID = Field(default_factory=uuid4, options={"hidden": True}, title="UUID")
    input_type: str = Field(
        ...,
        options={
            "autocomplete": {
                "$comment": "todo: we need an any-subcategory-of shortcut",
                "query": "[[SubClassOf::Category:Entity]]OR[[SubClassOf.SubClassOf::Category:Entity]]OR[[SubClassOf.SubClassOf.SubClassOf::Category:Entity]]OR[[SubClassOf.SubClassOf.SubClassOf.SubClassOf::Category:Entity]]OR[[SubClassOf.SubClassOf.SubClassOf.SubClassOf.SubClassOf::Category:Entity]]",
            }
        },
        title="Type",
        title_={"de": "Typ"},
    )
    input_default: Entity | None = Field(
        None,
        options={"autocomplete": {"query": "[[$(input_type_w)]]"}},
        range="Category:Entity",
        title="Default",
        title_={"de": "Standardwert"},
        watch={"input_type_w": "input_.input_type"},
    )


class Output(OswBaseModel):
    class Config:
        schema_extra = {
            "title": "Output",
            "title*": {"de": "Ausgangsressource"},
            "defaultProperties": ["output_type", "output_default"],
            "eval_template": [
                {
                    "type": "wikitext",
                    "mode": "render",
                    "value": "{{#switch:{{USERLANGUAGECODE}}|en=Type|de=Typ|#default=Type}}: [[:{{{output_type}}}]] {{#if: {{{output_default}}} | ({{#switch:{{USERLANGUAGECODE}}|en=default|de=Default|#default=default}}: [[{{{output_default}}}]]) | ({{#switch:{{USERLANGUAGECODE}}|en=no default|de=Kein Default|#default=no default}})}} ",
                }
            ],
        }

    uuid: UUID = Field(default_factory=uuid4, options={"hidden": True}, title="UUID")
    output_type: str = Field(
        ...,
        options={
            "autocomplete": {
                "$comment": "todo: we need an any-subcategory-of shortcut",
                "query": "[[SubClassOf::Category:Entity]]OR[[SubClassOf.SubClassOf::Category:Entity]]OR[[SubClassOf.SubClassOf.SubClassOf::Category:Entity]]OR[[SubClassOf.SubClassOf.SubClassOf.SubClassOf::Category:Entity]]OR[[SubClassOf.SubClassOf.SubClassOf.SubClassOf.SubClassOf::Category:Entity]]",
            }
        },
        title="Type",
        title_={"de": "Typ"},
    )
    output_default: Entity | None = Field(
        None,
        options={"autocomplete": {"query": "[[$(output_type_w)]]"}},
        range="Category:Entity",
        title="Default",
        title_={"de": "Standardwert"},
        watch={"output_type_w": "output_.output_type"},
    )


class Component(OswBaseModel):
    class Config:
        schema_extra = {
            "title": "Component",
            "title*": {"de": "Komponente"},
            "headerTemplate": "{{ i1 }} - {{ self.component_id }}",
            "defaultProperties": [],
        }

    uuid: UUID = Field(
        ...,
        dynamic_template="{{_uuid_}}",
        field_comment="format uuid field are copied, if not set in copy_ignore",
        field_template="dynamic_template",
        options={"hidden": True, "dynamic_template": {"override": "empty"}},
        title="UUID",
        title_={"de": "UUID"},
    )
    component_id: str = Field(
        ...,
        description_={"de": "Wird automatisch generiert"},
        dynamic_template="Component{{patternformat '00' _array_index_}}",
        field_comment="Will be used as a visual reference for the user",
        options={
            "hidden": True,
            "dynamic_template": {"override": "always"},
            "grid_columns": 6,
        },
        propertyOrder=10,
        readOnly=True,
        title="ID",
        title_={"de": "ID"},
    )
    """
    Automatically generated
    """
    label: list[LabelItem] | None = Field(
        None,
        description_={
            "de": "Bezeichnung der Funktion oder Rolle der Komponente in diesem spezifischen Kontext."
        },
        eval_template={
            "type": "mustache-wikitext",
            "mode": "render",
            "value": "{{=<% %>=}} {{#switch:{{USERLANGUAGECODE}} <%={{ }}=%> {{#label}} |{{lang}}={{text}} {{/label}} {{=<% %>=}} }}",
        },
        options={"grid_columns": 12},
        propertyOrder=20,
        title="Label",
        title_={"de": "Bezeichnung"},
    )
    """
    Designation of the function or role of the component in this specific context.
    """
    description: list[DescriptionItem] | None = Field(
        None,
        description_={
            "de": "Optional, zusätzliche Angaben zur Rolle oder Funktion der Komponente in diesem spezifischen Kontext."
        },
        eval_template={
            "type": "mustache-wikitext",
            "mode": "render",
            "value": "{{=<% %>=}} {{#switch:{{USERLANGUAGECODE}} <%={{ }}=%> {{#description}} |{{lang}}={{text}} {{/description}} {{=<% %>=}} }}",
        },
        options={"grid_columns": 12},
        propertyOrder=30,
        title="Description",
        title_={"de": "Beschreibung"},
    )
    """
    Optional, additional details on the role or function of the component in this specific context.
    """
    component_type: Category | None = Field(
        default_factory=lambda: Category.parse_obj(
            "Category:OSWe427aafafbac4262955b9f690a83405d"
        ),
        options={
            "autocomplete": {
                "$comment": "Tool",
                "query": "[[:Category:OSWe427aafafbac4262955b9f690a83405d]]OR[[SubClassOf::Category:OSWe427aafafbac4262955b9f690a83405d]]OR[[SubClassOf.SubClassOf::Category:OSWe427aafafbac4262955b9f690a83405d]]OR[[SubClassOf.SubClassOf.SubClassOf::Category:OSWe427aafafbac4262955b9f690a83405d]]OR[[SubClassOf.SubClassOf.SubClassOf.SubClassOf::Category:OSWe427aafafbac4262955b9f690a83405d]]OR[[SubClassOf.SubClassOf.SubClassOf.SubClassOf.SubClassOf::Category:OSWe427aafafbac4262955b9f690a83405d]]",
            },
            "grid_columns": 12,
        },
        propertyOrder=40,
        range="Category:Category",
        title="Component type",
        title_={"de": "Typ der Komponente"},
        x_oold_required_iri=True,
    )
    component_instance_property: str | None = Field(
        "Property:HasPart", options={"hidden": True}
    )
    component_instance: Tool1 | None = Field(
        None,
        options={
            "autocomplete": {
                "query": "[[HasType::$(component_type_)]]|?Display_title_of=label|?HasImage=image|?HasDescription=description"
            },
            "grid_columns": 12,
        },
        propertyOrder=50,
        range="Category:OSWe427aafafbac4262955b9f690a83405d",
        title="Instance",
        title_={"de": "Instanz"},
        watch={"component_type_": "component.component_type"},
        x_oold_required_iri=True,
    )


class InitialOccupantOfTheSlot(OswBaseModel):
    """
    Tool or component installed in the slot.
    """

    class Config:
        schema_extra = {
            "title": "Initial occupant of the slot",
            "title*": {"de": "Initiale Belegung des Slots"},
            "description": "Tool or component installed in the slot.",
            "description*": {"de": "Im Slot installiertes Werkzeug oder Komponente."},
            "defaultProperties": ["slot_occupant_type"],
            "options": {"grid_columns": 12},
            "propertyOrder": 60,
        }

    slot_occupant_type: Category | None = Field(
        None,
        options={
            "autocomplete": {
                "$comment": "Tool",
                "query": "[[:$(slot_type)]]OR[[SubClassOf::$(slot_type)]]OR[[SubClassOf.SubClassOf::$(slot_type)]]OR[[SubClassOf.SubClassOf.SubClassOf::$(slot_type)]]OR[[SubClassOf.SubClassOf.SubClassOf.SubClassOf::$(slot_type)]]OR[[SubClassOf.SubClassOf.SubClassOf.SubClassOf.SubClassOf::$(slot_type)]]",
            }
        },
        propertyOrder=11,
        range="Category:Category",
        title="Type",
        title_={"de": "Typ"},
        watch={"slot_type": "slot.slot_type_restriction"},
    )
    slot_occupant_instance_property: str | None = Field(
        "Property:HasOccupant", options={"hidden": True}
    )
    slot_occupant_instance: Tool1 | None = Field(
        None,
        options={
            "autocomplete": {
                "query": "[[HasType::$(slot_occupant_type_)]]|?Display_title_of=label|?HasImage=image|?HasDescription=description"
            }
        },
        propertyOrder=21,
        range="Category:OSWe427aafafbac4262955b9f690a83405d",
        title="Instance",
        title_={"de": "Instanz"},
        watch={"slot_occupant_type_": "slot_occupant.slot_occupant_type"},
        x_oold_required_iri=True,
    )


class Slot(OswBaseModel):
    class Config:
        schema_extra = {
            "title": "Slot",
            "title*": {"de": "Slot"},
            "headerTemplate": "{{ i1 }} - {{ self.slot_id }}",
            "defaultProperties": ["name", "description", "slot_occupant"],
        }

    uuid: str = Field(
        ...,
        dynamic_template="{{_uuid_}}",
        field_comment="format uuid field are copied, if not set in copy_ignore",
        field_format="uuid",
        field_template="dynamic_template",
        options={"hidden": True, "dynamic_template": {"override": "empty"}},
        title="UUID",
        title_={"de": "UUID"},
    )
    slot_osw_id: str = Field(
        ...,
        dynamic_template="{{_current_subject_}}#OSW{{#replace '-' ''}}{{_own_uuid}}{{/replace}}",
        field_comment="Will be used an unique reference for slot exchange events.",
        field_format="dynamic_template",
        options={"hidden": True, "dynamic_template": {"override": "empty"}},
        readOnly=True,
        title="OSW-ID",
        title_={"de": "OSW-ID"},
        watch={"_own_uuid": "slot.uuid"},
    )
    slot_id: str = Field(
        ...,
        description_={"de": "Wird automatisch generiert"},
        dynamic_template="Slot{{patternformat '00' _array_index_}}",
        field_comment="Will be used as a visual reference for the user",
        options={
            "hidden": True,
            "dynamic_template": {"override": "always"},
            "grid_columns": 6,
        },
        propertyOrder=10,
        readOnly=True,
        title="ID",
        title_={"de": "ID"},
    )
    """
    Automatically generated
    """
    name: str | None = Field(
        None,
        options={"grid_columns": 6},
        propertyOrder=20,
        title="Name",
        title_={"de": "Name"},
    )
    description: list[DescriptionItem] | None = Field(
        None,
        eval_template={
            "type": "mustache-wikitext",
            "mode": "render",
            "value": "{{=<% %>=}} {{#switch:{{USERLANGUAGECODE}} <%={{ }}=%> {{#description}} |{{lang}}={{text}} {{/description}} {{=<% %>=}} }}",
        },
        options={"grid_columns": 12},
        propertyOrder=30,
        title="Description",
        title_={"de": "Beschreibung"},
    )
    slot_init_date_time: datetime = Field(
        ...,
        dynamic_template="{{_now_}}",
        options={"dynamic_template": {"override": "empty"}, "grid_columns": 4},
        propertyOrder=21,
        title="Date of slot initialization",
        title_={"de": "Datum der Slot-Initialisierung"},
    )
    slot_type_restriction: Category | None = Field(
        default_factory=lambda: Category.parse_obj(
            "Category:OSWe427aafafbac4262955b9f690a83405d"
        ),
        options={
            "autocomplete": {
                "$comment": "Tool",
                "query": "[[:Category:OSWe427aafafbac4262955b9f690a83405d]]OR[[SubClassOf::Category:OSWe427aafafbac4262955b9f690a83405d]]OR[[SubClassOf.SubClassOf::Category:OSWe427aafafbac4262955b9f690a83405d]]OR[[SubClassOf.SubClassOf.SubClassOf::Category:OSWe427aafafbac4262955b9f690a83405d]]OR[[SubClassOf.SubClassOf.SubClassOf.SubClassOf::Category:OSWe427aafafbac4262955b9f690a83405d]]OR[[SubClassOf.SubClassOf.SubClassOf.SubClassOf.SubClassOf::Category:OSWe427aafafbac4262955b9f690a83405d]]",
            }
        },
        propertyOrder=50,
        range="Category:Category",
        title="Type restriction of the slot",
        title_={"de": "Typeinschränkung des Slots"},
        x_oold_required_iri=True,
    )
    slot_occupant: InitialOccupantOfTheSlot | None = Field(
        None,
        defaultProperties=["slot_occupant_type"],
        description_={"de": "Im Slot installiertes Werkzeug oder Komponente."},
        options={"grid_columns": 12},
        propertyOrder=60,
        title="Initial occupant of the slot",
        title_={"de": "Initiale Belegung des Slots"},
    )
    """
    Tool or component installed in the slot.
    """


class ProcessType(Category):
    class Config:
        schema_extra = {
            "@context": [
                "/wiki/Category:Category?action=raw&slot=jsonschema",
                {
                    "actionees_default": {
                        "@id": "Property:HasActionee",
                        "@type": "@id",
                    },
                    "creator_default": {"@id": "Property:HasCreator", "@type": "@id"},
                    "start_date_time_default": "Property:HasStartDateAndTime",
                    "end_date_time_default": "Property:HasEndDateAndTime",
                    "sop": {"@id": "Property:HasSop", "@type": "@id"},
                    "status_default": {"@id": "Property:HasStatus", "@type": "@id"},
                    "tools": {
                        "@id": "Property:HasStatement",
                        "@context": {
                            "tool_type": {
                                "@id": "Property:HasToolType",
                                "@type": "@id",
                            },
                            "tool_default": {"@id": "Property:HasTool", "@type": "@id"},
                        },
                    },
                    "input": {
                        "@id": "Property:HasStatement",
                        "@context": {
                            "input_type": {
                                "@id": "Property:HasInputType",
                                "@type": "@id",
                            },
                            "input_default": {
                                "@id": "Property:HasInput",
                                "@type": "@id",
                            },
                        },
                    },
                    "output": {
                        "@id": "Property:HasStatement",
                        "@context": {
                            "output_type": {
                                "@id": "Property:HasOutputType",
                                "@type": "@id",
                            },
                            "output_default": {
                                "@id": "Property:HasOutput",
                                "@type": "@id",
                            },
                        },
                    },
                },
            ],
            "uuid": "c11438cd-6c81-4ed1-a5a2-53555ee351b4",
            "title": "ProcessType",
            "title*": {"en": "ProcessType", "de": "Prozesstyp"},
            "description": "",
            "description*": {},
        }

    type: list[str] | None = ["Category:OSWc11438cd6c814ed1a5a253555ee351b4"]
    actionees_default: list[str] | None = Field(
        None, title="Actionees (default)", title_={"de": "Akteure (Standardwert)"}
    )
    creator_default: str | None = Field(
        None,
        options={
            "autocomplete": {"category": "Category:OSW44deaa5b806d41a2a88594f562b110e9"}
        },
        title="Creator (default)",
        title_={"de": "Ersteller*in (Standardwert)"},
    )
    start_date_time_default: datetime | None = Field(
        None,
        title="Start time (default)",
        title_={"de": "Startzeitpunkt (Standardwert)"},
    )
    end_date_time_default: datetime | None = Field(
        None, title="End time (default)", title_={"de": "Endzeitpunkt (Standardwert)"}
    )
    status_default: str | None = Field(
        None,
        options={
            "autocomplete": {"category": "Category:OSW9725d7a91bab4f1aa68f423e4e9bfcf4"}
        },
        title="Status  (default)",
        title_={"de": "Status (Standardwert)"},
    )
    sop_default: StandardOperatingProcedure | None = Field(
        None,
        range="Category:OSWa2c8dd387d0b4a0c807a5a7bde190ba3",
        title="Standard operating procedure (SOP, default)",
        title_={"de": "Standard operating procedure (SOP, Standardwert)"},
    )
    tools: list[Tool] | None = Field(
        None, title="Tools (default)", title_={"de": "Werkzeuge (Standardwert)"}
    )
    input: list[Input] | None = Field(
        None,
        title="Inputs (default)",
        title_={"de": "Eingangsressourcen (Standardwert)"},
    )
    output: list[Output] | None = Field(
        None,
        title="Outputs (default)",
        title_={"de": "Ausgangsressourcen (Standardwert)"},
    )


class CreativeWork(Item):
    """
    The most generic kind of (product of) creative work, including books, movies, photographs, software programs, etc.
    """

    class Config:
        schema_extra = {
            "@context": [
                {
                    "author": {"@id": "schema:Author", "@type": "@id"},
                    "author*": {"@id": "Property:HasAuthor", "@type": "@id"},
                },
                "/wiki/Category:Item?action=raw&slot=jsonschema",
            ],
            "uuid": "712583f2-4799-44de-b254-6b77cf860dda",
            "title": "CreativeWork",
            "title*": {"en": "Creative Work", "de": "Produkt kreativer Arbeit"},
            "description": "The most generic kind of (product of) creative work, including books, movies, photographs, software programs, etc.",
            "description*": {
                "en": "The most generic kind of (product of) creative work, including books, movies, photographs, software programs, etc.",
                "de": "Die allgemeinste Art eines Produktes kreativer Arbeit, einschließlich Bücher, Filme, Fotos, Softwareprogramme usw.",
            },
            "defaultProperties": ["author"],
        }

    type: list[str] | None = ["Category:OSW712583f2479944deb2546b77cf860dda"]
    author: list[str] | None = Field(
        None,
        description_={
            "de": "Person oder Organisationseinheit, die diese Arbeit erzeugt hat."
        },
        title="Author(s)",
        title_={"de": "Autor(en)"},
    )
    """
    Person or organizational unit that created this work.
    """


class Tool1(Item):
    """
    Item that participates as a utility (almost) unchanged in a process
    """

    class Config:
        schema_extra = {
            "@context": [
                "/wiki/Category:Item?action=raw&slot=jsonschema",
                {
                    "components": {
                        "@id": "Property:HasStatement",
                        "@type": "@id",
                        "@context": {
                            "component_instance_property": {
                                "@id": "Property:HasProperty",
                                "@type": "@id",
                            },
                            "component_instance": {
                                "@id": "Property:HasObject",
                                "@type": "@id",
                            },
                        },
                    },
                    "events": {"@id": "Property:HasEvent", "@type": "@id"},
                    "slots": {
                        "@id": "Property:HasSlot",
                        "@type": "@id",
                        "@context": {
                            "slot_osw_id": {
                                "@id": "Property:HasOswId",
                                "@type": "xsd:string",
                            },
                            "slot_id": {"@id": "Property:HasId", "@type": "xsd:string"},
                            "name": {"@id": "Property:HasName", "@type": "xsd:string"},
                            "description": {
                                "@id": "Property:HasDescription",
                                "@type": "@id",
                            },
                            "slot_init_date_time": {
                                "@id": "Property:HasInitDate",
                                "@type": "xsd:dateTime",
                            },
                            "slot_occupant": {
                                "@id": "Property:HasStatement",
                                "@type": "@id",
                                "@context": {
                                    "slot_occupant_instance_property": "Property:HasProperty",
                                    "slot_occupant_instance": "Property:HasObject",
                                },
                            },
                            "slot_type_restriction": {
                                "@id": "Property:HasTypeRestriction",
                                "@type": "@id",
                            },
                        },
                    },
                    "typical_process": {
                        "@id": "Property:HasTypicalProcess",
                        "@type": "@id",
                    },
                },
            ],
            "uuid": "e427aafa-fbac-4262-955b-9f690a83405d",
            "title": "Tool",
            "title*": {"en": "Tool", "de": "Werkzeug"},
            "description": "Item that participates as a utility (almost) unchanged in a process",
            "description*": {
                "en": "Item that participates as a utility (almost) unchanged in a process",
                "de": "Gegenstand der als Hilfsmittel (nahezu) unverändert in einem Prozess teilnimmt",
            },
            "defaultProperties": [],
        }

    type: list[str] | None = ["Category:OSWe427aafafbac4262955b9f690a83405d"]
    typical_process: list[Category] | None = Field(
        None,
        eval_template=[
            {
                "type": "mustache-wikitext",
                "mode": "render",
                "value": "{{=<% %>=}} <ul><%#typical_process%><li>[[:<%.%>]]</li><%/typical_process%></ul>",
            }
        ],
        range="Category:Category",
        title="Typical Process(es)",
        title_={"de": "Typische(r) Prozess(e)"},
    )
    components: list[Component] | None = Field(
        None,
        description_={
            "de": "Komponenten sind dauerhafte Teile eines Werkzeugs (im Gegensatz zu Slots für austauschbare Teile)."
        },
        eval_template=[
            {
                "type": "mustache-wikitext",
                "mode": "render",
                "value": "{{=<% %>=}} <ul><%#components%><li>[[<%component_instance%>]] ({{#switch:{{USERLANGUAGECODE}}|en=Type|de=Typ|#default=Type}}: {{#ask:[[<%component_instance%>]]|?HasType=|format=plain|mainlabel=-}})</li><%/components%></ul>",
            }
        ],
        options={
            "enable_array_copy": True,
            "array_copy_ignore": ["uuid", "component_id", "attachments"],
        },
        title="Components",
        title_={"de": "Komponenten"},
    )
    """
    Component are permanent parts of a tool (vs. Slots for exchangeable parts).
    """
    slots: list[Slot] | None = Field(
        None,
        description_={
            "de": "Slots stellen Plätze für austauschbare Teile oder Komponenten eines Werkzeugs dar (im Gegensatz zu Komponenten, die permanente Teile sind). Slot-Austauschereignisse können verwendet werden, um Änderungen an Slots zu dokumentieren. Dies ist die anfängliche Slot-Konfiguration!"
        },
        eval_template=[
            {
                "type": "mustache-wikitext",
                "mode": "render",
                "value": "{{=<% %>=}} <%#slots%> {{Viewer/Link |page=<%slot_osw_id%>}}: {{#if: <!-- if there's at least one ToolMaintenanceEvent-->{{#ask: [[Category:OSW5433f882b9f14dca81994e058c8ab4a0]][[HasTarget::{{FULLPAGENAME}}]][[HasAction.HasSlot::<%slot_osw_id%>]]|sort=HasEndDate|order=desc|format=plain|link=none|limit=1|searchlabel=}}<!-- use the action of the latest ToolMaintenanceEvent-->|{{#ask:[[-HasAction.HasType::Category:OSW5433f882b9f14dca81994e058c8ab4a0]][[HasSlot::<%slot_osw_id%>]]<!-- same query as above-->[[-HasAction::{{#ask: [[Category:OSW5433f882b9f14dca81994e058c8ab4a0]][[HasTarget::{{FULLPAGENAME}}]][[HasAction.HasSlot::<%slot_osw_id%>]]|sort=HasEndDate|order=desc|format=plain|link=none|limit=1|searchlabel=}}]] <!-- -->|?HasOccupant=|format=plain|mainlabel=-|default={{#switch:{{USERLANGUAGECODE}}|de=Keine Belegung|#default=No occupant}} }} <!-- else use the default occupant-->|{{#ask: [[<%slot_osw_id%>]]|?HasOccupant=|format=plain|sort=HasInitDate|order=desc|limit=1|searchlabel=|mainlabel=-|default={{#switch:{{USERLANGUAGECODE}}|de=Keine Belegung|#default=No occupant}}}} }} <br> <%/slots%>",
            }
        ],
        options={
            "enable_array_copy": True,
            "array_copy_ignore": ["uuid", "slot_osw_id", "slot_id", "attachments"],
        },
        title="Slot configuration",
        title_={"de": "Slot-Konfiguration"},
    )
    """
    Slots represent spaces for exchangable parts or components of a tool (vs. Components, which are permanent parts). Slot exchange events can be used to document changes on slots. This is the initial slot configuration!
    """
    events: list[Event] | None = Field(
        None,
        range="Category:OSWb97757b46edb430591758662c18d354d",
        title="Event(s)",
        title_={"de": "Ereignis(se)"},
    )


class Event(Item):
    """
    Something that happens or takes place, esp. something significant or noteworthy; an incident, an occurrence (according to Oxford English Dictionary).
    """

    class Config:
        schema_extra = {
            "@context": [
                {
                    "duration": {"@id": "Property:HasDuration"},
                    "duration*": {"@id": "schema:duration"},
                    "end_date": {"@id": "Property:HasEndDate", "@type": "xs:date"},
                    "end_date*": {"@id": "schema:endDate", "@type": "xs:date"},
                    "end_date_time": {
                        "@id": "Property:HasEndDateAndTime",
                        "@type": "xs:dateTime",
                    },
                    "end_date_time*": {"@id": "schema:endDate", "@type": "xs:dateTime"},
                    "start_date": {"@id": "Property:HasStartDate", "@type": "xs:date"},
                    "start_date*": {"@id": "schema:startDate", "@type": "xs:date"},
                    "start_date_time": {
                        "@id": "Property:HasStartDateAndTime",
                        "@type": "xs:dateTime",
                    },
                    "start_date_time*": {
                        "@id": "schema:startDate",
                        "@type": "xs:dateTime",
                    },
                },
                "/wiki/Category:Item?action=raw&slot=jsonschema",
            ],
            "uuid": "b97757b4-6edb-4305-9175-8662c18d354d",
            "title": "Event",
            "title*": {"en": "Event", "de": "Ereignis"},
            "description": "Something that happens or takes place, esp. something significant or noteworthy; an incident, an occurrence (according to Oxford English Dictionary).",
            "description*": {
                "en": "Something that happens or takes place, esp. something significant or noteworthy; an incident, an occurrence (according to Oxford English Dictionary).",
                "de": "Etwas, das geschieht oder stattfindet, insbesondere etwas Bedeutendes oder Bemerkenswertes; ein Ereignis, ein Vorfall.",
            },
        }

    type: list[str] | None = ["Category:OSWb97757b46edb430591758662c18d354d"]
    start_date: date | None = Field(
        None,
        options={"flatpicker": {}},
        title="Start date",
        title_={"de": "Beginn (Datum)"},
    )
    start_date_time: datetime | None = Field(
        None, title="Start date and time", title_={"de": "Beginn (Datum und Uhrzeit)"}
    )
    end_date: date | None = Field(
        None,
        options={"flatpicker": {}},
        title="End date",
        title_={"de": "Ende (Datum)"},
    )
    end_date_time: datetime | None = Field(
        None, title="End date and time", title_={"de": "Ende (Datum und Uhrzeit)"}
    )
    duration: Duration | None = Field(None, title="Duration", title_={"de": "Dauer"})


class DigitalDocument(CreativeWork):
    """
    An electronic file or document.
    """

    class Config:
        schema_extra = {
            "@context": [
                "/wiki/Category:OSW712583f2479944deb2546b77cf860dda?action=raw&slot=jsonschema"
            ],
            "uuid": "afcac839-79f4-4722-98b6-acdc01981728",
            "title": "DigitalDocument",
            "title*": {"en": "Digital document"},
            "description": "An electronic file or document.",
            "description*": {"en": "An electronic file or document."},
        }

    type: list[str] | None = ["Category:OSWafcac83979f4472298b6acdc01981728"]


class StandardOperatingProcedure(DigitalDocument):
    """
    A standard operating procedure (SOP) is a set of step-by-step instructions compiled by an organization to help workers carry out routine operations. SOPs aim to achieve efficiency, quality output, and uniformity of performance, while reducing miscommunication and failure to comply with industry regulations.
    """

    class Config:
        schema_extra = {
            "@context": [
                "/wiki/Category:OSWafcac83979f4472298b6acdc01981728?action=raw&slot=jsonschema"
            ],
            "uuid": "a2c8dd38-7d0b-4a0c-807a-5a7bde190ba3",
            "title": "StandardOperatingProcedure",
            "title*": {
                "en": "Standard Operation Procedure",
                "de": "Standard Operating Procedure",
            },
            "description": "A standard operating procedure (SOP) is a set of step-by-step instructions compiled by an organization to help workers carry out routine operations. SOPs aim to achieve efficiency, quality output, and uniformity of performance, while reducing miscommunication and failure to comply with industry regulations.",
            "description*": {
                "en": "A standard operating procedure (SOP) is a set of step-by-step instructions compiled by an organization to help workers carry out routine operations. SOPs aim to achieve efficiency, quality output, and uniformity of performance, while reducing miscommunication and failure to comply with industry regulations.",
                "de": "Eine Standardarbeitsanweisung (SOP) ist eine Reihe von Schritt-für-Schritt-Anweisungen, die von einer Organisation zusammengestellt werden, um den Mitarbeitern bei der Durchführung von Routinearbeiten zu helfen[1].",
            },
            "defaultProperties": ["attachments"],
        }

    type: list[str] | None = ["Category:OSWa2c8dd387d0b4a0c807a5a7bde190ba3"]


# generated by datamodel-codegen:
#   filename:  OSWe5aa96bffb1c4d95be7fbd46142ad203.json
#   timestamp: 2026-01-05T17:29:50+00:00


class Status(str, Enum):
    Item_OSWaa8d29404288446a9f3ec7afa4e2a512 = (
        "Item:OSWaa8d29404288446a9f3ec7afa4e2a512"
    )
    """
    To do
    """
    Item_OSWa2b4567ad4874ea1b9adfed19a3d06d1 = (
        "Item:OSWa2b4567ad4874ea1b9adfed19a3d06d1"
    )
    """
    In work
    """
    Item_OSWf474ec34b7df451ea8356134241aef8a = (
        "Item:OSWf474ec34b7df451ea8356134241aef8a"
    )
    """
    Done
    """


class DisplayName(OswBaseModel):
    class Config:
        schema_extra = {"title": "Display name", "title*": {"de": "Anzeigenamen"}}

    text: Any | None = Field(
        None,
        dynamic_template="{{first_name}}{{#each middle_name}} {{.}}{{/each}}{{#if surname}} {{{surname}}}{{/if}}",
        readonly=True,
        watch={
            "first_name": "root.first_name",
            "middle_name": "root.middle_name",
            "surname": "root.surname",
        },
    )
    lang: str | None = "en"


class GPSCoordinates(OswBaseModel):
    class Config:
        schema_extra = {
            "title": "GPS coordinates",
            "title*": {"en": "GPS coordinates", "de": "GPS Koordinaten"},
            "eval_template": {
                "type": "wikitext",
                "value": "{{{latitude|}}}, {{{longitude|}}}",
            },
            "defaultProperties": ["uuid", "latitude", "longitude"],
        }

    uuid: UUID = Field(default_factory=uuid4, options={"hidden": True}, title="UUID")
    latitude: confloat(ge=-90.0, le=90.0) | None = Field(
        None,
        description_={
            "de": "Die Winkelmessung reicht von 0 Grad am Aequator bis +90 Grad am Nordpol und minus 90 Grad am Suedpol."
        },
        title="Latitude",
        title_={"en": "Latitude", "de": "Breitengrad"},
    )
    """
    Angular measurement ranging from 0 degree at the equator to +90 degree at the North Pole and minus 90 degree at the South Pole.
    """
    longitude: confloat(ge=-180.0, le=180.0) | None = Field(
        None,
        description_={
            "de": "Die Winkelmessung reicht von 0 Grad am Nullmeridian bis +180 Grad im Osten und minus 180 Grad im Westen."
        },
        title="Longitude",
        title_={"en": "Longitude", "de": "Laengengrad"},
    )
    """
    Angular measurement ranging from 0 degree at the Prime Meridian to +180 degree eastward and minus 180 degree westward.
    """


class ProjectTypeDeprecated(str, Enum):
    """
    Replaced with Project / Funding Type
    """

    house_project = "house_project"
    """
    House project
    """
    internal = "internal"
    """
    Internal
    """
    public = "public"
    """
    Public
    """
    industry = "industry"
    """
    Industry
    """


class WeightedSum(OswBaseModel):
    class Config:
        schema_extra = {
            "_allOf": [{"$ref": "QuantityProperty.json"}],
            "title": "weighted sum",
            "title*": {"de": "Gewichtete Summe"},
            "_description": "weighted with probability of successful funding",
            "_description*": {"de": "gewichtet mit Erfolgswahrscheinlichkeit"},
            "options": {
                "disable_collapse": True,
                "disable_properties": True,
                "compact": True,
            },
        }

    uuid: UUID = Field(default_factory=uuid4, options={"hidden": True}, title="UUID")
    quantity: str | None = Field("Property:HasWeightedBudget", options={"hidden": True})
    numerical_value: str = Field(
        ...,
        dynamic_template="{{#calc 0.01 '*'}}{{#calc probability_of_successful_funding '*'}}{{yearly_budget_sum_value}}{{/calc}}{{/calc}}",
        field_format="template",
        options={
            "grid_columns": 12,
            "hidden": True,
            "dynamic_template": {"override": "always"},
        },
        watch={
            "probability_of_successful_funding": "probability_of_successful_funding.numerical_value",
            "yearly_budget_sum_value": "yearly_budget.yearly_budget_sum.numerical_value",
        },
    )
    value: str = Field(
        ...,
        field_format="template",
        field_watch={
            "probability_of_successful_funding": "probability_of_successful_funding.numerical_value",
            "yearly_budget_sum_value": "yearly_budget.yearly_budget_sum.numerical_value",
            "yearly_budget_sum_unit_symbol": "yearly_budget.yearly_budget_sum.unit_symbol",
        },
        options={"grid_columns": 12, "hidden": False},
        template="{{{numerical_value}}} {{{unit_symbol}}}",
        title="Wert",
        watch={
            "numerical_value": "statement.numerical_value",
            "unit_symbol": "statement.unit_symbol",
        },
    )
    unit: str = Field(
        ...,
        field_format="template",
        options={"grid_columns": 6, "hidden": True},
        propertyOrder=1001,
        template="{{yearly_budget_sum_unit}}",
        title="Currency",
        title_={"de": "Währung"},
        watch={"yearly_budget_sum_unit": "yearly_budget.yearly_budget_sum.unit"},
    )
    unit_symbol: str = Field(
        ...,
        options={"grid_columns": 6, "hidden": True},
        template="{{yearly_budget_sum_unit_symbol}}",
        watch={
            "yearly_budget_sum_unit_symbol": "yearly_budget.yearly_budget_sum.unit_symbol"
        },
    )


class Quantity(OswBaseModel):
    class Config:
        schema_extra = {
            "@context": {
                "Property": "https://wiki-dev.open-semantic-lab.org/id/Property-3A",
                "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
                "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
                "quantity*": "Property:HasProperty",
                "quantity": "rdf:predicate",
                "value*": "Property:HasObject",
                "value": "rdf:object",
                "unit": "Property:HasUnit",
            },
            "$comment": "A reduced version of JsonSchema:Statement",
            "title": "Quantity",
            "title*": {"de": "Menge"},
            "_headerTemplate": "{{self.value}}",
        }

    uuid: UUID = Field(default_factory=uuid4, options={"hidden": True}, title="UUID")
    quantity: str = Field(
        ...,
        options={
            "grid_columns": 8,
            "autocomplete": {"category": "Category:QuantityProperty"},
        },
        propertyOrder=10,
        title="Property",
        title_={"de": "Attribut"},
    )
    numerical_value: str = Field(
        ...,
        options={"grid_columns": 2},
        propertyOrder=20,
        title="Value",
        title_={"de": "Wert"},
    )
    unit: str = Field(
        ...,
        options={
            "grid_columns": 2,
            "autocomplete": {
                "query": "[[-HasInputUnit::{{$(quantity)}}]][[Display_title_of::like:*{{_user_input}}*]]|?Display_title_of=label",
                "render_template": {
                    "type": ["handlebars"],
                    "value": "{{result.printouts.label.[0]}}",
                },
                "field_maps": [
                    {
                        "source_path": "$",
                        "template": "{{{result.printouts.label.[0]}}}",
                        "target_path": "$(unit_symbol)",
                    }
                ],
            },
        },
        propertyOrder=30,
        title="Unit",
        title_={"de": "Einheit"},
        watch={
            "quantity": "statement.quantity",
            "unit_symbol": "statement.unit_symbol",
        },
    )
    unit_symbol: str = Field(..., options={"hidden": True})
    value: str = Field(
        ...,
        options={"hidden": True},
        template="{{{numerical_value}}} {{{unit_symbol}}}",
        title="Value",
        title_={"de": "Wert"},
        watch={
            "numerical_value": "statement.numerical_value",
            "unit_symbol": "statement.unit_symbol",
        },
    )


class ProbabilityOfSuccessfulFundingInPercent(Quantity):
    """
    Indicates the likelihood that the funding will be approved, determines the weighted budget
    """

    class Config:
        schema_extra = {
            "title": "Probability of Successful Funding in percent",
            "title*": {
                "de": "Wahrscheinlichkeit einer erfolgreichen Förderung in Prozent"
            },
            "description": "Indicates the likelihood that the funding will be approved, determines the weighted budget",
            "description*": {
                "de": "Gibt die Wahrscheinlichkeit an, dass die Förderung genehmigt wird, bestimmt das gewichtete Budget"
            },
        }

    quantity: str | None = Field(
        "Property:HasProbabilityOfSuccessfulFunding", options={"hidden": True}
    )
    unit: str | None = Field(
        "Property:HasDimensionlessRatio#OSW8b3dc9b793074afc8ab8b03041f97f16",
        readOnly=True,
    )


class TotalBudget(Quantity):
    class Config:
        schema_extra = {"title": "Total Budget", "title*": {"de": "Budgetsumme"}}

    quantity: str | None = Field("Property:HasBudget", options={"hidden": True})
    unit: str | None = Field(None, title="Currency", title_={"de": "Währung"})


class YearlyBudgetSum(Quantity):
    class Config:
        schema_extra = {
            "title": "Yearly Budget Sum",
            "title*": {"de": "Summe Jahresbudget"},
            "options": {
                "disable_collapse": True,
                "disable_properties": True,
                "compact": True,
            },
        }

    quantity: str | None = Field("Property:HasBudget", options={"hidden": True})
    numerical_value: str | None = Field(None, options={"grid_columns": 6})
    unit: str | None = Field(
        None,
        options={"grid_columns": 6},
        propertyOrder=1001,
        title="Currency",
        title_={"de": "Währung"},
    )


class IDAndCountry(OswBaseModel):
    class Config:
        schema_extra = {"title": "ID and country", "title*": {"de": "ID und Land"}}

    tax_id: str | None = Field(None, title="ID", title_={"de": "ID"})
    country: Country | None = Field(
        None,
        range="Category:OSW0551abcd6f734047825e3ded4c8a0ffe",
        title="Country",
        title_={"de": "Land"},
    )


class IDAndCountry1(OswBaseModel):
    class Config:
        schema_extra = {"title": "ID and country", "title*": {"de": "ID und Land"}}

    vat_id: str | None = Field(None, title="ID", title_={"de": "ID"})
    country: Country | None = Field(
        None,
        range="Category:OSW0551abcd6f734047825e3ded4c8a0ffe",
        title="Country",
        title_={"de": "Land"},
    )


class PostalAddress(OswBaseModel):
    class Config:
        schema_extra = {
            "@context": {
                "address_supplement": {
                    "@id": "Property:HasAddressSupplement",
                    "@type": "xsd:string",
                },
                "city": {"@id": "Property:HasCity", "@type": "@id"},
                "city*": {"@id": "schema:containedInPlace", "@type": "@id"},
                "city**": {"@id": "Property:IsLocatedIn", "@type": "@id"},
                "country": {"@id": "schema:addressCountry", "@type": "@id"},
                "country*": {"@id": "Property:HasCountry", "@type": "@id"},
                "house_no": {"@id": "Property:HasHouseNo", "@type": "xsd:string"},
                "postal_code": {"@id": "schema:postalCode", "@type": "xsd:string"},
                "postal_code*": {
                    "@id": "Property:HasPostalCode",
                    "@type": "xsd:string",
                },
                "post_office_box_no": {
                    "@id": "schema:postOfficeBoxNumer",
                    "@type": "xsd:string",
                },
                "post_office_box_no*": {
                    "@id": "Property:HasPoBoxNo",
                    "@type": "xsd:string",
                },
                "region": {"@id": "schema:addressRegion", "@type": "@id"},
                "region*": {"@id": "Property:HasRegion", "@type": "@id"},
                "state": {"@id": "schema:addressCountry", "@type": "@id"},
                "state*": {"@id": "Property:HasState", "@type": "@id"},
                "street_name": {"@id": "Property:HasStreet", "@type": "xsd:string"},
            },
            "title": "Postal address",
            "title*": {"en": "Postal address", "de": "Postalische Adresse"},
            "description": "",
            "eval_template": {
                "type": "wikitext",
                "mode": "render",
                "value": "{{#if: {{{addressee|}}}|{{{addressee|}}}<br>|}}{{{street_name|}}} {{{house_no|}}}<br>{{#if: {{{address_supplement|}}}|{{{address_supplement|}}}<br>|}}{{{postal_code|}}} {{#if: {{{city|}}} |[[{{{city|}}}]]|{{{city_name|}}} }}, {{#if: {{{region|}}}|[[{{{region|}}}]],&nbsp;|}}{{#if: {{{state|}}}|[[{{{state|}}}]],&nbsp;|}}{{#if: {{{country|}}} |[[{{{country|}}}]]|{{{country_name|}}} }}{{#if: {{{post_office_box_no|}}}|<br>{{#switch:{{USERLANGUAGECODE}}|#default=PO Box No|de=Postfach-Nr.}} {{{post_office_box_no|}}}|}}",
            },
            "defaultProperties": [
                "uuid",
                "street_name",
                "house_no",
                "postal_code",
                "city",
                "city_name",
                "country",
                "country_name",
                "address_supplement",
                "state",
                "region",
                "post_office_box_no",
            ],
        }

    uuid: UUID = Field(default_factory=uuid4, options={"hidden": True})
    country: Country | None = Field(
        None,
        range="Category:OSW0551abcd6f734047825e3ded4c8a0ffe",
        title="Country",
        title_={"en": "Country", "de": "Land"},
    )
    country_name: str | None = Field(
        None, title="Country (text)", title_={"de": "Land (Text)"}
    )
    state: State | None = Field(
        None,
        range="Category:OSWab60f9a227954ee0be92344ff6272420",
        title="State",
        title_={"en": "State", "de": "Bundesland"},
    )
    region: Region | None = Field(
        None,
        range="Category:OSW95efaf34e2c7439e8e7967233910e44b",
        title="Region",
        title_={"en": "Region", "de": "Region"},
    )
    post_office_box_no: str | None = Field(
        None,
        title="PO box number",
        title_={"en": "PO box number", "de": "Postfach nummer"},
    )
    postal_code: str | None = Field(
        None, title="Postal code", title_={"en": "Postal code", "de": "Postleitzahl"}
    )
    city: City | None = Field(
        None,
        range="Category:OSW807f1da5b42e42f296b213ab06ca873b",
        title="City",
        title_={"en": "City", "de": "Stadt"},
    )
    city_name: str | None = Field(
        None, title="City (text)", title_={"de": "Stadt (Text)"}
    )
    street_name: str | None = Field(
        None, title="Street", title_={"en": "Street", "de": "Straße"}
    )
    house_no: str | None = Field(
        None, title="House number", title_={"en": "House number", "de": "Hausnummer"}
    )
    address_supplement: str | None = Field(
        None,
        title="Address supplement",
        title_={"en": "Address supplement", "de": "Adresszusatz"},
    )
    addressee: str | None = Field(
        None,
        description_={
            "de": "Titelzeile der Adresse falls abweichend vom Organisationsname"
        },
        title="Addressee",
        title_={"de": "Adressat"},
    )
    """
    Title line of the address in case different from organization name
    """


class YearlyBudget(OswBaseModel):
    class Config:
        schema_extra = {
            "title": "Yearly budget",
            "title*": {"de": "Jahresbudget"},
            "defaultProperties": [
                "budget_year",
                "yearly_budget_sum",
                "budget_type",
                "budget_ou",
            ],
        }

    uuid: UUID = Field(default_factory=uuid4, options={"hidden": True}, title="UUID")
    budget_year: str | None = Field(None, title="Year", title_={"de": "Jahr"})
    yearly_budget_sum: YearlyBudgetSum | None = Field(
        None,
        options={"disable_collapse": True, "disable_properties": True, "compact": True},
        title="Yearly Budget Sum",
        title_={"de": "Summe Jahresbudget"},
    )
    yearly_budget_sum_weighted: WeightedSum | None = Field(
        None,
        field_allOf=[{"$ref": "QuantityProperty.json"}],
        field_description="weighted with probability of successful funding",
        field_description_={"de": "gewichtet mit Erfolgswahrscheinlichkeit"},
        options={"disable_collapse": True, "disable_properties": True, "compact": True},
        title="weighted sum",
        title_={"de": "Gewichtete Summe"},
    )
    budget_start: date | None = Field(None, title="Start", title_={"de": "Beginn"})
    budget_end: date | None = Field(None, title="End", title_={"de": "Ende"})
    budget_ou: OrganizationalUnit | None = Field(
        None,
        range="Category:OSW3cb8cef2225e403092f098f99bc4c472",
        title="OU",
        title_={"en": "OU", "de": "OE"},
    )
    budget_type: BudgetType | None = Field(
        None,
        range="Category:OSW595b282aedf048788f3ee326454792ce",
        title="Type",
        title_={"de": "Typ"},
    )


class Process(Item):
    """
    Members of the Process Category describe the act of changing the state or properties of something
    """

    class Config:
        schema_extra = {
            "@context": [
                "/wiki/Category:Item?action=raw&slot=jsonschema",
                {
                    "type": {"@id": "Property:HasType", "@type": "@id"},
                    "type*": {"@id": "Property:HasSchema", "@type": "@id"},
                    "tool": {"@id": "Property:HasTool", "@type": "@id"},
                    "input": {"@id": "Property:HasInput", "@type": "@id"},
                    "location": {"@id": "Property:HasLocation", "@type": "@id"},
                    "location_name": {"@id": "Property:HasLocation", "@type": "@id"},
                    "output": {"@id": "Property:HasOutput", "@type": "@id"},
                    "creator": {"@id": "Property:HasCreator", "@type": "@id"},
                    "actionees": {"@id": "Property:HasActionee", "@type": "@id"},
                    "projects": {"@id": "Property:HasProject", "@type": "@id"},
                    "status": {"@id": "Property:HasStatus", "@type": "@id"},
                    "start_date_time": {
                        "@id": "Property:HasStartDateAndTime",
                        "@type": "xsd:dateTime",
                    },
                    "end_date_time": {
                        "@id": "Property:HasEndDateAndTime",
                        "@type": "xsd:dateTime",
                    },
                    "subprocesses": {"@id": "Property:HasPart", "@type": "@id"},
                },
            ],
            "title": "Process",
            "title*": {"en": "Process", "de": "Prozess"},
            "uuid": "5a07d666-c55b-4ffa-89d4-9633c708029d",
            "description": "Members of the Process Category describe the act of changing the state or properties of something",
            "description*": {
                "en": "Members of the Process Category describe the act of changing the state or properties of something",
                "de": "Prozesse beschreiben den Akt des Änderns eines Zustandes oder der Eigenschaften von etwas.",
            },
            "defaultProperties": [
                "actionees",
                "start_date_time",
                "tool",
                "input",
                "output",
            ],
        }

    type: list[str] | None = ["Category:OSWe5aa96bffb1c4d95be7fbd46142ad203"]
    creator: Person | None = Field(
        None,
        range="Category:OSW44deaa5b806d41a2a88594f562b110e9",
        title="Creator",
        title_={"de": "Ersteller"},
    )
    actionees: list[Person] | None = Field(
        None,
        range="Category:OSW44deaa5b806d41a2a88594f562b110e9",
        title="Actionees",
        title_={"de": "Akteure"},
    )
    start_date_time: datetime | None = Field(
        None,
        field_comment='Note: To hide the time, you can set {"options":  {"flatpickr": {"dateFormat": "Z", "altInput": true, "altFormat": "Y-m-d"}}}',
        title="Start time",
        title_={"de": "Startzeitpunkt"},
    )
    end_date_time: datetime | None = Field(
        None, title="End time", title_={"de": "Endzeitpunkt"}
    )
    location: Location | None = Field(
        None,
        range="Category:OSW3d238d05316e45a4ac95a11d7b24e36b",
        title="Location",
        title_={"de": "Ort"},
    )
    location_name: str | None = Field(
        None,
        description_={
            "de": "Vorzugsweise sollte ein Ort aus dem Autocomplete-Feld 'Ort' ausgewählt oder erstellt werden."
        },
        title="Location (text)",
        title_={"de": "Ort (Text)"},
    )
    """
    Its prefered to select or create a location from or in the autocomplete field 'Location'.
    """
    status: Status | None = Field(
        None,
        field_format="autocomplete",
        options={
            "_autocomplete": {
                "category": "Category:OSW9725d7a91bab4f1aa68f423e4e9bfcf4"
            },
            "enum_titles": ["To do", "In work", "Done"],
            "enum_titles*": {"de": ["Zu tun", "In Arbeit", "Erledigt"]},
            "grid_columns": 6,
        },
        title="Status",
    )
    tool: list[Tool] | None = Field(
        None,
        options={"conditional_visible": {"modes": ["query", "default"]}},
        range="Category:OSWe427aafafbac4262955b9f690a83405d",
        title="Tools",
        title_={"de": "Werkzeuge"},
    )
    input: list[Item] | None = Field(
        None,
        options={"conditional_visible": {"modes": ["query", "default"]}},
        range="Category:Item",
        title="Inputs",
        title_={"de": "Eingangsressource (Input)"},
    )
    output: list[Item] | None = Field(
        None,
        options={"conditional_visible": {"modes": ["query", "default"]}},
        range="Category:Item",
        title="Outputs",
        title_={"de": "Ausgangsressource (Output)"},
    )
    projects: list[Project] | None = Field(
        None,
        options={"conditional_visible": {"modes": ["query", "default"]}},
        range="Category:OSWb2d7e6a2eff94c82b7f1f2699d5b0ee3",
        title="Project(s)",
        title_={"de": "Projekt(e)"},
    )
    parameters: dict[str, Any] | None = Field(None, title="Parameters")


class Person(Item):
    """
    Category for a person in general. Subcategories are e.g. 'User', i.e. persons who have a user ID.
    """

    class Config:
        schema_extra = {
            "@context": [
                {
                    "competence": {"@id": "schema:knowsAbout", "@type": "@id"},
                    "competence*": {"@id": "Property:HasCompetence", "@type": "@id"},
                    "email": {"@id": "schema:email", "@type": "xsd:string"},
                    "email*": {"@id": "Property:HasEmail", "@type": "xsd:string"},
                    "fax_number": {"@id": "schema:faxNumber", "@type": "xsd:string"},
                    "fax_number*": {
                        "@id": "Property:HasFaxNumber",
                        "@type": "xsd:string",
                    },
                    "first_name": {"@id": "schema:givenName", "@type": "xsd:string"},
                    "first_name*": {
                        "@id": "Property:HasFirstName",
                        "@type": "xsd:string",
                    },
                    "located_in": {"@id": "schema:workLocation", "@type": "@id"},
                    "located_in*": {"@id": "Property:IsLocatedIn", "@type": "@id"},
                    "middle_name": {
                        "@id": "schema:additionalName",
                        "@type": "xsd:string",
                    },
                    "middle_name*": {
                        "@id": "Property:HasMiddleName",
                        "@type": "xsd:string",
                    },
                    "orcid": {"@id": "schema:identifier", "@type": "xsd:string"},
                    "orcid*": {"@id": "Property:HasOrcidId", "@type": "xsd:string"},
                    "organization": {"@id": "schema:worksFor", "@type": "@id"},
                    "organization*": {
                        "@id": "Property:HasOrganization",
                        "@type": "@id",
                    },
                    "organization**": {"@id": "Property:HasOu", "@type": "@id"},
                    "organizational_unit": {"@id": "schema:memberOf", "@type": "@id"},
                    "organizational_unit*": {"@id": "Property:HasOu", "@type": "@id"},
                    "phone_number": {"@id": "schema:telephone", "@type": "xsd:string"},
                    "phone_number*": {
                        "@id": "Property:HasPhoneNumber",
                        "@type": "xsd:string",
                    },
                    "role": {"@id": "schema:jobTitle", "@type": "@id"},
                    "role*": {"@id": "Property:HasRole", "@type": "@id"},
                    "surname": {"@id": "schema:familyName", "@type": "xsd:string"},
                    "surname*": {"@id": "Property:HasSurname", "@type": "xsd:string"},
                    "topic": {"@id": "schema:knowsAbout", "@type": "@id"},
                    "topic*": {"@id": "Property:HasTopic", "@type": "@id"},
                    "website": {"@id": "schema:subjectOf", "@type": "xsd:string"},
                    "website*": {"@id": "Property:HasWebsite", "@type": "xsd:string"},
                },
                "/wiki/Category:Item?action=raw&slot=jsonschema",
            ],
            "title": "Person",
            "title*": {"de": "Person", "en": "Person"},
            "uuid": "44deaa5b-806d-41a2-a885-94f562b110e9",
            "description": "Category for a person in general. Subcategories are e.g. 'User', i.e. persons who have a user ID.",
            "description*": {
                "en": "Category for a person in general. Subcategories are e.g. 'User', i.e. persons who have a user ID.",
                "de": "Kategorie für eine Person im Allgemeinen. Unterkategorien sind bsp. 'User', also Personen die über eine Nutzerkennung verfügen.",
            },
            "data_source_maps": [
                {
                    "id": "pub.orcid.org",
                    "source": "https://pub.orcid.org/v3.0/{{#split '/' -1}}{{orcid}}{{/split}}",
                    "format": "jsonld",
                    "label": "ORCID",
                    "required": ["orcid"],
                    "object_map": {
                        "first_name": "$.givenName",
                        "surname": "$.familyName",
                    },
                }
            ],
            "defaultProperties": [
                "first_name",
                "surname",
                "organization",
                "email",
                "phone_number",
            ],
        }

    type: list[str] | None = ["Category:OSW44deaa5b806d41a2a88594f562b110e9"]
    first_name: str = Field(
        ...,
        propertyOrder=-3,
        title="First name / Given name / Forename",
        title_={"de": "Vorname"},
    )
    middle_name: set[str] | None = Field(
        None,
        propertyOrder=-2,
        title="Middle name(s)",
        title_={"de": "Zweite(r) Vorname(n)"},
    )
    surname: str = Field(
        ...,
        propertyOrder=-1,
        title="Last name / Family name / Surname",
        title_={"de": "Nachname"},
    )
    label: list[DisplayName] | None = Field(None, options={"hidden": True})
    organization: set[OrganizationalUnit] | None = Field(
        None,
        description_={
            "de": "Organisation(en), derer die Person Mitglied ist. Z.B. Universität, Forschungsinstitut, Unternehmen, etc."
        },
        range="Category:OSW3cb8cef2225e403092f098f99bc4c472",
        title="Organization",
        title_={"de": "Organisation"},
    )
    """
    Organization(s) the person is affiliated with. E.g., university, research institute, company, etc.
    """
    organizational_unit: set[OrganizationalSubUnit] | None = Field(
        None,
        description_={
            "de": "Organisations(unter)einheit(en), derer die Person Mitglied ist. Z.B. Fakultät, Institut, Abteilung oder Forschungsgruppe, etc."
        },
        range="Category:OSWfe3e842b804445c7bb0dd8ee61da2d70",
        title="Organizational (sub)unit",
        title_={"de": "Organisations(unter)einheit"},
    )
    """
    Organizational (sub)unit(s) the person is member of. E.g., faculty, institute, department or research group, etc.
    """
    email: set[EmailStr] | None = Field(
        None,
        eval_template={
            "type": "mustache-wikitext",
            "mode": "render",
            "value": "{{#email}}[mailto:{{.}} {{.}}] <br>{{/email}}",
        },
        title="Email address",
        title_={"de": "E-Mail Adresse"},
    )
    website: set[AnyUrl] | None = Field(
        None,
        eval_template={
            "type": "mustache-wikitext",
            "mode": "render",
            "value": "{{#website}}{{{.}}} <br>{{/website}}",
        },
        title="Website",
        title_={"de": "Webseite"},
    )
    orcid: AnyUrl | None = Field(
        None,
        description_={
            "de": "Die ORCID iD ist eine https URI mit einer 16-stelligen Nummer, z. B. https://orcid.org/0000-0001-2345-6789."
        },
        title="ORCID iD",
        title_={"de": "ORCID iD"},
    )
    """
    The ORCID iD is an https URI with a 16-digit number, e.g., https://orcid.org/0000-0001-2345-6789.
    """
    phone_number: (
        set[
            constr(
                regex=r"(?:(?:(?:\+|00|011)[\.\/\-\ \t]*([17]|2(?:[07]|[1-689]\d)|3(?:[0-4679]|[578]\d)|4(?:[013-9]|2\d)|5(?:[1-8]|[09]\d)|6(?:[0-6]|[789]\d)|8(?:[1246]|[035789]\d)|9(?:[0-58]|[679]\d))[\.\/\-\ \t]*|([17])[\.\/\-\ ])?(?:\((\d{1,6})\)[\.\/\-\ \t]*)?(?:(\d{1,6})[\.\/\-\ ])?(?:(\d{1,6})[\.\/\-\ ])?(?:(\d{1,6})[\.\/\-\ ])?(?:(\d{1,6})[\.\/\-\ ])?(\d{0,10}?)(\d{1,})(?:[\.\/\-;\ \t]*e?xt?[\.\/\-=\ \t]*(\d{1,14}))?)?"
            )
        ]
        | None
    ) = Field(
        None,
        description_={
            "de": "Telefonnummer mit Landesvorwahl und Bindestrichen formatiert, z.B.. +49-931-4100-172. Entsprechend https://www.wikidata.org/wiki/Property:P1329"
        },
        eval_template={
            "type": "mustache-wikitext",
            "mode": "render",
            "value": "{{#phone_number}}[tel:{{.}} {{.}}] <br>{{/phone_number}}",
        },
        title="Phone number",
        title_={"de": "Telefonnummer"},
    )
    """
    Phone number formatted with country code and hyphens, e.g.. +49-931-4100-172. According to https://www.wikidata.org/wiki/Property:P1329
    """
    fax_number: (
        set[
            constr(
                regex=r"(?:(?:(?:\+|00|011)[\.\/\-\ \t]*([17]|2(?:[07]|[1-689]\d)|3(?:[0-4679]|[578]\d)|4(?:[013-9]|2\d)|5(?:[1-8]|[09]\d)|6(?:[0-6]|[789]\d)|8(?:[1246]|[035789]\d)|9(?:[0-58]|[679]\d))[\.\/\-\ \t]*|([17])[\.\/\-\ ])?(?:\((\d{1,6})\)[\.\/\-\ \t]*)?(?:(\d{1,6})[\.\/\-\ ])?(?:(\d{1,6})[\.\/\-\ ])?(?:(\d{1,6})[\.\/\-\ ])?(?:(\d{1,6})[\.\/\-\ ])?(\d{0,10}?)(\d{1,})(?:[\.\/\-;\ \t]*e?xt?[\.\/\-=\ \t]*(\d{1,14}))?)?"
            )
        ]
        | None
    ) = Field(
        None,
        description_={
            "de": "Faxnummer mit Landesvorwahl und Bindestrichen formatiert, z.B.. +49-931-4100-172. Entsprechend https://www.wikidata.org/wiki/Property:P1329"
        },
        eval_template={
            "type": "mustache-wikitext",
            "mode": "render",
            "value": "{{#fax_number}}[tel:{{.}} {{.}}] <br>{{/fax_number}}",
        },
        title="Fax number",
        title_={"de": "Faxnummer"},
    )
    """
    Fax number formatted with country code and hyphens, e.g.. +49-931-4100-172. According to https://www.wikidata.org/wiki/Property:P1329
    """
    located_in: set[Site] | None = Field(
        None,
        range="Category:OSW473d7a1ed48544d1be83b258b5810948",
        title="Located at ",
        title_={"de": "Tätig an (Standort)"},
    )
    role: set[PersonRole] | None = Field(
        None,
        range="Category:OSW5efde23b1d8c4e1c864ef039cb0616ed",
        title="Roles",
        title_={"de": "Rollen"},
    )
    competence: set[Competence] | None = Field(
        None,
        range="Category:OSW5eb9c52b804544dc870dfd54ff434428",
        title="Competences",
        title_={"de": "Kompetenzen"},
    )
    topic: set[Topic] | None = Field(
        None,
        range="Category:OSW5a13eeda5ed5405ea7ef62ea6feeceec",
        title="Topics",
        title_={"de": "Themen"},
    )


class OrganizationalUnit(Item):
    """
    The most general kind of organizational unit - an organization but also parts of an organization
    """

    class Config:
        schema_extra = {
            "@context": [
                {
                    "abbreviation": {"@id": "Property:HasId", "@type": "xsd:string"},
                    "abbreviation*": {
                        "@id": "Property:HasAbbreviation",
                        "@type": "xsd:string",
                    },
                    "abbreviation**": {
                        "@id": "Property:HasAcronym",
                        "@type": "xsd:string",
                    },
                    "competence": {"@id": "schema:knowsAbout", "@type": "@id"},
                    "competence*": {"@id": "Property:HasCompetence", "@type": "@id"},
                    "deputy_manager": {
                        "@id": "Property:HasDeputyManager",
                        "@type": "@id",
                    },
                    "email": {"@id": "schema:email", "@type": "xsd:string"},
                    "email*": {"@id": "Property:HasEmail", "@type": "xsd:string"},
                    "fax_number": {"@id": "schema:faxNumber", "@type": "xsd:string"},
                    "fax_number*": {
                        "@id": "Property:HasFaxNumber",
                        "@type": "xsd:string",
                    },
                    "founder": {"@id": "schema:founder", "@type": "xsd:string"},
                    "founder*": {"@id": "Property:HasFounder", "@type": "@id"},
                    "founding_date": {
                        "@id": "schema:foundingDate",
                        "@type": "xsd:date",
                    },
                    "founding_date*": {
                        "@id": "Property:HasFoundingDate",
                        "@type": "xsd:date",
                    },
                    "founding_location": {
                        "@id": "schema:foundingLocation",
                        "@type": "@id",
                    },
                    "founding_location*": {
                        "@id": "Property:HasFoundingLocation",
                        "@type": "@id",
                    },
                    "funder": {"@id": "schema:funder", "@type": "@id"},
                    "funder*": {"@id": "Property:HasFunder", "@type": "@id"},
                    "image": {"@id": "schema:logo", "@type": "@id"},
                    "image*": {"@id": "Property:HasLogo", "@type": "@id"},
                    "legal_name": {"@id": "schema:legalName", "@type": "xsd:string"},
                    "legal_name*": {
                        "@id": "Property:HasLegalName",
                        "@type": "xsd:string",
                    },
                    "mailing_list": {"@id": "Property:HasMailingList", "@type": "@id"},
                    "manager": {"@id": "Property:HasManager", "@type": "@id"},
                    "member_ous": {"@id": "schema:member", "@type": "@id"},
                    "member_ous*": {"@id": "Property:HasMember", "@type": "@id"},
                    "member_persons": {"@id": "schema:member", "@type": "@id"},
                    "member_persons*": {"@id": "Property:HasMember", "@type": "@id"},
                    "member_of": {"@id": "schema:memberOf", "@type": "@id"},
                    "member_of*": {"@id": "Property:IsMemberOf", "@type": "@id"},
                    "employees*": {"@id": "schema:employee", "@type": "@id"},
                    "employees**": {
                        "@reverse": "Property:HasOrganization",
                        "@type": "@id",
                    },
                    "phone_number": {"@id": "schema:telephone", "@type": "@id"},
                    "phone_number*": {
                        "@id": "Property:HasPhoneNumber",
                        "@type": "xsd:string",
                    },
                    "postal_address": {
                        "@id": "Property:HasPostalAddress",
                        "@type": "@id",
                        "@context": ["/wiki/JsonSchema:PostalAddress?action=raw"],
                    },
                    "ror_id": {"@id": "Property:HasRorId", "@type": "xsd:string"},
                    "secretary": {"@id": "Property:HasSecretary", "@type": "@id"},
                    "site": {"@id": "schema:location", "@type": "@id"},
                    "site*": {"@id": "Property:IsLocatedIn", "@type": "@id"},
                    "superordinate_ou": {
                        "@id": "schema:parentOrganization",
                        "@type": "@id",
                    },
                    "superordinate_ou*": {
                        "@id": "Property:HasSuperordinateOu",
                        "@type": "@id",
                    },
                    "tax_id": {"@id": "schema:taxID", "@type": "xsd:string"},
                    "tax_id*": {"@id": "Property:HasTaxId", "@type": "xsd:string"},
                    "topic": {"@id": "schema:knowsAbout", "@type": "@id"},
                    "topic*": {"@id": "Property:HasTopic", "@type": "@id"},
                    "vat_id": {"@id": "schema:vatID", "@type": "xsd:string"},
                    "vat_id*": {"@id": "Property:HasVatId", "@type": "xsd:string"},
                    "website": {"@id": "schema:subjectOf", "@type": "@id"},
                    "website*": {"@id": "Property:HasWebsite", "@type": "xsd:anyURI"},
                    "associated_acl_roles*": {"@id": "Property:HasAssociatedAclRole"},
                },
                "/wiki/Category:Item?action=raw&slot=jsonschema",
            ],
            "title": "OrganizationalUnit",
            "title*": {"de": "Organisationseinheit", "en": "Organizational unit"},
            "uuid": "3cb8cef2-225e-4030-92f0-98f99bc4c472",
            "description": "The most general kind of organizational unit - an organization but also parts of an organization",
            "description*": {
                "de": "Die allgemeinste Art von Organisationseinheit - eine Organisation, aber auch Teile einer Organisation",
                "en": "The most general kind of organizational unit - an organization but also parts of an organization",
            },
            "defaultProperties": ["abbreviation"],
            "x-oold-reverse-defaultProperties": ["employees"],
            "x-oold-reverse-properties": {
                "employees": {
                    "type": "array",
                    "title": "Employees",
                    "items": {
                        "type": "string",
                        "format": "autocomplete",
                        "title": "Person",
                        "$comment": "range is Person",
                        "range": "Category:OSW44deaa5b806d41a2a88594f562b110e9",
                    },
                }
            },
        }

    type: list[str] | None = ["Category:OSW3cb8cef2225e403092f098f99bc4c472"]
    abbreviation: str | None = Field(
        None,
        description_={"de": "Akronym der Organisationseinheit."},
        title="Acronym",
        title_={"de": "Akronym"},
    )
    """
    Acronym of the organizational unit.
    """
    competence: set[Competence] | None = Field(
        None,
        range="Category:OSW5eb9c52b804544dc870dfd54ff434428",
        title="Competence(s)",
        title_={"de": "Kompetenz(en)"},
    )
    deputy_manager: set[Person] | None = Field(
        None,
        range="Category:OSW44deaa5b806d41a2a88594f562b110e9",
        title="Deputy manager",
        title_={"de": "Stellvertretende:r Manager:in"},
    )
    founder: set[Person] | None = Field(
        None,
        range="Category:OSW44deaa5b806d41a2a88594f562b110e9",
        title="Founder",
        title_={"de": "Gründer:in"},
    )
    founding_date: date | None = Field(
        None,
        title="Founding date",
        title_={"en": "Founding date", "de": "Gründungsdatum"},
    )
    founding_location: str | None = Field(
        None,
        title="Founding location",
        title_={"en": "Founding location", "de": "Gründungsort"},
    )
    funder: str | None = Field(
        None,
        description_={
            "de": "Der/die Geldgeber*in eines Konsortiums ist die Organisation, die die Finanzierung des Konsortiums bereitstellt"
        },
        options={
            "autocomplete": {
                "query": "[[Category:OSW3cb8cef2225e403092f098f99bc4c472]] OR [[Category:OSW44deaa5b806d41a2a88594f562b110e9]] |?Display_title_of=label"
            }
        },
        title="Funder",
        title_={"de": "Förderer*in"},
    )
    """
    The Funder of a Consortium is the Organization that provides the funding for the Consortium.
    """
    image: str | None = Field(None, title="Logo", title_={"de": "Logo"})
    legal_name: str | None = Field(
        None, title="Legal name", title_={"en": "Legal name", "de": "Rechtlicher Name"}
    )
    legal_form: str | None = Field(
        None, title="Legal form", title_={"en": "Legal form", "de": "Rechtsform"}
    )
    mailing_list: set[EmailStr] | None = Field(
        None,
        description_={"de": "Mailingliste der Organisationseinheit."},
        title="Mailing list",
        title_={"de": "E-Mail-Verteiler"},
    )
    """
    Mailing list of the organizational unit.
    """
    manager: set[Person] | None = Field(
        None,
        range="Category:OSW44deaa5b806d41a2a88594f562b110e9",
        title="Manager",
        title_={"de": "Manager:in"},
    )
    member_of: set[OrganizationalUnit] | None = Field(
        None,
        description_={
            "de": "Die Organisation(seinheit), der diese Organisation angehört."
        },
        range="Category:OSW3cb8cef2225e403092f098f99bc4c472",
        title="Member of",
        title_={"de": "Mitglied in"},
    )
    """
    The organization(al unit) this organization is a member of.
    """
    member_persons: set[Person] | None = Field(
        None,
        description_={"de": "Die Mitglieder (Personen) dieser Organisation(seinheit)."},
        range="Category:OSW44deaa5b806d41a2a88594f562b110e9",
        title="Member person(s)",
        title_={"de": "Mitgliedsperson(en)"},
    )
    """
    The members (persons) of this organization(al unit).
    """
    member_ous: set[OrganizationalUnit] | None = Field(
        None,
        description_={
            "de": "Die Mitglieder (Organisationseinheiten) dieser Organisation(seinheit)."
        },
        range="Category:OSW3cb8cef2225e403092f098f99bc4c472",
        title="Member OU(s)",
        title_={"de": "Mitglied OE(s)"},
    )
    """
    The members (organization units) of this organization(al unit).
    """
    secretary: set[Person] | None = Field(
        None,
        range="Category:OSW44deaa5b806d41a2a88594f562b110e9",
        title="Secretary",
        title_={"de": "Sekretär:in"},
    )
    postal_address: PostalAddress | None = None
    ror_id: str | None = Field(
        None,
        description_={"de": "ID bereitgestellt von https://ror.org/"},
        title="ROR ID",
        title_={"de": "ROR ID"},
    )
    """
    ID provided by https://ror.org/
    """
    site: set[Site] | None = Field(
        None,
        range="Category:OSW473d7a1ed48544d1be83b258b5810948",
        title="Site(s)",
        title_={"de": "Standort(e)"},
    )
    superordinate_ou: set[OrganizationalUnit] | None = Field(
        None,
        range="Category:OSW3cb8cef2225e403092f098f99bc4c472",
        title="Superordinate OU(s)",
        title_={"de": "Übergeordnete OE(s)"},
    )
    tax_id_obj: list[IDAndCountry] | None = Field(
        None,
        description_={"de": "Steuer-ID der Organisationseinheit."},
        title="Tax ID",
        title_={"de": "Steuer-ID"},
    )
    """
    Tax ID of the organizational unit.
    """
    vat_id_obj: list[IDAndCountry1] | None = Field(
        None,
        description_={"de": "Umsatzsteuer-ID der Organisationseinheit."},
        title="VAT ID",
        title_={"de": "Umsatzsteuer-ID"},
    )
    """
    VAT ID of the organizational unit.
    """
    topic: set[Topic] | None = Field(
        None,
        range="Category:OSW5a13eeda5ed5405ea7ef62ea6feeceec",
        title="Topic(s)",
        title_={"de": "Thema/en"},
    )
    website: set[AnyUrl] | None = Field(
        None,
        eval_template={
            "type": "mustache-wikitext",
            "mode": "render",
            "value": "{{#website}}{{{.}}} <br>{{/website}}",
        },
        title="Website",
        title_={"de": "Webseite"},
    )
    email: set[EmailStr] | None = Field(
        None,
        eval_template={
            "type": "mustache-wikitext",
            "mode": "render",
            "value": "{{#email}}[mailto:{{.}} {{.}}] <br>{{/email}}",
        },
        title="Email address",
        title_={"de": "E-Mail"},
    )
    phone_number: (
        set[
            constr(
                regex=r"(?:(?:(?:\+|00|011)[\.\/\-\ \t]*([17]|2(?:[07]|[1-689]\d)|3(?:[0-4679]|[578]\d)|4(?:[013-9]|2\d)|5(?:[1-8]|[09]\d)|6(?:[0-6]|[789]\d)|8(?:[1246]|[035789]\d)|9(?:[0-58]|[679]\d))[\.\/\-\ \t]*|([17])[\.\/\-\ ])?(?:\((\d{1,6})\)[\.\/\-\ \t]*)?(?:(\d{1,6})[\.\/\-\ ])?(?:(\d{1,6})[\.\/\-\ ])?(?:(\d{1,6})[\.\/\-\ ])?(?:(\d{1,6})[\.\/\-\ ])?(\d{0,10}?)(\d{1,})(?:[\.\/\-;\ \t]*e?xt?[\.\/\-=\ \t]*(\d{1,14}))?)?"
            )
        ]
        | None
    ) = Field(
        None,
        description_={
            "de": "Telefonnummer mit Landesvorwahl und Bindestrichen formatiert, z.B.. +49-931-4100-172. Entsprechend https://www.wikidata.org/wiki/Property:P1329"
        },
        eval_template={
            "type": "mustache-wikitext",
            "mode": "render",
            "value": "{{#phone_number}}[tel:{{.}} {{.}}] <br>{{/phone_number}}",
        },
        title="Phone number",
        title_={"de": "Telefonnummer"},
    )
    """
    Phone number formatted with country code and hyphens, e.g.. +49-931-4100-172. According to https://www.wikidata.org/wiki/Property:P1329
    """
    fax_number: (
        set[
            constr(
                regex=r"(?:(?:(?:\+|00|011)[\.\/\-\ \t]*([17]|2(?:[07]|[1-689]\d)|3(?:[0-4679]|[578]\d)|4(?:[013-9]|2\d)|5(?:[1-8]|[09]\d)|6(?:[0-6]|[789]\d)|8(?:[1246]|[035789]\d)|9(?:[0-58]|[679]\d))[\.\/\-\ \t]*|([17])[\.\/\-\ ])?(?:\((\d{1,6})\)[\.\/\-\ \t]*)?(?:(\d{1,6})[\.\/\-\ ])?(?:(\d{1,6})[\.\/\-\ ])?(?:(\d{1,6})[\.\/\-\ ])?(?:(\d{1,6})[\.\/\-\ ])?(\d{0,10}?)(\d{1,})(?:[\.\/\-;\ \t]*e?xt?[\.\/\-=\ \t]*(\d{1,14}))?)?"
            )
        ]
        | None
    ) = Field(
        None,
        description_={
            "de": "Faxnummer mit Landesvorwahl und Bindestrichen formatiert, z.B.. +49-931-4100-172. Entsprechend https://www.wikidata.org/wiki/Property:P1329"
        },
        eval_template={
            "type": "mustache-wikitext",
            "mode": "render",
            "value": "{{#fax_number}}[tel:{{.}} {{.}}] <br>{{/fax_number}}",
        },
        title="Fax number",
        title_={"de": "Faxnummer"},
    )
    """
    Fax number formatted with country code and hyphens, e.g.. +49-931-4100-172. According to https://www.wikidata.org/wiki/Property:P1329
    """
    associated_acl_roles: list[str] | None = Field(
        None,
        title="Access control roles",
        title_={"de": "Rollen für die Zugriffskontrolle"},
    )


class Place(Item):
    """
    Entities that have a somewhat fixed, physical extension.
    """

    class Config:
        schema_extra = {
            "@context": ["/wiki/Category:Item?action=raw&slot=jsonschema"],
            "uuid": "28f71f2c-20ad-48c3-8c4e-4d190a95c0b8",
            "title": "Place",
            "title*": {"en": "Place", "de": "Ort"},
            "description": "Entities that have a somewhat fixed, physical extension.",
            "description*": {
                "en": "Entities that have a somewhat fixed, physical extension.",
                "de": "Entitäten, die eine gewisse feste, physische Ausdehnung haben.",
            },
        }

    type: list[str] | None = ["Category:OSW28f71f2c20ad48c38c4e4d190a95c0b8"]


class Location(Item):
    """
    A location. Entities that have a somewhat fixed, physical extension.
    """

    class Config:
        schema_extra = {
            "@context": [
                {
                    "gps_coordinates": {"@id": "schema:geo", "@type": "xsd:string"},
                    "gps_coordinates*": {
                        "@id": "Property:HasGpsCoordinates",
                        "@type": "xsd:string",
                    },
                    "latitude": {"@id": "schema:latitude", "@type": "xsd:float"},
                    "located_in": {"@id": "schema:containedInPlace", "@type": "@id"},
                    "located_in*": {"@id": "Property:IsLocatedIn", "@type": "@id"},
                    "longitude": {"@id": "schema:longitude", "@type": "xsd:float"},
                    "longitude*": {
                        "@id": "Property:HasLongitude",
                        "@type": "xsd:float",
                    },
                    "postal_address": {
                        "@id": "Property:HasPostalAddress",
                        "@type": "@id",
                        "@context": ["/wiki/JsonSchema:PostalAddress?action=raw"],
                    },
                },
                "/wiki/Category:Item?action=raw&slot=jsonschema",
            ],
            "title": "Location",
            "uuid": "3d238d05-316e-45a4-ac95-a11d7b24e36b",
            "title*": {"en": "Location", "de": "Örtlichkeit"},
            "description": "A location. Entities that have a somewhat fixed, physical extension.",
            "description*": {
                "de": "Eine Örtlichkeit. Entitaeten, die eine mehr oder weniger feste, physische Ausdehnung haben."
            },
            "defaultProperties": ["label", "gps_coordinates", "postal_address"],
        }

    type: list[str] | None = ["Category:OSW3d238d05316e45a4ac95a11d7b24e36b"]
    postal_address: PostalAddress | None = None
    gps_coordinates: GPSCoordinates | None = Field(
        None,
        defaultProperties=["uuid", "latitude", "longitude"],
        eval_template={
            "type": "wikitext",
            "value": "{{{latitude|}}}, {{{longitude|}}}",
        },
        title="GPS coordinates",
        title_={"en": "GPS coordinates", "de": "GPS Koordinaten"},
    )


class PersonRole(Item):
    class Config:
        schema_extra = {
            "title": "Person role",
            "@context": [
                {
                    "ad_label": "Property:HasAdLabel",
                    "miri_label": "Property:HasMiriLabel",
                    "miri_id": "Property:HasMiriId",
                }
            ],
        }

    ad_label: list[str] | None = Field(
        None,
        description_={"de": "Label des Rolle im Active Directory"},
        title="AD label",
        title_={"de": "AD-Label"},
    )
    """
    Label of the role in the Active Directory
    """
    miri_label: list[str] | None = Field(
        None,
        description_={"de": "Label der Rolle in MIRI und eDirectory"},
        title="MIRI label",
        title_={"de": "MIRI-Label"},
    )
    """
    Label of the role in MIRI and eDirectory
    """
    miri_id: list[str] | None = Field(
        None,
        description_={"de": "ID der Rolle in MIRI"},
        title="MIRI id",
        title_={"de": "MIRI-ID"},
    )
    """
    ID of the role in MIRI
    """
    miri_label_orig: list[str] | None = Field(
        None,
        description_={"de": "Ursprüngliches Label der Rolle in MIRI"},
        title="Original MIRI label",
        title_={"de": "Ursprüngliches MIRI-Label"},
    )
    """
    Original label of the role in MIRI
    """
    type: list[str] | None = ["Category:OSW5efde23b1d8c4e1c864ef039cb0616ed"]


class Project(Item):
    """
    An enterprise (potentially individual but typically collaborative), planned to achieve a particular aim.
    """

    class Config:
        schema_extra = {
            "@context": [
                "/wiki/Category:Item?action=raw&slot=jsonschema",
                {
                    "abstract": {"@id": "Property:HasAbstract"},
                    "budget_end": {"@id": "Property:HasBudgetEndDate"},
                    "budget_ou": {"@id": "Property:HasBusinessUnit", "@type": "@id"},
                    "budget_start": {"@id": "Property:HasBudgetStartDate"},
                    "budget_type": {"@id": "Property:HasType", "@type": "@id"},
                    "budget_year": {"@id": "Property:HasBudgetYear"},
                    "end_date": {"@id": "Property:HasEndDate", "@type": "xsd:date"},
                    "funding_type": {"@id": "Property:HasFundingType", "@type": "@id"},
                    "funding_call": {"@id": "Property:HasFundingCall", "@type": "@id"},
                    "funding": {"@id": "schema:funding", "@type": "@id"},
                    "funding*": {"@id": "Property:HasFunding", "@type": "@id"},
                    "funder": {"@id": "schema:funder", "@type": "@id"},
                    "funder*": {"@id": "Property:HasFunder", "@type": "@id"},
                    "member": {"@id": "schema:member", "@type": "@id"},
                    "member*": {"@id": "Property:HasMember", "@type": "@id"},
                    "member_of": {"@id": "schema:memberOf", "@type": "@id"},
                    "member_of*": {"@id": "Property:IsMemberOf", "@type": "@id"},
                    "other_documents": {
                        "@id": "Property:HasAdditionalDocument",
                        "@type": "@id",
                    },
                    "ou": {"@id": "Property:HasBusinessUnit", "@type": "@id"},
                    "project_manager": {"@id": "Property:HasManager", "@type": "@id"},
                    "project_status": {"@id": "Property:HasStatus", "@type": "@id"},
                    "project_type": {"@id": "Property:HasType", "@type": "@id"},
                    "proposal": {"@id": "Property:HasProposal", "@type": "@id"},
                    "report": {"@id": "Property:HasReport", "@type": "@id"},
                    "start_date": {"@id": "Property:HasStartDate", "@type": "xsd:date"},
                    "subjects": {"@id": "Property:HasTopic", "@type": "@id"},
                    "total_budget": {"@id": "Property:HasStatement"},
                    "year": {"@id": "Property:HasYear"},
                    "yearly_budget": {"@id": "Property:HasBudgetPart", "@type": "@id"},
                    "yearly_budget_sum": {"@id": "Property:HasStatement"},
                    "yearly_budget_sum_weighted": {"@id": "Property:HasStatement"},
                    "probability_of_successful_funding": {
                        "@id": "Property:HasStatement"
                    },
                },
            ],
            "uuid": "b2d7e6a2-eff9-4c82-b7f1-f2699d5b0ee3",
            "title": "Project",
            "title*": {"en": "Project", "de": "Projekt"},
            "description": "An enterprise (potentially individual but typically collaborative), planned to achieve a particular aim.",
            "description*": {
                "de": "Ein (möglicherweise individuelles, in der Regel aber gemeinschaftliches) Unternehmen oder Unternehmung, das auf ein bestimmtes Ziel ausgerichtet ist."
            },
            "defaultProperties": [
                "subjects",
                "project_status",
                "funding_type",
                "funding_call",
                "funder",
                "funding",
                "funding_name",
                "ou",
                "project_manager",
                "member",
                "member_of",
                "start_date",
                "end_date",
                "total_budget",
                "proposal",
                "abstract",
            ],
        }

    type: list[str] | None = ["Category:OSWb2d7e6a2eff94c82b7f1f2699d5b0ee3"]
    subjects: list[str] | None = Field(None, title="Subjects", title_={"de": "Themen"})
    project_type: ProjectTypeDeprecated | None = Field(
        "",
        deprecated=True,
        description_={"de": "Ersetzt mit Projekt- bzw. Förderart"},
        options={
            "enum_titles": ["House project", "Internal", "Public", "Industry"],
            "enum_titles*": {
                "de": ["Hausprojekt", "Intern", "Öffentlich", "Industrie"]
            },
        },
        title="Project type (deprecated)",
        title_={"de": "Projekttyp (veraltet)"},
    )
    """
    Replaced with Project / Funding Type
    """
    funding_type: ProjectType | None = Field(
        None,
        range="Category:OSW67f2ef61ba284c919fefa00d0e95a7a0",
        title="Project / Funding Type",
        title_={"de": "Projekt- bzw. Förderart"},
    )
    project_status: ProjectStatus | None = Field(
        default_factory=lambda: ProjectStatus.parse_obj(
            "Item:OSW55a9a9bda7b248759e48ae2e3ed6df1d"
        ),
        range="Category:OSW490e38f9764f4408a244869a0ea98e7c",
        title="Project status",
        title_={"de": "Projektstatus"},
    )
    funding_call: str | None = Field(
        None,
        options={
            "autocomplete": {"category": "Category:OSWd22af0aa3b00462a9da9b509538e8926"}
        },
        title="Funding call",
        title_={"de": "Förderaufruf"},
    )
    funder: str | None = Field(
        None,
        category="Category:OSW3cb8cef2225e403092f098f99bc4c472",
        title="Funder",
        title_={"de": "Förder- bzw. Auftragsgeber"},
    )
    funding: str | None = Field(
        None,
        description_={"de": "Förderung oder Vertrag"},
        options={
            "autocomplete": {"category": "Category:OSWbe80b28aefd64921ba2e8e2d6225416e"}
        },
        title="Funding",
        title_={"de": "Förderung"},
    )
    """
    Grant or contract
    """
    funding_name: str | None = Field(
        None,
        description_={
            "de": "Förderung oder Vertrag. Verwenden Sie diese Eigenschaft, um einen Text einzugeben, wenn Sie keine neue Instanz von Grant erstellen möchten."
        },
        title="Funding (name)",
        title_={"de": "Förderung (Name)"},
    )
    """
    Grant or contract. Use this property to enter a text if you don't want to create a new instance of grant.
    """
    probability_of_successful_funding: (
        ProbabilityOfSuccessfulFundingInPercent | None
    ) = Field(
        None,
        description_={
            "de": "Gibt die Wahrscheinlichkeit an, dass die Förderung genehmigt wird, bestimmt das gewichtete Budget"
        },
        title="Probability of Successful Funding in percent",
        title_={"de": "Wahrscheinlichkeit einer erfolgreichen Förderung in Prozent"},
    )
    """
    Indicates the likelihood that the funding will be approved, determines the weighted budget
    """
    ou: list[str] | None = Field(
        None,
        description_={"de": "Organisationseinheit (OE), die das Projekt durchführt"},
        title="OU",
        title_={"en": "OU", "de": "OE"},
    )
    """
    Organizational Unit (OU), which carries out the project
    """
    project_manager: list[str] | None = Field(
        None,
        title="Project Manager",
        title_={"en": "Project Manager", "de": "Projektleiter*in"},
    )
    member: list[str] | None = Field(
        None, title="Member", title_={"en": "Member", "de": "Mitglieder*innen"}
    )
    member_of: list[str] | None = Field(
        None,
        description_={
            "de": "Organisationseinheit(en), zu der das Projekt gehört, z. B. ein Projektcluster"
        },
        title="Member of",
        title_={"en": "Member of ", "de": "Mitglied von"},
    )
    """
    Organizational unit(s), the project is a member of, e.g. a project cluster
    """
    start_date: date | None = Field(
        None, options={"flatpicker": {}}, title="Start", title_={"de": "Beginn"}
    )
    end_date: date | None = Field(
        None, options={"flatpicker": {}}, title="End", title_={"de": "Ende"}
    )
    total_budget: TotalBudget | None = Field(
        None, title="Total Budget", title_={"de": "Budgetsumme"}
    )
    yearly_budget: list[YearlyBudget] | None = Field(
        None,
        options={"disable_array_reorder": False, "enable_array_copy": True},
        title="Yearly budget",
        title_={"de": "Jahresbudget"},
    )
    proposal: str | None = Field(
        None,
        links=[
            {
                "href": "{{#if self}}/w/index.php?title=Special:Redirect/file/{{self}}&width=200&height=200{{/if}}",
                "mediaType": "image",
            },
            {
                "href": "{{#if self}}/w/index.php?title=Special:Redirect/file/{{self}}{{/if}}",
                "rel": "{{#if self}}download{{/if}}",
                "download": True,
            },
        ],
        options={"upload": {}},
        title="Proposal",
        title_={"de": "Antrag"},
    )
    report: str | None = Field(
        None,
        links=[
            {
                "href": "{{#if self}}/w/index.php?title=Special:Redirect/file/{{self}}&width=200&height=200{{/if}}",
                "mediaType": "image",
            },
            {
                "href": "{{#if self}}/w/index.php?title=Special:Redirect/file/{{self}}{{/if}}",
                "rel": "{{#if self}}download{{/if}}",
                "download": True,
            },
        ],
        options={"upload": {}},
        title="Report",
        title_={"de": "Bericht"},
    )
    other_documents: list[str] | None = Field(
        None,
        title="Additional documents",
        title_={"en": "Additional documents", "de": "Sonstige Dokumente"},
    )
    abstract: list[DescriptionItem] | None = Field(
        None,
        eval_template={
            "type": "mustache-wikitext",
            "mode": "render",
            "$comment": "Displays value according to user language with eng as fallback option. Note: {{=<% %>=}} changes mustache expression from {{..}} to <% %> for mixing with wikitext templates",
            "value": "{{=<% %>=}} {{#switch:{{USERLANGUAGECODE}} <%#abstract%> | {{#ifeq: <%lang%>|en|#default|<%lang%>}} = <%text%> <%/abstract%> }}",
        },
        title="Abstract",
        title_={"de": "Kurzbeschreibung"},
    )


class Enumeration(IntangibleItem):
    """
    Lists or enumerations—for example, a list of cuisines or music genres, etc.
    """

    class Config:
        schema_extra = {
            "@context": [
                "/wiki/Category:OSWcbb09a36336740c6a2cd62db9bf647ec?action=raw&slot=jsonschema"
            ],
            "uuid": "d0274138-1aaa-4709-ae07-53a0edc341ce",
            "title": "Enumeration",
            "title*": {"en": "Enumeration", "de": "Aufzählung"},
            "description": "Lists or enumerations—for example, a list of cuisines or music genres, etc.",
            "description*": {
                "en": "Lists or enumerations—for example, a list of cuisines or music genres, etc.",
                "de": "Listen oder Aufzählungen - zum Beispiel eine Liste von Küchen oder Musikrichtungen usw.",
            },
        }

    type: list[str] | None = ["Category:OSWd02741381aaa4709ae0753a0edc341ce"]


class OrganizationalSubUnit(OrganizationalUnit):
    """
    An organizational unit that explicitly is part of a larger organizational unit.
    """

    class Config:
        schema_extra = {
            "@context": [
                "/wiki/Category:OSW3cb8cef2225e403092f098f99bc4c472?action=raw&slot=jsonschema"
            ],
            "title": "OrganizationalSubUnit",
            "title*": {"de": "Organisationsuntereinheit"},
            "description": "An organizational unit that explicitly is part of a larger organizational unit.",
            "description*": {
                "de": "Eine Organisationseinheit, die ausdrücklich Teil einer größeren Organisationseinheit ist."
            },
            "defaultProperties": ["superordinate_ou"],
        }

    type: list[str] | None = ["Category:OSWfe3e842b804445c7bb0dd8ee61da2d70"]


class AdministrativeArea(Place):
    """
    A geographical region, typically under the jurisdiction of a particular government.
    """

    class Config:
        schema_extra = {
            "@context": [
                "/wiki/Category:OSW28f71f2c20ad48c38c4e4d190a95c0b8?action=raw&slot=jsonschema"
            ],
            "uuid": "137e7443-b2b9-4692-bd59-a0e0a6778b70",
            "title": "AdministrativeArea",
            "title*": {"en": "Administrative Area", "de": "Verwaltungsbereich"},
            "description": "A geographical region, typically under the jurisdiction of a particular government.",
            "description*": {
                "en": "A geographical region, typically under the jurisdiction of a particular government.",
                "de": "Eine geografische Region, die in der Regel unter die Zuständigkeit einer bestimmten Regierung fällt.",
            },
        }

    type: list[str] | None = ["Category:OSW137e7443b2b94692bd59a0e0a6778b70"]


class Site(Location):
    """
    A site is a location or place where a particular event, activity, or object exists or is situated.
    """

    class Config:
        schema_extra = {
            "@context": [
                "/wiki/Category:OSW3d238d05316e45a4ac95a11d7b24e36b?action=raw&slot=jsonschema"
            ],
            "title": "Site",
            "title*": {"en": "Site", "de": "Standort"},
            "uuid": "473d7a1e-d485-44d1-be83-b258b5810948",
            "description": "A site is a location or place where a particular event, activity, or object exists or is situated.",
            "description*": {
                "de": "Ein Standort ist ein Ort oder ein Platz, an dem ein bestimmtes Ereignis, eine Aktivität oder ein Objekt existiert oder sich befindet."
            },
        }

    type: list[str] | None = ["Category:OSW473d7a1ed48544d1be83b258b5810948"]


class Competence(DefinedTerm):
    class Config:
        schema_extra = {
            "@context": [
                "/wiki/Category:OSWa5812d3b5119416c8da1606cbe7054eb?action=raw&slot=jsonschema"
            ],
            "uuid": "5eb9c52b-8045-44dc-870d-fd54ff434428",
            "title": "Competence",
            "title*": {"de": "Kompetenz"},
        }

    type: list[str] | None = ["Category:OSW5eb9c52b804544dc870dfd54ff434428"]


class Topic(DefinedTerm):
    class Config:
        schema_extra = {
            "@context": [
                "/wiki/Category:OSWa5812d3b5119416c8da1606cbe7054eb?action=raw&slot=jsonschema"
            ],
            "title": "Topic",
        }

    type: list[str] | None = ["Category:OSW5a13eeda5ed5405ea7ef62ea6feeceec"]


class ProjectType(Enumeration):
    class Config:
        schema_extra = {
            "@context": [
                "/wiki/Category:OSWd02741381aaa4709ae0753a0edc341ce?action=raw&slot=jsonschema"
            ],
            "uuid": "67f2ef61-ba28-4c91-9fef-a00d0e95a7a0",
            "title": "ProjectType",
            "title*": {"en": "Project Type", "de": "Projekttyp"},
            "description": "",
            "description*": {},
        }

    type: list[str] | None = ["Category:OSW67f2ef61ba284c919fefa00d0e95a7a0"]


class StatusEnumeration(Enumeration):
    """
    Lists or enumerations dealing with status types.
    """

    class Config:
        schema_extra = {
            "@context": [
                "/wiki/Category:OSWd02741381aaa4709ae0753a0edc341ce?action=raw&slot=jsonschema"
            ],
            "uuid": "2c32802b-e590-4024-8c85-eda3479d484c",
            "title": "StatusEnumeration",
            "title*": {
                "en": "Zustandsaufzählungen",
                "de": "Aufzählung von Zustandsbeschreibungen",
            },
            "description": "Lists or enumerations dealing with status types.",
            "description*": {
                "en": "Lists or enumerations dealing with status types.",
                "de": "Listen oder Aufzählungen, die sich mit Statusarten (Zustandsarten) befassen.",
            },
        }

    type: list[str] | None = ["Category:OSW2c32802be59040248c85eda3479d484c"]


class BudgetType(Enumeration):
    """
    Type of usage of a certain budget
    """

    class Config:
        schema_extra = {
            "@context": [
                "/wiki/Category:OSWd02741381aaa4709ae0753a0edc341ce?action=raw&slot=jsonschema"
            ],
            "uuid": "595b282a-edf0-4878-8f3e-e326454792ce",
            "title": "BudgetType",
            "title*": {"en": "Budget Type", "de": "Budget-Typ"},
            "description": "Type of usage of a certain budget",
            "description*": {
                "en": "Type of usage of a certain budget",
                "de": "Art der Verwendung eines bestimmten Budgets",
            },
        }

    type: list[str] | None = ["Category:OSW595b282aedf048788f3ee326454792ce"]


class Country(AdministrativeArea):
    """
    A distinct part of the world, such as a state, nation, or other political entity
    """

    class Config:
        schema_extra = {
            "@context": [
                "/wiki/Category:OSW137e7443b2b94692bd59a0e0a6778b70?action=raw&slot=jsonschema"
            ],
            "uuid": "0551abcd-6f73-4047-825e-3ded4c8a0ffe",
            "title": "Country",
            "title*": {"en": "Country", "de": "Land"},
            "description": "A distinct part of the world, such as a state, nation, or other political entity",
            "description*": {
                "en": "A distinct part of the world, such as a state, nation, or other political entity",
                "de": "Ein bestimmter Teil der Welt, z. B. ein Staat, eine Nation oder eine andere politische Einheit",
            },
        }

    type: list[str] | None = ["Category:OSW0551abcd6f734047825e3ded4c8a0ffe"]


class State(AdministrativeArea):
    """
    A state or province of a country.
    """

    class Config:
        schema_extra = {
            "@context": [
                "/wiki/Category:OSW137e7443b2b94692bd59a0e0a6778b70?action=raw&slot=jsonschema"
            ],
            "uuid": "ab60f9a2-2795-4ee0-be92-344ff6272420",
            "title": "State",
            "title*": {"en": "State", "de": "Staat"},
            "description": "A state or province of a country.",
            "description*": {
                "en": "A state or province of a country.",
                "de": "Ein Staat oder eine Provinz eines Landes.",
            },
        }

    type: list[str] | None = ["Category:OSWab60f9a227954ee0be92344ff6272420"]


class Region(AdministrativeArea):
    class Config:
        schema_extra = {
            "@context": [
                "/wiki/Category:OSW137e7443b2b94692bd59a0e0a6778b70?action=raw&slot=jsonschema"
            ],
            "uuid": "95efaf34-e2c7-439e-8e79-67233910e44b",
            "title": "Region",
            "title*": {"en": "Region", "de": "Region"},
            "description": "",
            "description*": {},
        }

    type: list[str] | None = ["Category:OSW95efaf34e2c7439e8e7967233910e44b"]


class City(AdministrativeArea):
    """
    A city or town.
    """

    class Config:
        schema_extra = {
            "@context": [
                "/wiki/Category:OSW137e7443b2b94692bd59a0e0a6778b70?action=raw&slot=jsonschema"
            ],
            "uuid": "807f1da5-b42e-42f2-96b2-13ab06ca873b",
            "title": "City",
            "title*": {"en": "Stadt"},
            "description": "A city or town.",
            "description*": {
                "en": "A city or town.",
                "de": "Eine Stadt oder ein Ort, im Sinne einer Gemeinde",
            },
        }

    type: list[str] | None = ["Category:OSW807f1da5b42e42f296b213ab06ca873b"]


class ProjectStatus(StatusEnumeration):
    """
    Status for projects and project applications
    """

    class Config:
        schema_extra = {
            "@context": [
                "/wiki/Category:OSW2c32802be59040248c85eda3479d484c?action=raw&slot=jsonschema"
            ],
            "uuid": "490e38f9-764f-4408-a244-869a0ea98e7c",
            "title": "ProjectStatus",
            "title*": {
                "en": "Project (Application) Status",
                "de": "Projekt(antrags)status",
            },
            "description": "Status for projects and project applications",
            "description*": {
                "en": "Status for projects and project applications",
                "de": "Status für Projekte und Projektanträge",
            },
        }

    type: list[str] | None = ["Category:OSW490e38f9764f4408a244869a0ea98e7c"]


# generated by datamodel-codegen:
#   filename:  OSWc5d4829ed2744a219ba027171c75fa1d.json
#   timestamp: 2026-01-05T17:29:52+00:00


class Conclusion(OswBaseModel):
    class Config:
        schema_extra = {
            "@context": {
                "rdf": "http://www.w3.org/2000/01/rdf-schema#",
                "text": {"@id": "@value"},
                "lang": {"@id": "@language"},
            },
            "title": "Conclusion",
            "title*": {"de": "Fazit"},
            "eval_template": [
                {"type": "wikitext", "mode": "store", "value": "{{{text}}}@{{{lang}}}"}
            ],
        }

    text: constr(min_length=1) = Field(
        ...,
        options={
            "input_width": "800px",
            "inputAttributes": {"placeholder": "Title of the entry"},
            "inputAttributes*": {"de": {"placeholder": "Titel dieses Eintrags"}},
        },
        title="Text",
        title_={"de": "Text"},
    )
    lang: LangCode | None = Field(
        LangCode.en,
        default_={"en": "en", "de": "de"},
        options={"input_width": "100px"},
        title="Lang code",
        title_={"de": "Sprache"},
    )


class Task(Process):
    class Config:
        schema_extra = {
            "@context": [
                "/wiki/Category:OSWe5aa96bffb1c4d95be7fbd46142ad203?action=raw&slot=jsonschema",
                {
                    "belongs_to_project": {"@id": "Property:BelongsTo", "@type": "@id"},
                    "issue_label": {"@id": "Property:HasIssueLabel", "@type": "@id"},
                    "prio": {"@id": "Property:HasPriority", "@type": "@id"},
                    "prerequisite_task": {
                        "@id": "Property:HasPrerequisite",
                        "@type": "@id",
                    },
                    "related_to": {"@id": "Property:IsRelatedTo", "@type": "@id"},
                    "related_to_project": {
                        "@id": "Property:IsRelatedTo",
                        "@type": "@id",
                    },
                    "superordinate_work_package": {
                        "@id": "Property:IsSubordinateTo",
                        "@type": "@id",
                    },
                    "superordinate_task": {
                        "@id": "Property:IsSubordinateTo",
                        "@type": "@id",
                    },
                },
            ],
            "uuid": "c5d4829e-d274-4a21-9ba0-27171c75fa1d",
            "title": "Task",
            "title*": {"en": "Task", "de": "Aufgabe"},
            "description": "",
            "description*": {},
            "defaultProperties": ["actionees", "related_to", "description", "prio"],
        }

    type: list[str] | None = ["Category:OSWc5d4829ed2744a219ba027171c75fa1d"]
    conclusion: list[Conclusion] | None = Field(
        None,
        description_={
            "de": "Eine kurze abschließende Zusammenfassung, die die wichtigsten Ergebnisse oder Erkenntnisse eines Tasks hervorhebt."
        },
        eval_template=[
            {
                "type": "mustache-wikitext",
                "mode": "render",
                "$comment": "Displays value according to user language with eng as fallback option. Note: {{=<% %>=}} changes mustache expression from {{..}} to <% %> for mixing with wikitext templates",
                "value": "{{=<% %>=}} {{#switch:{{USERLANGUAGECODE}} <%#label%> | {{#ifeq: <%lang%>|en|#default|<%lang%>}} = <%text%> <%/label%> }}",
            }
        ],
        min_items=1,
        title="Conclusion",
        title_={"de": "Fazit"},
    )
    """
    A brief final summary that highlights the key results or insights of a task.
    """
    issue_label: list[IssueLabel] | None = Field(
        None,
        description_={
            "de": "Dient der Kategorisierung von Aufgaben, die im Sinne eines Issues bei der Softwareentwicklung angelegt werden."
        },
        range="Category:OSW8cb1935054464c99836d3bc0573a11cc",
        title="Issue Label",
        title_={"de": "Issue-Label"},
    )
    """
    Designated to categorize task, which are considered issues in software development.
    """
    prio: Priority | None = Field(
        None,
        description_={
            "de": "Bitte wählen. Falls Priorität (noch) nicht gesetzt werden kann, oder zur Diskussion steht, bitte freilassen."
        },
        range="Category:OSW65c8449bdd4f4fbcb7f68203a11d6e8f",
        title="Priority",
        title_={"de": "Priorität"},
    )
    """
    Bitte wählen. Falls Priorität (noch) nicht gesetzt werden kann, oder zur Diskussion steht, bitte freilassen.
    """
    related_to: list[Entity] | None = Field(
        None, range="Category:Entity", title="Related to", title_={"de": "Bezug zu"}
    )
    related_to_project: list[Project] | None = Field(
        None,
        range="Category:OSWb2d7e6a2eff94c82b7f1f2699d5b0ee3",
        title="Related to project",
        title_={"de": "Projektzuordnung"},
    )
    belongs_to_project: list[Project] | None = Field(
        None,
        description_={"de": "Projekt, zu dem diese Aufgabe gehört."},
        range="Category:OSWb2d7e6a2eff94c82b7f1f2699d5b0ee3",
        title="Belongs to (project)",
        title_={"de": "Gehört zu (Projekt)"},
    )
    """
    Project to which this task belongs.
    """
    superordinate_work_package: list[WorkPackage] | None = Field(
        None,
        range="Category:OSWb47292f68e834e3592f1fa8f706ddde4",
        title="Superordinate work package(s)",
        title_={"de": "Übergeordnete(s) Arbeitspaket(e)"},
    )
    superordinate_task: list[Task] | None = Field(
        None,
        range="Category:OSWc5d4829ed2744a219ba027171c75fa1d",
        title="Superordinate task(s)",
        title_={"de": "Übergeordnete(r) Task(s)"},
    )
    prerequisite_task: list[Task] | None = Field(
        None,
        range="Category:OSWc5d4829ed2744a219ba027171c75fa1d",
        title="Prerequisite task(s)",
        title_={"de": "Vorausgesetzte(r) Task(s)"},
    )


class WorkPackage(Process):
    """
    Work package as defined in a project proposal
    """

    class Config:
        schema_extra = {
            "@context": [
                {
                    "related_to": {"@id": "Property:IsRelatedTo", "@type": "@id"},
                    "belongs_to_project": {"@id": "Property:BelongsTo", "@type": "@id"},
                    "preceding_work_package": {
                        "@id": "Property:HasPredecessor",
                        "@type": "@id",
                    },
                    "prerequisite_work_package": {
                        "@id": "Property:HasPrerequisite",
                        "@type": "@id",
                    },
                    "superordinate_work_package": {
                        "@id": "Property:IsSubordinateTo",
                        "@type": "@id",
                    },
                },
                "/wiki/Category:OSWe5aa96bffb1c4d95be7fbd46142ad203?action=raw&slot=jsonschema",
            ],
            "uuid": "b47292f6-8e83-4e35-92f1-fa8f706ddde4",
            "title": "WorkPackage",
            "title*": {"en": "Work package", "de": "Arbeitspaket"},
            "description": "Work package as defined in a project proposal",
            "description*": {
                "en": "Work package as defined in a project proposal",
                "de": "Arbeitspaket wie in einem Projektvorschlag definiert",
            },
            "defaultProperties": ["belongs_to_project", "superordinate_work_package"],
        }

    type: list[str] | None = ["Category:OSWb47292f68e834e3592f1fa8f706ddde4"]
    related_to: list[Entity] | None = Field(
        None, range="Category:Entity", title="Related to", title_={"de": "Bezug zu"}
    )
    belongs_to_project: list[Project] | None = Field(
        None,
        description_={"de": "Projekt, zu dem dieses Arbeitspaket gehört."},
        range="Category:OSWb2d7e6a2eff94c82b7f1f2699d5b0ee3",
        title="Belongs to (project)",
        title_={"de": "Gehört zu (Projekt)"},
    )
    """
    Project that this work package belongs to.
    """
    superordinate_work_package: list[WorkPackage] | None = Field(
        None,
        range="Category:OSWb47292f68e834e3592f1fa8f706ddde4",
        title="Superordinate work package(s)",
        title_={"de": "Übergeordnete(s) Arbeitspaket(e)"},
    )
    preceding_work_package: list[WorkPackage] | None = Field(
        None,
        range="Category:OSWb47292f68e834e3592f1fa8f706ddde4",
        title="Preceding work package(s)",
        title_={"de": "Vorangegangene(s) Arbeitspaket(e)"},
    )
    prerequisite_work_package: list[WorkPackage] | None = Field(
        None,
        range="Category:OSWb47292f68e834e3592f1fa8f706ddde4",
        title="Prerequisite work package(s)",
        title_={"de": "Vorausgesetzte(s) Arbeitspaket(e)"},
    )


class IssueLabel(Enumeration):
    class Config:
        schema_extra = {
            "@context": [
                "/wiki/Category:OSWd02741381aaa4709ae0753a0edc341ce?action=raw&slot=jsonschema"
            ],
            "uuid": "8cb19350-5446-4c99-836d-3bc0573a11cc",
            "title": "IssueLabel",
            "title*": {"en": "Issue Label", "de": "Issue-Label"},
            "description": "",
            "description*": {},
        }

    type: list[str] | None = ["Category:OSW8cb1935054464c99836d3bc0573a11cc"]


class Priority(Enumeration):
    class Config:
        schema_extra = {
            "@context": [
                "/wiki/Category:OSWd02741381aaa4709ae0753a0edc341ce?action=raw&slot=jsonschema"
            ],
            "uuid": "65c8449b-dd4f-4fbc-b7f6-8203a11d6e8f",
            "title": "Priority",
            "title*": {"en": "Priority"},
            "description": "",
            "description*": {},
        }

    type: list[str] | None = ["Category:OSW65c8449bdd4f4fbcb7f68203a11d6e8f"]


# generated by datamodel-codegen:
#   filename:  OSWcbb09a36336740c6a2cd62db9bf647ec.json
#   timestamp: 2026-01-05T17:29:53+00:00


# generated by datamodel-codegen:
#   filename:  OSWca99a9bb9ad24386b222d18a73c2af5e.json
#   timestamp: 2026-01-05T17:29:54+00:00


class Supply(OswBaseModel):
    class Config:
        schema_extra = {"title": "Supply", "title*": {"de": "Bezugsmöglichkeit"}}

    supplier: str | None = Field(
        None,
        options={
            "autocomplete": {"category": "Category:OSW3cb8cef2225e403092f098f99bc4c472"}
        },
        title="Supplier",
        title_={"de": "Lieferant"},
    )
    article_no: str | None = Field(
        None,
        description_={"de": "Artikelnummer im Katalog des Lieferanten"},
        title="Article no.",
        title_={"de": "Artikelnummer"},
    )
    """
    Article number in the catalogue of the supplier
    """
    comment: str | None = Field(
        None,
        description_={"de": "Kommentar bezüglich der Bezugsmöglichkeit des Materials"},
        title="Comment",
        title_={"de": "Kommentar"},
    )
    """
    Comment on the supply of the material
    """
    link: AnyUrl | None = Field(
        None,
        description_={"de": "Link zum Artikel im Online-Katalog des Lieferanten"},
        title="Link",
        title_={"de": "Link"},
    )
    """
    Link to the article in the online catalogue of the supplier
    """


class NameItem(OswBaseModel):
    class Config:
        schema_extra = {}

    text: constr(min_length=1) = Field(
        ...,
        options={
            "input_width": "400px",
            "inputAttributes": {"placeholder": "Title of the entry"},
            "inputAttributes*": {"de": {"placeholder": "Titel dieses Eintrags"}},
        },
        title="Text",
        title_={"de": "Text"},
    )
    lang: LangCode | None = Field(
        LangCode.en,
        default_={"en": "en", "de": "de"},
        options={"input_width": "100px"},
        title="Lang code",
        title_={"de": "Sprache"},
    )


class Attribute(OswBaseModel):
    class Config:
        schema_extra = {
            "title": "Attribute",
            "title*": {"de": "Attribut"},
            "headerTemplate": "{{i1}} - {{self.name}}",
        }

    attribute_name: list[NameItem] = Field(..., min_items=1, title="Name")
    quantity_prop: Quantity


class OtherPhysicalItem(OswBaseModel):
    class Config:
        schema_extra = {
            "title": "Other physical Item",
            "title*": {"de": "Anderer physischer Gegenstand"},
            "headerTemplate": "{{ i1 }}",
            "defaultProperties": [],
        }

    uuid: str = Field(
        ...,
        dynamic_template="{{_uuid_}}",
        options={"hidden": True, "dynamic_template": {"override": "empty"}},
    )
    origin_item_type: Category | None = Field(
        default_factory=lambda: Category.parse_obj(
            "Category:OSW37a57741ae2e4dd4b29b1172b6848be8"
        ),
        options={
            "autocomplete": {
                "$comment": "Tool",
                "query": "[[:Category:OSW37a57741ae2e4dd4b29b1172b6848be8]]OR[[SubClassOf::Category:OSW37a57741ae2e4dd4b29b1172b6848be8]]OR[[SubClassOf.SubClassOf::Category:OSW37a57741ae2e4dd4b29b1172b6848be8]]OR[[SubClassOf.SubClassOf.SubClassOf::Category:OSW37a57741ae2e4dd4b29b1172b6848be8]]OR[[SubClassOf.SubClassOf.SubClassOf.SubClassOf::Category:OSW37a57741ae2e4dd4b29b1172b6848be8]]OR[[SubClassOf.SubClassOf.SubClassOf.SubClassOf.SubClassOf::Category:OSW37a57741ae2e4dd4b29b1172b6848be8]]",
            },
            "grid_columns": 12,
        },
        propertyOrder=40,
        range="Category:Category",
        title="Type",
        title_={"de": "Typ"},
        x_oold_required_iri=True,
    )
    origin_item_instance_property: str | None = Field(
        "Property:HasOrigin", options={"hidden": True}
    )
    origin_item_instance: PhysicalItem | None = Field(
        None,
        options={
            "autocomplete": {
                "query": "[[HasType::$(origin_item_type_)]]|?Display_title_of=label|?HasImage=image|?HasDescription=description"
            },
            "grid_columns": 12,
        },
        propertyOrder=50,
        range="Category:OSW37a57741ae2e4dd4b29b1172b6848be8",
        title="Instance",
        title_={"de": "Instanz"},
        watch={"origin_item_type_": "origin_item.origin_item_type"},
        x_oold_required_iri=True,
    )


class ItemModel(Entity):
    class Config:
        schema_extra = {
            "@context": [
                "/wiki/Category:Entity?action=raw&slot=jsonschema",
                {
                    "exact_ontology_match***": {"@id": "owl:sameAs", "@type": "@id"},
                    "rdf_type*": {"@id": "schema:additionalType"},
                },
            ],
            "title": "Item",
            "title*": {"de": "Item"},
        }

    type: list[str] | None = Field(
        ["Category:Item"],
        min_items=1,
        options={
            "collapsed": True,
            "conditional_visible": {"modes": ["default", "query"]},
        },
    )


class PhysicalItemType(Category):
    """
    Helps to create subcategories of PhysicalItem
    """

    class Config:
        schema_extra = {
            "@context": [
                "/wiki/Category:Category?action=raw&slot=jsonschema",
                {
                    "constituents": {
                        "@type": "@id",
                        "@id": "Property:HasStatement",
                        "@context": {
                            "property": "Property:HasProperty",
                            "type": "Property:HasValue",
                        },
                    },
                    "data_sheet": {"@id": "Property:HasDataSheet", "@type": "@id"},
                    "instructions": {"@id": "Property:HasInstructions", "@type": "@id"},
                    "manual": {"@id": "Property:HasManual", "@type": "@id"},
                    "manufacturer": {"@id": "Property:HasManufacturer", "@type": "@id"},
                    "safety_data_sheet": {
                        "@id": "Property:HasSafetyDataSheet",
                        "@type": "@id",
                    },
                    "type_no": "Property:HasTypeNumber",
                },
            ],
            "uuid": "ca99a9bb-9ad2-4386-b222-d18a73c2af5e",
            "title": "PhysicalItemType",
            "title*": {"en": "Physical Item Type"},
            "description": "Helps to create subcategories of PhysicalItem",
            "description*": {"en": "Helps to create subcategories of PhysicalItem"},
            "defaultPropertis": [
                "type_no",
                "manufacturer",
                "data_sheet",
                "safety_data_sheet",
                "supply",
                "specifications",
            ],
        }

    type: list[str] | None = ["Category:OSWca99a9bb9ad24386b222d18a73c2af5e"]
    type_no: str | None = Field(
        None,
        description_={"de": "Typen- oder Modellnummer wie vom Hersteller angegeben"},
        title="Type number",
        title_={"de": "Typennummer"},
    )
    """
    Type or model number as specified by the manufacturer
    """
    manufacturer: str | None = Field(
        None,
        description_={
            "de": "Der Hersteller dieses Gegendstandes - eine Organisation(seinheit)"
        },
        range="Category:OSW3cb8cef2225e403092f098f99bc4c472",
        title="Manufacturer",
        title_={"de": "Hersteller"},
    )
    """
    The manufacturer of this item - an organization(al unit).
    """
    data_sheet: set[str] | None = Field(
        None,
        eval_template={
            "type": "mustache-wikitext",
            "mode": "render",
            "value": "{{=<% %>=}} <%={{ }}=%>  {{#data_sheet}}[[:{{{.}}}]];{{/data_sheet}} {{=<% %>=}} <%={{ }}=%>",
        },
        title="Data sheet",
        title_={"de": "Datenblatt"},
    )
    safety_data_sheet: set[str] | None = Field(
        None,
        eval_template={
            "type": "mustache-wikitext",
            "mode": "render",
            "value": "{{=<% %>=}} <%={{ }}=%>  {{#safety_data_sheet}}[[:{{{.}}}]];{{/safety_data_sheet}} {{=<% %>=}} <%={{ }}=%>",
        },
        title="Safety data sheet",
        title_={"de": "Sicherheitsdatenblatt"},
    )
    instructions: set[str] | None = Field(
        None,
        description_={
            "de": "Eine Liste auszuführenden Schritte, z. B. die Einrichtungsanweisungen."
        },
        eval_template={
            "type": "mustache-wikitext",
            "mode": "render",
            "value": "{{=<% %>=}} <%={{ }}=%>  {{#instructions}}[[:{{{.}}}]];{{/instructions}} {{=<% %>=}} <%={{ }}=%>",
        },
        title="Instructions",
        title_={"de": "Anleitung"},
    )
    """
    A list of steps to be performed, e.g., the setup instructions.
    """
    manual: set[str] | None = Field(
        None,
        description_={
            "de": "Handbuch, Gerauchsanweisung, Betriebs- oder Bedienungsanleitung mit Einzelheiten zur Verwendung dieses Gegenstands."
        },
        eval_template={
            "type": "mustache-wikitext",
            "mode": "render",
            "value": "{{=<% %>=}} <%={{ }}=%>  {{#manual}}[[:{{{.}}}]];{{/manual}} {{=<% %>=}} <%={{ }}=%>",
        },
        title="Manual",
        title_={"de": "Handbuch"},
    )
    """
    Comprehensive guide that details how to use this item.
    """
    supply: list[Supply] | None = Field(
        None,
        description_={
            "de": "Bezugsmöglichkeit des Materials mit Lieferant, Artikelnummer und Link"
        },
        title="Supply",
        title_={"de": "Bezugsmöglichkeit"},
    )
    """
    Supply of the material with supplier, article no. and link
    """
    specifications: list[Attribute] | None = Field(
        None,
        title="Specification of technical properties",
        title_={"de": "Spezifikation technischer Eigenschaften"},
    )
    constituents: list[Item] | None = Field(
        None, title="Constituents", title_={"de": "Bestandteile"}
    )
    """
    Components or parts
    """


class PhysicalItem(ItemModel):
    """
    Physical item as opposed to intangible item. It can posses properties such as position, geometry, weight, volume , etc.
    """

    class Config:
        schema_extra = {
            "@context": [
                "/wiki/Category:Item?action=raw&slot=jsonschema",
                {
                    "data_sheet": {"@id": "Property:HasDataSheet", "@type": "@id"},
                    "instructions": {"@id": "Property:HasInstructions", "@type": "@id"},
                    "manual": {"@id": "Property:HasManual", "@type": "@id"},
                    "manufacturer": {"@id": "Property:HasManufacturer", "@type": "@id"},
                    "origin": {
                        "@id": "Property:HasStatement",
                        "@type": "@id",
                        "@context": {
                            "origin_item_instance_property": "Property:HasProperty",
                            "origin_item_instance": "Property:HasObject",
                        },
                    },
                    "quantity_statements": {
                        "@id": "Property:HasStatement",
                        "@type": "@id",
                    },
                    "safety_data_sheet": {
                        "@id": "Property:HasSafetyDataSheet",
                        "@type": "@id",
                    },
                    "serial_number": "Property:HasSerialNumber",
                    "type_no": "Property:HasTypeNumber",
                },
            ],
            "uuid": "37a57741-ae2e-4dd4-b29b-1172b6848be8",
            "title": "PhysicalItem",
            "title*": {"en": "Physical Item", "de": "Physischer Gegenstand"},
            "description": "Physical item as opposed to intangible item. It can posses properties such as position, geometry, weight, volume , etc.  ",
            "description*": {
                "en": "Physical item as opposed to intangible item. It can posses properties such as position, geometry, weight, volume , etc.  ",
                "de": "Physischer Gegenstand im Gegensatz zu immateriellen Gegenständen. Er kann Eigenschaften wie Position, Geometrie, Gewicht, Volumen usw. besitzen.  ",
            },
        }

    type: list[str] | None = ["Category:OSW37a57741ae2e4dd4b29b1172b6848be8"]
    quantity_statements: list[Quantity] | None = Field(
        None,
        eval_template={
            "type": "mustache-wikitext",
            "mode": "render",
            "value": "{{#quantity_statements}}.. {{#quantity}}[[{{quantity}}]]{{/quantity}} {{#value}}{{value}}{{/value}}<br>{{/quantity_statements}}",
        },
        title="Quantitative statement(s)",
        title_={"de": "Quantitative Aussage(n)"},
    )
    origin: list[OtherPhysicalItem] | None = Field(
        None,
        description_={
            "de": "Andere(r) physische(r) Gegenstand/Gegenstände aus der dieser physische Gegenstand hergestellt wurde."
        },
        eval_template=[
            {
                "type": "mustache-wikitext",
                "mode": "render",
                "value": "{{=<% %>=}} <ul><%#origin%><li>[[<%origin_item_instance%>]] ({{#switch:{{USERLANGUAGECODE}}|en=Type|de=Typ|#default=Type}}: {{#ask:[[<%origin_item_instance%>]]|?HasType=|format=plain|mainlabel=-}})</li><%/origin%></ul>",
            }
        ],
        options={
            "enable_array_copy": True,
            "array_copy_ignore": ["uuid", "attachments"],
        },
        title="Origin",
        title_={"de": "Ursprung"},
    )
    """
    Other physical item(s) that this physical item was derived from.
    """
    type_no: str | None = Field(
        None,
        description_={"de": "Typen- oder Modellnummer wie vom Hersteller angegeben"},
        title="Type number",
        title_={"de": "Typennummer"},
    )
    """
    Type or model number as specified by the manufacturer
    """
    manufacturer: str | None = Field(
        None,
        description_={
            "de": "Der Hersteller dieses Gegendstandes - eine Organisation(seinheit)"
        },
        range="Category:OSW3cb8cef2225e403092f098f99bc4c472",
        title="Manufacturer",
        title_={"de": "Hersteller"},
    )
    """
    The manufacturer of this item - an organization(al unit).
    """
    data_sheet: set[str] | None = Field(
        None,
        eval_template={
            "type": "mustache-wikitext",
            "mode": "render",
            "value": "{{=<% %>=}} <%={{ }}=%>  {{#data_sheet}}[[:{{{.}}}]];{{/data_sheet}} {{=<% %>=}} <%={{ }}=%>",
        },
        title="Data sheet",
        title_={"de": "Datenblatt"},
    )
    safety_data_sheet: set[str] | None = Field(
        None,
        eval_template={
            "type": "mustache-wikitext",
            "mode": "render",
            "value": "{{=<% %>=}} <%={{ }}=%>  {{#safety_data_sheet}}[[:{{{.}}}]];{{/safety_data_sheet}} {{=<% %>=}} <%={{ }}=%>",
        },
        title="Safety data sheet",
        title_={"de": "Sicherheitsdatenblatt"},
    )
    manual: set[str] | None = Field(
        None,
        description_={
            "de": "Handbuch, Gerauchsanweisung, Betriebs- oder Bedienungsanleitung mit Einzelheiten zur Verwendung dieses Gegenstands."
        },
        eval_template={
            "type": "mustache-wikitext",
            "mode": "render",
            "value": "{{=<% %>=}} <%={{ }}=%>  {{#manual}}[[:{{{.}}}]];{{/manual}} {{=<% %>=}} <%={{ }}=%>",
        },
        title="Manual",
        title_={"de": "Handbuch"},
    )
    """
    Comprehensive guide that details how to use this item.
    """
    instructions: set[str] | None = Field(
        None,
        description_={
            "de": "Eine Liste auszuführenden Schritte, z. B. die Einrichtungsanweisungen."
        },
        eval_template={
            "type": "mustache-wikitext",
            "mode": "render",
            "value": "{{=<% %>=}} <%={{ }}=%>  {{#instructions}}[[:{{{.}}}]];{{/instructions}} {{=<% %>=}} <%={{ }}=%>",
        },
        title="Instructions",
        title_={"de": "Anleitung"},
    )
    """
    A list of steps to be performed, e.g., the setup instructions.
    """


class Material(PhysicalItem):
    """
    Contains chemical substances and engineered matterials / parts
    """

    class Config:
        schema_extra = {
            "@context": [
                "/wiki/Category:OSW37a57741ae2e4dd4b29b1172b6848be8?action=raw&slot=jsonschema"
            ],
            "uuid": "31ca9a73-9cb2-4079-b368-24045c0832aa",
            "title": "Material",
            "title*": {"en": "Material", "de": "Material"},
            "description": "Contains chemical substances and engineered matterials / parts",
            "description*": {
                "en": "Contains chemical substances and engineered matterials / parts",
                "de": "Enthält chemische Stoffe, Materialien und Bauteile",
            },
        }

    type: list[str] | None = ["Category:OSW31ca9a739cb24079b36824045c0832aa"]


# generated by datamodel-codegen:
#   filename:  OSW37a57741ae2e4dd4b29b1172b6848be8.json
#   timestamp: 2026-01-05T17:29:55+00:00


# generated by datamodel-codegen:
#   filename:  OSWa5812d3b5119416c8da1606cbe7054eb.json
#   timestamp: 2026-01-05T17:29:56+00:00


# generated by datamodel-codegen:
#   filename:  OSW09f6cdd54bc54de786eafced5f675cbe.json
#   timestamp: 2026-01-05T17:29:57+00:00


# generated by datamodel-codegen:
#   filename:  OSWd02741381aaa4709ae0753a0edc341ce.json
#   timestamp: 2026-01-05T17:29:58+00:00


# generated by datamodel-codegen:
#   filename:  OSW2c32802be59040248c85eda3479d484c.json
#   timestamp: 2026-01-05T17:29:58+00:00


# generated by datamodel-codegen:
#   filename:  OSW9725d7a91bab4f1aa68f423e4e9bfcf4.json
#   timestamp: 2026-01-05T17:29:59+00:00


class TaskStatus(StatusEnumeration):
    """
    State of a task.
    """

    class Config:
        schema_extra = {
            "@context": [
                "/wiki/Category:OSW2c32802be59040248c85eda3479d484c?action=raw&slot=jsonschema"
            ],
            "uuid": "9725d7a9-1bab-4f1a-a68f-423e4e9bfcf4",
            "title": "Task Status",
            "title*": {"en": "Task Status", "de": "Aufgabenstatus"},
            "description": "State of a task.",
            "description*": {"de": "Status einer Aufgabe"},
        }

    type: list[str] | None = ["Category:OSW9725d7a91bab4f1aa68f423e4e9bfcf4"]


# generated by datamodel-codegen:
#   filename:  OSW65c8449bdd4f4fbcb7f68203a11d6e8f.json
#   timestamp: 2026-01-05T17:30:00+00:00


# generated by datamodel-codegen:
#   filename:  OSWe427aafafbac4262955b9f690a83405d.json
#   timestamp: 2026-01-05T17:30:01+00:00


# generated by datamodel-codegen:
#   filename:  OSWb97757b46edb430591758662c18d354d.json
#   timestamp: 2026-01-05T17:30:02+00:00


# generated by datamodel-codegen:
#   filename:  OSW5433f882b9f14dca81994e058c8ab4a0.json
#   timestamp: 2026-01-05T17:30:04+00:00


class TargetObject(OswBaseModel):
    """
    Tool, which the maintenance is performed on.
    """

    class Config:
        schema_extra = {
            "title": "Target object",
            "title*": {"de": "Zielobjekt"},
            "description": "Tool, which the maintenance is performed on.",
            "description*": {"de": "Werkzeug, mit dem die Wartung durchgeführt wird."},
            "eval_template": {
                "mode": "render",
                "type": "mustache-wikitext",
                "value": "{{=<% %>=}} [[<%target_object.target_object_instance%>]] ({{#switch:{{USERLANGUAGECODE}}|#default=Type|de=Typ}}: {{#ask:[[<%target_object.target_object_instance%>]]|?HasType=|format=plain|mainlabel=-}})",
            },
            "defaultProperties": ["target_object_type", "target_object_instance"],
        }

    uuid: UUID = Field(default_factory=uuid4, options={"hidden": True}, title="UUID")
    target_object_type: Category | None = Field(
        None,
        options={
            "autocomplete": {
                "$comment": "Tool",
                "query": "[[SubClassOf::Category:OSWe427aafafbac4262955b9f690a83405d]]OR[[SubClassOf.SubClassOf::Category:OSWe427aafafbac4262955b9f690a83405d]]OR[[SubClassOf.SubClassOf.SubClassOf::Category:OSWe427aafafbac4262955b9f690a83405d]]OR[[SubClassOf.SubClassOf.SubClassOf.SubClassOf::Category:OSWe427aafafbac4262955b9f690a83405d]]OR[[SubClassOf.SubClassOf.SubClassOf.SubClassOf.SubClassOf::Category:OSWe427aafafbac4262955b9f690a83405d]]",
            }
        },
        propertyOrder=10,
        range="Category:Category",
        title="Type",
        title_={"de": "Typ"},
    )
    target_object_instance_property: str | None = Field(
        "Property:HasTarget", options={"hidden": True}
    )
    target_object_instance: Tool | None = Field(
        None,
        options={
            "autocomplete": {
                "query": "[[HasType::$(type_)]]|?Display_title_of=label|?HasImage=image|?HasDescription=description"
            }
        },
        propertyOrder=20,
        range="Category:OSWe427aafafbac4262955b9f690a83405d",
        title="Instance",
        title_={"de": "Instanz"},
        watch={"type_": "target_object.target_object_type"},
        x_oold_required_iri=True,
    )


class NewOccupantOfTheSlot(OswBaseModel):
    """
    Tool or component to replace the one installed in the slot.
    """

    class Config:
        schema_extra = {
            "title": "New occupant of the slot",
            "title*": {"de": "Neue Belegung des Slots"},
            "description": "Tool or component to replace the one installed in the slot.",
            "description*": {
                "de": "Das Werkzeug oder Komponente, die das im Slot installierte ersetzen soll."
            },
            "defaultProperties": ["slot_occupant_type"],
        }

    slot_occupant_type: Category | None = Field(
        None,
        options={
            "autocomplete": {
                "$comment": "Tool",
                "query": "[[:$(slot_type)]]OR[[SubClassOf::$(slot_type)]]OR[[SubClassOf.SubClassOf::$(slot_type)]]OR[[SubClassOf.SubClassOf.SubClassOf::$(slot_type)]]OR[[SubClassOf.SubClassOf.SubClassOf.SubClassOf::$(slot_type)]]OR[[SubClassOf.SubClassOf.SubClassOf.SubClassOf.SubClassOf::$(slot_type)]]",
            }
        },
        propertyOrder=11,
        range="Category:Category",
        title="Type",
        title_={"de": "Typ"},
        watch={"slot_type": "slot_action.slot_type_restriction"},
    )
    slot_occupant_instance_property: str | None = Field(
        "Property:HasOccupant", options={"hidden": True}
    )
    slot_occupant_instance: Tool | None = Field(
        None,
        options={
            "autocomplete": {
                "query": "[[HasType::$(type_)]]|?Display_title_of=label|?HasImage=image|?HasDescription=description"
            }
        },
        propertyOrder=21,
        range="Category:OSWe427aafafbac4262955b9f690a83405d",
        title="Instance",
        title_={"de": "Instanz"},
        watch={"type_": "slot_occupant.slot_occupant_type"},
        x_oold_required_iri=True,
    )


class SlotAction(OswBaseModel):
    class Config:
        schema_extra = {
            "title": "Slot action",
            "title*": {"de": "Slot-Aktion"},
            "defaultProperties": [],
        }

    type: list[Any] | None = Field(
        None,
        field_comment="deprecated, undefined Category:SlotAction can be replaced with property chain -HasAction.HasType::Category:OSW5433f882b9f14dca81994e058c8ab4a0 (Action of a ToolMaintenanceEvent)",
        options={"hidden": True},
    )
    uuid: UUID = Field(default_factory=uuid4, options={"hidden": True}, title="UUID")
    slot_osw_id: str = Field(
        ...,
        options={
            "autocomplete": {
                "query": "[[-HasSlot::$(target_obj)]]|?Display_title_of=label|?HasImage=image|?HasDescription=description|?HasId=slot_id|?HasTypeRestriction=type_restriction|?HasOccupant.HasType=occupant_type",
                "field_maps": [
                    {
                        "source_path": "$",
                        "template": "{{{result.printouts.type_restriction.[0].fulltext}}}",
                        "target_path": "$(slot_type_restriction_)",
                    }
                ],
            }
        },
        title="Target slot",
        title_={"de": "Ziel-Slot"},
        watch={
            "target_obj": "target_object.target_object_instance",
            "slot_type_restriction_": "slot_action.slot_type_restriction",
        },
    )
    slot_type_restriction: str | None = Field(
        "Category:OSWe427aafafbac4262955b9f690a83405d",
        field_comment="Tool",
        options={"hidden": True},
    )
    slot_occupant: NewOccupantOfTheSlot = Field(
        ...,
        defaultProperties=["slot_occupant_type"],
        description_={
            "de": "Das Werkzeug oder Komponente, die das im Slot installierte ersetzen soll."
        },
        title="New occupant of the slot",
        title_={"de": "Neue Belegung des Slots"},
    )
    """
    Tool or component to replace the one installed in the slot.
    """


class ToolMaintenanceEvent(Event):
    """
    An event describing the maintenance of a tool.
    """

    class Config:
        schema_extra = {
            "@context": [
                {
                    "start_date_time": {
                        "@id": "Property:HasStartDate",
                        "@type": "xsd:dateTime",
                    },
                    "end_date_time": {
                        "@id": "Property:HasEndDate",
                        "@type": "xsd:dateTime",
                    },
                    "slot_actions": {
                        "@id": "Property:HasAction",
                        "@type": "@id",
                        "@context": {
                            "type": {"@id": "Property:HasType", "@type": "@id"},
                            "slot_osw_id": {"@id": "Property:HasSlot", "@type": "@id"},
                            "slot_occupant": {
                                "@id": "Property:HasStatement",
                                "@type": "@id",
                                "@context": {
                                    "slot_occupant_instance_property": "Property:HasProperty",
                                    "slot_occupant_instance": "Property:HasObject",
                                },
                            },
                        },
                    },
                    "target_object": {
                        "@id": "Property:HasStatement",
                        "@type": "@id",
                        "@context": {
                            "target_object_instance_property": "Property:HasProperty",
                            "target_object_instance": "Property:HasObject",
                        },
                    },
                },
                "/wiki/Category:OSWb97757b46edb430591758662c18d354d?action=raw&slot=jsonschema",
            ],
            "uuid": "5433f882-b9f1-4dca-8199-4e058c8ab4a0",
            "title": "ToolMaintenanceEvent",
            "title*": {
                "en": "Tool maintenance event",
                "de": "Werkzeugwartungs-Ereignis",
            },
            "description": "An event describing the maintenance of a tool.",
            "description*": {
                "en": "An event describing the maintenance of a tool.",
                "de": "Ein Ereignis, das die Wartung eines Werkzeugs beschreibt.",
            },
            "defaultProperties": ["start_date_time", "slot_actions"],
        }

    type: list[str] | None = ["Category:OSW5433f882b9f14dca81994e058c8ab4a0"]
    start_date_time: datetime | None = Field(
        None,
        dynamic_template="{{_now_}}",
        field_template="now",
        options={"dynamic_template": {"override": "empty"}},
    )
    end_date_time: datetime = Field(
        ...,
        dynamic_template="{{_now_}}",
        field_template="now",
        options={"dynamic_template": {"override": "empty"}},
    )
    target_object: TargetObject = Field(
        ...,
        defaultProperties=["target_object_type", "target_object_instance"],
        description_={"de": "Werkzeug, mit dem die Wartung durchgeführt wird."},
        eval_template={
            "mode": "render",
            "type": "mustache-wikitext",
            "value": "{{=<% %>=}} [[<%target_object.target_object_instance%>]] ({{#switch:{{USERLANGUAGECODE}}|#default=Type|de=Typ}}: {{#ask:[[<%target_object.target_object_instance%>]]|?HasType=|format=plain|mainlabel=-}})",
        },
        title="Target object",
        title_={"de": "Zielobjekt"},
    )
    """
    Tool, which the maintenance is performed on.
    """
    slot_actions: list[SlotAction] | None = Field(
        None,
        eval_template={
            "mode": "render",
            "type": "mustache-wikitext",
            "value": "{{=<% %>=}} <ul><%#slot_actions%><li>{{Template:Viewer/Link|page=<%slot_osw_id%>|url=|label=}}: {{#if: <%slot_occupant.slot_occupant_instance%> | [[<%slot_occupant.slot_occupant_instance%>]] ({{#switch:{{USERLANGUAGECODE}}|de=Typ|#default=Type}}: {{#ask:[[<%slot_occupant.slot_occupant_instance%>]]|?HasType=|format=plain|mainlabel=-}}) | {{#switch:{{USERLANGUAGECODE}}|de=Keine Belegung|#default=No occupant}} }}</li><%/slot_actions%></ul><%^slot_actions%>{{#switch:{{USERLANGUAGECODE}}|en=No slot action defined|de=Keine Slot-Aktion angegeben|#default=Type}}<%/slot_actions%>",
        },
        title="Slot action(s)",
        title_={"de": "Slot-Aktionen"},
    )


# generated by datamodel-codegen:
#   filename:  Property.json
#   timestamp: 2026-01-05T17:30:06+00:00


class DataType(str, Enum):
    """
    See https://www.semantic-mediawiki.org/wiki/Help:List_of_datatypes
    """

    Annotation_URI = "Annotation URI"
    """
    Annotation URI
    """
    Boolean = "Boolean"
    """
    Boolean
    """
    Email = "Email"
    """
    Email
    """
    Number = "Number"
    """
    Number
    """
    Page = "Page"
    """
    Page
    """
    Temperature = "Temperature"
    """
    Temperature
    """
    Text = "Text"
    """
    Text
    """
    URL = "URL"
    """
    URL
    """
    Date = "Date"
    """
    Date
    """
    Code = "Code"
    """
    Code
    """
    Telephone_number = "Telephone number"
    """
    Telephone number
    """
    Quantity = "Quantity"
    """
    Quantity
    """
    Record = "Record"
    """
    Record
    """
    Monolingual_text = "Monolingual text"
    """
    Monolingual text
    """
    External_identifier = "External identifier"
    """
    External identifier
    """
    Reference = "Reference"
    """
    Reference
    """
    Keyword = "Keyword"
    """
    Keyword
    """
    Geographic_coordinates = "Geographic coordinates"
    """
    Geographic coordinates
    """


class Relation(OswBaseModel):
    class Config:
        schema_extra = {"title": "Relation", "title*": {"de": "Beziehung"}}

    inverse_of: str = Field(..., title="Property")
    """
    Property to use in this relation
    """


class Property(Entity):
    """
    The named relation between a subject and an object
    """

    class Config:
        schema_extra = {
            "@context": [
                {
                    "description**": "Property:Has property description",
                    "exact_ontology_match***": {
                        "@id": "owl:equivalentProperty",
                        "@type": "@id",
                    },
                    "external_uri": "Property:External_formatter_uri",
                    "imported_from*": "Property:Imported_from",
                    "inverse_of": {"@id": "owl:inverseOf", "@type": "@id"},
                    "inverse_of*": {"@id": "Property:InverseOf", "@type": "@id"},
                    "label**": "Property:Has preferred property label",
                    "ontologies": {"@id": "rdfs:isDefinedBy", "@type": "@id"},
                    "ontologies*": {"@id": "Property:IsPartOf", "@type": "@id"},
                    "ontology_iri": "Property:Equivalent_URI",
                    "property_type": "Property:Has_type",
                    "relations": {"@id": "rdfs:subPropertyOf", "@type": "@id"},
                    "relations*": {"@id": "Property:HasRelation", "@type": "@id"},
                    "see_also": {"@id": "rdfs:seeAlso"},
                    "see_also*": "Property:HasUrl",
                    "subproperty_of": {"@id": "rdfs:subPropertyOf", "@type": "@id"},
                    "subproperty_of*": {
                        "@id": "Property:Subproperty_of",
                        "@type": "@id",
                    },
                },
                "/wiki/Category:Entity?action=raw&slot=jsonschema",
            ],
            "uuid": "19a1a69a-6843-442c-a9cf-b8e884db7047",
            "title": "Property",
            "title*": {"de": "Attribut", "en": "Property"},
            "description": "The named relation between a subject and an object",
            "description*": {
                "en": "The named relation between a subject and an object",
                "de": "Die benannte Beziehung zwischen einem Subjekt und einem Objekt",
            },
        }

    imported_from: str | None = Field(
        None, example="schema:Person", title="Imported from"
    )
    """
    A prefixed IRI defining this entry as a imported term. In OSW the prefix must be a registered imported ontology.
    """
    name: str = Field(
        ...,
        description_={"de": "Für Attribute ist dieser Wert der primäre Identifier."},
        options={"hidden": False},
    )
    """
    For properties this value is the primary identifier.
    """
    property_type: DataType | None = Field(
        DataType.Page,
        description_={
            "de": "Siehe https://www.semantic-mediawiki.org/wiki/Help:List_of_datatypes"
        },
        options={
            "enum_titles": [
                "Annotation URI",
                "Boolean",
                "Email",
                "Number",
                "Page",
                "Temperature",
                "Text",
                "URL",
                "Date",
                "Code",
                "Telephone number",
                "Quantity",
                "Record",
                "Monolingual text",
                "External identifier",
                "Reference",
                "Keyword",
                "Geographic coordinates",
            ],
            "enum_titles*": {
                "de": [
                    "Annotations-URI",
                    "Wahrheitswert",
                    "Email",
                    "Zahl",
                    "Seite",
                    "Temperatur",
                    "Text",
                    "URL",
                    "Datum",
                    "Programmcode",
                    "Telefonnummer",
                    "Mengengröße",
                    "Aufzeichnung",
                    "Einsprachiger Text",
                    "Externe ID",
                    "Verweis",
                    "Schlagwort",
                    "Geographische Koordinaten",
                ]
            },
        },
        title="Data type",
        title_={"de": "Datentyp"},
    )
    """
    See https://www.semantic-mediawiki.org/wiki/Help:List_of_datatypes
    """
    allowed_value: list[str] | None = Field(
        None, title="Allowed values", title_={"de": "Erlaubte Werte"}
    )
    ontology_iri: list[str] | None = Field(
        None,
        description_={
            "de": "z. B. von https://www.qudt.org/doc/DOC_VOCAB-QUANTITY-KINDS.html"
        },
        title="Ontology IRI(s)",
        title_={"de": "Ontologie-IRI(s)"},
    )
    """
    e. g. from https://www.qudt.org/doc/DOC_VOCAB-QUANTITY-KINDS.html
    """
    ontologies: list[OwlOntology] | None = Field(
        None,
        description_={"de": "Ontologien, die diesen Begriff enthalten"},
        range="Category:OSW662db0a2ad0946148422245f84e82f64",
        title="Ontologies",
        title_={"de": "Ontologien"},
    )
    """
    Ontologies that contain this term
    """
    subproperty_of: list[Property] | None = Field(
        None,
        range="Category:Property",
        title="Subproperty of",
        title_={"de": "Unterattribut von"},
    )
    inverse_of: list[Property] | None = Field(
        None,
        range="Category:Property",
        title="Inverse of",
        title_={"de": "Gegenteil von"},
    )
    type: list[str] | None = Field(
        ["Category:Property"],
        description_={
            "de": "Siehe auch https://www.w3.org/TR/owl2-syntax/#Object_Properties"
        },
    )
    """
    See also https://www.w3.org/TR/owl2-syntax/#Object_Properties
    """
    see_also: list[str] | None = Field(
        None,
        description_={"de": "Externer Verweis"},
        title="See also",
        title_={"de": "Siehe auch"},
    )
    """
    External reference
    """
    relations: list[Relation] | None = Field(
        None,
        description_={
            "de": "Beziehungen dieses Attributs zu anderen Attributen, Instanzen oder Literalwerten (OWL-Einschränkungen)"
        },
        eval_template=[
            {
                "type": "mustache-wikitext",
                "mode": "render",
                "value": "{{#relations}}[[Property:InverseOf]] [[{{{inverse_of}}}]]<br>{{/relations}}",
            }
        ],
        title="Relations",
        title_={"de": "Beziehungen"},
    )
    """
    Relations of this property to other properties, instances or literals (OWL Restrictions)
    """


class Ontology(Item):
    """
    System von Informationen mit logischen Relationen
    """

    class Config:
        schema_extra = {
            "@context": [
                "/wiki/Category:Item?action=raw&slot=jsonschema",
                {"url": "Property:HasUrl"},
            ],
            "title": "Ontology",
            "uuid": "288260cd-0728-420c-9f40-ae1c5fa19111",
            "title*": {"en": "Ontology", "de": "Ontologie"},
            "description": "System von Informationen mit logischen Relationen",
            "description*": {"en": "System von Informationen mit logischen Relationen"},
        }

    NameOfMostBasicConcept: str | None = None
    url: str | None = None
    type: list[str] | None = ["Category:OSW288260cd0728420c9f40ae1c5fa19111"]


class OwlOntology(Ontology):
    """
    see https://www.w3.org/TR/owl-ref/#Ontology-def
    """

    class Config:
        schema_extra = {
            "@context": [
                "/wiki/Category:OSW288260cd0728420c9f40ae1c5fa19111?action=raw&slot=jsonschema",
                {
                    "iri": "@id",
                    "dc": "http://purl.org/dc/elements/1.1/",
                    "label": "dc:title",
                    "description": "dc:abstract",
                    "see_also": "rdfs:seeAlso",
                    "is_defined_by": "rdfs:isDefinedBy",
                    "version_info": "owl:versionInfo",
                    "prior_version": {"type": "@id", "@id": "owl:priorVersion"},
                    "backward_compatible_with": {
                        "type": "@id",
                        "@id": "owl:backwardCompatibleWith",
                    },
                    "incompatible_with": {"type": "@id", "@id": "owl:incompatibleWith"},
                    "imports": {"type": "@id", "@id": "owl:imports"},
                },
            ],
            "uuid": "662db0a2-ad09-4614-8422-245f84e82f64",
            "title": "OwlOntology",
            "title*": {"en": "OWL Ontology"},
            "description": "see https://www.w3.org/TR/owl-ref/#Ontology-def",
            "description*": {"en": "see https://www.w3.org/TR/owl-ref/#Ontology-def"},
        }

    type: list[str] | None = ["Category:OSW662db0a2ad0946148422245f84e82f64"]
    iri: str | None = Field(None, options={"hidden": False})
    """
    IRI, e. g. 'http://www.example.com/ontology'
    """
    prefix: str | None = Field(None, title="(Prefered) prefix")
    """
    Typically the IRI extended with '/' or #', e. g. 'http://www.example.com/ontology#'
    """
    prefix_name: str | None = Field(None, title="(Preferred) prefix name")
    """
    A short representation of the IRI, e. g. 'ex'
    """
    version_iri: str | None = Field(None, title="Version IRI")
    """
    A version IRI, e. g. http://www.example.com/ontology/0.1.0
    """
    version_info: str | None = Field(None, title="Version info")
    """
    A version identifier, e. g. v0.1.0
    """
    prior_version: list[str] | None = Field(None, title="Prior versions")
    """
    Prior versions of this ontology
    """
    backward_compatible_with: list[str] | None = Field(
        None, title="Backward compatible"
    )
    """
    Prior backward-compatible versions of this ontology
    """
    incompatible_with: list[str] | None = Field(None, title="Incompatible")
    """
    Prior incompatible versions of this ontology
    """
    imports: list[str] | None = Field(None, title="Imported ontolgies")
    """
    OWL imports of other ontologies
    """
    see_also: list[str] | None = Field(None, title="Documentation")
    """
    A web resource describing this ontology, e. g. a website
    """
    is_defined_by: list[str] | None = Field(None, title="Source")
    """
    A web resource defining this ontology, e. g. a turtle file
    """


# generated by datamodel-codegen:
#   filename:  AnnotationProperty.json
#   timestamp: 2026-01-05T17:30:07+00:00


class AnnotationProperty(Property):
    """
    To annotate classes and individuals
    """

    class Config:
        schema_extra = {
            "@context": ["/wiki/Category:Property?action=raw&slot=jsonschema"],
            "uuid": "c3d78c97-6590-43f5-abcf-643513ae55e1",
            "title": "AnnotationProperty",
            "title*": {"en": "AnnotationProperty"},
            "description": "To annotate classes and individuals",
            "description*": {"en": "To annotate classes and individuals"},
        }

    property_type: str | None = "Text"
    type: list[str] | None = ["Category:AnnotationProperty"]


# generated by datamodel-codegen:
#   filename:  ObjectProperty.json
#   timestamp: 2026-01-05T17:30:08+00:00


class ObjectProperty(Property):
    """
    The named relation between a subject and an object
    """

    class Config:
        schema_extra = {
            "@context": [
                "/wiki/Category:Property?action=raw&slot=jsonschema",
                {
                    "range": {"@id": "rdfs:range", "@type": "@id"},
                    "range*": {"@id": "Property:HasRange", "@type": "@id"},
                },
            ],
            "uuid": "c1ffbdc5-628d-4192-a9d0-3d608dac31a8",
            "title": "ObjectProperty",
            "title*": {"en": "Object property", "de": "Objektattribut"},
            "description": "The named relation between a subject and an object",
            "description*": {
                "en": "The named relation between a subject and an object",
                "de": "Die benannte Beziehung zwischen einem Subjekt und einem Objekt",
            },
            "defaultProperties": ["range"],
        }

    property_type: str | None = Field("Page", options={"hidden": "true"})
    type: list[str] | None = ["Category:ObjectProperty"]
    range: list[Category] | None = Field(
        None,
        description_={
            "de": "Ermöglicht die Unterstützung der automatischen Vervollständigung durch Nachschlagen aller Elemente, die mindestens in einer der aufgeführten Kategorien enthalten sind. Derzeit wird nur eine einzelne Kategorie unterstützt."
        },
        range="Category:Category",
        title="Value range",
        title_={"de": "Wertebereich"},
    )
    """
    Enables autocomplete support by lookup all elements that are at least in one of the listed categories. Currently only a single category is supprted.
    """


# generated by datamodel-codegen:
#   filename:  DataProperty.json
#   timestamp: 2026-01-05T17:30:09+00:00


class DataProperty(Property):
    class Config:
        schema_extra = {
            "@context": ["/wiki/Category:Property?action=raw&slot=jsonschema"],
            "uuid": "5339291d-0c2f-475e-9f77-c85679ab6b24",
            "title": "DataProperty",
            "title*": {"en": "Data property"},
            "description": "",
            "description*": {},
        }

    property_type: str | None = "Text"
    type: list[str] | None = ["Category:DataProperty"]


# generated by datamodel-codegen:
#   filename:  QuantityProperty.json
#   timestamp: 2026-01-05T17:30:10+00:00


class QuantityProperty(Property):
    """
    Property that represents a physical quantity
    """

    class Config:
        schema_extra = {
            "@context": ["/wiki/Category:Property?action=raw&slot=jsonschema"],
            "uuid": "bc61accf-2c49-44ea-9317-6a4654c1d98a",
            "title": "QuantityProperty",
            "title*": {"en": "Quantity Property", "de": "Größeneigenschaft"},
            "description": "Property that represents a physical quantity",
            "description*": {
                "en": "Property that represents a physical quantity",
                "de": "Attribut das eine physikalische Größe repräsentiert",
            },
        }

    property_type: str | None = Field("Quantity", options={"hidden": "true"})
    type: list[str] | None = ["Category:QuantityProperty"]


# generated by datamodel-codegen:
#   filename:  OSW1b15ddcf042c4599bd9d431cbfdf3430.json
#   timestamp: 2026-01-05T17:30:11+00:00


class MainUnit(OswBaseModel):
    class Config:
        schema_extra = {
            "title": "Main unit",
            "title*": {"de": "Haupteinheit"},
            "options": {"compact": True},
            "eval_template": {
                "type": "mustache-wikitext",
                "mode": "render",
                "value": "1 {{main_unit.main_symbol}} {{=<% %>=}} {{#set: <%={{ }}=%> |Corresponds to=1 {{main_unit.main_symbol}} {{#main_unit.alternative_symbols}}, {{.}}{{/main_unit.alternative_symbols}} {{=<% %>=}} }} <%={{ }}=%>",
            },
            "defaultProperties": ["main_symbol"],
        }

    uuid: UUID = Field(default_factory=uuid4, options={"hidden": True}, title="UUID")
    name: str = Field(
        ...,
        description_={"de": "Technischer / Maschinenkompatibler Name"},
        options={"hidden": True},
        template="{{main_symbol}}",
        title="Name",
        watch={"main_symbol": "unit.main_symbol"},
    )
    """
    Technical / Machine compatible name
    """
    main_symbol: str = Field(..., title="Symbol", title_={"de": "Symbol"})
    alternative_symbols: list[str] | None = Field(
        None, title="Alternative symbols", title_={"de": "Alternative Symbole"}
    )
    codes: list[str] | None = Field(
        None,
        description_={
            "de": "z. B. UN/CEFACT Common Code (Maßeinheiten), ISO 4217 (Währungen)"
        },
        title="Unit codes",
        title_={"de": "Einheiten Codes"},
    )
    """
    e.g. UN/CEFACT Common Code (measurement units), ISO 4217 (currencies)
    """
    use_as_input_unit: bool | None = None
    use_as_display_unit: bool | None = None
    ontology_iri: list[str] | None = Field(
        None, title="Ontology IRI(s)", title_={"de": "Ontologie-IRI(s)"}
    )
    """
    e. g. from https://www.qudt.org/doc/DOC_VOCAB-UNITS.html
    """


class Unit(MainUnit):
    class Config:
        schema_extra = {
            "title": "Unit",
            "title*": {"de": "Einheit"},
            "headerTemplate": "{{self.main_symbol}}",
            "defaultProperties": ["conversion_factor_to_main_unit"],
        }

    conversion_factor_to_main_unit: str | None = None


class MainQuantityProperty(QuantityProperty):
    """
    Defines valid units for itself and all of its subquantities
    """

    class Config:
        schema_extra = {
            "@context": [
                {
                    "main_unit": {"@id": "Property:HasMainUnit", "@type": "@id"},
                    "main_unit*": "Property:HasDisplayUnit",
                    "main_unit**": "Property:HasInputUnit",
                    "additional_units": {"@id": "Property:HasUnit", "@type": "@id"},
                    "additional_units*": "Property:HasDisplayUnit",
                    "additional_units**": "Property:HasInputUnit",
                    "main_symbol": "Property:HasMainUnitSymbol",
                    "alternative_symbols": "Property:HasUnitSymbol",
                    "codes": {"@id": "Property:HasUnitCode"},
                    "conversion_factor_to_main_unit": "Property:HasConversionFactor",
                    "proportional_to": {
                        "@id": "Property:IsProportionalTo",
                        "@type": "@id",
                    },
                    "inverse_proportional_to": {
                        "@id": "Property:IsInverseProportionalTo",
                        "@type": "@id",
                    },
                },
                "/wiki/Category:QuantityProperty?action=raw&slot=jsonschema",
            ],
            "uuid": "1b15ddcf-042c-4599-bd9d-431cbfdf3430",
            "title": "MainQuantityProperty",
            "title*": {"en": "Main Quantity Property", "de": "Hauptgrößenattribut"},
            "description": "Defines valid units for itself and all of its subquantities",
            "description*": {
                "en": "Defines valid units for itself and all of its subquantities",
                "de": "Definiert gültige Einheiten für sich selbst und alle seine Untergrößen.",
            },
            "defaultProperties": ["main_unit", "additional_units"],
        }

    main_unit: MainUnit | None = Field(
        None,
        defaultProperties=["main_symbol"],
        eval_template={
            "type": "mustache-wikitext",
            "mode": "render",
            "value": "1 {{main_unit.main_symbol}} {{=<% %>=}} {{#set: <%={{ }}=%> |Corresponds to=1 {{main_unit.main_symbol}} {{#main_unit.alternative_symbols}}, {{.}}{{/main_unit.alternative_symbols}} {{=<% %>=}} }} <%={{ }}=%>",
        },
        options={"compact": True},
        title="Main unit",
        title_={"de": "Haupteinheit"},
    )
    additional_units: list[Unit] | None = Field(
        None,
        eval_template={
            "type": "mustache-wikitext",
            "mode": "render",
            "value": "{{#additional_units}} <br>= {{conversion_factor_to_main_unit}} {{main_symbol}} {{=<% %>=}} {{#set: <%={{ }}=%> |Corresponds to={{conversion_factor_to_main_unit}} {{main_symbol}} {{#alternative_symbols}}, {{.}}{{/alternative_symbols}} {{=<% %>=}} }} <%={{ }}=%> {{/additional_units}}",
        },
        eval_template_={
            "type": "mustache-wikitext",
            "mode": "render",
            "value": "{{#units}} {{conversion_factor_to_main_unit}} {{#unit_symbols}} {{.}}, {{/unit_symbols}} {{=<% %>=}} {{#set: <%={{ }}=%> |Corresponds to={{conversion_factor_to_main_unit}} {{#unit_symbols}} {{.}}, {{/unit_symbols}} {{=<% %>=}} }} <%={{ }}=%> <br> {{/units}}",
        },
        options={"dependencies": {"subproperty_of": ""}},
        title="Units",
        title_={"de": "Einheiten"},
    )
    proportional_to: list[str] | None = Field(
        None,
        description_={
            "de": "Verwandte Größe deren Einheiten im Zähler der Einheiten dieser Größe stehen "
        },
        eval_template={
            "type": "mustache-wikitext",
            "mode": "render",
            "value": "{{#proportional_to}} <br> [[{{{.}}}]] {{/proportional_to}}",
        },
        title="Proportional to",
        title_={"de": "Proportional zu"},
    )
    """
    Related quantity which units are in the numerator of the units of this quantity
    """
    inverse_proportional_to: list[str] | None = Field(
        None,
        description_={
            "de": "Verwandte Größe deren Einheiten im Nenner der Einheiten dieser Größe stehen "
        },
        eval_template={
            "type": "mustache-wikitext",
            "mode": "render",
            "value": "{{#inverse_proportional_to}} <br> [[{{{.}}}]] {{/inverse_proportional_to}}",
        },
        title="Inverse proportional to",
        title_={"de": "Invers proportional zu"},
    )
    """
    Related quantity which units are in the denominator of the units of this quantity
    """
    type: list[str] | None = ["Category:OSW1b15ddcf042c4599bd9d431cbfdf3430"]


# generated by datamodel-codegen:
#   filename:  OSW69f251a900944602a08d1cca830249b5.json
#   timestamp: 2026-01-05T17:30:13+00:00


class SubQuantityProperty(QuantityProperty):
    """
    Is the sub-property of a main quantity or other sub-quantity and inherits its valid units. Can define a subset of input and display units from it.
    """

    class Config:
        schema_extra = {
            "@context": [
                "/wiki/Category:QuantityProperty?action=raw&slot=jsonschema",
                {
                    "display_units": {"@id": "Property:HasDisplayUnit", "@type": "@id"},
                    "input_units": {"@id": "Property:HasInputUnit", "@type": "@id"},
                },
            ],
            "uuid": "69f251a9-0094-4602-a08d-1cca830249b5",
            "title": "SubQuantityProperty",
            "title*": {"en": "Sub Quantity Property", "de": "Untergrößenattribut"},
            "description": "Is the sub-property of a main quantity or other sub-quantity and inherits its valid units. Can define a subset of input and display units from it.",
            "description*": {
                "en": "Is the sub-property of a main quantity or other sub-quantity and inherits its valid units. Can define a subset of input and display units from it.",
                "de": "Ist das Unterattribut einer Hauptgröße oder einer anderen Untergröße und erbt dessen gültige Einheiten. Kann daraus ein Untermenge von Eingabe- und Anzeigeeinheiten definieren.",
            },
        }

    subproperty_of: list[QuantityProperty] | None = Field(
        None,
        range="Category:QuantityProperty",
        title="Subquantity of",
        title_={"de": "Untergröße von"},
        x_oold_required_iri=True,
    )
    base_property: str = Field(
        ...,
        options={
            "autocomplete": {"category": "Category:OSW1b15ddcf042c4599bd9d431cbfdf3430"}
        },
        title="Base quantity",
        title_={"de": "Hauptgröße"},
    )
    display_units: set[str] | None = Field(
        None,
        min_items=1,
        title="Display units",
        title_={"de": "Anzeigeeinheiten"},
        watch={"base_property": "base_property"},
    )
    input_units: set[str] | None = Field(
        None,
        min_items=1,
        title="Input units",
        title_={"de": "Eingabeeinheiten"},
        watch={"base_property": "base_property"},
    )
    type: list[str] | None = ["Category:OSW69f251a900944602a08d1cca830249b5"]


AdministrativeArea.update_forward_refs()
AnnotationProperty.update_forward_refs()
BudgetType.update_forward_refs()
Category.update_forward_refs()
City.update_forward_refs()
Competence.update_forward_refs()
Component.update_forward_refs()
Country.update_forward_refs()
CreativeWork.update_forward_refs()
Data.update_forward_refs()
DataProperty.update_forward_refs()
DataStatement.update_forward_refs()
DefinedTerm.update_forward_refs()
DigitalDocument.update_forward_refs()
DocumentationExtension.update_forward_refs()
Entity.update_forward_refs()
Enumeration.update_forward_refs()
Event.update_forward_refs()
File.update_forward_refs()
GroupPermission.update_forward_refs()
IDAndCountry.update_forward_refs()
IDAndCountry1.update_forward_refs()
InitialOccupantOfTheSlot.update_forward_refs()
Input.update_forward_refs()
IntangibleItem.update_forward_refs()
IssueLabel.update_forward_refs()
Item.update_forward_refs()
ItemModel.update_forward_refs()
Keyword.update_forward_refs()
LocalFile.update_forward_refs()
Location.update_forward_refs()
MainQuantityProperty.update_forward_refs()
Material.update_forward_refs()
NewOccupantOfTheSlot.update_forward_refs()
ObjectProperty.update_forward_refs()
ObjectStatement.update_forward_refs()
Ontology.update_forward_refs()
OrganizationalSubUnit.update_forward_refs()
OrganizationalUnit.update_forward_refs()
OtherPhysicalItem.update_forward_refs()
Output.update_forward_refs()
OwlOntology.update_forward_refs()
OwlThing.update_forward_refs()
PagePackage.update_forward_refs()
Permission.update_forward_refs()
Person.update_forward_refs()
PersonRole.update_forward_refs()
PhysicalItem.update_forward_refs()
PhysicalItemType.update_forward_refs()
Place.update_forward_refs()
PostalAddress.update_forward_refs()
Priority.update_forward_refs()
Process.update_forward_refs()
ProcessType.update_forward_refs()
Project.update_forward_refs()
ProjectStatus.update_forward_refs()
ProjectType.update_forward_refs()
Property.update_forward_refs()
QuantityProperty.update_forward_refs()
QuantityStatement.update_forward_refs()
Region.update_forward_refs()
RemoteFile.update_forward_refs()
Site.update_forward_refs()
Slot.update_forward_refs()
StandardOperatingProcedure.update_forward_refs()
State.update_forward_refs()
StatusEnumeration.update_forward_refs()
SubQuantityProperty.update_forward_refs()
TargetObject.update_forward_refs()
Task.update_forward_refs()
TaskStatus.update_forward_refs()
Tool.update_forward_refs()
Tool1.update_forward_refs()
ToolMaintenanceEvent.update_forward_refs()
Topic.update_forward_refs()
UserAccount.update_forward_refs()
UserGroup.update_forward_refs()
WikiFile.update_forward_refs()
WorkPackage.update_forward_refs()
YearlyBudget.update_forward_refs()
