Skip to content
Merged
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
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ TIME ?= time
include generated.mk

all: common test node_modules
$(NODE) $(JSONSCHEMA) fmt schemas rules test
$(NODE) $(JSONSCHEMA) fmt schemas examples rules test

.PHONY: common
common: $(GENERATED) node_modules
$(TIME) $(NODE) $(JSONSCHEMA) metaschema schemas rules
$(TIME) $(NODE) $(JSONSCHEMA) lint schemas
$(TIME) $(NODE) $(JSONSCHEMA) metaschema schemas examples rules
$(TIME) $(NODE) $(JSONSCHEMA) lint schemas examples
$(SHELLCHECK) scripts/*.sh
./scripts/quality-schemas-tests-mirror.sh
JQ="$(JQ)" ./scripts/quality-templates-xbrl-utr-mirror.sh
JQ="$(JQ)" ./scripts/quality-data-xbrl-utr-iris.sh

.PHONY: lint
lint: common node_modules
$(TIME) $(NODE) $(JSONSCHEMA) fmt schemas rules test --check
$(TIME) $(NODE) $(JSONSCHEMA) fmt schemas examples rules test --check

.PHONY: test
test: common node_modules
Expand Down
52 changes: 52 additions & 0 deletions examples/athlete-profile.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Athlete Profile",
"description": "A sports roster entry that describes an athlete as a Schema.org person, combining identity, physical measurements, and spoken languages from the standard library",
"examples": [
{
"name": "Lionel Messi",
"birthDate": "1987-06-24",
"nationality": "AR",
"height": 1.7,
"weight": 72,
"languages": [ "es" ]
}
],
"x-jsonld-type": "https://schema.org/Person",
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://schema.org/Person" ],
"type": "object",
"required": [ "name", "nationality" ],
"properties": {
"name": {
"x-jsonld-id": "https://schema.org/name",
"type": "string"
},
"birthDate": {
"x-jsonld-id": "https://schema.org/birthDate",
"$ref": "../schemas/iso/datetime/2019/date/calendar-extended/v1.json"
},
"nationality": {
"x-jsonld-id": "https://schema.org/nationality",
"$ref": "../schemas/iso/country/2020/alpha-2/v1.json"
},
"height": {
"x-jsonld-id": "https://schema.org/height",
"$ref": "../schemas/bipm/si/2019/base/unit/metre/v1.json"
},
"weight": {
"x-jsonld-id": "https://schema.org/weight",
"$ref": "../schemas/bipm/si/2019/base/unit/kilogram/v1.json"
},
"languages": {
"x-jsonld-container": "@set",
"x-jsonld-id": "https://schema.org/knowsLanguage",
"type": "array",
"uniqueItems": true,
"items": {
"$ref": "../schemas/iso/language/2023/set-1/v1.json"
}
}
},
"additionalProperties": false
}
62 changes: 62 additions & 0 deletions examples/dataset-catalog.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Dataset Catalog Entry",
"description": "A DCAT dataset description whose containing catalog is declared through a reverse membership relation and whose provenance is grouped in a named graph, built on the standard library",
"examples": [
{
"title": "Buenos Aires Air Quality Measurements",
"landingPage": "https://data.example.com/air-quality",
"catalog": {
"title": "City of Buenos Aires Open Data"
},
"provenance": {
"creator": "Environmental Protection Agency",
"created": "2024-11-02"
}
}
],
"x-jsonld-type": "http://www.w3.org/ns/dcat#Dataset",
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://www.w3.org/TR/vocab-dcat-3/" ],
"type": "object",
"required": [ "title" ],
"properties": {
"title": {
"x-jsonld-id": "http://purl.org/dc/terms/title",
"type": "string"
},
"landingPage": {
"x-jsonld-id": "http://www.w3.org/ns/dcat#landingPage",
"$ref": "../schemas/ietf/uri/3986/uri/v1.json"
},
"catalog": {
"x-jsonld-reverse": "http://www.w3.org/ns/dcat#dataset",
"x-jsonld-type": "http://www.w3.org/ns/dcat#Catalog",
"type": "object",
"properties": {
"title": {
"x-jsonld-id": "http://purl.org/dc/terms/title",
"type": "string"
}
},
"additionalProperties": false
},
"provenance": {
"x-jsonld-graph": true,
"x-jsonld-id": "http://purl.org/dc/terms/provenance",
"type": "object",
"properties": {
"creator": {
"x-jsonld-id": "http://purl.org/dc/terms/creator",
"type": "string"
},
"created": {
"x-jsonld-id": "http://purl.org/dc/terms/created",
"$ref": "../schemas/iso/datetime/2019/date/calendar-extended/v1.json"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
50 changes: 50 additions & 0 deletions examples/legacy-inventory.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Legacy Inventory Item",
"description": "A warehouse inventory record for a system with a pre-existing internal ontology, which adopts standard library atoms for validation while overriding their linked data mappings to keep its own identifiers",
"examples": [
{
"sku": "WH-4821-B",
"currency": "USD",
"unitPrice": 12.5,
"originCountry": "CN",
"attributes": {
"shelf": "B4",
"fragile": false,
"batch": null
}
}
],
"x-jsonld-type": "https://inventory.example.com/vocab#Item",
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://www.w3.org/TR/json-ld11/" ],
"type": "object",
"required": [ "sku", "currency", "unitPrice" ],
"properties": {
"sku": {
"x-jsonld-id": "https://inventory.example.com/vocab#sku",
"type": "string"
},
"currency": {
"x-jsonld-id": "https://inventory.example.com/vocab#currency",
"x-jsonld-override": true,
"x-jsonld-self": null,
"$ref": "../schemas/iso/currency/2015/alpha-currency/v1.json"
},
"unitPrice": {
"x-jsonld-id": "https://inventory.example.com/vocab#unitPrice",
"type": "number",
"minimum": 0
},
"originCountry": {
"x-jsonld-id": "https://inventory.example.com/vocab#originCountry",
"$ref": "../schemas/iso/country/2020/alpha-2/v1.json"
},
"attributes": {
"x-jsonld-id": "https://inventory.example.com/vocab#attributes",
"x-jsonld-json": true,
"type": "object"
}
},
"additionalProperties": false
}
54 changes: 54 additions & 0 deletions examples/product-listing.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Product Listing",
"description": "An e-commerce catalog entry that describes a physical product as a Schema.org product, with multilingual names, a price in a standard currency, and shipping measurements from the standard library",
"examples": [
{
"name": {
"en": "Wireless Mouse",
"fr": "Souris sans fil"
},
"price": 29.99,
"priceCurrency": "EUR",
"weight": 0.085,
"countryOfOrigin": "DE"
}
],
"x-jsonld-type": "https://schema.org/Product",
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://schema.org/Product" ],
"type": "object",
"required": [ "name", "price", "priceCurrency" ],
"properties": {
"name": {
"x-jsonld-container": "@language",
"x-jsonld-id": "https://schema.org/name",
"type": "object",
"minProperties": 1,
"propertyNames": {
"$ref": "../schemas/ietf/language/5646/tag-syntax/v1.json"
},
"additionalProperties": {
"type": "string"
}
},
"price": {
"x-jsonld-id": "https://schema.org/price",
"type": "number",
"minimum": 0
},
"priceCurrency": {
"x-jsonld-id": "https://schema.org/priceCurrency",
"$ref": "../schemas/iso/currency/2015/alpha-currency/v1.json"
},
"weight": {
"x-jsonld-id": "https://schema.org/weight",
"$ref": "../schemas/bipm/si/2019/base/unit/kilogram/v1.json"
},
"countryOfOrigin": {
"x-jsonld-id": "https://schema.org/countryOfOrigin",
"$ref": "../schemas/iso/country/2020/alpha-2/v1.json"
}
},
"additionalProperties": false
}
48 changes: 48 additions & 0 deletions examples/publication-record.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Publication Record",
"description": "A bibliographic catalog entry for an Arabic language publisher, with right to left titles, the language of the work, the publication date, and the license as linked data through the standard library",
"examples": [
{
"title": "ألف ليلة وليلة",
"abstract": "مجموعة من القصص الشعبية من العصر الذهبي الإسلامي",
"language": "ara",
"issued": "2019-03-14",
"license": "https://creativecommons.org/licenses/by/4.0/"
}
],
"x-jsonld-type": "http://purl.org/dc/terms/BibliographicResource",
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [
"https://www.dublincore.org/specifications/dublin-core/dcmi-terms/"
],
"type": "object",
"required": [ "title", "language" ],
"properties": {
"title": {
"x-jsonld-direction": "rtl",
"x-jsonld-id": "http://purl.org/dc/terms/title",
"x-jsonld-language": "ar",
"type": "string"
},
"abstract": {
"x-jsonld-direction": "rtl",
"x-jsonld-id": "http://purl.org/dc/terms/abstract",
"x-jsonld-language": "ar",
"type": "string"
},
"language": {
"x-jsonld-id": "http://purl.org/dc/terms/language",
"$ref": "../schemas/iso/language/2023/set-2-bibliographic/v1.json"
},
"issued": {
"x-jsonld-id": "http://purl.org/dc/terms/issued",
"$ref": "../schemas/iso/datetime/2019/date/calendar-extended/v1.json"
},
"license": {
"x-jsonld-id": "http://purl.org/dc/terms/license",
"$ref": "../schemas/ietf/uri/3986/uri/v1.json"
}
},
"additionalProperties": false
}
40 changes: 40 additions & 0 deletions examples/sensor-reading.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Sensor Reading",
"description": "An IoT telemetry observation modelled after the W3C SOSA ontology, with the measured quantity in a prefixed SI unit, the observed property as a dereferenceable IRI, and the sensor location as GeoJSON from the standard library",
"examples": [
{
"observedProperty": "http://qudt.org/vocab/quantitykind/Voltage",
"result": 743.2,
"resultTime": "2026-08-03T14:30:00Z",
"location": {
"type": "Point",
"coordinates": [ -58.3816, -34.6037 ]
}
}
],
"x-jsonld-type": "http://www.w3.org/ns/sosa/Observation",
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://www.w3.org/TR/vocab-ssn/" ],
"type": "object",
"required": [ "observedProperty", "result", "resultTime" ],
"properties": {
"observedProperty": {
"x-jsonld-id": "http://www.w3.org/ns/sosa/observedProperty",
"$ref": "../schemas/ietf/uri/3986/uri/v1.json"
},
"result": {
"x-jsonld-id": "http://www.w3.org/ns/sosa/hasResult",
"$ref": "../schemas/bipm/si/2019/derived/prefixed/millivolt/v1.json"
},
"resultTime": {
"x-jsonld-id": "http://www.w3.org/ns/sosa/resultTime",
"$ref": "../schemas/iso/datetime/2019/datetime/calendar-utc-extended/v1.json"
},
"location": {
"x-jsonld-id": "https://schema.org/location",
"$ref": "../schemas/ietf/geojson/7946/point/v1.json"
}
},
"additionalProperties": false
}
2 changes: 1 addition & 1 deletion schemas/iso/datetime/2019/datetime/calendar-basic/v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "ISO 8601-1:2019 Calendar Date and Local Time of Day (Basic Format)",
"description": "A representation of calendar date combined with complete local time of day in basic format [YYYY][MM][DD][\"T\"][hh][mm][ss] where the time designator \"T\" separates date from time (§5.4.2.1 a)",
"$comment": "This schema validates day/month combinations (i.e rejects April 31) but does not validate leap years. February 29 is accepted for any year, and leap year validation must be performed by the consumer",
"$comment": "This schema validates day/month combinations (i.e rejects April 31) but does not validate leap years. February 29 is accepted for any year, and leap year validation must be performed by the consumer. No linked data datatype is declared because ISO 8601 details such as the leap second put this representation outside the lexical space of the XML Schema date and time datatypes",
"examples": [
"19850412T232050",
"20000101T000000",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "ISO 8601-1:2019 Calendar Date and Local Time of Day (Extended Format)",
"description": "A representation of calendar date combined with complete local time of day in extended format [YYYY][\"-\"][MM][\"-\"][DD][\"T\"][hh][\":\"[mm][\":\"[ss] where the time designator \"T\" separates date from time (§5.4.2.1 b)",
"$comment": "This schema validates day/month combinations (i.e rejects April 31) but does not validate leap years. February 29 is accepted for any year, and leap year validation must be performed by the consumer",
"$comment": "This schema validates day/month combinations (i.e rejects April 31) but does not validate leap years. February 29 is accepted for any year, and leap year validation must be performed by the consumer. No linked data datatype is declared because ISO 8601 details such as the leap second put this representation outside the lexical space of the XML Schema date and time datatypes",
"examples": [
"1985-04-12T23:20:50",
"2000-01-01T00:00:00",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "ISO 8601-1:2019 Calendar Date and Local Time of Day with Reduced Precision (Basic Format)",
"description": "A representation of calendar date combined with reduced precision local time of day (hour and minute only) in basic format [YYYY][MM][DD][\"T\"][hh][mm] where seconds are omitted (§5.4.3 a)",
"$comment": "This schema validates day/month combinations (i.e rejects April 31) but does not validate leap years. February 29 is accepted for any year, and leap year validation must be performed by the consumer",
"$comment": "This schema validates day/month combinations (i.e rejects April 31) but does not validate leap years. February 29 is accepted for any year, and leap year validation must be performed by the consumer. No linked data datatype is declared because ISO 8601 details such as the leap second put this representation outside the lexical space of the XML Schema date and time datatypes",
"examples": [
"19850412T1015",
"20000101T0000",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "ISO 8601-1:2019 Calendar Date and Local Time of Day with Reduced Precision (Extended Format)",
"description": "A representation of calendar date combined with reduced precision local time of day (hour and minute only) in extended format [YYYY][\"-\"][MM][\"-\"][DD][\"T\"][hh][\":\"[mm] where seconds are omitted (§5.4.3 a)",
"$comment": "This schema validates day/month combinations (i.e rejects April 31) but does not validate leap years. February 29 is accepted for any year, and leap year validation must be performed by the consumer",
"$comment": "This schema validates day/month combinations (i.e rejects April 31) but does not validate leap years. February 29 is accepted for any year, and leap year validation must be performed by the consumer. No linked data datatype is declared because ISO 8601 details such as the leap second put this representation outside the lexical space of the XML Schema date and time datatypes",
"examples": [
"1985-04-12T10:15",
"2000-01-01T00:00",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "ISO 8601-1:2019 Calendar Date and Local Time of Day with Time Shift (Basic Format)",
"description": "A representation of calendar date combined with complete local time of day and time shift from UTC in basic format [YYYY][MM][DD][\"T\"][hh][mm][ss][±][hh][mm] where the time shift includes hours and minutes (§5.4.2.1 a)",
"$comment": "This schema validates day/month combinations (i.e rejects April 31) but does not validate leap years. February 29 is accepted for any year, and leap year validation must be performed by the consumer",
"$comment": "This schema validates day/month combinations (i.e rejects April 31) but does not validate leap years. February 29 is accepted for any year, and leap year validation must be performed by the consumer. No linked data datatype is declared because ISO 8601 details such as the leap second put this representation outside the lexical space of the XML Schema date and time datatypes",
"examples": [
"19850412T232050+0400",
"20000101T000000-0500",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "ISO 8601-1:2019 Calendar Date and Local Time of Day with Time Shift (Extended Format)",
"description": "A representation of calendar date combined with complete local time of day and time shift from UTC in extended format [YYYY][\"-\"][MM][\"-\"][DD][\"T\"][hh][\":\"[mm][\":\"[ss][±][hh][\":\"[mm] where the time shift includes hours and minutes (§5.4.2.1 b)",
"$comment": "This schema validates day/month combinations (i.e rejects April 31) but does not validate leap years. February 29 is accepted for any year, and leap year validation must be performed by the consumer",
"$comment": "This schema validates day/month combinations (i.e rejects April 31) but does not validate leap years. February 29 is accepted for any year, and leap year validation must be performed by the consumer. No linked data datatype is declared because ISO 8601 details such as the leap second put this representation outside the lexical space of the XML Schema date and time datatypes",
"examples": [
"1985-04-12T23:20:50+04:00",
"2000-01-01T00:00:00-05:00",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "ISO 8601-1:2019 Calendar Date and Local Time of Day with Hourly Time Shift (Basic Format)",
"description": "A representation of calendar date combined with complete local time of day and time shift from UTC in basic format [YYYY][MM][DD][\"T\"][hh][mm][ss][±][hh] where the time shift includes only hours (§5.4.2.1 a)",
"$comment": "This schema validates day/month combinations (i.e rejects April 31) but does not validate leap years. February 29 is accepted for any year, and leap year validation must be performed by the consumer",
"$comment": "This schema validates day/month combinations (i.e rejects April 31) but does not validate leap years. February 29 is accepted for any year, and leap year validation must be performed by the consumer. No linked data datatype is declared because ISO 8601 details such as the leap second put this representation outside the lexical space of the XML Schema date and time datatypes",
"examples": [
"19850412T232050+04",
"20000101T000000-05",
Expand Down
Loading
Loading