Skip to content
Permalink
Browse files
fix(groups): update test data and documentation to use language speci…
…fic group descriptions (DEV-123) (#1921)

* Add language to group descriptions

* add language to group descriptions in test data

* Update documentation

* fix failing tests

* add plugin to update data

* update plugin to update data

* improve code

Co-authored-by: Ivan Subotic <400790+subotic@users.noreply.github.com>
  • Loading branch information
irinaschubert and subotic committed Oct 14, 2021
1 parent 32b9e49 commit 0f45b519bd0ce7842bc07633eccd5236f60086f8
@@ -42,7 +42,7 @@ License along with DSP. If not, see <http://www.gnu.org/licenses/>.
- Required permission: SystemAdmin / hasProjectAllAdminPermission
/ hasProjectAllGroupAdminPermission
- Required information: name (unique inside project), project IRI
- Optional information: group description
- Optional information: group descriptions
- Returns information about the newly created group
- TypeScript Docs: groupFormats - CreateGroupApiRequestV1
- POST: `/admin/groups`
@@ -51,7 +51,10 @@ License along with DSP. If not, see <http://www.gnu.org/licenses/>.
```json
{
"name": "NewGroup",
"description": "NewGroupDescription",
"descriptions": [
{"value": "NewGroupDescription", "language": "en"},
{"value": "NeueGruppenBeschreibung", "language": "de"}
],
"project": "http://rdfh.ch/projects/00FF",
"status": true,
"selfjoin": false
@@ -65,7 +68,7 @@ specified by the `id` in the request body as below:
{
"id": "http://rdfh.ch/groups/00FF/a95UWs71KUklnFOe1rcw1w",
"name": "GroupWithCustomIRI",
"description": "A new group with a custom IRI",
"descriptions": [{"value": "A new group with a custom IRI", "language": "en"}],
"project": "http://rdfh.ch/projects/00FF",
"status": true,
"selfjoin": false
@@ -77,15 +80,15 @@ specified by the `id` in the request body as below:
- Required permission: SystemAdmin / hasProjectAllAdminPermission
/ hasProjectAllGroupAdminPermission /
hasProjectRestrictedGroupAdminPermission (for this group)
- Changeable information: `name`, `description`, `selfjoin`
- Changeable information: `name`, `descriptions`, `selfjoin`
- TypeScript Docs: groupFormats - ChangeGroupApiRequestADM
- PUT: `/admin/groups/<groupIri>`
- BODY:

```json
{
"name": "UpdatedGroupName",
"description": "UpdatedGroupDescription",
"descriptions": [{"value": "UpdatedGroupDescription", "language": "en"}],
"selfjoin": false
}
```
@@ -117,7 +120,7 @@ Example Group Information stored in admin named graph: :
<http://rdfh.ch/groups/[shortcode]/[UUID]>
rdf:type knora-admin:UserGroup ;
knora-admin:groupName "Name of the group" ;
knora-admin:groupDescriptions "A description of the group" ;
knora-admin:groupDescriptions "A description of the group"@en ;
knora-admin:belongsToProject <http://rdfh.ch/projects/[UUID]> ;
knora-admin:status "true"^^xsd:boolean ;
knora-admin:hasSelfJoinEnabled "false"^^xsd:boolean .
@@ -569,7 +569,7 @@
] ,
[ rdf:type owl:Restriction ;
owl:onProperty :groupDescriptions ;
owl:maxCardinality "1"^^xsd:nonNegativeInteger
owl:minCardinality "1"^^xsd:nonNegativeInteger
] ,
[ rdf:type owl:Restriction ;
owl:onProperty :status ;
@@ -33,7 +33,7 @@

:attachedToProject knora-admin:SystemProject ;

:ontologyVersion "knora-base v12" .
:ontologyVersion "knora-base v13" .



@@ -204,7 +204,7 @@

knora-admin:groupName "Image reviewer"^^xsd:string ;

knora-admin:groupDescriptions "A group for image reviewers."^^xsd:string ;
knora-admin:groupDescriptions "A group for image reviewers."@en ;

knora-admin:belongsToProject <http://rdfh.ch/projects/00FF> ;

@@ -433,7 +433,7 @@ Die Internetpublikation macht das digitalisierte Korpus dieser Frühdrucke durc

<http://rdfh.ch/groups/0001/thing-searcher> rdf:type knora-admin:UserGroup ;
knora-admin:groupName "Thing searcher"^^xsd:string ;
knora-admin:groupDescriptions "A group for thing searchers."^^xsd:string ;
knora-admin:groupDescriptions "A group for thing searchers."@en ;
knora-admin:belongsToProject <http://rdfh.ch/projects/0001> ;
knora-admin:status "true"^^xsd:boolean ;
knora-admin:hasSelfJoinEnabled "true"^^xsd:boolean .
@@ -20,28 +20,28 @@

<http://rdfh.ch/groups/0105/drawings-gods-meta-annotators> rdf:type knora-admin:UserGroup ;
knora-admin:groupName "Meta-annotators"^^xsd:string ;
knora-admin:groupDescriptions "A group of users allowed to annotate data. Does not upload images nor files. Does not access to personal data."^^xsd:string ;
knora-admin:groupDescriptions "A group of users allowed to annotate data. Does not upload images nor files. Does not access to personal data."@en ;
knora-admin:belongsToProject <http://rdfh.ch/projects/0105> ;
knora-admin:status "true"^^xsd:boolean ;
knora-admin:hasSelfJoinEnabled "false"^^xsd:boolean .

<http://rdfh.ch/groups/0105/drawings-gods-add-drawings> rdf:type knora-admin:UserGroup ;
knora-admin:groupName "Drawings contributors"^^xsd:string ;
knora-admin:groupDescriptions "A group of users allowed to upload images, files and annotate data. Does not access to personal data."^^xsd:string ;
knora-admin:groupDescriptions "A group of users allowed to upload images, files and annotate data. Does not access to personal data."@en ;
knora-admin:belongsToProject <http://rdfh.ch/projects/0105> ;
knora-admin:status "true"^^xsd:boolean ;
knora-admin:hasSelfJoinEnabled "false"^^xsd:boolean .

<http://rdfh.ch/groups/0105/drawings-gods-snf-team> rdf:type knora-admin:UserGroup ;
knora-admin:groupName "SNF team"^^xsd:string ;
knora-admin:groupDescriptions "A core group of members from the SNF project. Access to any data, including sensitive."^^xsd:string ;
knora-admin:groupDescriptions "A core group of members from the SNF project. Access to any data, including sensitive."@en ;
knora-admin:belongsToProject <http://rdfh.ch/projects/0105> ;
knora-admin:status "true"^^xsd:boolean ;
knora-admin:hasSelfJoinEnabled "false"^^xsd:boolean .

<http://rdfh.ch/groups/0105/drawings-gods-admin> rdf:type knora-admin:UserGroup ;
knora-admin:groupName "Administrators"^^xsd:string ;
knora-admin:groupDescriptions "A custom admin group created to apply permission precedence rules. Replaces the built-in knora-admin:ProjectAdmin group, not used for this project."^^xsd:string ;
knora-admin:groupDescriptions "A custom admin group created to apply permission precedence rules. Replaces the built-in knora-admin:ProjectAdmin group, not used for this project."@en ;
knora-admin:belongsToProject <http://rdfh.ch/projects/0105> ;
knora-admin:status "true"^^xsd:boolean ;
knora-admin:hasSelfJoinEnabled "false"^^xsd:boolean .
@@ -25,42 +25,42 @@

<http://rdfh.ch/groups/0113/lumieres-lausanne-user> rdf:type knora-admin:UserGroup ;
knora-admin:groupName "Utilisateur"^^xsd:string ;
knora-admin:groupDescriptions """Statut permanent. Attribué à toute personne désireuse de s'enregistrer. N'est membre d'aucun autre groupe (étudiant, chercheur). Par rapport au visiteur anonyme sans login, accès supplémentaire à la gestion des collections, aux transcriptions/documents joints/projets slmt si autorisation."""^^xsd:string ;
knora-admin:groupDescriptions """Statut permanent. Attribué à toute personne désireuse de s'enregistrer. N'est membre d'aucun autre groupe (étudiant, chercheur). Par rapport au visiteur anonyme sans login, accès supplémentaire à la gestion des collections, aux transcriptions/documents joints/projets slmt si autorisation."""@fr ;
knora-admin:belongsToProject <http://rdfh.ch/projects/0113> ;
knora-admin:status "true"^^xsd:boolean ;
knora-admin:hasSelfJoinEnabled "false"^^xsd:boolean .

<http://rdfh.ch/groups/0113/lumieres-lausanne-student> rdf:type knora-admin:UserGroup ;
knora-admin:groupName "Etudiant"^^xsd:string ;
knora-admin:groupDescriptions """Statut temporaire. Uniquement les étudiants UNIL liés à un séminaire donné dans le cadre du projet Lumières.Lausanne. Ont reçu les consignes ainsi qu'une initiation (obligatoire). A la fin du séminaire, leur statut est changé en statut "Utilisateur", sauf demande particulière."""^^xsd:string ;
knora-admin:groupDescriptions """Statut temporaire. Uniquement les étudiants UNIL liés à un séminaire donné dans le cadre du projet Lumières.Lausanne. Ont reçu les consignes ainsi qu'une initiation (obligatoire). A la fin du séminaire, leur statut est changé en statut "Utilisateur", sauf demande particulière."""@fr ;
knora-admin:belongsToProject <http://rdfh.ch/projects/0113> ;
knora-admin:status "true"^^xsd:boolean ;
knora-admin:hasSelfJoinEnabled "false"^^xsd:boolean .

<http://rdfh.ch/groups/0113/lumieres-lausanne-researcher> rdf:type knora-admin:UserGroup ;
knora-admin:groupName "Chercheur"^^xsd:string ;
knora-admin:groupDescriptions "Statut permanent. Doctorants, professeurs, autres chercheurs qui ont reçu préalablement l'autorisation d'un directeur. Ont reçu les consignes (obligatoire), et si possible une initiation."^^xsd:string ;
knora-admin:groupDescriptions "Statut permanent. Doctorants, professeurs, autres chercheurs qui ont reçu préalablement l'autorisation d'un directeur. Ont reçu les consignes (obligatoire), et si possible une initiation."@fr ;
knora-admin:belongsToProject <http://rdfh.ch/projects/0113> ;
knora-admin:status "true"^^xsd:boolean ;
knora-admin:hasSelfJoinEnabled "false"^^xsd:boolean .

<http://rdfh.ch/groups/0113/lumieres-lausanne-phdstudent> rdf:type knora-admin:UserGroup ;
knora-admin:groupName "Doctorant"^^xsd:string ;
knora-admin:groupDescriptions "Statut temporaire. Doctorants et étudiants-assistants directement liés au Projet Lumières.Lausanne. Ont reçu les consignes ainsi qu'une initiation (obligatoire). Une fois leur mandat terminé, passent en statut Chercheur."^^xsd:string ;
knora-admin:groupDescriptions "Statut temporaire. Doctorants et étudiants-assistants directement liés au Projet Lumières.Lausanne. Ont reçu les consignes ainsi qu'une initiation (obligatoire). Une fois leur mandat terminé, passent en statut Chercheur."@fr ;
knora-admin:belongsToProject <http://rdfh.ch/projects/0113> ;
knora-admin:status "true"^^xsd:boolean ;
knora-admin:hasSelfJoinEnabled "false"^^xsd:boolean .

<http://rdfh.ch/groups/0113/lumieres-lausanne-director> rdf:type knora-admin:UserGroup ;
knora-admin:groupName "Directeur"^^xsd:string ;
knora-admin:groupDescriptions "Béla Kapossy, Béatrice Lovis."^^xsd:string ;
knora-admin:groupDescriptions "Béla Kapossy, Béatrice Lovis."@fr ;
knora-admin:belongsToProject <http://rdfh.ch/projects/0113> ;
knora-admin:status "true"^^xsd:boolean ;
knora-admin:hasSelfJoinEnabled "false"^^xsd:boolean .

<http://rdfh.ch/groups/0113/lumieres-lausanne-administrator> rdf:type knora-admin:UserGroup ;
knora-admin:groupName "Administrateur"^^xsd:string ;
knora-admin:groupDescriptions "Béatrice Lovis."^^xsd:string ;
knora-admin:groupDescriptions "Béatrice Lovis."@fr ;
knora-admin:belongsToProject <http://rdfh.ch/projects/0113> ;
knora-admin:status "true"^^xsd:boolean ;
knora-admin:hasSelfJoinEnabled "false"^^xsd:boolean .
@@ -9,5 +9,6 @@ filegroup(
"pr1372.trig",
"pr1615.trig",
"pr1746.trig",
"pr1921.trig",
],
)
@@ -0,0 +1,55 @@
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix knora-admin: <http://www.knora.org/ontology/knora-admin#> .

<http://rdfh.ch/projects/0105> a knora-admin:knoraProject ;
knora-admin:projectLongname "Test Project"^^xsd:string ;
knora-admin:projectShortname "test-project"^^xsd:string ;
knora-admin:projectShortcode "0105"^^xsd:string ;
knora-admin:projectDescription "Project description"^^xsd:string ;
knora-admin:projectKeywords "Keyword"^^xsd:string ;
knora-admin:status "true"^^xsd:boolean ;
knora-admin:hasSelfJoinEnabled "false"^^xsd:boolean .

<http://rdfh.ch/groups/0105/group-without-language-attribute-1> rdf:type knora-admin:UserGroup ;
knora-admin:groupName "Group without language string 1"^^xsd:string ;
knora-admin:groupDescriptions "A group description without language attribute."^^xsd:string ;
knora-admin:belongsToProject <http://rdfh.ch/projects/0105> ;
knora-admin:status "true"^^xsd:boolean ;
knora-admin:hasSelfJoinEnabled "false"^^xsd:boolean .

<http://rdfh.ch/groups/0105/group-without-language-attribute-2> rdf:type knora-admin:UserGroup ;
knora-admin:groupName "Group without language string 2"^^xsd:string ;
knora-admin:groupDescriptions "A group description without language attribute." ;
knora-admin:belongsToProject <http://rdfh.ch/projects/0105> ;
knora-admin:status "true"^^xsd:boolean ;
knora-admin:hasSelfJoinEnabled "false"^^xsd:boolean .

<http://rdfh.ch/groups/0105/group-without-language-attribute-3> rdf:type knora-admin:UserGroup ;
knora-admin:groupName "Group without language string 3"^^xsd:string ;
knora-admin:groupDescription "A group description with old predicate name and without language attribute."^^xsd:string ;
knora-admin:belongsToProject <http://rdfh.ch/projects/0105> ;
knora-admin:status "true"^^xsd:boolean ;
knora-admin:hasSelfJoinEnabled "false"^^xsd:boolean .

<http://rdfh.ch/groups/0105/group-without-language-attribute-4> rdf:type knora-admin:UserGroup ;
knora-admin:groupName "Group without language string 4"^^xsd:string ;
knora-admin:groupDescription "A group description with old predicate name and without language attribute." ;
knora-admin:belongsToProject <http://rdfh.ch/projects/0105> ;
knora-admin:status "true"^^xsd:boolean ;
knora-admin:hasSelfJoinEnabled "false"^^xsd:boolean .

<http://rdfh.ch/groups/0105/group-with-language-attribute-de> rdf:type knora-admin:UserGroup ;
knora-admin:groupName "Group with language string"^^xsd:string ;
knora-admin:groupDescriptions "Eine Gruppe mit Sprachattribut."@de ;
knora-admin:belongsToProject <http://rdfh.ch/projects/0105> ;
knora-admin:status "true"^^xsd:boolean ;
knora-admin:hasSelfJoinEnabled "false"^^xsd:boolean .

<http://rdfh.ch/groups/0105/group-with-language-attribute-en> rdf:type knora-admin:UserGroup ;
knora-admin:groupName "Group with language string"^^xsd:string ;
knora-admin:groupDescriptions "A group with language attribute."@en ;
knora-admin:belongsToProject <http://rdfh.ch/projects/0105> ;
knora-admin:status "true"^^xsd:boolean ;
knora-admin:hasSelfJoinEnabled "false"^^xsd:boolean .

@@ -25,7 +25,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 v12"
val KnoraBaseVersion: String = "knora-base v13"

/**
* `IRI` is a synonym for `String`, used to improve code readability.
@@ -43,7 +43,11 @@ object RepositoryUpdatePlan {
PluginForKnoraBaseVersion(versionNumber = 9, plugin = new UpgradePluginPR1746(featureFactoryConfig, log)),
PluginForKnoraBaseVersion(versionNumber = 10, plugin = new NoopPlugin), // PR 1808
PluginForKnoraBaseVersion(versionNumber = 11, plugin = new NoopPlugin), // PR 1813
PluginForKnoraBaseVersion(versionNumber = 12, plugin = new NoopPlugin) // PR 1891
PluginForKnoraBaseVersion(versionNumber = 12, plugin = new NoopPlugin), // PR 1891
PluginForKnoraBaseVersion(
versionNumber = 13,
plugin = new UpgradePluginPR1921(featureFactoryConfig, log)
) // PR 1921
)

/**
Loading

0 comments on commit 0f45b51

Please sign in to comment.