Skip to content

Commit

Permalink
fix: bugs in json schema (DEV-1142) (#252)
Browse files Browse the repository at this point in the history
 - resources-only.json: add "Region" and "Representation" as base resources
 - define super-resource in a non-recurring way
 - harmonization between all 4 schema files
 - improve: "format": "uri" has no effect --> needs a regex
 - expand test data:
    - URI as "super" of a resource
    - properties.xlsx: hasLinkTo: Resource, Region, StillImageRepresentation, AudioRepresentation, MovingImageRepresentation, ArchiveRepresentation
 - remove excelfileref
 - disallow nested excelfolderref: must be on top hierarchy level
 - remove redundancy of definitions/label, definitions/comment, definitions/description
 - langstring: make at least one language mandatory
 - take URI into account in the conditions for the super-properties
  • Loading branch information
jnussbaum committed Nov 11, 2022
1 parent 7947dec commit 92af830
Show file tree
Hide file tree
Showing 8 changed files with 366 additions and 303 deletions.
66 changes: 9 additions & 57 deletions knora/dsplib/schemas/lists-only.json
Expand Up @@ -11,18 +11,7 @@
"type": "string"
}
},
"additionalProperties": false
},
"label": {
"$ref": "#/definitions/langstring"
},
"comment": {
"type": "object",
"patternProperties": {
"^(en|de|fr|it|rm)$": {
"type": "string"
}
},
"minProperties": 1,
"additionalProperties": false
},
"node": {
Expand All @@ -32,29 +21,17 @@
"type": "string"
},
"labels": {
"$ref": "#/definitions/label"
"$ref": "#/definitions/langstring"
},
"comments": {
"$ref": "#/definitions/comment"
"$ref": "#/definitions/langstring"
},
"nodes": {
"type": "array",
"minItems": 1,
"oneOf": [
{
"type": "array",
"items": {
"$ref": "#/definitions/node"
}
},
{
"type": "object",
"$ref": "#/definitions/excelfileref"
},
{
"type": "object",
"$ref": "#/definitions/excelfolderref"
}
]
"items": {
"$ref": "#/definitions/node"
}
}
},
"required": [
Expand All @@ -63,27 +40,6 @@
],
"additionalProperties": false
},
"excelfileref": {
"type": "object",
"properties": {
"file": {
"type": "string"
},
"worksheet": {
"type": "string"
},
"startrow": {
"type": "integer"
},
"startcol": {
"type": "integer"
}
},
"required": [
"file",
"worksheet"
]
},
"excelfolderref": {
"type": "object",
"properties": {
Expand All @@ -107,10 +63,10 @@
"type": "string"
},
"labels": {
"$ref": "#/definitions/label"
"$ref": "#/definitions/langstring"
},
"comments": {
"$ref": "#/definitions/comment"
"$ref": "#/definitions/langstring"
},
"nodes": {
"oneOf": [
Expand All @@ -120,10 +76,6 @@
"$ref": "#/definitions/node"
}
},
{
"type": "object",
"$ref": "#/definitions/excelfileref"
},
{
"type": "object",
"$ref": "#/definitions/excelfolderref"
Expand Down

0 comments on commit 92af830

Please sign in to comment.