Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: add isSequenceOf to knora-base ontology (DEV-745) #2061

Merged
merged 59 commits into from Aug 3, 2022
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
efd60f8
add isSequenceOf to knora-base ontology
BalduinLandolt Apr 28, 2022
15b9ed9
Merge branch 'main' into wip/DEV-745-add-issequenceof
BalduinLandolt May 9, 2022
c056212
add hasSequenceBounds to knora-base
BalduinLandolt May 9, 2022
e688ccb
bump knora-base version
BalduinLandolt May 9, 2022
2238cc0
Merge branch 'main' into wip/DEV-745-add-issequenceof
BalduinLandolt May 10, 2022
c226b6e
Merge branch 'main' into wip/DEV-745-add-issequenceof
BalduinLandolt May 19, 2022
0d4df70
Merge branch 'main' into wip/DEV-745-add-issequenceof
BalduinLandolt May 30, 2022
be7de69
Merge branch 'main' into wip/DEV-745-add-issequenceof
BalduinLandolt Jul 11, 2022
05dc3a8
better error messages
BalduinLandolt Jul 12, 2022
3e403b6
test: write test to create isSequenceOf resource classes for video re…
BalduinLandolt Jul 13, 2022
9a6117b
update testdata according to modified knora-base ontology
BalduinLandolt Jul 13, 2022
51c9520
Merge branch 'main' into wip/DEV-745-add-issequenceof
BalduinLandolt Jul 13, 2022
786e850
test: add test for audio sequence in ontology
BalduinLandolt Jul 13, 2022
5459a4f
make ontology model slightly slimmer
BalduinLandolt Jul 13, 2022
e64d0ff
add sequence bounds property to ontology tests
BalduinLandolt Jul 13, 2022
165983d
fix minor oversights in knora-base
BalduinLandolt Jul 14, 2022
053f2b1
minor refactorings
BalduinLandolt Jul 14, 2022
e687c7e
start working on a test ontology and dataset for sequences
BalduinLandolt Jul 14, 2022
2e8b30e
add ontology constants
BalduinLandolt Jul 14, 2022
c688cea
add test for dynamically creating a video resource
BalduinLandolt Jul 14, 2022
30447b7
bump API version again
BalduinLandolt Jul 14, 2022
b7ebfc6
add audio (including subclasses of isSequenceOf etc.) to sequences on…
BalduinLandolt Jul 14, 2022
754e5fb
add audio resource to sequences data
BalduinLandolt Jul 14, 2022
d0dc2c7
add tests for audio sequences with ontology-specific sub-props of isS…
BalduinLandolt Jul 14, 2022
25b0744
Merge branch 'main' into wip/DEV-745-add-issequenceof
BalduinLandolt Jul 14, 2022
20b60e4
refactor: remove some code duplication
BalduinLandolt Jul 14, 2022
7c68bfc
create client test data
BalduinLandolt Jul 14, 2022
111da4b
add newly created test data to list of expected test data
BalduinLandolt Jul 14, 2022
384ec70
add noop upgrade plugin
BalduinLandolt Jul 18, 2022
f63d2e5
use Validation in OntologyHelpers
BalduinLandolt Jul 18, 2022
08a3875
Merge branch 'main' into wip/DEV-745-add-issequenceof
BalduinLandolt Jul 18, 2022
af494c8
replace more throws with validations
BalduinLandolt Jul 19, 2022
cabec10
fix validation
BalduinLandolt Jul 19, 2022
7d0cea1
createPropertyCommand value object in schema slice
BalduinLandolt Jul 19, 2022
8458dec
Merge branch 'main' into wip/DEV-745-add-issequenceof
BalduinLandolt Jul 19, 2022
05c2820
remove client test data
BalduinLandolt Jul 20, 2022
6b7443f
add isSequenceOf to anything ontology
BalduinLandolt Jul 20, 2022
7862db2
update test data to change anything ontology
BalduinLandolt Jul 20, 2022
3004db1
Merge branch 'main' into wip/DEV-745-add-issequenceof
BalduinLandolt Jul 25, 2022
7a376de
add unit tests to ontology part of the changes
BalduinLandolt Jul 25, 2022
e489f1e
add documentation
BalduinLandolt Jul 25, 2022
cdfa1d5
Merge branch 'main' into wip/DEV-745-add-issequenceof
BalduinLandolt Jul 26, 2022
e5a02a3
first improvements according to review
BalduinLandolt Jul 26, 2022
cd3f5ab
Update LangString.scala
BalduinLandolt Jul 26, 2022
236c10e
improve LangString value object
BalduinLandolt Jul 26, 2022
9e6309c
add tests for LangString value object
BalduinLandolt Jul 26, 2022
fe5d934
move language code error messages in the right place
BalduinLandolt Jul 26, 2022
b2c4ef4
add documentation to SchemaCommands
BalduinLandolt Jul 26, 2022
ad86d69
add tests for SchemaCommands
BalduinLandolt Jul 26, 2022
9a6778f
rename V3 smartIri in OntologiesRoute
BalduinLandolt Jul 26, 2022
45b94a8
Merge branch 'main' into wip/DEV-745-add-issequenceof
BalduinLandolt Jul 27, 2022
a7d5fe5
apply feedback from review
BalduinLandolt Jul 27, 2022
87b563e
Merge branch 'main' into wip/DEV-745-add-issequenceof
subotic Jul 29, 2022
287e2e1
Merge branch 'main' into wip/DEV-745-add-issequenceof
BalduinLandolt Aug 2, 2022
ddd13cb
fix problems after merge conflicts
BalduinLandolt Aug 2, 2022
95a8532
Merge branch 'main' into wip/DEV-745-add-issequenceof
BalduinLandolt Aug 2, 2022
10f1a4d
add logging to unsafeMake
BalduinLandolt Aug 3, 2022
fedaadc
Merge branch 'main' into wip/DEV-745-add-issequenceof
BalduinLandolt Aug 3, 2022
74e20de
tidy up language code stuff
BalduinLandolt Aug 3, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
42 changes: 39 additions & 3 deletions knora-ontologies/knora-base.ttl
Expand Up @@ -19,7 +19,7 @@
rdf:type owl:Ontology ;
rdfs:label "The Knora base ontology"@en ;
:attachedToProject knora-admin:SystemProject ;
:ontologyVersion "knora-base v23" .
:ontologyVersion "knora-base v24" .


