From d22adfd2b0fcf699def349a2f63da4d5cdf02937 Mon Sep 17 00:00:00 2001 From: Balduin Landolt <33053745+BalduinLandolt@users.noreply.github.com> Date: Wed, 3 Apr 2024 13:26:11 +0200 Subject: [PATCH 1/3] fix: Temporarily bring back support for `isSequenceOf` while it exists in data (#3162) --- .../knoraApiOntologySimple.jsonld | 27 ++++++++++ .../knoraApiOntologyWithValueObjects.jsonld | 49 +++++++++++++++++++ .../resources/knora-ontologies/knora-base.ttl | 39 ++++++++++++++- .../main/scala/org/knora/webapi/package.scala | 2 +- .../upgrade/RepositoryUpdatePlan.scala | 1 + 5 files changed, 116 insertions(+), 2 deletions(-) diff --git a/test_data/generated_test_data/ontologyR2RV2/knoraApiOntologySimple.jsonld b/test_data/generated_test_data/ontologyR2RV2/knoraApiOntologySimple.jsonld index 35be7da34c..8f6c85f437 100644 --- a/test_data/generated_test_data/ontologyR2RV2/knoraApiOntologySimple.jsonld +++ b/test_data/generated_test_data/ontologyR2RV2/knoraApiOntologySimple.jsonld @@ -1285,6 +1285,18 @@ }, "@id": "knora-api:hasSegmentBounds" }, + { + "rdfs:label": "Sequence Bounds", + "rdfs:subPropertyOf": { + "@id": "knora-api:hasValue" + }, + "rdfs:comment": "Indicates the bounds of a sequence, i.e. the start and end point in the containing resource.", + "@type": "owl:DatatypeProperty", + "knora-api:objectType": { + "@id": "knora-api:Interval" + }, + "@id": "knora-api:hasSequenceBounds" + }, { "rdfs:label": "has Standoff Link to", "rdfs:subPropertyOf": { @@ -1432,6 +1444,21 @@ }, "@id": "knora-api:isSegmentOf" }, + { + "rdfs:label": "is sequence of", + "rdfs:subPropertyOf": { + "@id": "knora-api:hasLinkTo" + }, + "rdfs:comment": "Deprecated in favour of :Segment", + "@type": "owl:ObjectProperty", + "knora-api:subjectType": { + "@id": "knora-api:Resource" + }, + "knora-api:objectType": { + "@id": "knora-api:Resource" + }, + "@id": "knora-api:isSequenceOf" + }, { "rdfs:label": "is video segment of", "rdfs:subPropertyOf": { diff --git a/test_data/generated_test_data/ontologyR2RV2/knoraApiOntologyWithValueObjects.jsonld b/test_data/generated_test_data/ontologyR2RV2/knoraApiOntologyWithValueObjects.jsonld index 1605a7d542..ccd683799d 100644 --- a/test_data/generated_test_data/ontologyR2RV2/knoraApiOntologyWithValueObjects.jsonld +++ b/test_data/generated_test_data/ontologyR2RV2/knoraApiOntologyWithValueObjects.jsonld @@ -8184,6 +8184,20 @@ }, "rdfs:comment": "Indicates the bounds of a segment, i.e. the start and end point in the containing resource." }, + { + "rdfs:label": "Sequence Bounds", + "rdfs:subPropertyOf": { + "@id": "knora-api:hasValue" + }, + "knora-api:isEditable": true, + "knora-api:isResourceProperty": true, + "rdfs:comment": "Indicates the bounds of a sequence, i.e. the start and end point in the containing resource.", + "@type": "owl:ObjectProperty", + "knora-api:objectType": { + "@id": "knora-api:IntervalValue" + }, + "@id": "knora-api:hasSequenceBounds" + }, { "rdfs:label": "has Standoff Link to", "rdfs:subPropertyOf": { @@ -8581,6 +8595,41 @@ }, "@id": "knora-api:isSegmentOfValue" }, + { + "rdfs:label": "is sequence of", + "rdfs:subPropertyOf": { + "@id": "knora-api:hasLinkTo" + }, + "knora-api:isEditable": true, + "knora-api:isResourceProperty": true, + "@type": "owl:ObjectProperty", + "knora-api:objectType": { + "@id": "knora-api:Resource" + }, + "@id": "knora-api:isSequenceOf", + "knora-api:subjectType": { + "@id": "knora-api:Resource" + }, + "knora-api:isLinkProperty": true, + "rdfs:comment": "Deprecated in favour of :Segment" + }, + { + "knora-api:isLinkValueProperty": true, + "rdfs:subPropertyOf": { + "@id": "knora-api:hasLinkToValue" + }, + "knora-api:isEditable": true, + "knora-api:isResourceProperty": true, + "@type": "owl:ObjectProperty", + "knora-api:objectType": { + "@id": "knora-api:LinkValue" + }, + "@id": "knora-api:isSequenceOfValue", + "knora-api:subjectType": { + "@id": "knora-api:Resource" + }, + "rdfs:comment": "Deprecated in favour of :Segment" + }, { "rdfs:label": "is shared", "rdfs:comment": "Indicates whether an ontology can be shared by multiple projects", diff --git a/webapi/src/main/resources/knora-ontologies/knora-base.ttl b/webapi/src/main/resources/knora-ontologies/knora-base.ttl index f36ca234ab..43ba5caeb3 100644 --- a/webapi/src/main/resources/knora-ontologies/knora-base.ttl +++ b/webapi/src/main/resources/knora-ontologies/knora-base.ttl @@ -20,7 +20,7 @@ rdf:type owl:Ontology ; rdfs:label "The Knora base ontology"@en ; :attachedToProject knora-admin:SystemProject ; - :ontologyVersion "knora-base v33" . + :ontologyVersion "knora-base v34" . ################################################################# @@ -2366,3 +2366,40 @@ "Video Segment"@en ; :canBeInstantiated true ; rdfs:comment "A segment of a video resource"@en . + +### http://www.knora.org/ontology/knora-base#isSequenceOf + +:isSequenceOf + rdf:type owl:ObjectProperty ; + rdfs:label "ist Sequenz von"@de, + "is sequence of"@en, + "fait partie de"@fr, + "fa parte di"@it ; + rdfs:comment "Deprecated in favour of :Segment"@en ; + :subjectClassConstraint :Resource ; + :objectClassConstraint :Resource ; + :isEditable true ; + rdfs:subPropertyOf :hasLinkTo . + + +### http://www.knora.org/ontology/knora-base#isSequenceOfValue + +:isSequenceOfValue + rdf:type owl:ObjectProperty ; + :objectClassConstraint :LinkValue ; + :subjectClassConstraint :Resource ; + :isEditable true ; + rdfs:comment "Deprecated in favour of :Segment"@en ; + rdfs:subPropertyOf :hasLinkToValue . + +### http://www.knora.org/ontology/knora-base#hasSequenceBounds + +:hasSequenceBounds + rdf:type owl:ObjectProperty ; + :objectClassConstraint :IntervalValue ; + :isEditable true ; + rdfs:subPropertyOf :hasValue ; + rdfs:label "Sequenz-Grenzen"@de, + "Sequence Bounds"@en ; + rdfs:comment "Deprecated in favour of :Segment"@en ; + rdfs:comment "Indicates the bounds of a sequence, i.e. the start and end point in the containing resource."@en . diff --git a/webapi/src/main/scala/org/knora/webapi/package.scala b/webapi/src/main/scala/org/knora/webapi/package.scala index 9d5c9b6169..843f1a36f9 100644 --- a/webapi/src/main/scala/org/knora/webapi/package.scala +++ b/webapi/src/main/scala/org/knora/webapi/package.scala @@ -11,7 +11,7 @@ package object webapi { * The version of `knora-base` and of the other built-in ontologies that this version of Knora requires. * Must be the same as the object of `knora-base:ontologyVersion` in the `knora-base` ontology being used. */ - val KnoraBaseVersion: String = "knora-base v33" + val KnoraBaseVersion: String = "knora-base v34" /** * `IRI` is a synonym for `String`, used to improve code readability. diff --git a/webapi/src/main/scala/org/knora/webapi/store/triplestore/upgrade/RepositoryUpdatePlan.scala b/webapi/src/main/scala/org/knora/webapi/store/triplestore/upgrade/RepositoryUpdatePlan.scala index 317fa82ef2..56edd69acf 100644 --- a/webapi/src/main/scala/org/knora/webapi/store/triplestore/upgrade/RepositoryUpdatePlan.scala +++ b/webapi/src/main/scala/org/knora/webapi/store/triplestore/upgrade/RepositoryUpdatePlan.scala @@ -49,6 +49,7 @@ object RepositoryUpdatePlan { PluginForKnoraBaseVersion(versionNumber = 31, plugin = new UpgradePluginPR3112()), PluginForKnoraBaseVersion(versionNumber = 32, plugin = new MigrateOnlyBuiltInGraphs()), PluginForKnoraBaseVersion(versionNumber = 33, plugin = new MigrateOnlyBuiltInGraphs()), + PluginForKnoraBaseVersion(versionNumber = 34, plugin = new MigrateOnlyBuiltInGraphs()), ) /** From 937480c62ec6aaeed989875207fbf65ca2a9dc1d Mon Sep 17 00:00:00 2001 From: Balduin Landolt <33053745+BalduinLandolt@users.noreply.github.com> Date: Wed, 3 Apr 2024 13:52:36 +0200 Subject: [PATCH 2/3] chore: Add `Deprecated` as a category in our release notes (#3160) --- .github/pull_request_template.md | 1 + .github/workflows/check-pr-title.yml | 2 +- .github/workflows/create-release.yml | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 5e70f37dd2..e57977bf94 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -17,6 +17,7 @@ Issue Number: DEV- - [ ] perf: performance improvements - [ ] refactor: represents production code refactoring - [ ] test: adding or refactoring tests (no production code change) +- [ ] deprecated: Deprecation warning (ideally referencing a migration guide) ### Basic requirements for bug fixes and features diff --git a/.github/workflows/check-pr-title.yml b/.github/workflows/check-pr-title.yml index 5bd63ae016..798fa27ce0 100644 --- a/.github/workflows/check-pr-title.yml +++ b/.github/workflows/check-pr-title.yml @@ -11,5 +11,5 @@ jobs: steps: - uses: deepakputhraya/action-pr-title@master with: - regex: '^(build|chore|docs|feat|fix|perf|refactor|test)(\(.+\))?!?: [A-Z].+$' + regex: '^(build|chore|docs|feat|fix|perf|refactor|test|deprecated)(\(.+\))?!?: [A-Z].+$' max_length: 140 diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 230b764379..d1ffac9239 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -28,5 +28,6 @@ jobs: {"type": "fix", "section": "Bug Fixes", "hidden": false }, {"type": "perf", "section": "Enhancements", "hidden": false }, {"type": "refactor", "section": "Maintenance", "hidden": false }, - {"type": "test", "section": "Maintenance", "hidden": false } + {"type": "test", "section": "Maintenance", "hidden": false }, + {"type": "deprecated", "section": "Deprecated", "hidden": false } ]' From 0cf9e43934106c91d4a5be9b8e6fc3f5054e858a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Kleinb=C3=B6lting?= Date: Wed, 3 Apr 2024 16:43:50 +0200 Subject: [PATCH 3/3] chore: Remove unused constants (#3164) --- .../webapi/messages/OntologyConstants.scala | 51 +------------------ 1 file changed, 2 insertions(+), 49 deletions(-) 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 1a1ca02b4f..63390f25f9 100644 --- a/webapi/src/main/scala/org/knora/webapi/messages/OntologyConstants.scala +++ b/webapi/src/main/scala/org/knora/webapi/messages/OntologyConstants.scala @@ -7,8 +7,6 @@ package org.knora.webapi package messages import dsp.constants.SalsahGui -import org.knora.webapi.messages.OntologyConstants.KnoraAdmin.KnoraAdminOntologyIri -import org.knora.webapi.slice.resourceinfo.domain.InternalIri /** * Contains string constants for IRIs from ontologies used by the application. @@ -159,7 +157,6 @@ object OntologyConstants { val KnoraBaseOntologyLabel: String = "knora-base" val KnoraBaseOntologyIri: IRI = KnoraInternal.InternalOntologyStart + "/" + KnoraBaseOntologyLabel - val KnoraBasePrefix: String = KnoraBaseOntologyLabel + ":" val KnoraBasePrefixExpansion: IRI = KnoraBaseOntologyIri + "#" val OntologyVersion: IRI = KnoraBasePrefixExpansion + "ontologyVersion" @@ -209,9 +206,7 @@ object OntologyConstants { val HasLinkToValue: IRI = KnoraBasePrefixExpansion + "hasLinkToValue" val IsPartOf: IRI = KnoraBasePrefixExpansion + "isPartOf" val IsPartOfValue: IRI = KnoraBasePrefixExpansion + "isPartOfValue" - val Seqnum: IRI = KnoraBasePrefixExpansion + "seqnum" val Region: IRI = KnoraBasePrefixExpansion + "Region" - val IsRegionOf: IRI = KnoraBasePrefixExpansion + "isRegionOf" val IsSegmentOf: IRI = KnoraBasePrefixExpansion + "isSegmentOf" val IsSegmentOfValue: IRI = KnoraBasePrefixExpansion + "isSegmentOfValue" val IsAudioSegmentOf: IRI = KnoraBasePrefixExpansion + "isAudioSegmentOf" @@ -263,7 +258,6 @@ object OntologyConstants { val HasTextFileValue: IRI = KnoraBasePrefixExpansion + "hasTextFileValue" val HasDocumentFileValue: IRI = KnoraBasePrefixExpansion + "hasDocumentFileValue" val HasArchiveFileValue: IRI = KnoraBasePrefixExpansion + "hasArchiveFileValue" - val HasComment: IRI = KnoraBasePrefixExpansion + "hasComment" val ResourceIcon: IRI = KnoraBasePrefixExpansion + "resourceIcon" @@ -420,18 +414,6 @@ object OntologyConstants { val ExternalResource: IRI = OntologyConstants.KnoraBase.KnoraBasePrefixExpansion + "ExternalResource" val ExternalResValue: IRI = OntologyConstants.KnoraBase.KnoraBasePrefixExpansion + "ExternalResValue" - val AbstractResourceClasses: Set[IRI] = Set( - Resource, - ExternalResource, - Representation, - AudioRepresentation, - DDDRepresentation, - DocumentRepresentation, - ArchiveRepresentation, - MovingImageRepresentation, - StillImageRepresentation, - TextRepresentation, - ) } object KnoraAdmin { @@ -448,7 +430,6 @@ object OntologyConstants { val GivenName: IRI = KnoraAdminPrefixExpansion + "givenName" val FamilyName: IRI = KnoraAdminPrefixExpansion + "familyName" val Password: IRI = KnoraAdminPrefixExpansion + "password" - val UsersActiveProject: IRI = KnoraAdminPrefixExpansion + "currentproject" val PreferredLanguage: IRI = KnoraAdminPrefixExpansion + "preferredLanguage" val IsInProject: IRI = KnoraAdminPrefixExpansion + "isInProject" val IsInProjectAdminGroup: IRI = KnoraAdminPrefixExpansion + "isInProjectAdminGroup" @@ -555,13 +536,6 @@ object OntologyConstants { val StandoffOrderedListTag: IRI = StandoffPrefixExpansion + "StandoffOrderedListTag" val StandoffUnorderedListTag: IRI = StandoffPrefixExpansion + "StandoffUnorderedListTag" val StandoffListElementTag: IRI = StandoffPrefixExpansion + "StandoffListElementTag" - val StandoffStyleElementTag: IRI = StandoffPrefixExpansion + "StandoffStyleTag" - } - - object XPathFunctions { - val XPathPrefixExpansion: IRI = "http://www.w3.org/2005/xpath-functions#" - - val Contains: IRI = XPathPrefixExpansion + "contains" } object KnoraApi { @@ -573,8 +547,6 @@ object OntologyConstants { val KnoraApiOntologyLabel: String = "knora-api" - val KnoraApiPrefix: String = KnoraApiOntologyLabel + ":" - /** * The IRIs representing `knora-api:Resource` in Knora API v2, in the simple and complex schemas. */ @@ -739,8 +711,6 @@ object OntologyConstants { val DocumentFileValue: IRI = KnoraApiV2PrefixExpansion + "DocumentFileValue" val ArchiveFileValue: IRI = KnoraApiV2PrefixExpansion + "ArchiveFileValue" - val HasRepresentationValue: IRI = KnoraApiV2PrefixExpansion + "hasRepresentationValue" - val FileValueClasses: Set[IRI] = Set( FileValue, StillImageFileValue, @@ -777,17 +747,11 @@ object OntologyConstants { val IsPartOf: IRI = KnoraApiV2PrefixExpansion + "isPartOf" val IsPartOfValue: IRI = KnoraApiV2PrefixExpansion + "isPartOfValue" - val Seqnum: IRI = KnoraApiV2PrefixExpansion + "seqnum" - val IsRegionOf: IRI = KnoraApiV2PrefixExpansion + "isRegionOf" - val IsRegionOfValue: IRI = KnoraApiV2PrefixExpansion + "isRegionOfValue" - val HasGeometry: IRI = KnoraApiV2PrefixExpansion + "hasGeometry" val HasColor: IRI = KnoraApiV2PrefixExpansion + "hasColor" - val HasComment: IRI = KnoraApiV2PrefixExpansion + "hasComment" val HasFileValue: IRI = KnoraApiV2PrefixExpansion + "hasFileValue" val HasStillImageFileValue: IRI = KnoraApiV2PrefixExpansion + "hasStillImageFileValue" val HasMovingImageFileValue: IRI = KnoraApiV2PrefixExpansion + "hasMovingImageFileValue" val HasAudioFileValue: IRI = KnoraApiV2PrefixExpansion + "hasAudioFileValue" - val HasDDDFileValue: IRI = KnoraApiV2PrefixExpansion + "hasDDDFileValue" val HasTextFileValue: IRI = KnoraApiV2PrefixExpansion + "hasTextFileValue" val HasDocumentFileValue: IRI = KnoraApiV2PrefixExpansion + "hasDocumentFileValue" val HasArchiveFileValue: IRI = KnoraApiV2PrefixExpansion + "hasArchiveFileValue" @@ -842,8 +806,6 @@ object OntologyConstants { val StillImageFileValueHasIIIFBaseUrl: IRI = KnoraApiV2PrefixExpansion + "stillImageFileValueHasIIIFBaseUrl" val StillImageFileValueHasExternalUrl: IRI = KnoraApiV2PrefixExpansion + "stillImageFileValueHasExternalUrl" - val AudioFileValueHasDuration: IRI = KnoraApiV2PrefixExpansion + "audioFileValueHasDuration" - val IntervalValueHasStart: IRI = KnoraApiV2PrefixExpansion + "intervalValueHasStart" val IntervalValueHasEnd: IRI = KnoraApiV2PrefixExpansion + "intervalValueHasEnd" @@ -917,21 +879,13 @@ object OntologyConstants { val ResourceIcon: IRI = KnoraApiV2PrefixExpansion + "resourceIcon" - val BelongsToOntology: IRI = KnoraApiV2PrefixExpansion + "belongsToOntology" - - val HasShortname: IRI = KnoraApiV2PrefixExpansion + "hasShortname" - val HasValue: IRI = KnoraApiV2PrefixExpansion + "hasValue" val HasLinkTo: IRI = KnoraApiV2PrefixExpansion + "hasLinkTo" val HasIncomingLink: IRI = KnoraApiV2PrefixExpansion + "hasIncomingLink" - val IsPartOf: IRI = KnoraApiV2PrefixExpansion + "isPartOf" - val IsRegionOf: IRI = KnoraApiV2PrefixExpansion + "isRegionOf" - val Seqnum: IRI = KnoraApiV2PrefixExpansion + "seqnum" - val HasGeometry: IRI = KnoraApiV2PrefixExpansion + "hasGeometry" - val HasColor: IRI = KnoraApiV2PrefixExpansion + "hasColor" - val HasComment: IRI = KnoraApiV2PrefixExpansion + "hasComment" + val IsPartOf: IRI = KnoraApiV2PrefixExpansion + "isPartOf" + val HasColor: IRI = KnoraApiV2PrefixExpansion + "hasColor" val HasFile: IRI = KnoraApiV2PrefixExpansion + "hasFile" @@ -1073,7 +1027,6 @@ object OntologyConstants { object NamedGraphs { val DataNamedGraphStart: IRI = "http://www.knora.org/data" - val KnoraAdminOntology: InternalIri = InternalIri(KnoraAdminOntologyIri) } object Fuseki {