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

[WIP] Json schema draft 7 #411

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
out/
archives/
build/
.venv

._*
.cache
Expand Down
1 change: 1 addition & 0 deletions examples/Body-01.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://schema.oparl.org/1.1/Body",
"id": "https://oparl.example.org/body/0",
"type": "https://schema.oparl.org/1.1/Body",
"system": "https://oparl.example.org/",
Expand Down
1 change: 1 addition & 0 deletions examples/File-01.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://schema.oparl.org/1.1/File",
"id": "https://oparl.example.org/files/57737",
"type": "https://schema.oparl.org/1.1/File",
"name": "Anlage 1 zur Anfrage",
Expand Down
1 change: 1 addition & 0 deletions examples/Location-01.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://schema.oparl.org/1.1/Location",
"id": "https://oparl.example.org/location/0",
"type": "https://schema.oparl.org/1.1/Location",
"description": "Deutscher Bundestag, Platz der Republik 1, 11011 Berlin",
Expand Down
1 change: 1 addition & 0 deletions examples/Meeting-01.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://schema.oparl.org/1.1/Meeting",
"id": "https://oparl.example.org/meeting/281",
"type": "https://schema.oparl.org/1.1/Meeting",
"name": "4. Sitzung des Finanzausschusses",
Expand Down
1 change: 1 addition & 0 deletions examples/Organization-01.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://schema.oparl.org/1.1/Organization",
"id": "https://oparl.example.org/organization/34",
"type": "https://schema.oparl.org/1.1/Organization",
"body": "https://oparl.example.org/bodies/1",
Expand Down
1 change: 1 addition & 0 deletions examples/Paper-01.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://schema.oparl.org/1.1/Paper",
"id": "https://oparl.example.org/paper/749",
"type": "https://schema.oparl.org/1.1/Paper",
"body": "https://oparl.example.org/bodies/1",
Expand Down
1 change: 1 addition & 0 deletions examples/Person-01.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://schema.oparl.org/1.1/Person",
"id": "https://oparl.example.org/person/29",
"type": "https://schema.oparl.org/1.1/Person",
"body": "https://oparl.example.org/body/0",
Expand Down
1 change: 1 addition & 0 deletions examples/System-01.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://schema.oparl.org/1.1/System",
"id": "https://oparl.example.org/",
"type": "https://schema.oparl.org/1.1/System",
"oparlVersion": "https://schema.oparl.org/1.1/",
Expand Down
10 changes: 5 additions & 5 deletions schema/AgendaItem.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://schema.oparl.org/1.1/AgendaItem",
"title": "AgendaItem",
"description": "{{ AgendaItem.description }}",
"type": "object",
Expand All @@ -14,7 +16,7 @@
},
"type": {
"type": "string",
"pattern": "^https\\:\\/\\/schema\\.oparl\\.org\\/1\\.1\\/AgendaItem$"
"const": "https://schema.oparl.org/1.1/AgendaItem"
},
"meeting": {
"description": "{{ AgendaItem.properties.meeting.description }}",
Expand Down Expand Up @@ -56,15 +58,13 @@
},
"resolutionFile": {
"description": "{{ AgendaItem.properties.resolutionFile.description }}",
"type": "object",
"schema": "File.json"
"$ref": "File.json"
},
"auxiliaryFile": {
"description": "{{ AgendaItem.properties.auxiliaryFile.description }}",
"type": "array",
"items": {
"type": "object",
"schema": "File.json"
"$ref": "File.json"
}
},
"start": {
Expand Down
42 changes: 16 additions & 26 deletions schema/Body.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://schema.oparl.org/1.1/Body",
"title": "Body",
"description": "{{ Body.description }}",
"type": "object",
Expand All @@ -19,7 +21,7 @@
},
"type": {
"type": "string",
"pattern": "^https\\:\\/\\/schema\\.oparl\\.org\\/1\\.1\\/Body$"
"const": "https://schema.oparl.org/1.1/Body"
},
"system": {
"description": "{{ Body.properties.system.description }}",
Expand Down Expand Up @@ -87,8 +89,7 @@
"format": "url",
"references": "externalList",
"items": {
"type": "object",
"schema": "Organization.json"
"$ref": "Organization.json"
}
},
"person": {
Expand All @@ -97,8 +98,7 @@
"format": "url",
"references": "externalList",
"items": {
"type": "object",
"schema": "Person.json"
"$ref": "Person.json"
}
},
"meeting": {
Expand All @@ -107,8 +107,7 @@
"format": "url",
"references": "externalList",
"items": {
"type": "object",
"schema": "Meeting.json"
"$ref": "Meeting.json"
}
},
"paper": {
Expand All @@ -117,16 +116,14 @@
"format": "url",
"references": "externalList",
"items": {
"type": "object",
"schema": "Paper.json"
"$ref": "Paper.json"
}
},
"legislativeTerm": {
"description": "{{ Body.properties.legislativeTerm.description }}",
"type": "array",
"items": {
"type": "object",
"schema": "LegislativeTerm.json"
"$ref": "LegislativeTerm.json"
}
},
"agendaItem": {
Expand All @@ -135,8 +132,7 @@
"format": "url",
"references": "externalList",
"items": {
"type": "object",
"schema": "AgendaItem.json"
"$ref": "AgendaItem.json"
}
},
"consultation": {
Expand All @@ -145,8 +141,7 @@
"format": "url",
"references": "externalList",
"items": {
"type": "object",
"schema": "Consultation.json"
"$ref": "Consultation.json"
}
},
"file": {
Expand All @@ -155,8 +150,7 @@
"format": "url",
"references": "externalList",
"items": {
"type": "object",
"schema": "File.json"
"$ref": "File.json"
}
},
"locationList": {
Expand All @@ -165,8 +159,7 @@
"format": "url",
"references": "externalList",
"items": {
"type": "object",
"schema": "Location.json"
"$ref": "Location.json"
}
},
"legislativeTermList": {
Expand All @@ -175,8 +168,7 @@
"format": "url",
"references": "externalList",
"items": {
"type": "object",
"schema": "LegislativeTerm.json"
"$ref": "LegislativeTerm.json"
}
},
"membership": {
Expand All @@ -185,8 +177,7 @@
"format": "url",
"references": "externalList",
"items": {
"type": "object",
"schema": "Membership.json"
"$ref": "Membership.json"
}
},
"classification": {
Expand All @@ -195,14 +186,13 @@
},
"location": {
"description": "{{ Body.properties.location.description }}",
"type": "object",
"schema": "Location.json"
"$ref": "Location.json"
},
"mainOrganization": {
"description": "{{ Body.properties.mainOrganization.description }}",
"type": "string",
"format": "url",
"schema": "Organization",
"$ref": "Organization",
"references": "Organization",
"cardinality": "1:1"
},
Expand Down
4 changes: 3 additions & 1 deletion schema/Consultation.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://schema.oparl.org/1.1/Consultation",
"title": "Consultation",
"type": "object",
"description": "{{ Consultation.description }}",
Expand All @@ -13,7 +15,7 @@
},
"type": {
"type": "string",
"pattern": "^https\\:\\/\\/schema\\.oparl\\.org\\/1\\.1\\/Consultation$"
"const": "https://schema.oparl.org/1.1/Consultation"
},
"paper": {
"type": "string",
Expand Down
4 changes: 3 additions & 1 deletion schema/File.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://schema.oparl.org/1.1/File",
"title": "File",
"description": "{{ File.description }}",
"type": "object",
Expand All @@ -14,7 +16,7 @@
},
"type": {
"type": "string",
"pattern": "^https\\:\\/\\/schema\\.oparl\\.org\\/1\\.1\\/File$"
"const": "https://schema.oparl.org/1.1/File"
},
"name": {
"description": "{{ File.properties.name.description }}",
Expand Down
4 changes: 3 additions & 1 deletion schema/LegislativeTerm.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://schema.oparl.org/1.1/LegislativeTerm",
"title": "LegislativeTerm",
"description": "{{ LegislativeTerm.description }}",
"type": "object",
Expand All @@ -13,7 +15,7 @@
},
"type": {
"type": "string",
"pattern": "^https\\:\\/\\/schema\\.oparl\\.org\\/1\\.1\\/LegislativeTerm$"
"const": "https://schema.oparl.org/1.1/LegislativeTerm"
},
"body": {
"type": "string",
Expand Down
4 changes: 3 additions & 1 deletion schema/Location.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://schema.oparl.org/1.1/Location",
"title": "Location",
"description": "{{ Location.description }}",
"type": "object",
Expand All @@ -13,7 +15,7 @@
},
"type": {
"type": "string",
"pattern": "^https\\:\\/\\/schema\\.oparl\\.org\\/1\\.1\\/Location$"
"const": "https://schema.oparl.org/1.1/Location"
},
"description": {
"description": "{{ Location.properties.description.description }}",
Expand Down
22 changes: 9 additions & 13 deletions schema/Meeting.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://schema.oparl.org/1.1/Meeting",
"title": "Meeting",
"description": "{{ Meeting.description }}",
"type": "object",
Expand All @@ -13,7 +15,7 @@
},
"type": {
"type": "string",
"pattern": "^https\\:\\/\\/schema\\.oparl\\.org\\/1\\.1\\/Meeting$"
"const": "https://schema.oparl.org/1.1/Meeting"
},
"name": {
"description": "{{ Meeting.properties.name.description }}",
Expand All @@ -39,8 +41,7 @@
},
"location": {
"description": "{{ Meeting.properties.location.description }}",
"type": "object",
"schema": "Location.json"
"$ref": "Location.json"
},
"organization": {
"description": "{{ Meeting.properties.organization.description }}",
Expand All @@ -65,33 +66,28 @@
},
"invitation": {
"description": "{{ Meeting.properties.invitation.description }}",
"type": "object",
"schema": "File.json"
"$ref": "File.json"
},
"resultsProtocol": {
"description": "{{ Meeting.properties.resultsProtocol.description }}",
"type": "object",
"schema": "File.json"
"$ref": "File.json"
},
"verbatimProtocol": {
"description": "{{ Meeting.properties.verbatimProtocol.description }}",
"type": "object",
"schema": "File.json"
"$ref": "File.json"
},
"auxiliaryFile": {
"description": "{{ Meeting.properties.auxiliaryFile.description }}",
"type": "array",
"items": {
"type": "object",
"schema": "File.json"
"$ref": "File.json"
}
},
"agendaItem": {
"description": "{{ Meeting.properties.agendaItem.description }}",
"type": "array",
"items": {
"type": "object",
"schema": "AgendaItem.json"
"$ref": "AgendaItem.json"
}
},
"license": {
Expand Down
4 changes: 3 additions & 1 deletion schema/Membership.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://schema.oparl.org/1.1/Membership",
"title": "Membership",
"description": "{{ Membership.description }}",
"type": "object",
Expand All @@ -13,7 +15,7 @@
},
"type": {
"type": "string",
"pattern": "^https\\:\\/\\/schema\\.oparl\\.org\\/1\\.1\\/Membership$"
"const": "https://schema.oparl.org/1.1/Membership"
},
"person": {
"type": "string",
Expand Down
Loading