diff --git a/config/database_versions.py b/config/database_versions.py index 15e201ea1..eb69ebe44 100644 --- a/config/database_versions.py +++ b/config/database_versions.py @@ -1,5 +1,6 @@ # Used for automatic database upgrades and version checks DATABASE_VERSIONS = [ + '9.5.0', '9.4.0', '9.3.0', '9.2.0', diff --git a/install/1_structure.sql b/install/1_structure.sql index af86fb9ef..250d95efe 100644 --- a/install/1_structure.sql +++ b/install/1_structure.sql @@ -52,7 +52,6 @@ ALTER TABLE IF EXISTS ONLY model.gis DROP CONSTRAINT IF EXISTS gis_entity_id_fke ALTER TABLE IF EXISTS ONLY model.rights_holder_file DROP CONSTRAINT IF EXISTS fk_rights_holder; ALTER TABLE IF EXISTS ONLY model.rights_holder_file DROP CONSTRAINT IF EXISTS fk_entity; ALTER TABLE IF EXISTS ONLY model.entity DROP CONSTRAINT IF EXISTS entity_openatlas_class_name_fkey; -ALTER TABLE IF EXISTS ONLY model.entity DROP CONSTRAINT IF EXISTS entity_class_code_fkey; ALTER TABLE IF EXISTS ONLY model.cidoc_class_inheritance DROP CONSTRAINT IF EXISTS class_inheritance_super_code_fkey; ALTER TABLE IF EXISTS ONLY model.cidoc_class_inheritance DROP CONSTRAINT IF EXISTS class_inheritance_sub_code_fkey; ALTER TABLE IF EXISTS ONLY model.cidoc_class_i18n DROP CONSTRAINT IF EXISTS class_i18n_class_code_fkey; @@ -94,7 +93,6 @@ DROP INDEX IF EXISTS model.link_property_code_idx; DROP INDEX IF EXISTS model.link_domain_id_idx; DROP INDEX IF EXISTS model.gis_entity_id_idx; DROP INDEX IF EXISTS model.entity_openatlas_class_name_idx; -DROP INDEX IF EXISTS model.entity_cidoc_class_code_idx; DROP INDEX IF EXISTS model.cidoc_class_code_idx; ALTER TABLE IF EXISTS ONLY web."user" DROP CONSTRAINT IF EXISTS user_username_key; ALTER TABLE IF EXISTS ONLY web.user_tokens DROP CONSTRAINT IF EXISTS user_tokens_pkey; @@ -308,18 +306,18 @@ CREATE FUNCTION model.delete_entity_related() RETURNS trigger LANGUAGE plpgsql AS $$ BEGIN - -- Delete aliases (P1, P131) - IF OLD.cidoc_class_code IN ('E18', 'E21', 'E40', 'E74') THEN + -- Delete aliases + IF OLD.openatlas_class_name IN ('place', 'person', 'group') THEN DELETE FROM model.entity WHERE id IN (SELECT range_id FROM model.link WHERE domain_id = OLD.id AND property_code IN ('P1', 'P131')); END IF; - -- Delete location (E53) if it was an artifact, human remains or place - IF OLD.cidoc_class_code IN ('E18', 'E20', 'E22') THEN + -- Delete location if it was an artifact, human remains or place + IF OLD.openatlas_class_name IN ('place', 'human_remains', 'artifact') THEN DELETE FROM model.entity WHERE id = (SELECT range_id FROM model.link WHERE domain_id = OLD.id AND property_code = 'P53'); END IF; - -- Delete translations (E33) if it was a document - IF OLD.cidoc_class_code = 'E33' THEN + -- Delete text if it was a document not attached to a source anymore + IF OLD.openatlas_class_name = 'text' THEN DELETE FROM model.entity WHERE id IN (SELECT range_id FROM model.link WHERE domain_id = OLD.id AND property_code = 'P73'); END IF; @@ -622,7 +620,6 @@ ALTER SEQUENCE model.cidoc_class_inheritance_id_seq OWNED BY model.cidoc_class_i CREATE TABLE model.entity ( id integer NOT NULL, - cidoc_class_code text NOT NULL, name text NOT NULL, description text, created timestamp without time zone DEFAULT now() NOT NULL, @@ -2294,13 +2291,6 @@ ALTER TABLE ONLY web."user" CREATE INDEX cidoc_class_code_idx ON model.cidoc_class USING btree (code); --- --- Name: entity_cidoc_class_code_idx; Type: INDEX; Schema: model; Owner: openatlas --- - -CREATE INDEX entity_cidoc_class_code_idx ON model.entity USING btree (cidoc_class_code); - - -- -- Name: entity_openatlas_class_name_idx; Type: INDEX; Schema: model; Owner: openatlas -- @@ -2598,14 +2588,6 @@ ALTER TABLE ONLY model.cidoc_class_inheritance ADD CONSTRAINT class_inheritance_super_code_fkey FOREIGN KEY (super_code) REFERENCES model.cidoc_class(code) ON UPDATE CASCADE ON DELETE CASCADE; --- --- Name: entity entity_class_code_fkey; Type: FK CONSTRAINT; Schema: model; Owner: openatlas --- - -ALTER TABLE ONLY model.entity - ADD CONSTRAINT entity_class_code_fkey FOREIGN KEY (cidoc_class_code) REFERENCES model.cidoc_class(code) ON UPDATE CASCADE ON DELETE CASCADE; - - -- -- Name: entity entity_openatlas_class_name_fkey; Type: FK CONSTRAINT; Schema: model; Owner: openatlas -- diff --git a/install/3_data_web.sql b/install/3_data_web.sql index 3855638ce..c25d52f85 100644 --- a/install/3_data_web.sql +++ b/install/3_data_web.sql @@ -8,7 +8,7 @@ INSERT INTO web.group (name) VALUES ('readonly'); INSERT INTO web.settings (name, value) VALUES - ('database_version', '9.4.0'), + ('database_version', '9.5.0'), ('api_public', ''), ('default_language', 'en'), ('table_rows', '25'), diff --git a/install/4_data_type.sql b/install/4_data_type.sql index 8e15818a4..0dae6de9b 100644 --- a/install/4_data_type.sql +++ b/install/4_data_type.sql @@ -1,52 +1,52 @@ -- Default types and OpenAtlas classes INSERT INTO model.openatlas_class (name, cidoc_class_code, new_types_allowed, write_access_group_name, standard_type_id) VALUES - ('administrative_unit', 'E53', false, 'editor', NULL), - ('type', 'E55', false, 'editor', NULL), - ('type_tools', 'E55', false, 'admin', NULL); - -INSERT INTO model.entity (cidoc_class_code, openatlas_class_name, name, description) VALUES - ('E55', 'type', 'Bibliography', 'Categories for bibliographical entries as used for example in BibTeX, e.g. Book, Inbook, Article etc.'), - ('E55', 'type', 'Inbook', Null), - ('E55', 'type', 'Article', Null), - ('E55', 'type', 'Book', Null); + ('administrative_unit', 'E53', false, 'editor', NULL), + ('type' , 'E55', false, 'editor', NULL), + ('type_tools' , 'E55', false, 'admin', NULL); + +INSERT INTO model.entity (openatlas_class_name, name, description) VALUES + ('type', 'Bibliography', 'Categories for bibliographical entries as used for example in BibTeX, e.g. Book, Inbook, Article etc.'), + ('type', 'Inbook', Null), + ('type', 'Article', Null), + ('type', 'Book', Null); INSERT INTO model.link (property_code, range_id, domain_id) VALUES ('P127', (SELECT id FROM model.entity WHERE name='Bibliography'), (SELECT id FROM model.entity WHERE name='Inbook')), ('P127', (SELECT id FROM model.entity WHERE name='Bibliography'), (SELECT id FROM model.entity WHERE name='Article')) , ('P127', (SELECT id FROM model.entity WHERE name='Bibliography'), (SELECT id FROM model.entity WHERE name='Book')); -INSERT INTO model.entity (cidoc_class_code, openatlas_class_name, name, description) VALUES - ('E55', 'type', 'Edition', 'Categories for the classification of written sources'' editions like charter editions, chronicle edition etc.'), - ('E55', 'type', 'Charter Edition', Null), - ('E55', 'type', 'Letter Edition', Null), - ('E55', 'type', 'Chronicle Edition', Null); +INSERT INTO model.entity (openatlas_class_name, name, description) VALUES + ('type', 'Edition', 'Categories for the classification of written sources'' editions like charter editions, chronicle edition etc.'), + ('type', 'Charter Edition', Null), + ('type', 'Letter Edition', Null), + ('type', 'Chronicle Edition', Null); INSERT INTO model.link (property_code, range_id, domain_id) VALUES ('P127', (SELECT id FROM model.entity WHERE name='Edition'), (SELECT id FROM model.entity WHERE name='Charter Edition')), ('P127', (SELECT id FROM model.entity WHERE name='Edition'), (SELECT id FROM model.entity WHERE name='Letter Edition')), ('P127', (SELECT id FROM model.entity WHERE name='Edition'), (SELECT id FROM model.entity WHERE name='Chronicle Edition')); -INSERT INTO model.entity (cidoc_class_code, openatlas_class_name, name, description) VALUES - ('E55', 'type', 'External reference', 'Categories for the classification of external references like a link to Wikipedia'), - ('E55', 'type', 'Link', Null); +INSERT INTO model.entity (openatlas_class_name, name, description) VALUES + ('type', 'External reference', 'Categories for the classification of external references like a link to Wikipedia'), + ('type', 'Link', Null); INSERT INTO model.link (property_code, range_id, domain_id) VALUES ('P127', (SELECT id FROM model.entity WHERE name='External reference'), (SELECT id FROM model.entity WHERE name='Link')); -INSERT INTO model.entity (cidoc_class_code, openatlas_class_name, name, description) VALUES - ('E55', 'type', 'External reference match', 'SKOS based definition of the confidence degree that concepts can be used interchangeable.'), - ('E55', 'type', 'exact match', 'High degree of confidence that the concepts can be used interchangeably.'), - ('E55', 'type', 'close match', 'Concepts are sufficiently similar that they can be used interchangeably in some information retrieval applications.'); +INSERT INTO model.entity (openatlas_class_name, name, description) VALUES + ('type', 'External reference match', 'SKOS based definition of the confidence degree that concepts can be used interchangeable.'), + ('type', 'exact match', 'High degree of confidence that the concepts can be used interchangeably.'), + ('type', 'close match', 'Concepts are sufficiently similar that they can be used interchangeably in some information retrieval applications.'); INSERT INTO model.link (property_code, range_id, domain_id) VALUES ('P127', (SELECT id FROM model.entity WHERE name='External reference match'), (SELECT id FROM model.entity WHERE name='exact match')), ('P127', (SELECT id FROM model.entity WHERE name='External reference match'), (SELECT id FROM model.entity WHERE name='close match')); -INSERT INTO model.entity (cidoc_class_code, openatlas_class_name, name, description) VALUES - ('E55', 'type', 'Actor function', 'Definitions of an actor''s function within a group. An actor can for example be member of a group and this membership is defined by a certain function during a certain period of time. E.g. actor "Charlemagne" is member of the group "Frankish Reign" from 768 to 814 in the function of "King" and he is member of the group "Roman Empire" from 800 to 814 in the function "Emperor".'), - ('E55', 'type', 'Bishop', Null), - ('E55', 'type', 'Abbot', Null), - ('E55', 'type', 'Pope', Null), - ('E55', 'type', 'Emperor', Null), - ('E55', 'type', 'Count', Null), - ('E55', 'type', 'King', Null); +INSERT INTO model.entity (openatlas_class_name, name, description) VALUES + ('type', 'Actor function', 'Definitions of an actor''s function within a group. An actor can for example be member of a group and this membership is defined by a certain function during a certain period of time. E.g. actor "Charlemagne" is member of the group "Frankish Reign" from 768 to 814 in the function of "King" and he is member of the group "Roman Empire" from 800 to 814 in the function "Emperor".'), + ('type', 'Bishop', Null), + ('type', 'Abbot', Null), + ('type', 'Pope', Null), + ('type', 'Emperor', Null), + ('type', 'Count', Null), + ('type', 'King', Null); INSERT INTO model.link (property_code, range_id, domain_id) VALUES ('P127', (SELECT id FROM model.entity WHERE name='Actor function'), (SELECT id FROM model.entity WHERE name='Bishop')), ('P127', (SELECT id FROM model.entity WHERE name='Actor function'), (SELECT id FROM model.entity WHERE name='Abbot')), @@ -55,43 +55,43 @@ INSERT INTO model.link (property_code, range_id, domain_id) VALUES ('P127', (SELECT id FROM model.entity WHERE name='Actor function'), (SELECT id FROM model.entity WHERE name='Count')), ('P127', (SELECT id FROM model.entity WHERE name='Actor function'), (SELECT id FROM model.entity WHERE name='King')); -INSERT INTO model.entity (cidoc_class_code, openatlas_class_name, name) VALUES - ('E55', 'type', 'Artifact'), - ('E55', 'type', 'Coin'), - ('E55', 'type', 'Statue'); +INSERT INTO model.entity (openatlas_class_name, name) VALUES + ('type', 'Artifact'), + ('type', 'Coin'), + ('type', 'Statue'); INSERT INTO model.link (property_code, range_id, domain_id) VALUES ('P127', (SELECT id FROM model.entity WHERE name='Artifact'), (SELECT id FROM model.entity WHERE name='Coin')), ('P127', (SELECT id FROM model.entity WHERE name='Artifact'), (SELECT id FROM model.entity WHERE name='Statue')); -INSERT INTO model.entity (cidoc_class_code, openatlas_class_name, name, description) VALUES - ('E55', 'type', 'Involvement', 'Categories to define the involvement of an actor within an event. E.g. "Napoleon" participated in the event "Invasion of Russia" as "Commander" or "Michelangelo" performed the event "painting of the Sistine chapel" as "Artist".'), - ('E55', 'type', 'Creator', Null), - ('E55', 'type', 'Sponsor', Null), - ('E55', 'type', 'Victim', Null), - ('E55', 'type', 'Offender', Null); +INSERT INTO model.entity (openatlas_class_name, name, description) VALUES + ('type', 'Involvement', 'Categories to define the involvement of an actor within an event. E.g. "Napoleon" participated in the event "Invasion of Russia" as "Commander" or "Michelangelo" performed the event "painting of the Sistine chapel" as "Artist".'), + ('type', 'Creator', Null), + ('type', 'Sponsor', Null), + ('type', 'Victim', Null), + ('type', 'Offender', Null); INSERT INTO model.link (property_code, range_id, domain_id) VALUES ('P127', (SELECT id FROM model.entity WHERE name='Involvement'), (SELECT id FROM model.entity WHERE name='Creator')), ('P127', (SELECT id FROM model.entity WHERE name='Involvement'), (SELECT id FROM model.entity WHERE name='Sponsor')), ('P127', (SELECT id FROM model.entity WHERE name='Involvement'), (SELECT id FROM model.entity WHERE name='Victim')), ('P127', (SELECT id FROM model.entity WHERE name='Involvement'), (SELECT id FROM model.entity WHERE name='Offender')); -INSERT INTO model.entity (cidoc_class_code, openatlas_class_name, name, description) VALUES - ('E55', 'type', 'Sex', 'Categories for sex like female, male.'), - ('E55', 'type', 'Female', Null), - ('E55', 'type', 'Male', Null); +INSERT INTO model.entity (openatlas_class_name, name, description) VALUES + ('type', 'Sex', 'Categories for sex like female, male.'), + ('type', 'Female', Null), + ('type', 'Male', Null); INSERT INTO model.link (property_code, range_id, domain_id) VALUES ('P127', (SELECT id FROM model.entity WHERE name='Sex'), (SELECT id FROM model.entity WHERE name='Female')), ('P127', (SELECT id FROM model.entity WHERE name='Sex'), (SELECT id FROM model.entity WHERE name='Male')); -INSERT INTO model.entity (cidoc_class_code, openatlas_class_name, name, description) VALUES - ('E55', 'type', 'Event', 'Categories for the type of events like Change of property, Conflict, Movement, Attendance etc.'), - ('E55', 'type', 'Change of Property', Null), - ('E55', 'type', 'Donation', Null), - ('E55', 'type', 'Sale', Null), - ('E55', 'type', 'Exchange', Null), - ('E55', 'type', 'Conflict', Null), - ('E55', 'type', 'Battle', Null), - ('E55', 'type', 'Raid', Null); +INSERT INTO model.entity (openatlas_class_name, name, description) VALUES + ('type', 'Event', 'Categories for the type of events like Change of property, Conflict, Movement, Attendance etc.'), + ('type', 'Change of Property', Null), + ('type', 'Donation', Null), + ('type', 'Sale', Null), + ('type', 'Exchange', Null), + ('type', 'Conflict', Null), + ('type', 'Battle', Null), + ('type', 'Raid', Null); INSERT INTO model.link (property_code, range_id, domain_id) VALUES ('P127', (SELECT id FROM model.entity WHERE name='Event'), (SELECT id FROM model.entity WHERE name='Change of Property')), ('P127', (SELECT id FROM model.entity WHERE name='Event'), (SELECT id FROM model.entity WHERE name='Conflict')), @@ -101,41 +101,41 @@ INSERT INTO model.link (property_code, range_id, domain_id) VALUES ('P127', (SELECT id FROM model.entity WHERE name='Conflict'), (SELECT id FROM model.entity WHERE name='Battle')), ('P127', (SELECT id FROM model.entity WHERE name='Conflict'), (SELECT id FROM model.entity WHERE name='Raid')); -INSERT INTO model.entity (cidoc_class_code, openatlas_class_name, name, description) VALUES - ('E55', 'type', 'Source', 'Types for historical sources like charter, chronicle, letter etc.'), - ('E55', 'type', 'Charter', Null), - ('E55', 'type', 'Testament', Null), - ('E55', 'type', 'Letter', Null), - ('E55', 'type', 'Contract', Null); +INSERT INTO model.entity (openatlas_class_name, name, description) VALUES + ('type', 'Source', 'Types for historical sources like charter, chronicle, letter etc.'), + ('type', 'Charter', Null), + ('type', 'Testament', Null), + ('type', 'Letter', Null), + ('type', 'Contract', Null); INSERT INTO model.link (property_code, range_id, domain_id) VALUES ('P127', (SELECT id FROM model.entity WHERE name='Source'), (SELECT id FROM model.entity WHERE name='Charter')), ('P127', (SELECT id FROM model.entity WHERE name='Source'), (SELECT id FROM model.entity WHERE name='Testament')), ('P127', (SELECT id FROM model.entity WHERE name='Source'), (SELECT id FROM model.entity WHERE name='Letter')), ('P127', (SELECT id FROM model.entity WHERE name='Source'), (SELECT id FROM model.entity WHERE name='Contract')); -INSERT INTO model.entity (cidoc_class_code, openatlas_class_name, name, description) VALUES - ('E55', 'type', 'License', 'Type for the licensing of a file'), - ('E55', 'type', 'Public domain', Null), - ('E55', 'type', 'CC BY 4.0', Null), - ('E55', 'type', 'CC BY-SA 4.0', Null); +INSERT INTO model.entity (openatlas_class_name, name, description) VALUES + ('type', 'License', 'Type for the licensing of a file'), + ('type', 'Public domain', Null), + ('type', 'CC BY 4.0', Null), + ('type', 'CC BY-SA 4.0', Null); INSERT INTO model.link (property_code, range_id, domain_id) VALUES ('P127', (SELECT id FROM model.entity WHERE name='License'), (SELECT id FROM model.entity WHERE name='Public domain')), ('P127', (SELECT id FROM model.entity WHERE name='License'), (SELECT id FROM model.entity WHERE name='CC BY 4.0')), ('P127', (SELECT id FROM model.entity WHERE name='License'), (SELECT id FROM model.entity WHERE name='CC BY-SA 4.0')); -INSERT INTO model.entity (cidoc_class_code, openatlas_class_name, name, description) VALUES - ('E55', 'type', 'Actor relation', 'Categories for the relationship between two actors. This may be a mutual relationship (e.g. actor A is friend of actor B and vice versa), or a directional relationship (e.g. actor A is the child of actor B, while actor B is the parent of actor A).'), - ('E55', 'type', 'Kindredship', Null), - ('E55', 'type', 'Parent of (Child of)', Null), - ('E55', 'type', 'Social', Null), - ('E55', 'type', 'Friend of', Null), - ('E55', 'type', 'Enemy of', Null), - ('E55', 'type', 'Mentor of (Student of)', Null), - ('E55', 'type', 'Political', Null), - ('E55', 'type', 'Ally of', Null), - ('E55', 'type', 'Leader of (Retinue of)', Null), - ('E55', 'type', 'Economical', Null), - ('E55', 'type', 'Provider of (Customer of)', Null); +INSERT INTO model.entity (openatlas_class_name, name, description) VALUES + ('type', 'Actor relation', 'Categories for the relationship between two actors. This may be a mutual relationship (e.g. actor A is friend of actor B and vice versa), or a directional relationship (e.g. actor A is the child of actor B, while actor B is the parent of actor A).'), + ('type', 'Kindredship', Null), + ('type', 'Parent of (Child of)', Null), + ('type', 'Social', Null), + ('type', 'Friend of', Null), + ('type', 'Enemy of', Null), + ('type', 'Mentor of (Student of)', Null), + ('type', 'Political', Null), + ('type', 'Ally of', Null), + ('type', 'Leader of (Retinue of)', Null), + ('type', 'Economical', Null), + ('type', 'Provider of (Customer of)', Null); INSERT INTO model.link (property_code, range_id, domain_id) VALUES ('P127', (SELECT id FROM model.entity WHERE name='Actor relation'), (SELECT id FROM model.entity WHERE name='Kindredship')), ('P127', (SELECT id FROM model.entity WHERE name='Actor relation'), (SELECT id FROM model.entity WHERE name='Social')), @@ -149,16 +149,16 @@ INSERT INTO model.link (property_code, range_id, domain_id) VALUES ('P127', (SELECT id FROM model.entity WHERE name='Political'), (SELECT id FROM model.entity WHERE name='Leader of (Retinue of)')), ('P127', (SELECT id FROM model.entity WHERE name='Economical'), (SELECT id FROM model.entity WHERE name='Provider of (Customer of)')); -INSERT INTO model.entity (cidoc_class_code, openatlas_class_name, name, description) VALUES - ('E55', 'type', 'Place', 'Types for non-moveable entities (i.e. places) with a certain extent and/or location like Settlement, Burial site, Ritual site, Fortification etc.'), - ('E55', 'type', 'Settlement', Null), - ('E55', 'type', 'Military Facility', Null), - ('E55', 'type', 'Ritual Site', Null), - ('E55', 'type', 'Burial Site', Null), - ('E55', 'type', 'Infrastructure', Null), - ('E55', 'type', 'Economic Site', Null), - ('E55', 'type', 'Boundary Mark', Null), - ('E55', 'type', 'Topographical entity', Null); +INSERT INTO model.entity (openatlas_class_name, name, description) VALUES + ('type', 'Place', 'Types for non-moveable entities (i.e. places) with a certain extent and/or location like Settlement, Burial site, Ritual site, Fortification etc.'), + ('type', 'Settlement', Null), + ('type', 'Military Facility', Null), + ('type', 'Ritual Site', Null), + ('type', 'Burial Site', Null), + ('type', 'Infrastructure', Null), + ('type', 'Economic Site', Null), + ('type', 'Boundary Mark', Null), + ('type', 'Topographical entity', Null); INSERT INTO model.link (property_code, range_id, domain_id) VALUES ('P127', (SELECT id FROM model.entity WHERE name='Place'), (SELECT id FROM model.entity WHERE name='Settlement')), ('P127', (SELECT id FROM model.entity WHERE name='Place'), (SELECT id FROM model.entity WHERE name='Military Facility')), @@ -169,58 +169,58 @@ INSERT INTO model.link (property_code, range_id, domain_id) VALUES ('P127', (SELECT id FROM model.entity WHERE name='Place'), (SELECT id FROM model.entity WHERE name='Boundary Mark')), ('P127', (SELECT id FROM model.entity WHERE name='Place'), (SELECT id FROM model.entity WHERE name='Topographical entity')); -INSERT INTO model.entity (cidoc_class_code, openatlas_class_name, name, description) VALUES - ('E55', 'type', 'Feature', 'Classification of the archaeological feature e.g. grave, pit, ...'), - ('E55', 'type', 'Grave', Null), - ('E55', 'type', 'Pit', Null); +INSERT INTO model.entity (openatlas_class_name, name, description) VALUES + ('type', 'Feature', 'Classification of the archaeological feature e.g. grave, pit, ...'), + ('type', 'Grave', Null), + ('type', 'Pit', Null); INSERT INTO model.link (property_code, range_id, domain_id) VALUES ('P127', (SELECT id FROM model.entity WHERE name='Feature'), (SELECT id FROM model.entity WHERE name='Grave')), ('P127', (SELECT id FROM model.entity WHERE name='Feature'), (SELECT id FROM model.entity WHERE name='Pit')); -INSERT INTO model.entity (cidoc_class_code, openatlas_class_name, name, description) VALUES - ('E55', 'type', 'Stratigraphic unit', 'Classification of the archaeological SU e.g. burial, deposit, ...'), - ('E55', 'type', 'Burial', Null), - ('E55', 'type', 'Deposit', Null); +INSERT INTO model.entity (openatlas_class_name, name, description) VALUES + ('type', 'Stratigraphic unit', 'Classification of the archaeological SU e.g. burial, deposit, ...'), + ('type', 'Burial', Null), + ('type', 'Deposit', Null); INSERT INTO model.link (property_code, range_id, domain_id) VALUES ('P127', (SELECT id FROM model.entity WHERE name='Stratigraphic unit'), (SELECT id FROM model.entity WHERE name='Burial')), ('P127', (SELECT id FROM model.entity WHERE name='Stratigraphic unit'), (SELECT id FROM model.entity WHERE name='Deposit')); -INSERT INTO model.entity (cidoc_class_code, openatlas_class_name, name, description) VALUES - ('E55', 'type', 'Human remains', 'Human remains, that for example were discovered during archaeological excavations. They are associated with a stratigraphic unit (in most cases a skeleton) that is composed of (P46) one or multiple parts (in most cases bones) that are classified as biological objects (E20). From a hierarchical point of view the human remains are one level below the stratigraphic unit respectively the model.entity whose sum of parts resembles the individual/skeleton. This way individual bones or body parts can be treated individually and be connected with separate classifications (e.g. Injuries of the right upper arm or caries on a certain tooth).'), - ('E55', 'type', 'Upper Body', Null), - ('E55', 'type', 'Lower Body', Null); +INSERT INTO model.entity (openatlas_class_name, name, description) VALUES + ('type', 'Human remains', 'Human remains, that for example were discovered during archaeological excavations. They are associated with a stratigraphic unit (in most cases a skeleton) that is composed of (P46) one or multiple parts (in most cases bones) that are classified as biological objects (E20). From a hierarchical point of view the human remains are one level below the stratigraphic unit respectively the model.entity whose sum of parts resembles the individual/skeleton. This way individual bones or body parts can be treated individually and be connected with separate classifications (e.g. Injuries of the right upper arm or caries on a certain tooth).'), + ('type', 'Upper Body', Null), + ('type', 'Lower Body', Null); INSERT INTO model.link (property_code, range_id, domain_id) VALUES - ('P127', (SELECT id FROM model.entity WHERE name='Human remains' AND cidoc_class_code = 'E55'), (SELECT id FROM model.entity WHERE name='Upper Body')), - ('P127', (SELECT id FROM model.entity WHERE name='Human remains' AND cidoc_class_code = 'E55'), (SELECT id FROM model.entity WHERE name='Lower Body')); - -INSERT INTO model.entity (cidoc_class_code, openatlas_class_name, name) VALUES - ('E55', 'type', 'Text'), - ('E55', 'type', 'Original Text'), - ('E55', 'type', 'Translation'), - ('E55', 'type', 'Transliteration'); + ('P127', (SELECT id FROM model.entity WHERE name='Human remains' AND openatlas_class_name = 'type'), (SELECT id FROM model.entity WHERE name='Upper Body')), + ('P127', (SELECT id FROM model.entity WHERE name='Human remains' AND openatlas_class_name = 'type'), (SELECT id FROM model.entity WHERE name='Lower Body')); + +INSERT INTO model.entity (openatlas_class_name, name) VALUES + ('type', 'Text'), + ('type', 'Original Text'), + ('type', 'Translation'), + ('type', 'Transliteration'); INSERT INTO model.link (property_code, range_id, domain_id) VALUES ('P127', (SELECT id FROM model.entity WHERE name='Text'), (SELECT id FROM model.entity WHERE name='Original Text')), ('P127', (SELECT id FROM model.entity WHERE name='Text'), (SELECT id FROM model.entity WHERE name='Translation')), ('P127', (SELECT id FROM model.entity WHERE name='Text'), (SELECT id FROM model.entity WHERE name='Transliteration')); -INSERT INTO model.entity (cidoc_class_code, openatlas_class_name, name, description) VALUES - ('E55', 'type', 'Dimensions', 'Physical dimensions like weight and height.'), - ('E55', 'type', 'Height', 'centimeter'), - ('E55', 'type', 'Weight', 'gram'); +INSERT INTO model.entity (openatlas_class_name, name, description) VALUES + ('type', 'Dimensions', 'Physical dimensions like weight and height.'), + ('type', 'Height', 'centimeter'), + ('type', 'Weight', 'gram'); INSERT INTO model.link (property_code, range_id, domain_id) VALUES ('P127', (SELECT id FROM model.entity WHERE name='Dimensions'), (SELECT id FROM model.entity WHERE name='Height')), ('P127', (SELECT id FROM model.entity WHERE name='Dimensions'), (SELECT id FROM model.entity WHERE name='Weight')); -INSERT INTO model.entity (cidoc_class_code, openatlas_class_name, name, description) VALUES - ('E55', 'type', 'Case study', 'Mark entities for different case studies, used e.g. for presentation sites.'); +INSERT INTO model.entity (openatlas_class_name, name, description) VALUES + ('type', 'Case study', 'Mark entities for different case studies, used e.g. for presentation sites.'); -INSERT INTO model.entity (cidoc_class_code, openatlas_class_name, name, description) VALUES - ('E55', 'type_tools', 'Features for sexing', 'Bone features used for biological sex estimation of human remains.'), - ('E55', 'type_tools', 'Radiocarbon', 'Used for radiocarbon dating'), - ('E55', 'type_tools', 'Skull', NULL), - ('E55', 'type_tools', 'Mandible', NULL), - ('E55', 'type_tools', 'Pelvis', NULL), - ('E55', 'type_tools', 'Robusticity', NULL); +INSERT INTO model.entity (openatlas_class_name, name, description) VALUES + ('type_tools', 'Features for sexing', 'Bone features used for biological sex estimation of human remains.'), + ('type_tools', 'Radiocarbon', 'Used for radiocarbon dating'), + ('type_tools', 'Skull', NULL), + ('type_tools', 'Mandible', NULL), + ('type_tools', 'Pelvis', NULL), + ('type_tools', 'Robusticity', NULL); INSERT INTO model.link (property_code, domain_id, range_id) VALUES ('P127', (SELECT id FROM model.entity WHERE name='Skull'), (SELECT id FROM model.entity WHERE name='Features for sexing')), @@ -228,19 +228,19 @@ INSERT INTO model.link (property_code, domain_id, range_id) VALUES ('P127', (SELECT id FROM model.entity WHERE name='Pelvis'), (SELECT id FROM model.entity WHERE name='Features for sexing')), ('P127', (SELECT id FROM model.entity WHERE name='Robusticity'), (SELECT id FROM model.entity WHERE name='Features for sexing')); -INSERT INTO model.entity (cidoc_class_code, openatlas_class_name, name) VALUES - ('E55', 'type_tools', 'Glabella'), - ('E55', 'type_tools', 'Arcus superciliaris'), - ('E55', 'type_tools', 'Tuber frontalis and parietalis'), - ('E55', 'type_tools', 'Inclinatio frontalis'), - ('E55', 'type_tools', 'Processus mastoideus'), - ('E55', 'type_tools', 'Relief of planum nuchale'), - ('E55', 'type_tools', 'Protuberantia occipitalis externa'), - ('E55', 'type_tools', 'Processus zygomaticus'), - ('E55', 'type_tools', 'Os zygomaticum'), - ('E55', 'type_tools', 'Crista supramastoideum'), - ('E55', 'type_tools', 'Margo supraorbitalis'), - ('E55', 'type_tools', 'Shape of orbita'); +INSERT INTO model.entity (openatlas_class_name, name) VALUES + ('type_tools', 'Glabella'), + ('type_tools', 'Arcus superciliaris'), + ('type_tools', 'Tuber frontalis and parietalis'), + ('type_tools', 'Inclinatio frontalis'), + ('type_tools', 'Processus mastoideus'), + ('type_tools', 'Relief of planum nuchale'), + ('type_tools', 'Protuberantia occipitalis externa'), + ('type_tools', 'Processus zygomaticus'), + ('type_tools', 'Os zygomaticum'), + ('type_tools', 'Crista supramastoideum'), + ('type_tools', 'Margo supraorbitalis'), + ('type_tools', 'Shape of orbita'); INSERT INTO model.link (property_code, domain_id, range_id) VALUES ('P127', (SELECT id FROM model.entity WHERE name='Glabella'), (SELECT id FROM model.entity WHERE name='Skull')), @@ -256,12 +256,12 @@ INSERT INTO model.link (property_code, domain_id, range_id) VALUES ('P127', (SELECT id FROM model.entity WHERE name='Margo supraorbitalis'), (SELECT id FROM model.entity WHERE name='Skull')), ('P127', (SELECT id FROM model.entity WHERE name='Shape of orbita'), (SELECT id FROM model.entity WHERE name='Skull')); -INSERT INTO model.entity (cidoc_class_code, openatlas_class_name, name) VALUES - ('E55', 'type_tools', 'Overall apperence'), - ('E55', 'type_tools', 'Mentum'), - ('E55', 'type_tools', 'Angulus'), - ('E55', 'type_tools', 'Margo inferior (M2)'), - ('E55', 'type_tools', 'Angle'); +INSERT INTO model.entity (openatlas_class_name, name) VALUES + ('type_tools', 'Overall apperence'), + ('type_tools', 'Mentum'), + ('type_tools', 'Angulus'), + ('type_tools', 'Margo inferior (M2)'), + ('type_tools', 'Angle'); INSERT INTO model.link (property_code, domain_id, range_id) VALUES ('P127', (SELECT id FROM model.entity WHERE name='Overall apperence'), (SELECT id FROM model.entity WHERE name='Mandible')), @@ -270,20 +270,20 @@ INSERT INTO model.link (property_code, domain_id, range_id) VALUES ('P127', (SELECT id FROM model.entity WHERE name='Margo inferior (M2)'), (SELECT id FROM model.entity WHERE name='Mandible')), ('P127', (SELECT id FROM model.entity WHERE name='Angle'), (SELECT id FROM model.entity WHERE name='Mandible')); -INSERT INTO model.entity (cidoc_class_code, openatlas_class_name, name) VALUES - ('E55', 'type_tools', 'Sulcus praeauricularis'), - ('E55', 'type_tools', 'Incisura ischiadica major'), - ('E55', 'type_tools', 'Angulus pubis'), - ('E55', 'type_tools', 'Arc composé'), - ('E55', 'type_tools', 'Os coxae'), - ('E55', 'type_tools', 'Foramen obturatum'), - ('E55', 'type_tools', 'Corpus ossis ischii'), - ('E55', 'type_tools', 'Crista iliaca'), - ('E55', 'type_tools', 'Fossa iliaca'), - ('E55', 'type_tools', 'Pelvis major'), - ('E55', 'type_tools', 'Auricular area'), - ('E55', 'type_tools', 'Sacrum'), - ('E55', 'type_tools', 'Fossa acetabuli'); +INSERT INTO model.entity (openatlas_class_name, name) VALUES + ('type_tools', 'Sulcus praeauricularis'), + ('type_tools', 'Incisura ischiadica major'), + ('type_tools', 'Angulus pubis'), + ('type_tools', 'Arc composé'), + ('type_tools', 'Os coxae'), + ('type_tools', 'Foramen obturatum'), + ('type_tools', 'Corpus ossis ischii'), + ('type_tools', 'Crista iliaca'), + ('type_tools', 'Fossa iliaca'), + ('type_tools', 'Pelvis major'), + ('type_tools', 'Auricular area'), + ('type_tools', 'Sacrum'), + ('type_tools', 'Fossa acetabuli'); INSERT INTO model.link (property_code, domain_id, range_id) VALUES ('P127', (SELECT id FROM model.entity WHERE name='Sulcus praeauricularis'), (SELECT id FROM model.entity WHERE name='Pelvis')), @@ -300,17 +300,17 @@ INSERT INTO model.link (property_code, domain_id, range_id) VALUES ('P127', (SELECT id FROM model.entity WHERE name='Sacrum'), (SELECT id FROM model.entity WHERE name='Pelvis')), ('P127', (SELECT id FROM model.entity WHERE name='Fossa acetabuli'), (SELECT id FROM model.entity WHERE name='Pelvis')); -INSERT INTO model.entity (cidoc_class_code, openatlas_class_name, name) VALUES - ('E55', 'type_tools', 'Humerus'), - ('E55', 'type_tools', 'Femur'); +INSERT INTO model.entity (openatlas_class_name, name) VALUES + ('type_tools', 'Humerus'), + ('type_tools', 'Femur'); INSERT INTO model.link (property_code, domain_id, range_id) VALUES ('P127', (SELECT id FROM model.entity WHERE name='Humerus'), (SELECT id FROM model.entity WHERE name='Robusticity')), ('P127', (SELECT id FROM model.entity WHERE name='Femur'), (SELECT id FROM model.entity WHERE name='Robusticity')); -INSERT INTO model.entity (cidoc_class_code, openatlas_class_name, name, description) VALUES - ('E55', 'type', 'Public sharing allowed', 'Mark files for public sharing, e.g. on presentation sites'), - ('E55', 'type', 'Yes', ''), - ('E55', 'type', 'No', ''); +INSERT INTO model.entity (openatlas_class_name, name, description) VALUES + ('type', 'Public sharing allowed', 'Mark files for public sharing, e.g. on presentation sites'), + ('type', 'Yes', ''), + ('type', 'No', ''); INSERT INTO model.link (property_code, range_id, domain_id) VALUES ('P127', (SELECT id FROM model.entity WHERE name='Public sharing allowed'), (SELECT id FROM model.entity WHERE name='Yes')), ('P127', (SELECT id FROM model.entity WHERE name='Public sharing allowed'), (SELECT id FROM model.entity WHERE name='No')); @@ -328,7 +328,7 @@ INSERT INTO web.hierarchy (id, name, category, multiple, directional, required) ((SELECT id FROM model.entity WHERE name='External reference match'), 'External reference match', 'system', False, False, False), ((SELECT id FROM model.entity WHERE name='Feature'), 'Feature', 'standard', False, False, False), ((SELECT id FROM model.entity WHERE name='Features for sexing'), 'Features for sexing', 'tools', False, False, False), - ((SELECT id FROM model.entity WHERE name='Human remains' AND cidoc_class_code = 'E55'), 'Human remains', 'standard', False, False, False), + ((SELECT id FROM model.entity WHERE name='Human remains' AND openatlas_class_name = 'type'), 'Human remains', 'standard', False, False, False), ((SELECT id FROM model.entity WHERE name='Involvement'), 'Involvement', 'standard', False, False, False), ((SELECT id FROM model.entity WHERE name='License'), 'License', 'standard', False, False, False), ((SELECT id FROM model.entity WHERE name='Place'), 'Place', 'standard', False, False, False), @@ -339,28 +339,27 @@ INSERT INTO web.hierarchy (id, name, category, multiple, directional, required) ((SELECT id FROM model.entity WHERE name='Stratigraphic unit'), 'Stratigraphic unit', 'standard', False, False, False), ((SELECT id FROM model.entity WHERE name='Text'), 'Text', 'standard', False, False, False); - INSERT INTO model.openatlas_class (name, cidoc_class_code, new_types_allowed, write_access_group_name, standard_type_id) VALUES - ('acquisition', 'E8', true, 'contributor', (SELECT id FROM model.entity WHERE name = 'Event' AND cidoc_class_code = 'E55' ORDER BY id ASC LIMIT 1)), - ('activity', 'E7', true, 'contributor', (SELECT id FROM model.entity WHERE name = 'Event' AND cidoc_class_code = 'E55' ORDER BY id ASC LIMIT 1)), + ('acquisition', 'E8', true, 'contributor', (SELECT id FROM model.entity WHERE name = 'Event' AND openatlas_class_name = 'type' ORDER BY id ASC LIMIT 1)), + ('activity', 'E7', true, 'contributor', (SELECT id FROM model.entity WHERE name = 'Event' AND openatlas_class_name = 'type' ORDER BY id ASC LIMIT 1)), ('alias', 'E41', false, 'contributor', NULL), - ('artifact', 'E22', true, 'contributor', (SELECT id FROM model.entity WHERE name = 'Artifact' AND cidoc_class_code = 'E55' ORDER BY id ASC LIMIT 1)), - ('bibliography', 'E31', true, 'contributor', (SELECT id FROM model.entity WHERE name = 'Bibliography' AND cidoc_class_code = 'E55' ORDER BY id ASC LIMIT 1)), - ('edition', 'E31', true, 'contributor', (SELECT id FROM model.entity WHERE name = 'Edition' AND cidoc_class_code = 'E55' ORDER BY id ASC LIMIT 1)), - ('external_reference', 'E31', true, 'contributor', (SELECT id FROM model.entity WHERE name = 'External reference' AND cidoc_class_code = 'E55' ORDER BY id ASC LIMIT 1)), - ('feature', 'E18', true, 'contributor', (SELECT id FROM model.entity WHERE name = 'Feature' AND cidoc_class_code = 'E55' ORDER BY id ASC LIMIT 1)), - ('file', 'E31', true, 'contributor', (SELECT id FROM model.entity WHERE name = 'License' AND cidoc_class_code = 'E55' ORDER BY id ASC LIMIT 1)), + ('artifact', 'E22', true, 'contributor', (SELECT id FROM model.entity WHERE name = 'Artifact' AND openatlas_class_name = 'type' ORDER BY id ASC LIMIT 1)), + ('bibliography', 'E31', true, 'contributor', (SELECT id FROM model.entity WHERE name = 'Bibliography' AND openatlas_class_name = 'type' ORDER BY id ASC LIMIT 1)), + ('edition', 'E31', true, 'contributor', (SELECT id FROM model.entity WHERE name = 'Edition' AND openatlas_class_name = 'type' ORDER BY id ASC LIMIT 1)), + ('external_reference', 'E31', true, 'contributor', (SELECT id FROM model.entity WHERE name = 'External reference' AND openatlas_class_name = 'type' ORDER BY id ASC LIMIT 1)), + ('feature', 'E18', true, 'contributor', (SELECT id FROM model.entity WHERE name = 'Feature' AND openatlas_class_name = 'type' ORDER BY id ASC LIMIT 1)), + ('file', 'E31', true, 'contributor', (SELECT id FROM model.entity WHERE name = 'License' AND openatlas_class_name = 'type' ORDER BY id ASC LIMIT 1)), ('group', 'E74', true, 'contributor', NULL), - ('human_remains', 'E20', true, 'contributor', (SELECT id FROM model.entity WHERE name = 'Human remains' AND cidoc_class_code = 'E55' ORDER BY id ASC LIMIT 1)), - ('modification', 'E11', true, 'contributor', (SELECT id FROM model.entity WHERE name = 'Event' AND cidoc_class_code = 'E55' ORDER BY id ASC LIMIT 1)), - ('move', 'E9', true, 'contributor', (SELECT id FROM model.entity WHERE name = 'Event' AND cidoc_class_code = 'E55' ORDER BY id ASC LIMIT 1)), + ('human_remains', 'E20', true, 'contributor', (SELECT id FROM model.entity WHERE name = 'Human remains' AND openatlas_class_name = 'type' ORDER BY id ASC LIMIT 1)), + ('modification', 'E11', true, 'contributor', (SELECT id FROM model.entity WHERE name = 'Event' AND openatlas_class_name = 'type' ORDER BY id ASC LIMIT 1)), + ('move', 'E9', true, 'contributor', (SELECT id FROM model.entity WHERE name = 'Event' AND openatlas_class_name = 'type' ORDER BY id ASC LIMIT 1)), ('object_location', 'E53', false, 'contributor', NULL), ('person', 'E21', true, 'contributor', NULL), - ('place', 'E18', true, 'contributor', (SELECT id FROM model.entity WHERE name = 'Place' AND cidoc_class_code = 'E55' ORDER BY id ASC LIMIT 1)), - ('production', 'E12', true, 'contributor', (SELECT id FROM model.entity WHERE name = 'Event' AND cidoc_class_code = 'E55' ORDER BY id ASC LIMIT 1)), + ('place', 'E18', true, 'contributor', (SELECT id FROM model.entity WHERE name = 'Place' AND openatlas_class_name = 'type' ORDER BY id ASC LIMIT 1)), + ('production', 'E12', true, 'contributor', (SELECT id FROM model.entity WHERE name = 'Event' AND openatlas_class_name = 'type' ORDER BY id ASC LIMIT 1)), ('reference_system', 'E32', false, 'manager', NULL), - ('source', 'E33', true, 'contributor', (SELECT id FROM model.entity WHERE name = 'Source' AND cidoc_class_code = 'E55' ORDER BY id ASC LIMIT 1)), - ('stratigraphic_unit', 'E18', true, 'contributor', (SELECT id FROM model.entity WHERE name = 'Stratigraphic unit' AND cidoc_class_code = 'E55' ORDER BY id ASC LIMIT 1)), + ('source', 'E33', true, 'contributor', (SELECT id FROM model.entity WHERE name = 'Source' AND openatlas_class_name = 'type' ORDER BY id ASC LIMIT 1)), + ('stratigraphic_unit', 'E18', true, 'contributor', (SELECT id FROM model.entity WHERE name = 'Stratigraphic unit' AND openatlas_class_name = 'type' ORDER BY id ASC LIMIT 1)), ('text', 'E33', false, 'contributor', NULL); INSERT INTO web.hierarchy_openatlas_class (hierarchy_id, openatlas_class_name) VALUES @@ -386,28 +385,28 @@ INSERT INTO web.hierarchy_openatlas_class (hierarchy_id, openatlas_class_name) V ((SELECT id FROM web.hierarchy WHERE name='Text'), 'text'); -- External Reference Systems -INSERT INTO model.entity (name, cidoc_class_code, description, openatlas_class_name) VALUES - ('GeoNames', 'E32', 'Geographical database covering all countries and many places.', 'reference_system'), - ('Wikidata', 'E32', 'A free and open knowledge base and common source of open data providing persistent identifier and links to other sources.', 'reference_system'), - ('GND', 'E32', 'GND stands for Gemeinsame Normdatei (Integrated Authority File) and offers a broad range of elements to describe authorities.', 'reference_system'), - ('DOI', 'E32', 'A DOI (Digital Object Identifier) is a persistent identifier for digital resources. OpenAtlas uses Crossref for autocomplete, but any DOI can be stored and resolved, even if it is not found there. Please enter only the DOI identifier itself, not the full URL or domain.', 'reference_system'), - ('Cadaster', 'E32', 'Austrian cadastre from the Federal Office of Metrology and Surveying Austria.', 'reference_system'), - ('ChronOntology', 'E32', 'iDAI.chronontology is a Linked Open Data gazetteer developed by the German Archaeological Institute (DAI) that connects and organizes historical and prehistoric period definitions across space, time, and scholarly disciplines. It provides a standardized framework for mapping chronological terms and their spatial overlaps, making regional period names machine-readable and interoperable across different databases.', 'reference_system'), - ('VIAF', 'E32', 'VIAF (Virtual International Authority File) is a major international service that clusters authority data from national libraries and cultural institutions worldwide into single, unified clusters.', 'reference_system'), - ('Kulturpool', 'E32', 'Kulturpool is Austria''s central digital portal for art, culture, and science, aggregating millions of digital objects and metadata from nationwide museums, libraries, and archives. Administered by the Natural History Museum Vienna (NHM), it serves as the official national aggregator for the European digital platform Europeana.', 'reference_system'), - ('Getty AAT', 'E32', 'Getty AAT (Art and Architecture Thesaurus) is a controlled vocabulary for art and architecture terms. AAT is a thesaurus containing generic terms, dates, relationships, sources, and notes for work types, roles, materials, styles, cultures, techniques, and other concepts related to art, architecture, and other cultural heritage (e.g., amphora, oil paint, olieverf, acetolysis, sintering, orthographic drawings, Olmeca, Rinascimento, Buddhism, watercolors, asa-no-ha-toji, sralais). Please enter only the Getty AAT identifier itself, not the full URL or domain.', 'reference_system'); +INSERT INTO model.entity (openatlas_class_name, name, description) VALUES + ('reference_system', 'GeoNames', 'Geographical database covering all countries and many places.'), + ('reference_system', 'Wikidata', 'A free and open knowledge base and common source of open data providing persistent identifier and links to other sources.'), + ('reference_system', 'GND', 'GND stands for Gemeinsame Normdatei (Integrated Authority File) and offers a broad range of elements to describe authorities.'), + ('reference_system', 'DOI', 'A DOI (Digital Object Identifier) is a persistent identifier for digital resources. OpenAtlas uses Crossref for autocomplete, but any DOI can be stored and resolved, even if it is not found there. Please enter only the DOI identifier itself, not the full URL or domain.'), + ('reference_system', 'Cadaster', 'Austrian cadastre from the Federal Office of Metrology and Surveying Austria.'), + ('reference_system', 'ChronOntology', 'iDAI.chronontology is a Linked Open Data gazetteer developed by the German Archaeological Institute (DAI) that connects and organizes historical and prehistoric period definitions across space, time, and scholarly disciplines. It provides a standardized framework for mapping chronological terms and their spatial overlaps, making regional period names machine-readable and interoperable across different databases.'), + ('reference_system', 'VIAF', 'VIAF (Virtual International Authority File) is a major international service that clusters authority data from national libraries and cultural institutions worldwide into single, unified clusters.'), + ('reference_system', 'Kulturpool', 'Kulturpool is Austria''s central digital portal for art, culture, and science, aggregating millions of digital objects and metadata from nationwide museums, libraries, and archives. Administered by the Natural History Museum Vienna (NHM), it serves as the official national aggregator for the European digital platform Europeana.'), + ('reference_system', 'Getty AAT', 'Getty AAT (Art and Architecture Thesaurus) is a controlled vocabulary for art and architecture terms. AAT is a thesaurus containing generic terms, dates, relationships, sources, and notes for work types, roles, materials, styles, cultures, techniques, and other concepts related to art, architecture, and other cultural heritage (e.g., amphora, oil paint, olieverf, acetolysis, sintering, orthographic drawings, Olmeca, Rinascimento, Buddhism, watercolors, asa-no-ha-toji, sralais). Please enter only the Getty AAT identifier itself, not the full URL or domain.'); INSERT INTO web.reference_system (system, name, api, entity_id, resolver_url, website_url, identifier_example) VALUES - (true, 'GeoNames', 'GeoNames', (SELECT id FROM model.entity WHERE name = 'GeoNames' AND cidoc_class_code = 'E32'), 'https://www.geonames.org/', 'https://www.geonames.org/', '1234567'), - (true, 'Wikidata', 'Wikidata', (SELECT id FROM model.entity WHERE name = 'Wikidata' AND cidoc_class_code = 'E32'), 'https://www.wikidata.org/entity/', 'https://www.wikidata.org', 'Q123'), - (true, 'GND', 'GND', (SELECT id FROM model.entity WHERE name = 'GND' AND cidoc_class_code = 'E32'), 'https://lobid.org/gnd/', 'https://d-nb.info/standards/elementset/gnd', '119338467'), - (true, 'DOI', 'DOI', (SELECT id FROM model.entity WHERE name = 'DOI' AND cidoc_class_code = 'E32'), 'https://doi.org/', 'https://www.crossref.org/', '10.5281/zenodo.20451000'), - (true, 'Cadaster', 'Cadaster', (SELECT id FROM model.entity WHERE name = 'Cadaster' AND cidoc_class_code = 'E32'), 'https://kataster.bev.gv.at/api/gst/', 'https://kataster.bev.gv.at/', '01004/784/1'), - (true, 'VIAF', 'VIAF', (SELECT id FROM model.entity WHERE name = 'VIAF' AND cidoc_class_code = 'E32'), 'https://viaf.org/viaf/', 'https://viaf.org', '6215151353538552720009'), - (true, 'ChronOntology', 'ChronOntology', (SELECT id FROM model.entity WHERE name = 'ChronOntology' AND cidoc_class_code = 'E32'), 'https://chronontology.dainst.org/period/', 'https://chronontology.dainst.org/', 'UCBAClZzVqwh'), - (true, 'Kulturpool', 'Kulturpool', (SELECT id FROM model.entity WHERE name = 'Kulturpool' AND cidoc_class_code = 'E32'), 'https://kulturpool.at/objekte/', 'https://kulturpool.at/', 'dfc50104-275f-44b7-aa9f-00975528a671'), - (true, 'Getty AAT', 'GettyAAT', (SELECT id FROM model.entity WHERE name = 'Getty AAT' AND cidoc_class_code = 'E32'), 'https://vocab.getty.edu/page/aat/', 'https://www.getty.edu/research/tools/vocabularies/aat/', '300387513'); + (true, 'GeoNames', 'GeoNames', (SELECT id FROM model.entity WHERE name = 'GeoNames' AND openatlas_class_name = 'reference_system'), 'https://www.geonames.org/', 'https://www.geonames.org/', '1234567'), + (true, 'Wikidata', 'Wikidata', (SELECT id FROM model.entity WHERE name = 'Wikidata' AND openatlas_class_name = 'reference_system'), 'https://www.wikidata.org/entity/', 'https://www.wikidata.org', 'Q123'), + (true, 'GND', 'GND', (SELECT id FROM model.entity WHERE name = 'GND' AND openatlas_class_name = 'reference_system'), 'https://lobid.org/gnd/', 'https://d-nb.info/standards/elementset/gnd', '119338467'), + (true, 'DOI', 'DOI', (SELECT id FROM model.entity WHERE name = 'DOI' AND openatlas_class_name = 'reference_system'), 'https://doi.org/', 'https://www.crossref.org/', '10.5281/zenodo.20451000'), + (true, 'Cadaster', 'Cadaster', (SELECT id FROM model.entity WHERE name = 'Cadaster' AND openatlas_class_name = 'reference_system'), 'https://kataster.bev.gv.at/api/gst/', 'https://kataster.bev.gv.at/', '01004/784/1'), + (true, 'VIAF', 'VIAF', (SELECT id FROM model.entity WHERE name = 'VIAF' AND openatlas_class_name = 'reference_system'), 'https://viaf.org/viaf/', 'https://viaf.org', '6215151353538552720009'), + (true, 'ChronOntology', 'ChronOntology', (SELECT id FROM model.entity WHERE name = 'ChronOntology' AND openatlas_class_name = 'reference_system'), 'https://chronontology.dainst.org/period/', 'https://chronontology.dainst.org/', 'UCBAClZzVqwh'), + (true, 'Kulturpool', 'Kulturpool', (SELECT id FROM model.entity WHERE name = 'Kulturpool' AND openatlas_class_name = 'reference_system'), 'https://kulturpool.at/objekte/', 'https://kulturpool.at/', 'dfc50104-275f-44b7-aa9f-00975528a671'), + (true, 'Getty AAT', 'GettyAAT', (SELECT id FROM model.entity WHERE name = 'Getty AAT' AND openatlas_class_name = 'reference_system'), 'https://vocab.getty.edu/page/aat/', 'https://www.getty.edu/research/tools/vocabularies/aat/', '300387513'); INSERT INTO model.link (property_code, range_id, domain_id) VALUES ('P2', (SELECT id FROM model.entity WHERE name='exact match'), (SELECT id FROM model.entity WHERE name='Cadaster')), diff --git a/install/data_test.sql b/install/data_test.sql index 7a7a5a0c2..3281beaa6 100644 --- a/install/data_test.sql +++ b/install/data_test.sql @@ -41,11 +41,11 @@ INSERT INTO web.hierarchy_openatlas_class (hierarchy_id, openatlas_class_name) V ((SELECT id FROM web.hierarchy WHERE name='Dimensions'), 'place'); -- Custom place hierarchy: Administrative Unit -INSERT INTO model.entity (cidoc_class_code, openatlas_class_name, name, description) VALUES - ('E53', 'administrative_unit', 'Administrative unit', 'Hierarchy of administrative units'), - ('E53', 'administrative_unit', 'Austria', Null), - ('E53', 'administrative_unit', 'Wien', Null), - ('E53', 'administrative_unit', 'Italy', Null); +INSERT INTO model.entity (openatlas_class_name, name, description) VALUES + ('administrative_unit', 'Administrative unit', 'Hierarchy of administrative units'), + ('administrative_unit', 'Austria', Null), + ('administrative_unit', 'Wien', Null), + ('administrative_unit', 'Italy', Null); INSERT INTO model.link (property_code, range_id, domain_id) VALUES ('P89', (SELECT id FROM model.entity WHERE name='Administrative unit'), (SELECT id FROM model.entity WHERE name='Austria')), diff --git a/install/data_test_api.sql b/install/data_test_api.sql index 22cd757a4..c62ff6067 100644 --- a/install/data_test_api.sql +++ b/install/data_test_api.sql @@ -1,45 +1,44 @@ -INSERT INTO model.entity ( - cidoc_class_code, openatlas_class_name, name, description, begin_from, begin_to, begin_comment, end_from, end_to, end_comment, created, modified) +INSERT INTO model.entity (openatlas_class_name, name, description, begin_from, begin_to, begin_comment, end_from, end_to, end_comment, created, modified) VALUES - ('E18', 'place', 'Shire','The Shire was the homeland of the hobbits.','2018-01-31', '2018-03-01', 'Begin of the shire', '2019-01-31', '2019-03-01','Descent of Shire', '2022-09-21 16:38:01.923431','2022-09-21 16:38:05.923431'), - ('E21', 'person', 'Sam', 'That is Sam','200-01-31', '200-03-01', 'Begin of the shire', '700-01-31', '800-03-01','Descent of Shire', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP), - ('E74', 'group', 'The Fellowship', '','215-01-31', NULL, '', '700-01-31', NULL,'', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP); + ('place', 'Shire','The Shire was the homeland of the hobbits.','2018-01-31', '2018-03-01', 'Begin of the shire', '2019-01-31', '2019-03-01','Descent of Shire', '2022-09-21 16:38:01.923431','2022-09-21 16:38:05.923431'), + ('person', 'Sam', 'That is Sam','200-01-31', '200-03-01', 'Begin of the shire', '700-01-31', '800-03-01','Descent of Shire', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP), + ('group', 'The Fellowship', '','215-01-31', NULL, '', '700-01-31', NULL,'', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP); -INSERT INTO model.entity (cidoc_class_code, openatlas_class_name, name, description, modified) +INSERT INTO model.entity (openatlas_class_name, name, description, modified) VALUES - ('E53', 'object_location', 'Location of Shire', NULL, CURRENT_TIMESTAMP), - ('E18', 'place', 'Mordor', 'The heart of evil.', CURRENT_TIMESTAMP), - ('E53', 'object_location', 'Location of Mordor', NULL, CURRENT_TIMESTAMP), - ('E22', 'artifact', 'The One Ring', 'The one ring', CURRENT_TIMESTAMP), - ('E53', 'object_location', 'Location of The One Ring', NULL, CURRENT_TIMESTAMP), - ('E20', 'human_remains', 'Dragon bones', 'Bones of an ancient dragon', CURRENT_TIMESTAMP), - ('E53', 'object_location', 'Location of Dragon bones', NULL, CURRENT_TIMESTAMP), - ('E18', 'feature', 'Home of Baggins', 'Home of Baggins', CURRENT_TIMESTAMP), - ('E53', 'object_location', 'Location of Home of Baggins', NULL, CURRENT_TIMESTAMP), - ('E18', 'stratigraphic_unit', 'Bar', NULL, CURRENT_TIMESTAMP), - ('E53', 'object_location', 'Location of Bar', NULL, CURRENT_TIMESTAMP), - ('E31', 'file', 'Picture with a License', 'With a license', CURRENT_TIMESTAMP), - ('E31', 'file', 'File without license', 'No license', CURRENT_TIMESTAMP), - ('E31', 'file', 'File without file', 'No file', CURRENT_TIMESTAMP), - ('E31', 'file', 'File not public', 'Not public', CURRENT_TIMESTAMP), - ('E33', 'source', 'Silmarillion', 'The Silmarillion', CURRENT_TIMESTAMP), - ('E33', 'source', 'Silmarillion text', 'Nice text', CURRENT_TIMESTAMP), - ('E21', 'person', 'Frodo', 'That is Frodo', CURRENT_TIMESTAMP), - ('E21', 'person', 'https://viaf.org/viaf/95218067', 'John Ronald Reuel Tolkien', CURRENT_TIMESTAMP), - ('E31', 'external_reference', 'https://lotr.fandom.com/', NULL, CURRENT_TIMESTAMP), - ('E31', 'bibliography', 'Frodo et. al.', 'Book of Frodo and his friends', CURRENT_TIMESTAMP), - ('E31', 'edition', 'Translation of Silmarillion', 'Book of Frodo and his friends', CURRENT_TIMESTAMP), - ('E41', 'alias', 'Sûza', NULL, CURRENT_TIMESTAMP), - ('E41', 'alias', 'The ring bearer', NULL, CURRENT_TIMESTAMP), - ('E7', 'activity', 'Travel to Mordor', NULL, CURRENT_TIMESTAMP), - ('E7', 'activity', 'Exchange of the one ring', NULL, CURRENT_TIMESTAMP), - ('E55', 'type', 'Lord of the rings', NULL, CURRENT_TIMESTAMP), - ('E55', 'type', 'Case Study', NULL, CURRENT_TIMESTAMP), - ('E55', 'type', 'Tavern', NULL, CURRENT_TIMESTAMP), - ('E55', 'type', 'Hills', NULL, CURRENT_TIMESTAMP), - ('E55', 'type', 'Ring', NULL, CURRENT_TIMESTAMP), - ('E31', 'external_reference', 'https://en.wikipedia.org/wiki/Public_domain', NULL, CURRENT_TIMESTAMP), - ('E31', 'external_reference', 'https://doi.org/10.2307/j.ctv1vtz8mq.3', NULL, CURRENT_TIMESTAMP); + ('object_location', 'Location of Shire', NULL, CURRENT_TIMESTAMP), + ('place', 'Mordor', 'The heart of evil.', CURRENT_TIMESTAMP), + ('object_location', 'Location of Mordor', NULL, CURRENT_TIMESTAMP), + ('artifact', 'The One Ring', 'The one ring', CURRENT_TIMESTAMP), + ('object_location', 'Location of The One Ring', NULL, CURRENT_TIMESTAMP), + ('human_remains', 'Dragon bones', 'Bones of an ancient dragon', CURRENT_TIMESTAMP), + ('object_location', 'Location of Dragon bones', NULL, CURRENT_TIMESTAMP), + ('feature', 'Home of Baggins', 'Home of Baggins', CURRENT_TIMESTAMP), + ('object_location', 'Location of Home of Baggins', NULL, CURRENT_TIMESTAMP), + ('stratigraphic_unit', 'Bar', NULL, CURRENT_TIMESTAMP), + ('object_location', 'Location of Bar', NULL, CURRENT_TIMESTAMP), + ('file', 'Picture with a License', 'With a license', CURRENT_TIMESTAMP), + ('file', 'File without license', 'No license', CURRENT_TIMESTAMP), + ('file', 'File without file', 'No file', CURRENT_TIMESTAMP), + ('file', 'File not public', 'Not public', CURRENT_TIMESTAMP), + ('source', 'Silmarillion', 'The Silmarillion', CURRENT_TIMESTAMP), + ('source', 'Silmarillion text', 'Nice text', CURRENT_TIMESTAMP), + ('person', 'Frodo', 'That is Frodo', CURRENT_TIMESTAMP), + ('person', 'https://viaf.org/viaf/95218067', 'John Ronald Reuel Tolkien', CURRENT_TIMESTAMP), + ('external_reference', 'https://lotr.fandom.com/', NULL, CURRENT_TIMESTAMP), + ('bibliography', 'Frodo et. al.', 'Book of Frodo and his friends', CURRENT_TIMESTAMP), + ('edition', 'Translation of Silmarillion', 'Book of Frodo and his friends', CURRENT_TIMESTAMP), + ('alias', 'Sûza', NULL, CURRENT_TIMESTAMP), + ('alias', 'The ring bearer', NULL, CURRENT_TIMESTAMP), + ('activity', 'Travel to Mordor', NULL, CURRENT_TIMESTAMP), + ('activity', 'Exchange of the one ring', NULL, CURRENT_TIMESTAMP), + ('type', 'Lord of the rings', NULL, CURRENT_TIMESTAMP), + ('type', 'Case Study', NULL, CURRENT_TIMESTAMP), + ('type', 'Tavern', NULL, CURRENT_TIMESTAMP), + ('type', 'Hills', NULL, CURRENT_TIMESTAMP), + ('type', 'Ring', NULL, CURRENT_TIMESTAMP), + ('external_reference', 'https://en.wikipedia.org/wiki/Public_domain', NULL, CURRENT_TIMESTAMP), + ('external_reference', 'https://doi.org/10.2307/j.ctv1vtz8mq.3', NULL, CURRENT_TIMESTAMP); INSERT INTO model.gis (entity_id, name, description, type, geom_point, geom_polygon, geom_linestring) diff --git a/install/import_scripts/openatlas_demo.py b/install/import_scripts/openatlas_demo.py index 39e673965..655a6f30b 100644 --- a/install/import_scripts/openatlas_demo.py +++ b/install/import_scripts/openatlas_demo.py @@ -110,7 +110,6 @@ def insert_hierarchy(item: dict[str, Any]) -> None: """ SELECT id, - cidoc_class_code, name, description, created, diff --git a/install/upgrade/9.5.0.sql b/install/upgrade/9.5.0.sql new file mode 100644 index 000000000..d63d99ac9 --- /dev/null +++ b/install/upgrade/9.5.0.sql @@ -0,0 +1,38 @@ +BEGIN; + +-- Raise database version +UPDATE web.settings SET value = '9.5.0' WHERE name = 'database_version'; + +-- Remove cidoc_class_code FROM model.entity +ALTER TABLE model.entity DROP COLUMN IF EXISTS cidoc_class_code; + + +DROP FUNCTION IF EXISTS model.delete_entity_related() CASCADE; + +CREATE FUNCTION model.delete_entity_related() RETURNS trigger + LANGUAGE plpgsql + AS $$ + BEGIN + -- Delete aliases + IF OLD.openatlas_class_name IN ('place', 'person', 'group') THEN + DELETE FROM model.entity WHERE id IN (SELECT range_id FROM model.link WHERE domain_id = OLD.id AND property_code IN ('P1', 'P131')); + END IF; + + -- Delete location if it was an artifact, human remains or place + IF OLD.openatlas_class_name IN ('place', 'human_remains', 'artifact') THEN + DELETE FROM model.entity WHERE id = (SELECT range_id FROM model.link WHERE domain_id = OLD.id AND property_code = 'P53'); + END IF; + + -- Delete text if it was a document not attached to a source anymore + IF OLD.openatlas_class_name = 'text' THEN + DELETE FROM model.entity WHERE id IN (SELECT range_id FROM model.link WHERE domain_id = OLD.id AND property_code = 'P73'); + END IF; + + RETURN OLD; + END; + + $$; +ALTER FUNCTION model.delete_entity_related() OWNER TO openatlas; +CREATE TRIGGER on_delete_entity BEFORE DELETE ON model.entity FOR EACH ROW EXECUTE FUNCTION model.delete_entity_related(); + +END; diff --git a/openatlas/database/checks.py b/openatlas/database/checks.py index 7bf278664..7c601939b 100644 --- a/openatlas/database/checks.py +++ b/openatlas/database/checks.py @@ -34,13 +34,15 @@ def get_orphans() -> list[dict[str, Any]]: SELECT e.id FROM model.entity e LEFT JOIN model.link l1 ON e.id = l1.domain_id - AND l1.range_id NOT IN - (SELECT id FROM model.entity WHERE cidoc_class_code = 'E55') + AND l1.range_id NOT IN ( + SELECT id + FROM model.entity + WHERE e.openatlas_class_name IN ('type', 'type_tools')) LEFT JOIN model.link l2 ON e.id = l2.range_id WHERE l1.domain_id IS NULL AND l2.range_id IS NULL - AND e.cidoc_class_code != 'E55' - AND e.openatlas_class_name != 'reference_system'; + AND e.openatlas_class_name + NOT IN ('reference_system', 'type', 'type_tools'); """) return list(g.cursor) @@ -56,11 +58,13 @@ def get_cidoc_links() -> list[dict[str, Any]]: SELECT DISTINCT l.id, l.property_code, - d.cidoc_class_code AS domain_code, - r.cidoc_class_code AS range_code + dc.cidoc_class_code AS domain_code, + rc.cidoc_class_code AS range_code FROM model.link l JOIN model.entity d ON l.domain_id = d.id - JOIN model.entity r ON l.range_id = r.id; + JOIN model.openatlas_class dc ON d.openatlas_class_name = dc.name + JOIN model.entity r ON l.range_id = r.id + JOIN model.openatlas_class rc ON r.openatlas_class_name = rc.name """) return list(g.cursor) @@ -72,7 +76,7 @@ def check_type_count_needed(entity_id: int) -> bool: FROM model.entity WHERE id = %(entity_id)s AND openatlas_class_name IN - ('administrative_unit', 'type', 'type_tools'); + ('administrative_unit', 'type', 'type_tools'); """, {'entity_id': entity_id}) return bool(g.cursor.rowcount) diff --git a/openatlas/database/cidoc.py b/openatlas/database/cidoc.py index b87800a61..76d5affd5 100644 --- a/openatlas/database/cidoc.py +++ b/openatlas/database/cidoc.py @@ -11,10 +11,11 @@ def cidoc_classes(with_count: bool = False) -> list[dict[str, Any]]: c.name, comment {', COUNT(e.id) AS count' if with_count else ''} - FROM model.cidoc_class c - {''' LEFT JOIN model.entity e ON c.code = e.cidoc_class_code - GROUP BY (c.code, c.name, c.comment)''' if with_count else ''} - ; + FROM model.cidoc_class c {""" + LEFT JOIN model.openatlas_class oa ON c.code = oa.cidoc_class_code + LEFT JOIN model.entity e ON oa.name = e.openatlas_class_name + GROUP BY (c.code, c.name, c.comment) + """ if with_count else ''}; """) return list(g.cursor) diff --git a/openatlas/database/entity.py b/openatlas/database/entity.py index ec148a0e4..dadbeb32f 100644 --- a/openatlas/database/entity.py +++ b/openatlas/database/entity.py @@ -41,7 +41,6 @@ def get_by_project_id(project_id: int) -> list[dict[str, Any]]: SELECT e.id, ie.origin_id, - e.cidoc_class_code, e.name, e.description, e.created, @@ -78,8 +77,10 @@ def get_by_cidoc_class( types: bool = False, aliases: bool = False) -> list[dict[str, Any]]: g.cursor.execute( - select_sql(types, aliases) + - 'WHERE e.cidoc_class_code IN %(codes)s GROUP BY e.id;', + select_sql(types, aliases) + """ + JOIN model.openatlas_class oa ON e.openatlas_class_name = oa.name + WHERE oa.cidoc_class_code IN %(codes)s GROUP BY e.id; + """, {'codes': tuple(code if isinstance(code, list) else [code])}) return list(g.cursor) @@ -130,7 +131,6 @@ def get_all_entities() -> list[dict[str, Any]]: """ SELECT e.id, - e.cidoc_class_code, e.name, e.description, COALESCE(to_char(e.created, 'yyyy-mm-dd hh24:mi:ss BC'), '') @@ -161,7 +161,6 @@ def insert(data: dict[str, Any]) -> int: INSERT INTO model.entity ( name, openatlas_class_name, - cidoc_class_code, description, begin_from, begin_to, @@ -172,7 +171,6 @@ def insert(data: dict[str, Any]) -> int: ) VALUES ( %(name)s, %(openatlas_class_name)s, - %(cidoc_class_code)s, %(description)s, %(begin_from)s, %(begin_to)s, @@ -252,7 +250,6 @@ def select_sql(types: bool = False, aliases: bool = False) -> str: SELECT e.id, e.uuid, - e.cidoc_class_code, e.name, e.description, e.created, @@ -531,7 +528,6 @@ def get_types(with_count: bool) -> list[dict[str, Any]]: e.id, e.uuid, e.name, - e.cidoc_class_code, e.description, e.openatlas_class_name, e.created, @@ -798,7 +794,6 @@ def get_reference_systems() -> list[dict[str, Any]]: e.id, e.uuid, e.name, - e.cidoc_class_code, e.description, e.openatlas_class_name, e.created, @@ -819,7 +814,6 @@ def get_reference_systems() -> list[dict[str, Any]]: e.id, e.uuid, e.name, - e.cidoc_class_code, e.description, e.openatlas_class_name, e.created, diff --git a/openatlas/database/gis.py b/openatlas/database/gis.py index 3f2901aaf..8a4365f12 100644 --- a/openatlas/database/gis.py +++ b/openatlas/database/gis.py @@ -177,7 +177,7 @@ def get_all(extra_ids: list[int]) -> list[dict[str, Any]]: JOIN model.gis g ON place.id = g.entity_id LEFT JOIN model.link t ON object.id = t.domain_id AND t.property_code = 'P2' - WHERE place.cidoc_class_code = 'E53' + WHERE place.openatlas_class_name = 'object_location' AND l.property_code = 'P53' AND (object.openatlas_class_name = 'place' OR object.id IN %(extra_ids)s) diff --git a/openatlas/views/ajax.py b/openatlas/views/ajax.py index 59cb1ede7..03db5eb2c 100644 --- a/openatlas/views/ajax.py +++ b/openatlas/views/ajax.py @@ -39,7 +39,6 @@ def ajax_add_type() -> str: data={ 'name': request.form['name'], 'openatlas_class_name': root.class_.name, - 'cidoc_class_code': root.cidoc_class.code, 'description': request.form['description']}) entity.link(link[root.cidoc_class.code], root) g.logger.log_user(entity.id, 'insert') diff --git a/openatlas/views/changelog.py b/openatlas/views/changelog.py index 74fabba8c..9da6365ec 100644 --- a/openatlas/views/changelog.py +++ b/openatlas/views/changelog.py @@ -15,7 +15,11 @@ def index_changelog() -> str: versions = { - '9.5.0': ['TBA', {}], + '9.5.0': ['TBA', { + 'feature': { + '2875': 'Remove database field model.entity.cidoc_class_code' + } + }], '9.4.0': ['2026-08-01', { 'feature': { '924': 'Multi instance capability',