#################################################################
Expand Down Expand Up @@ -573,6 +573,29 @@
rdfs:subPropertyOf :hasLinkToValue .


### 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 "Indicates that this resource is a sequence of a video or audio resource"@en ;
:subjectClassConstraint :Resource ;
:objectClassConstraint :Resource ;
rdfs:subPropertyOf :hasLinkTo .


### http://www.knora.org/ontology/knora-base#isSequenceOfValue

:isSequenceOfValue
rdf:type owl:ObjectProperty ;
:objectClassConstraint :LinkValue ;
:subjectClassConstraint :Resource ;
rdfs:subPropertyOf :hasLinkToValue .


### http://www.knora.org/ontology/knora-base#isRegionOf

:isRegionOf
Expand Down Expand Up @@ -623,7 +646,18 @@
"Sequence number"@en,
"Numéro de séquence"@fr,
"Numero di sequenza"@it ;
rdfs:comment "Indicates the position of a resource within a sequence"@en .
rdfs:comment "Indicates the position of a resource within a compound object. Typically used to indicate the order of pages within a book or similar resource."@en .


### http://www.knora.org/ontology/knora-base#hasSequenceBounds

:hasSequenceBounds
rdf:type owl:ObjectProperty ;
:objectClassConstraint :IntervalValue ;
rdfs:subPropertyOf :hasValue ;
rdfs:label "Sequenz-Grenzen"@de,
"Sequence Bounds"@en;
rdfs:comment "Indicates the bounds of a sequence, i.e. the start and end point in the containing resource."@en .


### http://www.knora.org/ontology/knora-base#standoffTagHasOriginalXMLID
Expand Down Expand Up @@ -1581,6 +1615,8 @@
rdfs:comment "Represents a time interval, e.g. in an audio recording"@en .


