From 66105eb2ccfa3f236cafd373fde26deaa204e26a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Kleinb=C3=B6lting?= Date: Mon, 11 Mar 2024 11:53:50 +0100 Subject: [PATCH] Remove Institution class and related properties --- .../domain/domain-entities-and-relations.md | 5 -- test_data/project_data/admin-data.ttl | 5 -- ...001__remove_Institution_and_related.sparql | 9 +++ .../knora-ontologies/knora-admin.ttl | 78 ------------------- .../webapi/messages/OntologyConstants.scala | 8 -- .../domain/IriTestConstants.scala | 1 - 6 files changed, 9 insertions(+), 97 deletions(-) create mode 100644 webapi/src/main/resources/db/0001__remove_Institution_and_related.sparql diff --git a/docs/05-internals/design/domain/domain-entities-and-relations.md b/docs/05-internals/design/domain/domain-entities-and-relations.md index b41dd4f290..92179f252e 100644 --- a/docs/05-internals/design/domain/domain-entities-and-relations.md +++ b/docs/05-internals/design/domain/domain-entities-and-relations.md @@ -97,11 +97,6 @@ erDiagram ``` -!!! danger "Unclear/Unexpected Stuff" - - - User.phone? - - Institution? (name, description, website, phone, address, email) - ### Overview V2 ```mermaid diff --git a/test_data/project_data/admin-data.ttl b/test_data/project_data/admin-data.ttl index 23f119e798..be4139deab 100644 --- a/test_data/project_data/admin-data.ttl +++ b/test_data/project_data/admin-data.ttl @@ -140,11 +140,6 @@ knora-admin:hasSelfJoinEnabled "false"^^xsd:boolean . - - rdf:type knora-admin:Institution ; - knora-admin:institutionName "Digital Humanities Lab, Basel" . - - ########################################################## # # INCUNABULA PROJECT / USERS / GROUPS diff --git a/webapi/src/main/resources/db/0001__remove_Institution_and_related.sparql b/webapi/src/main/resources/db/0001__remove_Institution_and_related.sparql new file mode 100644 index 0000000000..a91b4b5b63 --- /dev/null +++ b/webapi/src/main/resources/db/0001__remove_Institution_and_related.sparql @@ -0,0 +1,9 @@ +PREFIX rdf: +PREFIX knora-admin: + +DELETE WHERE { + GRAPH { + ?s a knora-admin:Institution ; + ?p ?o . + } +} diff --git a/webapi/src/main/resources/knora-ontologies/knora-admin.ttl b/webapi/src/main/resources/knora-ontologies/knora-admin.ttl index 2eace8ad31..5e291d0e58 100644 --- a/webapi/src/main/resources/knora-ontologies/knora-admin.ttl +++ b/webapi/src/main/resources/knora-ontologies/knora-admin.ttl @@ -86,16 +86,6 @@ # ################################################################# - -### http://www.knora.org/ontology/knora-admin#address - -:address - rdf:type owl:DatatypeProperty ; - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - knora-base:objectDatatypeConstraint xsd:string ; - rdfs:comment "The address of a person or an institution"@en . - - ### http://www.knora.org/ontology/knora-admin#groupName :groupName @@ -129,37 +119,6 @@ knora-base:objectDatatypeConstraint xsd:boolean . -### http://www.knora.org/ontology/knora-admin#institutionName - -:institutionName - rdf:type owl:DatatypeProperty ; - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - rdfs:comment "The institutions's name."@en ; - rdfs:subPropertyOf ; - knora-base:subjectClassConstraint :Institution ; - knora-base:objectDatatypeConstraint xsd:string . - - -### http://www.knora.org/ontology/knora-admin#institutionDescription - -:institutionDescription - rdf:type owl:DatatypeProperty ; - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - rdfs:comment "A description of an institution."@en ; - knora-base:subjectClassConstraint :Institution ; - knora-base:objectDatatypeConstraint xsd:string . - - -### http://www.knora.org/ontology/knora-admin#institutionWebsite - -:institutionWebsite - rdf:type owl:DatatypeProperty ; - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - rdfs:comment "The URL of a web site."@en ; - knora-base:subjectClassConstraint :Institution ; - knora-base:objectDatatypeConstraint xsd:anyURI . - - ### http://www.knora.org/ontology/knora-admin#isActiveUser :isInSystemAdminGroup @@ -199,16 +158,6 @@ knora-base:subjectClassConstraint :User ; knora-base:objectDatatypeConstraint xsd:string . - -### http://www.knora.org/ontology/knora-admin#phone - -:phone - rdf:type owl:DatatypeProperty ; - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - rdfs:comment "The phone number of a person, institution, etc."@en ; - knora-base:objectDatatypeConstraint xsd:string . - - ### http://www.knora.org/ontology/knora-admin#preferredLanguage :preferredLanguage @@ -335,33 +284,6 @@ # ################################################################# - -### http://www.knora.org/ontology/knora-admin#Institution - -:Institution - rdf:type owl:Class ; - rdfs:subClassOf foaf:Organization, - [ rdf:type owl:Restriction ; - owl:onProperty :institutionName ; - owl:cardinality "1"^^xsd:nonNegativeInteger ], - [ rdf:type owl:Restriction ; - owl:onProperty :institutionDescription ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger ], - [ rdf:type owl:Restriction ; - owl:onProperty :institutionWebsite ; - owl:minCardinality "0"^^xsd:nonNegativeInteger ], - [ rdf:type owl:Restriction ; - owl:onProperty :phone ; - owl:minCardinality "0"^^xsd:nonNegativeInteger ], - [ rdf:type owl:Restriction ; - owl:onProperty :address ; - owl:minCardinality "0"^^xsd:nonNegativeInteger ], - [ rdf:type owl:Restriction ; - owl:onProperty :email ; - owl:minCardinality "0"^^xsd:nonNegativeInteger ] ; - rdfs:comment "An institution that has data in Knora."@en . - - ### http://www.knora.org/ontology/knora-admin#User :User diff --git a/webapi/src/main/scala/org/knora/webapi/messages/OntologyConstants.scala b/webapi/src/main/scala/org/knora/webapi/messages/OntologyConstants.scala index 556a49b1fb..fb4946dd02 100644 --- a/webapi/src/main/scala/org/knora/webapi/messages/OntologyConstants.scala +++ b/webapi/src/main/scala/org/knora/webapi/messages/OntologyConstants.scala @@ -457,7 +457,6 @@ object OntologyConstants { val GivenName: IRI = KnoraAdminPrefixExpansion + "givenName" val FamilyName: IRI = KnoraAdminPrefixExpansion + "familyName" val Password: IRI = KnoraAdminPrefixExpansion + "password" - val Address: IRI = KnoraAdminPrefixExpansion + "address" val UsersActiveProject: IRI = KnoraAdminPrefixExpansion + "currentproject" val PreferredLanguage: IRI = KnoraAdminPrefixExpansion + "preferredLanguage" val IsInProject: IRI = KnoraAdminPrefixExpansion + "isInProject" @@ -503,13 +502,6 @@ object OntologyConstants { ProjectAdmin, ) - /* Institution */ - val Institution: IRI = KnoraAdminPrefixExpansion + "Institution" - val InstitutionDescription: IRI = KnoraAdminPrefixExpansion + "institutionDescription" - val InstitutionName: IRI = KnoraAdminPrefixExpansion + "institutionName" - val InstitutionWebsite: IRI = KnoraAdminPrefixExpansion + "institutionWebsite" - val Phone: IRI = KnoraAdminPrefixExpansion + "phone" - /* Permissions */ val Permission: IRI = KnoraAdminPrefixExpansion + "Permission" val AdministrativePermission: IRI = KnoraAdminPrefixExpansion + "AdministrativePermission" diff --git a/webapi/src/test/scala/org/knora/webapi/slice/resourceinfo/domain/IriTestConstants.scala b/webapi/src/test/scala/org/knora/webapi/slice/resourceinfo/domain/IriTestConstants.scala index eaf345576d..26feb8a413 100644 --- a/webapi/src/test/scala/org/knora/webapi/slice/resourceinfo/domain/IriTestConstants.scala +++ b/webapi/src/test/scala/org/knora/webapi/slice/resourceinfo/domain/IriTestConstants.scala @@ -67,7 +67,6 @@ object IriTestConstants { object Class { val AdministrativePermission: InternalIri = makeEntity(KnoraAdmin.Ontology, "AdministrativePermission") - val Institution: InternalIri = makeEntity(KnoraAdmin.Ontology, "Institution") val Permission: InternalIri = makeEntity(KnoraAdmin.Ontology, "Permission") } }