Skip to content

Commit

Permalink
Merge commit 'c770113803401fd376492372cad33d76facdef4f'
Browse files Browse the repository at this point in the history
  • Loading branch information
bertspaan committed Jan 8, 2020
2 parents e755892 + c770113 commit 7319c7d
Show file tree
Hide file tree
Showing 20 changed files with 136 additions and 244 deletions.
10 changes: 5 additions & 5 deletions dataset.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://schemas.data.amsterdam.nl/[email protected]",
"$id": "https://schemas.data.amsterdam.nl/dataset@v1.1.0",
"type": "object",
"allOf": [
{
"$ref": "./[email protected]#/definitions/basicProperties"
"$ref": "./schema@v1.1.0#/definitions/basicProperties"
}
],
"required": [
Expand All @@ -16,7 +16,7 @@
"const": "dataset"
},
"version": {
"$ref": "./[email protected]#/definitions/version"
"$ref": "./schema@v1.1.0#/definitions/version"
},
"homepage": {
"type": "string",
Expand Down Expand Up @@ -50,7 +50,7 @@
},
"authorizationGrantor": {
"type": "string"
},
},
"keywords": {
"type": "array",
"items": {
Expand Down Expand Up @@ -79,7 +79,7 @@
"items": {
"oneOf": [
{
"$ref": "./[email protected]"
"$ref": "./table@v1.1.0"
},
{
"type": "object",
Expand Down
4 changes: 2 additions & 2 deletions meta/auth.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://schemas.data.amsterdam.nl/meta/[email protected]",
"$id": "https://schemas.data.amsterdam.nl/meta/auth@v1.1.0",
"$vocabulary": {
"https://schemas.data.amsterdam.nl/meta/[email protected]": true
"https://schemas.data.amsterdam.nl/meta/auth@v1.1.0": true
},
"$recursiveAnchor": true,
"title": "Amsterdam Schema authorization",
Expand Down
4 changes: 2 additions & 2 deletions meta/provenance.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://schemas.data.amsterdam.nl/meta/[email protected]",
"$id": "https://schemas.data.amsterdam.nl/meta/provenance@v1.1.0",
"$vocabulary": {
"https://schemas.data.amsterdam.nl/meta/[email protected]": true
"https://schemas.data.amsterdam.nl/meta/provenance@v1.1.0": true
},
"$recursiveAnchor": true,
"title": "Amsterdam Schema provenance",
Expand Down
6 changes: 3 additions & 3 deletions meta/relation.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://schemas.data.amsterdam.nl/meta/[email protected]",
"$id": "https://schemas.data.amsterdam.nl/meta/relation@v1.1.0",
"$vocabulary": {
"https://schemas.data.amsterdam.nl/meta/[email protected]": true
"https://schemas.data.amsterdam.nl/meta/relation@v1.1.0": true
},
"$recursiveAnchor": true,
"properties": {
"relation": {
"type": "string",
"format": "uri"
"format": "uri-reference"
}
}
}
5 changes: 2 additions & 3 deletions meta/unit.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://schemas.data.amsterdam.nl/meta/[email protected]",
"$id": "https://schemas.data.amsterdam.nl/meta/unit@v1.1.0",
"$vocabulary": {
"https://schemas.data.amsterdam.nl/meta/[email protected]": true
"https://schemas.data.amsterdam.nl/meta/unit@v1.1.0": true
},
"$recursiveAnchor": true,
"title": "Amsterdam Schema unit",
Expand All @@ -13,4 +13,3 @@
}
}
}

11 changes: 2 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
{
"name": "amsterdam-schema",
"version": "1.0.0",
"description": "",
"main": "cli.js",
"bin": {
"amsterdam-schema": "validate.js"
},
"version": "1.1.0",
"description": "Amsterdam Schema",
"directories": {
"example": "example",
"test": "test"
},
"scripts": {
Expand All @@ -17,7 +12,6 @@
"type": "git",
"url": "git+https://github.com/Amsterdam/amsterdam-schema.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/Amsterdam/amsterdam-schema/issues"
Expand All @@ -27,7 +21,6 @@
"ajv": "^6.10.2",
"axios": "^0.19.0",
"glob": "^7.1.4",
"highland": "^2.13.5",
"jsonpath": "^1.0.2"
}
}
38 changes: 11 additions & 27 deletions row-meta-schema.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://schemas.data.amsterdam.nl/[email protected]",
"$id": "https://schemas.data.amsterdam.nl/row-meta-schema@v1.1.0",
"definitions": {
"rootProperty": {
"type": "object",
Expand Down Expand Up @@ -57,23 +57,16 @@
"allOf": [
{
"type": "array",
"minItems": 3,
"minItems": 2,
"contains": {
"const": "id"
}
},
{
"type": "array",
"minItems": 3,
"minItems": 2,
"contains": {
"const": "table"
}
},
{
"type": "array",
"minItems": 3,
"contains": {
"const": "dataset"
"const": "schema"
}
}
]
Expand All @@ -82,48 +75,39 @@
"type": "object",
"required": [
"id",
"table",
"dataset"
"schema"
],
"propertyNames": {
"pattern": "^[a-z][A-Za-z0-9]*$"
},
"properties": {
"id": {
"type": "object",
"required": ["$ref"],
"properties": {
"description": {
"type": "string"
},
"$ref": {
"const": "https://schemas.data.amsterdam.nl/[email protected]#/definitions/id"
}
}
},
"table": {
"type": "object",
"properties": {
"description": {
"type": "string"
},
"$ref": {
"const": "https://schemas.data.amsterdam.nl/[email protected]#/definitions/table"
"const": "https://schemas.data.amsterdam.nl/[email protected]#/definitions/id"
}
}
},
"dataset": {
"schema": {
"type": "object",
"required": ["$ref"],
"properties": {
"description": {
"type": "string"
},
"$ref": {
"const": "https://schemas.data.amsterdam.nl/[email protected]#/definitions/dataset"
"const": "https://schemas.data.amsterdam.nl/schema@v1.1.0#/definitions/schema"
}
}
},
"geometry": {
"type": "object",
"required": ["$ref"],
"properties": {
"$ref": {
"type": "string",
Expand Down
36 changes: 15 additions & 21 deletions schema.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://schemas.data.amsterdam.nl/[email protected]#",
"$id": "https://schemas.data.amsterdam.nl/schema@v1.1.0#",
"title": "Amsterdam Schema",
"$vocabulary": {
"https://json-schema.org/draft/2019-09/vocab/core": true,
"https://schemas.data.amsterdam.nl/meta/[email protected]": false,
"https://schemas.data.amsterdam.nl/[email protected]": false,
"https://schemas.data.amsterdam.nl/[email protected]": false,
"https://schemas.data.amsterdam.nl/[email protected]": false
"https://schemas.data.amsterdam.nl/meta/auth@v1.1.0": false,
"https://schemas.data.amsterdam.nl/meta/units@v1.1.0": false,
"https://schemas.data.amsterdam.nl/meta/relation@v1.1.0": false,
"https://schemas.data.amsterdam.nl/meta/provenance@v1.1.0": false
},
"$recursiveAnchor": true,
"definitions": {
Expand Down Expand Up @@ -65,22 +65,16 @@
"table"
]
},
"schema": {
"type": "string",
"format": "uri-reference"
},
"title": {
"type": "string"
},
"description": {
"type": "string"
},
"dataset": {
"$ref": "#/definitions/idString"
},
"class": {
"$ref": "#/definitions/idString"
},
"uri": {
"type": "string",
"format": "uri"
},
"year": {
"type": "integer"
},
Expand All @@ -93,13 +87,13 @@
{
"oneOf": [
{
"$ref": "./[email protected]"
"$ref": "./dataset@v1.1.0"
},
{
"$ref": "./[email protected]"
"$ref": "./table@v1.1.0"
},
{
"$ref": "./[email protected]"
"$ref": "./row-meta-schema@v1.1.0"
}
]
},
Expand All @@ -112,7 +106,7 @@
}
},
"then": {
"$ref": "./[email protected]"
"$ref": "./dataset@v1.1.0"
}
},
{
Expand All @@ -124,7 +118,7 @@
}
},
"then": {
"$ref": "./[email protected]"
"$ref": "./table@v1.1.0"
}
},
{
Expand All @@ -137,7 +131,7 @@
}
},
"then": {
"$ref": "./[email protected]"
"$ref": "./row-meta-schema@v1.1.0"
}
}
]
Expand Down
6 changes: 3 additions & 3 deletions table.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://schemas.data.amsterdam.nl/[email protected]",
"$id": "https://schemas.data.amsterdam.nl/table@v1.1.0",
"type": "object",
"allOf": [
{
"$ref": "./[email protected]#/definitions/basicProperties"
"$ref": "./schema@v1.1.0#/definitions/basicProperties"
}
],
"required": [
Expand All @@ -17,7 +17,7 @@
"schema": {
"oneOf": [
{
"$ref": "./[email protected]"
"$ref": "./row-meta-schema@v1.1.0"
},
{
"type": "object",
Expand Down
6 changes: 3 additions & 3 deletions test/datasets/ref-tables.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
"language": "nl",
"tables": [
{
"$ref": "[email protected]"
"$ref": "containers@v1.1.0"
},
{
"$ref": "[email protected]"
"$ref": "putten@v1.1.0"
},
{
"$ref": "[email protected]"
"$ref": "inzamellocaties@v1.1.0"
}
]
},
Expand Down
12 changes: 4 additions & 8 deletions test/row-meta-schemas/invalid-geometry-type.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,15 @@
"type": "object",
"required": [
"id",
"dataset",
"table"
"schema"
],
"additionalProperties": false,
"properties": {
"id": {
"$ref": "https://schemas.data.amsterdam.nl/[email protected]#/definitions/id"
"$ref": "https://schemas.data.amsterdam.nl/schema@v1.1.0#/definitions/id"
},
"table": {
"$ref": "https://schemas.data.amsterdam.nl/[email protected]#/definitions/table"
},
"dataset": {
"$ref": "https://schemas.data.amsterdam.nl/[email protected]#/definitions/dataset"
"schema": {
"$ref": "https://schemas.data.amsterdam.nl/[email protected]#/definitions/schema"
},
"geometry": {
"$ref": "https://geojson.org/schema/MultiPoint.json",
Expand Down
12 changes: 4 additions & 8 deletions test/row-meta-schemas/invalid-property-name.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,14 @@
"type": "object",
"required": [
"id",
"dataset",
"table"
"schema"
],
"properties": {
"id": {
"$ref": "https://schemas.data.amsterdam.nl/[email protected]#/definitions/id"
"$ref": "https://schemas.data.amsterdam.nl/schema@v1.1.0#/definitions/id"
},
"table": {
"$ref": "https://schemas.data.amsterdam.nl/[email protected]#/definitions/table"
},
"dataset": {
"$ref": "https://schemas.data.amsterdam.nl/[email protected]#/definitions/dataset"
"schema": {
"$ref": "https://schemas.data.amsterdam.nl/[email protected]#/definitions/schema"
},
"Abc": {
"type": "string",
Expand Down
Loading

0 comments on commit 7319c7d

Please sign in to comment.