### http://www.knora.org/ontology/knora-base#TimeBase

:TimeBase
rdf:type owl:Class ;
rdfs:subClassOf :ValueBase,
Expand All @@ -1589,7 +1625,7 @@
owl:cardinality "1"^^xsd:nonNegativeInteger ] .


### http://www.knora.org/ontology/knora-base#IntervalValue
### http://www.knora.org/ontology/knora-base#TimeValue

:TimeValue
rdf:type owl:Class ;
Expand Down
96 changes: 96 additions & 0 deletions test_data/all_data/sequences-data.ttl
@@ -0,0 +1,96 @@
@prefix s: <http://www.knora.org/ontology/0001/sequences#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix knora-base: <http://www.knora.org/ontology/knora-base#> .
@prefix salsah-gui: <http://www.knora.org/ontology/salsah-gui#> .


# audio-01 resource
<http://rdfh.ch/0001/audio-01>
a s:Audio ;
knora-base:attachedToUser <http://rdfh.ch/users/9XBCrDV3SRa7kS1WwynB4Q> ;
knora-base:attachedToProject <http://rdfh.ch/projects/0001> ;
knora-base:hasPermissions "V knora-admin:UnknownUser|M knora-admin:ProjectMember" ;
knora-base:creationDate "2022-07-13T16:21:34Z"^^xsd:dateTime ;
rdfs:label "an audio instance" ;
s:hasTitle <http://rdfh.ch/0001/audio-01/values/ZHGLzD0rSfyVzfUG0ck4aw> ;
knora-base:isDeleted false .

# title value of audio-01 resource
<http://rdfh.ch/0001/audio-01/values/ZHGLzD0rSfyVzfUG0ck4aw>
a knora-base:TextValue ;
knora-base:valueHasUUID "ZHGLzD0rSfyVzfUG0ck4aw"^^xsd:string ;
knora-base:valueCreationDate "2022-07-13T16:21:34Z"^^xsd:dateTime ;
knora-base:valueHasOrder 0 ;
knora-base:valueHasString "Audio Title" ;
knora-base:hasPermissions "V knora-admin:UnknownUser|M knora-admin:ProjectMember" ;
knora-base:attachedToUser <http://rdfh.ch/users/9XBCrDV3SRa7kS1WwynB4Q> ;
knora-base:isDeleted false .


# video-01 resource
<http://rdfh.ch/0001/video-01>
a s:Video ;
knora-base:attachedToUser <http://rdfh.ch/users/9XBCrDV3SRa7kS1WwynB4Q> ;
knora-base:attachedToProject <http://rdfh.ch/projects/0001> ;
knora-base:hasPermissions "V knora-admin:UnknownUser|M knora-admin:ProjectMember" ;
knora-base:creationDate "2022-07-13T16:21:34Z"^^xsd:dateTime ;
rdfs:label "a video instance" ;
s:hasTitle <http://rdfh.ch/0001/video-01/values/BKkJutVSTK-EU8fkc2tgLg> ;
knora-base:isDeleted false .

# title value of video-01 resource
<http://rdfh.ch/0001/video-01/values/BKkJutVSTK-EU8fkc2tgLg>
a knora-base:TextValue ;
knora-base:valueHasUUID "BKkJutVSTK-EU8fkc2tgLg"^^xsd:string ;
knora-base:valueCreationDate "2022-07-13T16:21:34Z"^^xsd:dateTime ;
knora-base:valueHasOrder 0 ;
knora-base:valueHasString "Video Title" ;
knora-base:hasPermissions "V knora-admin:UnknownUser|M knora-admin:ProjectMember" ;
knora-base:attachedToUser <http://rdfh.ch/users/9XBCrDV3SRa7kS1WwynB4Q> ;
knora-base:isDeleted false .


