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

fix: Value update or deletion doesn't work for properties of other ontology (DEV-1367) #2222

Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
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
Expand Up @@ -12,8 +12,8 @@ client code without the need for a running Knora instance.

## Implementation

Client test data is generated as a side effect of running Knora's E2E tests.
E2E tests use `ClientTestDataCollector` to collect test API requests and
Client test data is generated as a side effect of running E2E tests.
E2E tests use `ClientTestDataCollector` to collect API requests and
responses. The implementation of `ClientTestDataCollector` collects these
in a Redis hash. When the E2E tests have completed, the script
`webapi/scripts/dump-client-test-data.sh` saves the collected test data
Expand All @@ -35,9 +35,7 @@ make client-test-data
```

When the tests have finished running, you will find the file
`client-test-data.zip` in the current directory.

If generated client test data changes, run `make client-test-data`, then run
`client-test-data.zip` in the current directory. Then, run
this script to update the list of expected test data files:

```
Expand Down
22 changes: 22 additions & 0 deletions test_data/all_data/freetest-data.ttl
Expand Up @@ -8,6 +8,7 @@
@prefix knora-admin: <http://www.knora.org/ontology/knora-admin#> .
@prefix salsah-gui: <http://www.knora.org/ontology/salsah-gui#> .
@prefix freetest: <http://www.knora.org/ontology/0001/freetest#> .
@prefix anything: <http://www.knora.org/ontology/0001/anything#> .
@prefix standoff: <http://www.knora.org/ontology/standoff#> .

# List
Expand Down Expand Up @@ -287,3 +288,24 @@
knora-base:valueHasString "1" ;
knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:KnownUser|RV knora-admin:UnknownUser" ;
knora-base:attachedToUser <http://rdfh.ch/users/BhkfBc3hTeS_IDo-JgXRbQ> .

<http://rdfh.ch/0001/freetest-with-a-property-from-anything-ontology>
a freetest:FreetestWithAPropertyFromAnythingOntology ;
knora-base:attachedToUser <http://rdfh.ch/users/BhkfBc3hTeS_IDo-JgXRbQ> ;
knora-base:attachedToProject <http://rdfh.ch/projects/0001> ;
knora-base:hasPermissions "V knora-admin:UnknownUser|M knora-admin:ProjectMember" ;
knora-base:creationDate "2019-11-29T10:00:00.673298Z"^^xsd:dateTime ;
rdfs:label "A FT with a property from an other ontology" ;
anything:hasIntegerUsedByOtherOntologies <http://rdfh.ch/0001/freetest-with-a-property-from-anything-ontology/values/CYWRc1iuQ3-pKgIZ1RPasA> ;
knora-base:isDeleted false .
irinaschubert marked this conversation as resolved.
Show resolved Hide resolved

<http://rdfh.ch/0001/freetest-with-a-property-from-anything-ontology/values/CYWRc1iuQ3-pKgIZ1RPasA>
a knora-base:IntValue ;
knora-base:valueHasUUID "CYWRc1iuQ3-pKgIZ1RPasA"^^xsd:string ;
knora-base:isDeleted false ;
knora-base:valueCreationDate "2018-05-28T15:52:03.897Z"^^xsd:dateTime ;
knora-base:valueHasInteger "1"^^xsd:integer ;
knora-base:valueHasOrder 0 ;
knora-base:valueHasString "1" ;
knora-base:hasPermissions "V knora-admin:UnknownUser|M knora-admin:ProjectMember" ;
knora-base:attachedToUser <http://rdfh.ch/users/BhkfBc3hTeS_IDo-JgXRbQ> .
12 changes: 11 additions & 1 deletion test_data/ontologies/anything-onto.ttl
Expand Up @@ -123,7 +123,17 @@
salsah-gui:guiAttribute "min=0",
"max=-1" .


:hasIntegerUsedByOtherOntologies
rdf:type owl:ObjectProperty ;
rdfs:subPropertyOf knora-base:hasValue ;
rdfs:label "Ganzzahl"@de,
"Nombre entier"@fr,
"Intero"@it,
"Integer"@en ;
knora-base:objectClassConstraint knora-base:IntValue ;
salsah-gui:guiElement salsah-gui:Spinbox ;
salsah-gui:guiAttribute "min=0",
"max=-1" .

:hasDecimal
rdf:type owl:ObjectProperty ;
Expand Down
14 changes: 14 additions & 0 deletions test_data/ontologies/freetest-onto.ttl
Expand Up @@ -6,6 +6,7 @@
@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#> .
@prefix anything: <http://www.knora.org/ontology/0001/anything#> .
@base <http://www.knora.org/ontology/0001/freetest#> .

# A trivial ontology, used only for testing Knora.
Expand Down Expand Up @@ -481,3 +482,16 @@
rdfs:label "Listenobjekt"@de,
"Object with a list value"@en ;
rdfs:comment """A comment for object with a list value"""@en .

:FreetestWithAPropertyFromAnythingOntology
rdf:type owl:Class ;
rdfs:subClassOf knora-base:Resource,
[ rdf:type owl:Restriction ;
owl:onProperty anything:hasIntegerUsedByOtherOntologies ;
owl:minCardinality "0"^^xsd:nonNegativeInteger ;
salsah-gui:guiOrder "1"^^xsd:nonNegativeInteger ] ;
rdfs:label "FTPAO de"@de,
"FTPAO fr"@fr,
"FTPAO it"@it,
"FTPAO en"@en ;
rdfs:comment """A comment for FTPAO."""@de .
20 changes: 20 additions & 0 deletions test_data/ontologyR2RV2/anythingOntologyWithValueObjects.jsonld
Expand Up @@ -2883,6 +2883,26 @@
},
"@id": "anything:hasInteger"
},
{
"rdfs:label": "Integer",
"rdfs:subPropertyOf": {
"@id": "knora-api:hasValue"
},
"knora-api:isEditable": true,
"knora-api:isResourceProperty": true,
"@type": "owl:ObjectProperty",
"salsah-gui:guiAttribute": [
"max=-1",
"min=0"
],
"knora-api:objectType": {
"@id": "knora-api:IntValue"
},
"salsah-gui:guiElement": {
"@id": "salsah-gui:Spinbox"
},
"@id": "anything:hasIntegerUsedByOtherOntologies"
},
{
"rdfs:label": "Time interval",
"rdfs:subPropertyOf": {
Expand Down