Schema

network-schema.json is the single source of truth for defining OFDS’s objects and fields. It is documented using an extended version of JSON Schema 2020-12.

The source for network-schema.json and other schema files is in the schema directory of the standard repository.

JSON Schema usage

The tables below list the validation keywords, types and formats used in the schema. For each keyword, type and format, the ‘Test data’ column contains a JSON pointer to a field in network-package-invalid.json that fails validation.

Keywords

Keyword

Test Data

prefixItems

/networks/0/links/0/

const

/networks/0/crs/name

minItems

/networks/0/nodes

uniqueItems

/networks/0/phases

pattern (propertyNames)

/networks/0/spans/0/route

pattern (string)

/networks/0/links/1/rel

minLength

/networks/0/name

enum

/networks/0/spans/0/status

required

/networks/0/spans/0/id

minProperties

/networks/0/organisations/0/

Types

Types are validated using the type keyword.

Type

Test Data

boolean

/networks/0/spans/0/directed

integer

/networks/0/spans/0/fibreCount

number

/networks/0/accuracy

string

/networks/0/accuracyDetails

object

/networks/0/publisher

array

/networks/0/contracts

Formats

Formats are validated using the format keyword.

Format

Test Data

date

/networks/0/publicationDate

iri

/networks/0/website

uri

/networks/0/crs/uri

uuid

/networks/0/id

Other normative rules

The table below lists normative rules specified in field descriptions. For each rule, the ‘Test data’ column contains JSON pointers to the fields in network-package-additional-checks.json that does not conform to the rule.

Rule

Specified in

Test data

Node reference is resolvable

Span.start, Span.end

networks/0/spans/0/start, networks/0/spans/0/end

Node location type is ‘Point’

Geometry.type

networks/0/nodes/0/location/type

Node location coordinates format is a single position

Geometry.coordinates

networks/0/nodes/0/location/coordinates

Span route geometry is ‘LineString’

Geometry.type

networks/0/spans/0/route/type

Span route coordinates is an array of positions

Geometry.coordinates

networks/0/spans/0/route/coordinates

Phase reference is resolvable

PhaseReference.id

networks/0/nodes/0/phase/id, networks/0/spans/0/phase/id, networks/0/contracts/0/relatedPhases/0/id

Phase name is consistent

PhaseReference.name

networks/0/contracts/0/relatedPhases/1/name

Organisation reference is resolvable

OrganisationReference.id

networks/0/spans/0/physicalInfrastructureProvider/id, networks/0/spans/0/networkProvider/id, networks/0/spans/0/supplier/id, networks/0/nodes/0/physicalInfrastructureProvider, networks/0/nodes/0/networkProvider, networks/0/phases/0/funders/0/id

Organisation name is consistent

OrganisationReference.name

networks/0/phases/0/funders/1/name

Node international connections country is present

Node.internationalConnections

networks/0/nodes/0/internationalConnections/0/

Identifier is unique

Node.id, Span.id, Phase.id, Organisation.id, Contract.id

networks/0/spans/1/id, networks/0/nodes/1/id, networks/0/phases/1/id, networks/0/contracts/1/id, networks/0/organisations/1/id