# sequence of video-01
<http://rdfh.ch/0001/video-sequence-01>
a s:VideoSequence ;
knora-base:attachedToUser <http://rdfh.ch/users/9XBCrDV3SRa7kS1WwynB4Q> ;
knora-base:attachedToProject <http://rdfh.ch/projects/0001> ;
knora-base:hasPermissions "V knora-admin:UnknownUser|M knora-admin:ProjectMember" ;
knora-base:creationDate "2022-07-13T16:21:34Z"^^xsd:dateTime ;
rdfs:label "a video sequence instance" ;
knora-base:isSequenceOf <http://rdfh.ch/0001/video-01> ;
knora-base:isSequenceOfValue <http://rdfh.ch/0001/video-sequence-01/values/6CKp1AmZT1SRHYeSOUaJjA> ;
knora-base:hasSequenceBounds <http://rdfh.ch/0001/video-sequence-01/values/vEDim4wvSfGnhSvX6fXcaA> ;
knora-base:isDeleted false .

# reification of the isSequenceOf link from video-sequence-01 to video-01
<http://rdfh.ch/0001/video-sequence-01/values/6CKp1AmZT1SRHYeSOUaJjA>
a knora-base:LinkValue ;
knora-base:valueHasUUID "6CKp1AmZT1SRHYeSOUaJjA"^^xsd:string ;
rdf:subject <http://rdfh.ch/0001/video-sequence-01> ;
rdf:predicate s:isSequenceOf ;
rdf:object <http://rdfh.ch/0001/video-01> ;
knora-base:attachedToUser <http://rdfh.ch/users/9XBCrDV3SRa7kS1WwynB4Q> ;
knora-base:hasPermissions "V knora-admin:UnknownUser|M knora-admin:ProjectMember" ;
knora-base:valueCreationDate "2022-07-13T16:21:34Z"^^xsd:dateTime ;
knora-base:valueHasString "http://rdfh.ch/0001/video-01" ;
knora-base:valueHasRefCount "1"^^xsd:int ;
knora-base:isDeleted false .

# sequence bounds interval of video-sequence-01
<http://rdfh.ch/0001/video-sequence-01/values/vEDim4wvSfGnhSvX6fXcaA>
a knora-base:IntervalValue ;
knora-base:valueHasUUID "vEDim4wvSfGnhSvX6fXcaA"^^xsd:string ;
knora-base:valueCreationDate "2022-07-13T16:21:34Z"^^xsd:dateTime ;
knora-base:valueHasIntervalEnd "100"^^xsd:decimal ;
knora-base:valueHasIntervalStart "0"^^xsd:decimal ;
knora-base:valueHasOrder 0 ;
knora-base:valueHasString "0 - 100" ;
knora-base:hasPermissions "V knora-admin:UnknownUser|M knora-admin:ProjectMember" ;
knora-base:attachedToUser <http://rdfh.ch/users/9XBCrDV3SRa7kS1WwynB4Q> ;
knora-base:isDeleted false .
118 changes: 118 additions & 0 deletions test_data/ontologies/sequences-onto.ttl
@@ -0,0 +1,118 @@
@prefix : <http://www.knora.org/ontology/0001/sequences#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix knora-base: <http://www.knora.org/ontology/knora-base#> .
@prefix salsah-gui: <http://www.knora.org/ontology/salsah-gui#> .
@base <http://www.knora.org/ontology/0001/sequences> .

# A trivial ontology to test isSequenceOf relations

<http://www.knora.org/ontology/0001/sequences>
rdf:type owl:Ontology ;
rdfs:label "The sequences ontology" ;
knora-base:attachedToProject <http://rdfh.ch/projects/0001> ;
knora-base:lastModificationDate "2022-07-13T16:21:34Z"^^xsd:dateTime .

:Video
rdf:type owl:Class ;
rdfs:subClassOf knora-base:MovingImageRepresentation,
[ rdf:type owl:Restriction ;
owl:onProperty :hasTitle ;
owl:cardinality "1"^^xsd:nonNegativeInteger ;
salsah-gui:guiOrder "0"^^xsd:nonNegativeInteger ] ;
rdfs:label "Video"@en ;
rdfs:comment "A video resource."@en .

