diff --git a/schemas/test/definitions.json b/schemas/test/definitions.json deleted file mode 100644 index 0b9b74a..0000000 --- a/schemas/test/definitions.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "$id": "https://ontology.riskine.com/definitions.json", - "gender": { - "type": "integer", - "enum": [ - 1, - 2 - ] - } -} \ No newline at end of file diff --git a/schemas/test/import_jsonschema.py b/schemas/test/import_jsonschema.py deleted file mode 100644 index 0d6bcfd..0000000 --- a/schemas/test/import_jsonschema.py +++ /dev/null @@ -1,15 +0,0 @@ -import jsonschema -import json -import glob, os - -schema = json.load(open("/schemas/schemas/core/person.json")) -data = json.load(open("/schemas/schemas/test/sample.json")) -store = {} - -for file in glob.glob("/schemas/schemas/core/*.json"): - additionalschema = json.load(open(file)) - store[additionalschema["$id"]] = additionalschema - -resolver = jsonschema.RefResolver.from_schema(schema, store=store) -validator = jsonschema.Draft7Validator(schema, resolver=resolver) -validator.validate(data, schema) \ No newline at end of file diff --git a/schemas/test/otherschema.json b/schemas/test/otherschema.json deleted file mode 100644 index 03e51bf..0000000 --- a/schemas/test/otherschema.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "$id": "https://ontology.riskine.com/otherschema.json", - "type": "object", - "properties": { - "birthdate": { - "type": "string" - } - } -} \ No newline at end of file diff --git a/schemas/test/sample.json b/schemas/test/sample.json deleted file mode 100644 index 15fcb77..0000000 --- a/schemas/test/sample.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "first-name": "Johannes", - "gender": "m", - "birthdate": "1980-01-01", - "partner": { - "first-name": "nonexistent", - "gender": "f" - }, - "children": [ - { - "birthdate": "1990-01-01" - }, - { - "birthdate": "1992-01-01", - "parents": [ - { - "birthdate": "1980-01-01" - } - ] - } - ], - "credit-card": [ - { - "": "" - } - ], - "profession": { - "employment-category": 12 - }, - "education": { - "educational-level": 1 - } -} \ No newline at end of file diff --git a/schemas/test/schema.json b/schemas/test/schema.json deleted file mode 100644 index 8d40af4..0000000 --- a/schemas/test/schema.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$id": "https://ontology.riskine.com/schema.json", - "allOf": [ - { - "$ref": "otherschema.json" - } - ], - "type": "object", - "properties": { - "gender": { - "$ref": "definitions.json#/gender" - } - } -} \ No newline at end of file