diff --git a/apis_ontology/migrations/0017_eventhadparticipantgroup_eventhadparticipantperson_and_more.py b/apis_ontology/migrations/0017_eventhadparticipantgroup_eventhadparticipantperson_and_more.py new file mode 100644 index 0000000..115293d --- /dev/null +++ b/apis_ontology/migrations/0017_eventhadparticipantgroup_eventhadparticipantperson_and_more.py @@ -0,0 +1,937 @@ +# Generated by Django 5.1.3 on 2024-12-10 17:16 + +import apis_core.generic.abc +import django.db.models.deletion +import simple_history.models +from django.conf import settings +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("apis_ontology", "0016_event_event_type_versionevent_event_type"), + ("contenttypes", "0002_remove_content_type_name"), + ("relations", "0001_initial"), + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ + migrations.CreateModel( + name="EventHadParticipantGroup", + fields=[ + ( + "relation_ptr", + models.OneToOneField( + auto_created=True, + on_delete=django.db.models.deletion.CASCADE, + parent_link=True, + primary_key=True, + serialize=False, + to="relations.relation", + ), + ), + ], + options={ + "abstract": False, + }, + bases=("relations.relation", models.Model), + ), + migrations.CreateModel( + name="EventHadParticipantPerson", + fields=[ + ( + "relation_ptr", + models.OneToOneField( + auto_created=True, + on_delete=django.db.models.deletion.CASCADE, + parent_link=True, + primary_key=True, + serialize=False, + to="relations.relation", + ), + ), + ], + options={ + "abstract": False, + }, + bases=("relations.relation", models.Model), + ), + migrations.CreateModel( + name="EventWasMotivatedByWork", + fields=[ + ( + "relation_ptr", + models.OneToOneField( + auto_created=True, + on_delete=django.db.models.deletion.CASCADE, + parent_link=True, + primary_key=True, + serialize=False, + to="relations.relation", + ), + ), + ], + options={ + "abstract": False, + }, + bases=("relations.relation", models.Model), + ), + migrations.CreateModel( + name="PerformanceHadDirectorPerson", + fields=[ + ( + "relation_ptr", + models.OneToOneField( + auto_created=True, + on_delete=django.db.models.deletion.CASCADE, + parent_link=True, + primary_key=True, + serialize=False, + to="relations.relation", + ), + ), + ], + options={ + "abstract": False, + }, + bases=("relations.relation", models.Model), + ), + migrations.CreateModel( + name="PerformanceHadParticipantGroup", + fields=[ + ( + "relation_ptr", + models.OneToOneField( + auto_created=True, + on_delete=django.db.models.deletion.CASCADE, + parent_link=True, + primary_key=True, + serialize=False, + to="relations.relation", + ), + ), + ], + options={ + "abstract": False, + }, + bases=("relations.relation", models.Model), + ), + migrations.CreateModel( + name="PerformanceHadParticipantPerson", + fields=[ + ( + "relation_ptr", + models.OneToOneField( + auto_created=True, + on_delete=django.db.models.deletion.CASCADE, + parent_link=True, + primary_key=True, + serialize=False, + to="relations.relation", + ), + ), + ], + options={ + "abstract": False, + }, + bases=("relations.relation", models.Model), + ), + migrations.CreateModel( + name="PerformancePerformedWork", + fields=[ + ( + "relation_ptr", + models.OneToOneField( + auto_created=True, + on_delete=django.db.models.deletion.CASCADE, + parent_link=True, + primary_key=True, + serialize=False, + to="relations.relation", + ), + ), + ], + options={ + "abstract": False, + }, + bases=("relations.relation", models.Model), + ), + migrations.CreateModel( + name="PosterPromotedEvent", + fields=[ + ( + "relation_ptr", + models.OneToOneField( + auto_created=True, + on_delete=django.db.models.deletion.CASCADE, + parent_link=True, + primary_key=True, + serialize=False, + to="relations.relation", + ), + ), + ], + options={ + "abstract": False, + }, + bases=("relations.relation", models.Model), + ), + migrations.CreateModel( + name="PosterPromotedPerformance", + fields=[ + ( + "relation_ptr", + models.OneToOneField( + auto_created=True, + on_delete=django.db.models.deletion.CASCADE, + parent_link=True, + primary_key=True, + serialize=False, + to="relations.relation", + ), + ), + ], + options={ + "abstract": False, + }, + bases=("relations.relation", models.Model), + ), + migrations.CreateModel( + name="VersionEventHadParticipantGroup", + fields=[ + ( + "relation_ptr", + models.ForeignKey( + auto_created=True, + blank=True, + db_constraint=False, + null=True, + on_delete=django.db.models.deletion.DO_NOTHING, + parent_link=True, + related_name="+", + to="relations.relation", + ), + ), + ( + "id", + models.IntegerField( + auto_created=True, blank=True, db_index=True, verbose_name="ID" + ), + ), + ("subj_object_id", models.PositiveIntegerField()), + ("obj_object_id", models.PositiveIntegerField()), + ( + "version_tag", + models.CharField(blank=True, max_length=255, null=True), + ), + ("history_id", models.AutoField(primary_key=True, serialize=False)), + ("history_date", models.DateTimeField(db_index=True)), + ("history_change_reason", models.CharField(max_length=100, null=True)), + ( + "history_type", + models.CharField( + choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")], + max_length=1, + ), + ), + ( + "history_user", + models.ForeignKey( + null=True, + on_delete=django.db.models.deletion.SET_NULL, + related_name="+", + to=settings.AUTH_USER_MODEL, + ), + ), + ( + "obj_content_type", + models.ForeignKey( + blank=True, + db_constraint=False, + null=True, + on_delete=django.db.models.deletion.DO_NOTHING, + related_name="+", + to="contenttypes.contenttype", + ), + ), + ( + "subj_content_type", + models.ForeignKey( + blank=True, + db_constraint=False, + null=True, + on_delete=django.db.models.deletion.DO_NOTHING, + related_name="+", + to="contenttypes.contenttype", + ), + ), + ], + options={ + "verbose_name": "historical event had participant group", + "verbose_name_plural": "historical event had participant groups", + "ordering": ("-history_date", "-history_id"), + "get_latest_by": ("history_date", "history_id"), + }, + bases=( + simple_history.models.HistoricalChanges, + models.Model, + apis_core.generic.abc.GenericModel, + ), + ), + migrations.CreateModel( + name="VersionEventHadParticipantPerson", + fields=[ + ( + "relation_ptr", + models.ForeignKey( + auto_created=True, + blank=True, + db_constraint=False, + null=True, + on_delete=django.db.models.deletion.DO_NOTHING, + parent_link=True, + related_name="+", + to="relations.relation", + ), + ), + ( + "id", + models.IntegerField( + auto_created=True, blank=True, db_index=True, verbose_name="ID" + ), + ), + ("subj_object_id", models.PositiveIntegerField()), + ("obj_object_id", models.PositiveIntegerField()), + ( + "version_tag", + models.CharField(blank=True, max_length=255, null=True), + ), + ("history_id", models.AutoField(primary_key=True, serialize=False)), + ("history_date", models.DateTimeField(db_index=True)), + ("history_change_reason", models.CharField(max_length=100, null=True)), + ( + "history_type", + models.CharField( + choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")], + max_length=1, + ), + ), + ( + "history_user", + models.ForeignKey( + null=True, + on_delete=django.db.models.deletion.SET_NULL, + related_name="+", + to=settings.AUTH_USER_MODEL, + ), + ), + ( + "obj_content_type", + models.ForeignKey( + blank=True, + db_constraint=False, + null=True, + on_delete=django.db.models.deletion.DO_NOTHING, + related_name="+", + to="contenttypes.contenttype", + ), + ), + ( + "subj_content_type", + models.ForeignKey( + blank=True, + db_constraint=False, + null=True, + on_delete=django.db.models.deletion.DO_NOTHING, + related_name="+", + to="contenttypes.contenttype", + ), + ), + ], + options={ + "verbose_name": "historical event had participant person", + "verbose_name_plural": "historical event had participant persons", + "ordering": ("-history_date", "-history_id"), + "get_latest_by": ("history_date", "history_id"), + }, + bases=( + simple_history.models.HistoricalChanges, + models.Model, + apis_core.generic.abc.GenericModel, + ), + ), + migrations.CreateModel( + name="VersionEventWasMotivatedByWork", + fields=[ + ( + "relation_ptr", + models.ForeignKey( + auto_created=True, + blank=True, + db_constraint=False, + null=True, + on_delete=django.db.models.deletion.DO_NOTHING, + parent_link=True, + related_name="+", + to="relations.relation", + ), + ), + ( + "id", + models.IntegerField( + auto_created=True, blank=True, db_index=True, verbose_name="ID" + ), + ), + ("subj_object_id", models.PositiveIntegerField()), + ("obj_object_id", models.PositiveIntegerField()), + ( + "version_tag", + models.CharField(blank=True, max_length=255, null=True), + ), + ("history_id", models.AutoField(primary_key=True, serialize=False)), + ("history_date", models.DateTimeField(db_index=True)), + ("history_change_reason", models.CharField(max_length=100, null=True)), + ( + "history_type", + models.CharField( + choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")], + max_length=1, + ), + ), + ( + "history_user", + models.ForeignKey( + null=True, + on_delete=django.db.models.deletion.SET_NULL, + related_name="+", + to=settings.AUTH_USER_MODEL, + ), + ), + ( + "obj_content_type", + models.ForeignKey( + blank=True, + db_constraint=False, + null=True, + on_delete=django.db.models.deletion.DO_NOTHING, + related_name="+", + to="contenttypes.contenttype", + ), + ), + ( + "subj_content_type", + models.ForeignKey( + blank=True, + db_constraint=False, + null=True, + on_delete=django.db.models.deletion.DO_NOTHING, + related_name="+", + to="contenttypes.contenttype", + ), + ), + ], + options={ + "verbose_name": "historical event was motivated by work", + "verbose_name_plural": "historical event was motivated by works", + "ordering": ("-history_date", "-history_id"), + "get_latest_by": ("history_date", "history_id"), + }, + bases=( + simple_history.models.HistoricalChanges, + models.Model, + apis_core.generic.abc.GenericModel, + ), + ), + migrations.CreateModel( + name="VersionPerformanceHadDirectorPerson", + fields=[ + ( + "relation_ptr", + models.ForeignKey( + auto_created=True, + blank=True, + db_constraint=False, + null=True, + on_delete=django.db.models.deletion.DO_NOTHING, + parent_link=True, + related_name="+", + to="relations.relation", + ), + ), + ( + "id", + models.IntegerField( + auto_created=True, blank=True, db_index=True, verbose_name="ID" + ), + ), + ("subj_object_id", models.PositiveIntegerField()), + ("obj_object_id", models.PositiveIntegerField()), + ( + "version_tag", + models.CharField(blank=True, max_length=255, null=True), + ), + ("history_id", models.AutoField(primary_key=True, serialize=False)), + ("history_date", models.DateTimeField(db_index=True)), + ("history_change_reason", models.CharField(max_length=100, null=True)), + ( + "history_type", + models.CharField( + choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")], + max_length=1, + ), + ), + ( + "history_user", + models.ForeignKey( + null=True, + on_delete=django.db.models.deletion.SET_NULL, + related_name="+", + to=settings.AUTH_USER_MODEL, + ), + ), + ( + "obj_content_type", + models.ForeignKey( + blank=True, + db_constraint=False, + null=True, + on_delete=django.db.models.deletion.DO_NOTHING, + related_name="+", + to="contenttypes.contenttype", + ), + ), + ( + "subj_content_type", + models.ForeignKey( + blank=True, + db_constraint=False, + null=True, + on_delete=django.db.models.deletion.DO_NOTHING, + related_name="+", + to="contenttypes.contenttype", + ), + ), + ], + options={ + "verbose_name": "historical performance had director person", + "verbose_name_plural": "historical performance had director persons", + "ordering": ("-history_date", "-history_id"), + "get_latest_by": ("history_date", "history_id"), + }, + bases=( + simple_history.models.HistoricalChanges, + models.Model, + apis_core.generic.abc.GenericModel, + ), + ), + migrations.CreateModel( + name="VersionPerformanceHadParticipantGroup", + fields=[ + ( + "relation_ptr", + models.ForeignKey( + auto_created=True, + blank=True, + db_constraint=False, + null=True, + on_delete=django.db.models.deletion.DO_NOTHING, + parent_link=True, + related_name="+", + to="relations.relation", + ), + ), + ( + "id", + models.IntegerField( + auto_created=True, blank=True, db_index=True, verbose_name="ID" + ), + ), + ("subj_object_id", models.PositiveIntegerField()), + ("obj_object_id", models.PositiveIntegerField()), + ( + "version_tag", + models.CharField(blank=True, max_length=255, null=True), + ), + ("history_id", models.AutoField(primary_key=True, serialize=False)), + ("history_date", models.DateTimeField(db_index=True)), + ("history_change_reason", models.CharField(max_length=100, null=True)), + ( + "history_type", + models.CharField( + choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")], + max_length=1, + ), + ), + ( + "history_user", + models.ForeignKey( + null=True, + on_delete=django.db.models.deletion.SET_NULL, + related_name="+", + to=settings.AUTH_USER_MODEL, + ), + ), + ( + "obj_content_type", + models.ForeignKey( + blank=True, + db_constraint=False, + null=True, + on_delete=django.db.models.deletion.DO_NOTHING, + related_name="+", + to="contenttypes.contenttype", + ), + ), + ( + "subj_content_type", + models.ForeignKey( + blank=True, + db_constraint=False, + null=True, + on_delete=django.db.models.deletion.DO_NOTHING, + related_name="+", + to="contenttypes.contenttype", + ), + ), + ], + options={ + "verbose_name": "historical performance had participant group", + "verbose_name_plural": "historical performance had participant groups", + "ordering": ("-history_date", "-history_id"), + "get_latest_by": ("history_date", "history_id"), + }, + bases=( + simple_history.models.HistoricalChanges, + models.Model, + apis_core.generic.abc.GenericModel, + ), + ), + migrations.CreateModel( + name="VersionPerformanceHadParticipantPerson", + fields=[ + ( + "relation_ptr", + models.ForeignKey( + auto_created=True, + blank=True, + db_constraint=False, + null=True, + on_delete=django.db.models.deletion.DO_NOTHING, + parent_link=True, + related_name="+", + to="relations.relation", + ), + ), + ( + "id", + models.IntegerField( + auto_created=True, blank=True, db_index=True, verbose_name="ID" + ), + ), + ("subj_object_id", models.PositiveIntegerField()), + ("obj_object_id", models.PositiveIntegerField()), + ( + "version_tag", + models.CharField(blank=True, max_length=255, null=True), + ), + ("history_id", models.AutoField(primary_key=True, serialize=False)), + ("history_date", models.DateTimeField(db_index=True)), + ("history_change_reason", models.CharField(max_length=100, null=True)), + ( + "history_type", + models.CharField( + choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")], + max_length=1, + ), + ), + ( + "history_user", + models.ForeignKey( + null=True, + on_delete=django.db.models.deletion.SET_NULL, + related_name="+", + to=settings.AUTH_USER_MODEL, + ), + ), + ( + "obj_content_type", + models.ForeignKey( + blank=True, + db_constraint=False, + null=True, + on_delete=django.db.models.deletion.DO_NOTHING, + related_name="+", + to="contenttypes.contenttype", + ), + ), + ( + "subj_content_type", + models.ForeignKey( + blank=True, + db_constraint=False, + null=True, + on_delete=django.db.models.deletion.DO_NOTHING, + related_name="+", + to="contenttypes.contenttype", + ), + ), + ], + options={ + "verbose_name": "historical performance had participant person", + "verbose_name_plural": "historical performance had participant persons", + "ordering": ("-history_date", "-history_id"), + "get_latest_by": ("history_date", "history_id"), + }, + bases=( + simple_history.models.HistoricalChanges, + models.Model, + apis_core.generic.abc.GenericModel, + ), + ), + migrations.CreateModel( + name="VersionPerformancePerformedWork", + fields=[ + ( + "relation_ptr", + models.ForeignKey( + auto_created=True, + blank=True, + db_constraint=False, + null=True, + on_delete=django.db.models.deletion.DO_NOTHING, + parent_link=True, + related_name="+", + to="relations.relation", + ), + ), + ( + "id", + models.IntegerField( + auto_created=True, blank=True, db_index=True, verbose_name="ID" + ), + ), + ("subj_object_id", models.PositiveIntegerField()), + ("obj_object_id", models.PositiveIntegerField()), + ( + "version_tag", + models.CharField(blank=True, max_length=255, null=True), + ), + ("history_id", models.AutoField(primary_key=True, serialize=False)), + ("history_date", models.DateTimeField(db_index=True)), + ("history_change_reason", models.CharField(max_length=100, null=True)), + ( + "history_type", + models.CharField( + choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")], + max_length=1, + ), + ), + ( + "history_user", + models.ForeignKey( + null=True, + on_delete=django.db.models.deletion.SET_NULL, + related_name="+", + to=settings.AUTH_USER_MODEL, + ), + ), + ( + "obj_content_type", + models.ForeignKey( + blank=True, + db_constraint=False, + null=True, + on_delete=django.db.models.deletion.DO_NOTHING, + related_name="+", + to="contenttypes.contenttype", + ), + ), + ( + "subj_content_type", + models.ForeignKey( + blank=True, + db_constraint=False, + null=True, + on_delete=django.db.models.deletion.DO_NOTHING, + related_name="+", + to="contenttypes.contenttype", + ), + ), + ], + options={ + "verbose_name": "historical performance performed work", + "verbose_name_plural": "historical performance performed works", + "ordering": ("-history_date", "-history_id"), + "get_latest_by": ("history_date", "history_id"), + }, + bases=( + simple_history.models.HistoricalChanges, + models.Model, + apis_core.generic.abc.GenericModel, + ), + ), + migrations.CreateModel( + name="VersionPosterPromotedEvent", + fields=[ + ( + "relation_ptr", + models.ForeignKey( + auto_created=True, + blank=True, + db_constraint=False, + null=True, + on_delete=django.db.models.deletion.DO_NOTHING, + parent_link=True, + related_name="+", + to="relations.relation", + ), + ), + ( + "id", + models.IntegerField( + auto_created=True, blank=True, db_index=True, verbose_name="ID" + ), + ), + ("subj_object_id", models.PositiveIntegerField()), + ("obj_object_id", models.PositiveIntegerField()), + ( + "version_tag", + models.CharField(blank=True, max_length=255, null=True), + ), + ("history_id", models.AutoField(primary_key=True, serialize=False)), + ("history_date", models.DateTimeField(db_index=True)), + ("history_change_reason", models.CharField(max_length=100, null=True)), + ( + "history_type", + models.CharField( + choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")], + max_length=1, + ), + ), + ( + "history_user", + models.ForeignKey( + null=True, + on_delete=django.db.models.deletion.SET_NULL, + related_name="+", + to=settings.AUTH_USER_MODEL, + ), + ), + ( + "obj_content_type", + models.ForeignKey( + blank=True, + db_constraint=False, + null=True, + on_delete=django.db.models.deletion.DO_NOTHING, + related_name="+", + to="contenttypes.contenttype", + ), + ), + ( + "subj_content_type", + models.ForeignKey( + blank=True, + db_constraint=False, + null=True, + on_delete=django.db.models.deletion.DO_NOTHING, + related_name="+", + to="contenttypes.contenttype", + ), + ), + ], + options={ + "verbose_name": "historical poster promoted event", + "verbose_name_plural": "historical poster promoted events", + "ordering": ("-history_date", "-history_id"), + "get_latest_by": ("history_date", "history_id"), + }, + bases=( + simple_history.models.HistoricalChanges, + models.Model, + apis_core.generic.abc.GenericModel, + ), + ), + migrations.CreateModel( + name="VersionPosterPromotedPerformance", + fields=[ + ( + "relation_ptr", + models.ForeignKey( + auto_created=True, + blank=True, + db_constraint=False, + null=True, + on_delete=django.db.models.deletion.DO_NOTHING, + parent_link=True, + related_name="+", + to="relations.relation", + ), + ), + ( + "id", + models.IntegerField( + auto_created=True, blank=True, db_index=True, verbose_name="ID" + ), + ), + ("subj_object_id", models.PositiveIntegerField()), + ("obj_object_id", models.PositiveIntegerField()), + ( + "version_tag", + models.CharField(blank=True, max_length=255, null=True), + ), + ("history_id", models.AutoField(primary_key=True, serialize=False)), + ("history_date", models.DateTimeField(db_index=True)), + ("history_change_reason", models.CharField(max_length=100, null=True)), + ( + "history_type", + models.CharField( + choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")], + max_length=1, + ), + ), + ( + "history_user", + models.ForeignKey( + null=True, + on_delete=django.db.models.deletion.SET_NULL, + related_name="+", + to=settings.AUTH_USER_MODEL, + ), + ), + ( + "obj_content_type", + models.ForeignKey( + blank=True, + db_constraint=False, + null=True, + on_delete=django.db.models.deletion.DO_NOTHING, + related_name="+", + to="contenttypes.contenttype", + ), + ), + ( + "subj_content_type", + models.ForeignKey( + blank=True, + db_constraint=False, + null=True, + on_delete=django.db.models.deletion.DO_NOTHING, + related_name="+", + to="contenttypes.contenttype", + ), + ), + ], + options={ + "verbose_name": "historical poster promoted performance", + "verbose_name_plural": "historical poster promoted performances", + "ordering": ("-history_date", "-history_id"), + "get_latest_by": ("history_date", "history_id"), + }, + bases=( + simple_history.models.HistoricalChanges, + models.Model, + apis_core.generic.abc.GenericModel, + ), + ), + ] diff --git a/apis_ontology/models.py b/apis_ontology/models.py index 126d603..22d6e30 100644 --- a/apis_ontology/models.py +++ b/apis_ontology/models.py @@ -451,3 +451,182 @@ def name(cls) -> str: @classmethod def reverse_name(cls) -> str: return "has publisher" + + +class EventWasMotivatedByWork(BaseRelation): + """ + Event was motivated by Work relation. + + Describes Works regarded as reason for carrying out an Event. + + Based on CIDOC CRM property P17 was motivated by (motivated): + https://cidoc-crm.org/html/cidoc_crm_v7.1.3.html#P17 + """ + + subj_model = Event + obj_model = Work + + @classmethod + def name(cls) -> str: + return "was motivated by" + + @classmethod + def reverse_name(cls) -> str: + return "motivated" + + +class EventHadParticipantPerson(BaseRelation): + """ + Event had (not further specified) participant Person relation. + + Based on CIDOC CRM property P11 had participant (participated in): + https://cidoc-crm.org/html/cidoc_crm_v7.1.3.html#P11 + """ + + subj_model = Event + obj_model = Person + + @classmethod + def name(cls) -> str: + return "had participant" + + @classmethod + def reverse_name(cls) -> str: + return "participated in" + + +class EventHadParticipantGroup(BaseRelation): + """ + Event had (not further specified) participant Group relation. + + Group could be the host, an organizer, advertiser,... + + Based on CIDOC CRM property P11 had participant (participated in): + https://cidoc-crm.org/html/cidoc_crm_v7.1.3.html#P11 + """ + + subj_model = Event + obj_model = Group + + @classmethod + def name(cls) -> str: + return "had participant" + + @classmethod + def reverse_name(cls) -> str: + return "participated in" + + +class PerformancePerformedWork(BaseRelation): + """ + Performance performed Work relation. + + Based on LRMoo property R80 performed (is performed in): + https://cidoc-crm.org//extensions/lrmoo/html/LRMoo_v1.0.html#R80 + """ + + subj_model = Performance + obj_model = Work + + @classmethod + def name(cls) -> str: + return "performed" + + @classmethod + def reverse_name(cls) -> str: + return "is performed in" + + +class PerformanceHadDirectorPerson(BaseRelation): + """ + Performance had director Person relation. + + Modelled after CIDOC CRM property P11 had participant. + """ + + subj_model = Performance + obj_model = Person + + @classmethod + def name(cls) -> str: + return "had director" + + @classmethod + def reverse_name(cls) -> str: + return "directed" + + +class PerformanceHadParticipantPerson(BaseRelation): + """ + Performance had (not further specified) participant Person relation. + + Based on CIDOC CRM property P11 had participant (participated in): + https://cidoc-crm.org/html/cidoc_crm_v7.1.3.html#P11 + """ + + subj_model = Performance + obj_model = Person + + @classmethod + def name(cls) -> str: + return "had participant" + + @classmethod + def reverse_name(cls) -> str: + return "participated in" + + +class PerformanceHadParticipantGroup(BaseRelation): + """ + Performance had (not further specified) participant Group relation. + + Group could be the host, an organizer, advertiser,... + + Based on CIDOC CRM property P11 had participant (participated in): + https://cidoc-crm.org/html/cidoc_crm_v7.1.3.html#P11 + """ + + subj_model = Performance + obj_model = Group + + @classmethod + def name(cls) -> str: + return "had participant" + + @classmethod + def reverse_name(cls) -> str: + return "participated in" + + +class PosterPromotedEvent(BaseRelation): + """ + Poster promoted (advertised, announced,...) Event relation. + """ + + subj_model = Poster + obj_model = Event + + @classmethod + def name(cls) -> str: + return "promoted" + + @classmethod + def reverse_name(cls) -> str: + return "was promoted by" + + +class PosterPromotedPerformance(BaseRelation): + """ + Poster promoted (advertised, announced,...) Performance relation. + """ + + subj_model = Poster + obj_model = Performance + + @classmethod + def name(cls) -> str: + return "promoted" + + @classmethod + def reverse_name(cls) -> str: + return "was promoted by"