:Audio
rdf:type owl:Class ;
rdfs:subClassOf knora-base:AudioRepresentation,
[ rdf:type owl:Restriction ;
owl:onProperty :hasTitle ;
owl:cardinality "1"^^xsd:nonNegativeInteger ;
salsah-gui:guiOrder "0"^^xsd:nonNegativeInteger ] ;
rdfs:label "Audio"@en ;
rdfs:comment "An audio resource."@en .


:VideoSequence
rdf:type owl:Class ;
rdfs:subClassOf knora-base:Resource,
[ rdf:type owl:Restriction ;
owl:onProperty knora-base:isSequenceOf ;
owl:cardinality "1"^^xsd:nonNegativeInteger ;
salsah-gui:guiOrder "0"^^xsd:nonNegativeInteger ],
[ rdf:type owl:Restriction ;
owl:onProperty knora-base:isSequenceOfValue ;
owl:cardinality "1"^^xsd:nonNegativeInteger ;
salsah-gui:guiOrder "0"^^xsd:nonNegativeInteger ],
[ rdf:type owl:Restriction ;
owl:onProperty knora-base:hasSequenceBounds ;
owl:cardinality "1"^^xsd:nonNegativeInteger ;
salsah-gui:guiOrder "0"^^xsd:nonNegativeInteger ] ;
rdfs:label "Sequence"@en ;
rdfs:comment "Sequence of a Video."@en .

:AudioSequence
rdf:type owl:Class ;
rdfs:subClassOf knora-base:Resource,
[ rdf:type owl:Restriction ;
owl:onProperty :isAnnotatedSequenceOfAudio ;
owl:cardinality "1"^^xsd:nonNegativeInteger ;
salsah-gui:guiOrder "0"^^xsd:nonNegativeInteger ],
[ rdf:type owl:Restriction ;
owl:onProperty :isAnnotatedSequenceOfAudioValue ;
owl:cardinality "1"^^xsd:nonNegativeInteger ;
salsah-gui:guiOrder "0"^^xsd:nonNegativeInteger ],
[ rdf:type owl:Restriction ;
owl:onProperty :hasCustomSequenceBounds ;
owl:cardinality "1"^^xsd:nonNegativeInteger ;
salsah-gui:guiOrder "0"^^xsd:nonNegativeInteger ] ;
rdfs:label "Sequence"@en ;
rdfs:comment "Sequence of a Video."@en .


:hasTitle
rdf:type owl:ObjectProperty ;
rdfs:label "has title"@en ;
rdfs:comment "has a title"@en ;
rdfs:subPropertyOf knora-base:hasValue ;
knora-base:subjectClassConstraint knora-base:Resource ;
knora-base:objectClassConstraint knora-base:TextValue ;
salsah-gui:guiElement salsah-gui:SimpleText ;
salsah-gui:guiAttribute "size=80",
"maxlength=255" .


:isAnnotatedSequenceOfAudio
rdf:type owl:ObjectProperty ;
rdfs:label "isAnnotatedSequenceOfAudio"@en ;
rdfs:comment "annotated sub-sequence of an audio resource"@en ;
rdfs:subPropertyOf knora-base:isSequenceOf ;
knora-base:subjectClassConstraint :AudioSequence ;
knora-base:objectClassConstraint :Audio ;
salsah-gui:guiElement salsah-gui:Searchbox .


:isAnnotatedSequenceOfAudioValue
rdf:type owl:ObjectProperty ;
rdfs:label "isAnnotatedSequenceOfAudio"@en ;
rdfs:comment "annotated sub-sequence of an audio resource"@en ;
rdfs:subPropertyOf knora-base:isSequenceOfValue ;
knora-base:subjectClassConstraint :AudioSequence ;
knora-base:objectClassConstraint knora-base:LinkValue ;
salsah-gui:guiElement salsah-gui:Searchbox .


:hasCustomSequenceBounds
rdf:type owl:ObjectProperty ;
rdfs:label "hasCustomSequenceBounds"@en ;
rdfs:comment "custom subclass of sequence bounds"@en ;
rdfs:subPropertyOf knora-base:hasSequenceBounds ;
knora-base:subjectClassConstraint :AudioSequence ;
knora-base:objectClassConstraint knora-base:IntervalValue ;
salsah-gui:guiElement salsah-gui:Interval .