diff --git a/docs/_static/jsonschema.css b/docs/_static/jsonschema.css new file mode 100644 index 0000000..d5768b8 --- /dev/null +++ b/docs/_static/jsonschema.css @@ -0,0 +1,3 @@ +.wy-table-responsive table td { + white-space: normal !important; +} diff --git a/docs/_static/renderjson.css b/docs/_static/renderjson.css index c0b56ea..169c28b 100644 --- a/docs/_static/renderjson.css +++ b/docs/_static/renderjson.css @@ -1,11 +1,11 @@ -pre.renderjson { overflow: scroll; font-size:smaller; border: 1px solid grey;} +pre.renderjson { overflow: scroll; font-size:smaller; border: 1px solid #e1e4e5; padding: 12px; background-color: #eeffcc;} .renderjson a { text-decoration: none; } -.renderjson .disclosure { color: crimson; font-size: 150%; } +.renderjson .disclosure { color: grey; font-size: 150%; } .renderjson .syntax { color: grey; } -.renderjson .string { color: darkred; } +.renderjson .string { color: #4070a0; } .renderjson .number { color: darkcyan; } .renderjson .boolean { color: blueviolet; } -.renderjson .key { color: darkblue; } +.renderjson .key { color: #062873; font-weight: bold;} .renderjson .keyword { color: blue; } -.renderjson .object.syntax { color: lightseagreen; } -.renderjson .array.syntax { color: orange; } \ No newline at end of file +.renderjson .object.syntax { color: grey; } +.renderjson .array.syntax { color: grey; } \ No newline at end of file diff --git a/docs/_static/renderjson.js b/docs/_static/renderjson.js index 0397024..295604b 100644 --- a/docs/_static/renderjson.js +++ b/docs/_static/renderjson.js @@ -185,7 +185,7 @@ var module; //Added by timgdavies renderjson.set_default_open = function(node_list) { renderjson.default_open = node_list ? node_list : [] ; return renderjson; }; - renderjson.set_icons('⊕', '⊖'); + renderjson.set_icons('▹', '▾'); renderjson.set_show_by_default(false); renderjson.set_sort_objects(false); renderjson.set_max_string_length("none"); diff --git a/docs/_templates/layout.html b/docs/_templates/layout.html index e089487..52e7102 100644 --- a/docs/_templates/layout.html +++ b/docs/_templates/layout.html @@ -1,3 +1,3 @@ {% extends "!layout.html" %} -{% set css_files = css_files + ["_static/renderjson.css"] %} +{% set css_files = css_files + ["_static/renderjson.css", "_static/jsonschema.css"] %} {% set script_files = script_files + ["_static/renderjson.js", "_static/json-example-format.js"] %} \ No newline at end of file diff --git a/docs/guidance/publication.md b/docs/guidance/publication.md index 9359fff..18ebec3 100644 --- a/docs/guidance/publication.md +++ b/docs/guidance/publication.md @@ -52,7 +52,7 @@ To meet the widest range of use cases, you ought to publish data in all three fo :::{tab-item} JSON to GeoJSON The standard repository's [`manage.py`](https://github.com/Open-Telecoms-Data/open-fibre-data-standard/blob/main/manage.py) file provides a command-line interface for transforming OFDS data from JSON to GeoJSON format. -To convert a network to GeoJSON format: +To convert a network package to GeoJSON format: * Clone the [repository](https://github.com/Open-Telecoms-Data/open-fibre-data-standard) * Create a virtual environment: @@ -68,7 +68,7 @@ pip install -r requirements.txt * Run the following command: ```bash -./manage.py convert-to-geojson network.json +./manage.py convert-to-geojson network-package.json ``` ::: @@ -109,15 +109,17 @@ The preferred approach is to publish embedded nodes and links in `.nodes` and `. :::{tab-item} Embedded data The following example shows a network with embedded nodes and links: -```{jsoninclude} ../../examples/json/network-embedded.json -:jsonpointer: +```{jsoninclude} ../../examples/json/network-package.json +:jsonpointer: /networks/0 +:expand: nodes,links ``` ::: :::{tab-item} References to endpoints The following example shows a network with references to separate endpoints for nodes and links: ```{jsoninclude} ../../examples/json/network-separate-endpoints.json -:jsonpointer: +:jsonpointer: /networks/0 +:expand: relatedResources ``` ::: @@ -145,15 +147,16 @@ The preferred approach is to publish embedded nodes and links. If your network i :::{tab-item} Embedded data The following example shows a network with embedded nodes and links: -```{jsoninclude} ../../examples/json/network-embedded.json -:jsonpointer: +```{jsoninclude} ../../examples/json/network-package.json +:jsonpointer: /networks/0 ``` ::: :::{tab-item} References to files The following example shows a network with references to separate files for nodes and links: ```{jsoninclude} ../../examples/json/network-separate-files.json -:jsonpointer: +:jsonpointer: /networks/0 +:expand: relatedResources ``` ::: diff --git a/docs/reference/identifiers.md b/docs/reference/identifiers.md index c459456..03e22ca 100644 --- a/docs/reference/identifiers.md +++ b/docs/reference/identifiers.md @@ -32,8 +32,8 @@ To ensure that an organisation's `.identifier` is globally unique, it has two co :::{tab-item} Example The following example shows the `.identifier` for an organisation registered at Ghana's Registrar General's Department, the scheme code for which is [GH-RGD](https://org-id.guide/list/GH-RGD): -```{jsoninclude} ../../examples/json/network.json -:jsonpointer: /organisations/0/identifier +```{jsoninclude} ../../examples/json/network-package.json +:jsonpointer: /networks/0/organisations/0/identifier ``` ::: diff --git a/docs/reference/publication_formats.md b/docs/reference/publication_formats.md index e513bc9..f760030 100644 --- a/docs/reference/publication_formats.md +++ b/docs/reference/publication_formats.md @@ -43,8 +43,9 @@ Click on schema elements to expand the tree, or use the '+' icon to expand all e :::{tab-item} Small file example The following example shows a network package containing two networks: -```{jsoninclude} ../../examples/json/network-package.json +```{jsoninclude} ../../examples/json/multiple-networks.json :jsonpointer: +:expand: networks ``` ::: @@ -52,6 +53,7 @@ The following example shows a network package containing two networks: The following example shows a network package containing two networks with URLs for the next and previous pages of results. ```{jsoninclude} ../../examples/json/api-response.json :jsonpointer: +:expand: networks,pages ``` ::: @@ -90,6 +92,7 @@ Publish separate GeoJSON [feature collections](https://datatracker.ietf.org/doc/ The following example shows a GeoJSON feature collection containing nodes: ```{jsoninclude} ../../examples/geojson/nodes.geojson :jsonpointer: +:expand: features ``` ::: @@ -97,6 +100,7 @@ The following example shows a GeoJSON feature collection containing nodes: The following example shows a GeoJSON feature collection containing links: ```{jsoninclude} ../../examples/geojson/links.geojson :jsonpointer: +:expand: features ``` ::: @@ -108,6 +112,7 @@ The following example shows a GeoJSON feature collection containing features fro ```{jsoninclude} ../../examples/geojson/multiple-networks.geojson :jsonpointer: +:expand: features ``` For data published via a paginated API, you should add a top-level `pages` object to the feature collection to provide URLs for the next and previous pages of results: @@ -201,3 +206,175 @@ This section has [open issues](https://github.com/Open-Telecoms-Data/open-fibre- This section describes how to publish data in CSV format. +The CSV format has 10 tables, reflecting the structure of the [schema](schema.md). Arrays of objects in the schema are represented as separate tables: + +* [Networks](#table-structure) + * [Nodes](#nodes) + * [International connections](#international-connections) + * [Links](#links) + * [Phases](#phases) + * [Funders](#funders) + * [Organisations](#organisations) + * [Contracts](#contracts) + * [Documents](#documents) + * [Related phases](#related-phases) + +The field in the schema that each column represents is identified by the field's [JSON Pointer](https://tools.ietf.org/html/rfc6901). Rows in child tables are related to rows in parent tables using the parent object's `id` field. + +The following example shows a network with two nodes represented in JSON format and as tables. Note how the network's `.id` appears in both tables. + +::::{tab-set} + +:::{tab-item} JSON +```{jsoninclude} ../../examples/json/network-package.json +:jsonpointer: /networks/0 +:exclude: links,phases,organisations,contracts +``` +::: + +:::{tab-item} Networks table +```{csv-table-no-translate} +:header-rows: 1 +:widths: auto +:file: ../../examples/csv/networks.csv +``` +::: + +:::{tab-item} Nodes table +```{csv-table-no-translate} +:header-rows: 1 +:widths: auto +:file: ../../examples/csv/nodes.csv +``` +::: + +:::: + +### Table structure + +This section describes the structure of the tables in the CSV format and the relationship between the tables. Example CSV files and blank templates are provided for each table. + +The networks table is the main table. It is related to the following tables: + +* [Nodes](#nodes): one-to-many by `id` +* [Links](#links): one-to-many by `id` +* [Phases](#phases): one-to-many by `id` +* [Organisations](#organisations): one-to-many by `id` +* [Contracts](#contracts): one-to-many by `id` + +The fields in this table are listed below. You can also download an [example CSV file](../../examples/csv/networks.csv) or a [blank template](../../examples/csv/template/networks.csv) for this table. + +```{jsonschema} ../../schema/network-schema.json +:include: id,name,website,publisher,publicationDate,collectionDate,crs,accuracy,accuracyDetails,language +``` + +#### Nodes + +This table is related to the following tables: + +* [Networks](#table-structure): many-to-one by `id` +* [International connections](#international-connections): one-to-many by `nodes/0/id` + +The fields in this table are listed below. You can also download an [example CSV file](../../examples/csv/nodes.csv) or a [blank template](../../examples/csv/template/nodes.csv). + +```{jsonschema} ../../schema/network-schema.json +:include: id,nodes/0/id,nodes/0/name,nodes/0/phase,nodes/0/status,nodes/0/location,nodes/0/address,nodes/0/type,nodes/0/accessPoint,nodes/0/power,nodes/0/technologies,nodes/0/physicalInfrastructureProvider,nodes/0/networkProvider +``` + +##### International connections + +This table is related to the following tables: + +* [Nodes](#nodes): many-to-one by `nodes/0/id` + +The fields in this table are listed below. You can also download an [example CSV file](../../examples/csv/nodes_internationalConnections.csv) or a [blank template](../../examples/csv/template/nodes_internationalConnections.csv). + +```{jsonschema} ../../schema/network-schema.json +:include: id,nodes/0/id,nodes/0/internationalConnections/0/streetAddress,nodes/0/internationalConnections/0/locality,nodes/0/internationalConnections/0/region,nodes/0/internationalConnections/0/postalCode,nodes/0/internationalConnections/0/country +``` + +#### Links + +This table is related to the following tables: + +* [Networks](#table-structure): many-to-one by `id` + +The fields in this table are listed below. You can also download an [example CSV file](../../examples/csv/links.csv) or a [blank template](../../examples/csv/template/links.csv). + +```{jsonschema} ../../schema/network-schema.json +:include: id,links/0/id,links/0/name,links/0/phase,links/0/status,links/0/readyForServiceDate,links/0/start,links/0/end,links/0/route,links/0/physicalInfrastructureProvider,links/0/networkProvider,links/0/supplier,links/0/transmissionMedium,links/0/deployment,links/0/deploymentDetails,links/0/darkFibre,links/0/fibreType,links/0/fibreTypeDetails,links/0/fibreCount,links/0/fibreLength,links/0/technologies,links/0/capacity,links/0/capacityDetails,links/0/countries,links/0/directed +``` + +#### Phases + +This table is related to the following tables: + +* [Networks](#table-structure): many-to-one by `id` +* [Funders](#funders): one-to-many by `phases/0/id` + +The fields in this table are listed below. You can also download an [example CSV file](../../examples/csv/phases.csv) or a [blank template](../../examples/csv/template/phases.csv). + +```{jsonschema} ../../schema/network-schema.json +:include: id,phases/0/name,phases/0/description +``` + +##### Funders + +This table is related to the following tables: + +* [Phases](#phases): many-to-one by `phase/0/id` + +The fields in this table are listed below. You can also download an [example CSV file](../../examples/csv/phases_funders.csv) or a [blank template](../../examples/csv/template/phases_funders.csv). + +```{jsonschema} ../../schema/network-schema.json +:include: id,phases/0/id,phases/0/funders/0/id,phases/0/funders/0/name +``` + +#### Organisations + +This table is related to the following tables: + +* [Network](#table-structure): many-to-one by `id` + +The fields in this table are listed below. You can also download an [example CSV file](../../examples/csv/organisations.csv) or a [blank template](../../examples/csv/template/organisations.csv). + +```{jsonschema} ../../schema/network-schema.json +:include: id,organisations/0/id,organisations/0/name,organisations/0/identifier,organisations/0/country,organisations/0/roles,organisations/0/roleDetails,organisations/0/website,organisations/0/logo +``` + +#### Contracts + +This table is related to the following tables: + +* [Network](#table-structure): many-to-one by `id` +* [Documents](#documents): one-to-many by `contracts/0/id` + +The fields in this table are listed below. You can also download an [example CSV file](../../examples/csv/contracts.csv) or a [blank template](../../examples/csv/template/contracts.csv). + +```{jsonschema} ../../schema/network-schema.json +:include: id,contracts/0/id,contracts/0/title,contracts/0/description,contracts/0/type,contracts/0/value,contracts/0/dateSigned +``` + +##### Documents + +This table is related to the following tables: + +* [Contracts](#contracts): many-to-one by `contracts/0/id` + +The fields in this table are listed below. You can also download an [example CSV file](../../examples/csv/contracts_documents.csv) or a [blank template](../../examples/csv/template/contracts_documents.csv). + +```{jsonschema} ../../schema/network-schema.json +:include: id,contracts/0/id,contracts/0/documents/0/title,contracts/0/documents/0/description,contracts/0/documents/0/url,contracts/0/documents/0/format +``` + +##### Related phases + +This table is related to the following tables: + +* [Contracts](#contracts): many-to-one by `contracts/0/id` + +The fields in this table are listed below. You can also download an [example CSV file](../../examples/csv/contracts_relatedPhases.csv) or a [blank template](../../examples/csv/template/contracts_relatedPhases.csv). + +```{jsonschema} ../../schema/network-schema.json +:include: id,contracts/0/id,contracts/0/relatedPhases/0/id,contracts/0/relatedPhases/0/name +``` \ No newline at end of file diff --git a/docs/reference/schema.md b/docs/reference/schema.md index 4ea0db3..d951c63 100644 --- a/docs/reference/schema.md +++ b/docs/reference/schema.md @@ -43,8 +43,8 @@ In addition to the above sections, there are several top-level metadata fields: :::{tab-item} Example ```{eval-rst} -.. jsoninclude:: ../../examples/json/network.json - :jsonpointer: +.. jsoninclude:: ../../examples/json/network-package.json + :jsonpointer: /networks/0 :title: Example ``` ::: @@ -111,8 +111,8 @@ Each `Node` has the following fields: :::{tab-item} Example ```{eval-rst} -.. jsoninclude:: ../../examples/json/network.json - :jsonpointer: /nodes +.. jsoninclude:: ../../examples/json/network-package.json + :jsonpointer: /networks/0/nodes :title: Example ``` ::: @@ -148,8 +148,9 @@ Each `Link` has the following fields: :::{tab-item} Example ```{eval-rst} -.. jsoninclude:: ../../examples/json/network.json - :jsonpointer: /links +.. jsoninclude:: ../../examples/json/network-package.json + :jsonpointer: /networks/0/links + :title: Example ``` ::: @@ -173,8 +174,8 @@ Each `Phase` has the following fields: :::{tab-item} Example ```{eval-rst} -.. jsoninclude:: ../../examples/json/network.json - :jsonpointer: /phases +.. jsoninclude:: ../../examples/json/network-package.json + :jsonpointer: /networks/0/phases :title: Example ``` ::: @@ -203,8 +204,8 @@ Each `Organisation` has the following fields: :::{tab-item} Example ```{eval-rst} -.. jsoninclude:: ../../examples/json/network.json - :jsonpointer: /organisations +.. jsoninclude:: ../../examples/json/network-package.json + :jsonpointer: /networks/0/organisations :title: Example ``` ::: @@ -233,8 +234,8 @@ Each `Contract` has the following fields: :::{tab-item} Example ```{eval-rst} -.. jsoninclude:: ../../examples/json/network.json - :jsonpointer: /contracts +.. jsoninclude:: ../../examples/json/network-package.json + :jsonpointer: /networks/0/contracts :title: Example ``` ::: @@ -259,12 +260,12 @@ Each `Geometry` has the following fields: :::{tab-item} Example ```{eval-rst} -.. jsoninclude:: ../../examples/json/network.json - :jsonpointer: /nodes/0/location +.. jsoninclude:: ../../examples/json/network-package.json + :jsonpointer: /networks/0/nodes/0/location :title: Node -.. jsoninclude:: ../../examples/json/network.json - :jsonpointer: /links/0/route +.. jsoninclude:: ../../examples/json/network-package.json + :jsonpointer: /networks/0/links/0/route :title: Link ``` ::: @@ -289,8 +290,8 @@ Each `OrganisationReference` has the following fields: :::{tab-item} Example ```{eval-rst} -.. jsoninclude:: ../../examples/json/network.json - :jsonpointer: /links/0/physicalInfrastructureProvider +.. jsoninclude:: ../../examples/json/network-package.json + :jsonpointer: /networks/0/links/0/physicalInfrastructureProvider :title: Example ``` ::: @@ -314,8 +315,8 @@ Each `PhaseReference` has the following fields: :::{tab-item} Example ```{eval-rst} -.. jsoninclude:: ../../examples/json/network.json - :jsonpointer: /contracts/0/relatedPhases +.. jsoninclude:: ../../examples/json/network-package.json + :jsonpointer: /networks/0/contracts/0/relatedPhases :title: Example ``` ::: @@ -340,8 +341,8 @@ Each `Address` has the following fields: :::{tab-item} Example ```{eval-rst} -.. jsoninclude:: ../../examples/json/network.json - :jsonpointer: /nodes/0/address +.. jsoninclude:: ../../examples/json/network-package.json + :jsonpointer: /networks/0/nodes/0/address :title: Example ``` ::: @@ -365,8 +366,8 @@ Each `Value` has the following fields: :::{tab-item} Example ```{eval-rst} -.. jsoninclude:: ../../examples/json/network.json - :jsonpointer: /contracts/0/value +.. jsoninclude:: ../../examples/json/network-package.json + :jsonpointer: /networks/0/contracts/0/value :title: Example ``` ::: @@ -391,8 +392,8 @@ Each `Document` has the following fields: :::{tab-item} Example ```{eval-rst} -.. jsoninclude:: ../../examples/json/network.json - :jsonpointer: /contracts/0/documents +.. jsoninclude:: ../../examples/json/network-package.json + :jsonpointer: /networks/0/contracts/0/documents :title: Example ``` ::: @@ -417,8 +418,8 @@ Each `Identifier` has the following fields: :::{tab-item} Example ```{eval-rst} -.. jsoninclude:: ../../examples/json/network.json - :jsonpointer: /organisations/0/identifier +.. jsoninclude:: ../../examples/json/network-package.json + :jsonpointer: /networks/0/organisations/0/identifier :title: Example ``` ::: @@ -460,8 +461,8 @@ Each `CoordinateReferenceSystem` has the following fields: :::{tab-item} Example ```{eval-rst} -.. jsoninclude:: ../../examples/json/network.json - :jsonpointer: /crs +.. jsoninclude:: ../../examples/json/network-package.json + :jsonpointer: /networks/0/crs :title: Example ``` ::: @@ -491,11 +492,11 @@ Each `RelatedResourceReference` has the following fields: :::{tab-item} Example ```{eval-rst} .. jsoninclude:: ../../examples/json/network-separate-endpoints.json - :jsonpointer: /relatedResources + :jsonpointer: /networks/0/relatedResources :title: Pagination .. jsoninclude:: ../../examples/json/network-separate-files.json - :jsonpointer: /relatedResources + :jsonpointer: /networks/0/relatedResources :title: Streaming ``` ::: @@ -516,13 +517,12 @@ Each `FibreTypeDetails` has the following fields: :pointer: /definitions/FibreTypeDetails :collapse: description ``` -``` ::: :::{tab-item} Example ```{eval-rst} -.. jsoninclude:: ../../examples/json/network.json - :jsonpointer: /links/0/fibreTypeDetails +.. jsoninclude:: ../../examples/json/network-package.json + :jsonpointer: /networks/0/links/0/fibreTypeDetails :title: Example ``` ::: @@ -547,13 +547,12 @@ Each `DeploymentDetails` has the following fields: :pointer: /definitions/DeploymentDetails :collapse: description ``` -``` ::: :::{tab-item} Example ```{eval-rst} -.. jsoninclude:: ../../examples/json/network.json - :jsonpointer: /links/0/deploymentDetails +.. jsoninclude:: ../../examples/json/network-package.json + :jsonpointer: /networks/0/links/0/deploymentDetails :title: Example ``` ::: @@ -582,10 +581,11 @@ Each `CapacityDetails` has the following fields: :::{tab-item} Example ```{eval-rst} -.. jsoninclude:: ../../examples/json/network.json - :jsonpointer: /links/0/capacityDetails +.. jsoninclude:: ../../examples/json/network-package.json + :jsonpointer: /networks/0/links/0/capacityDetails :title: Example ``` ::: :::: + \ No newline at end of file diff --git a/examples/csv/contracts.csv b/examples/csv/contracts.csv new file mode 100644 index 0000000..c38ca6a --- /dev/null +++ b/examples/csv/contracts.csv @@ -0,0 +1,2 @@ +id,contracts/0/id,contracts/0/title,contracts/0/description,contracts/0/type,contracts/0/value/amount,contracts/0/value/currency,contracts/0/dateSigned +a096d627-72e1-4f9b-b129-951b1737bff4,1,NextGen Phase 1 Construction Contract,Contract for the construction of phase 1 of the NextGen network.,private,1537459500.00,GHS,2016-06-30 diff --git a/examples/csv/contracts_documents.csv b/examples/csv/contracts_documents.csv new file mode 100644 index 0000000..30d0a9a --- /dev/null +++ b/examples/csv/contracts_documents.csv @@ -0,0 +1,2 @@ +id,contracts/0/id,contracts/0/documents/0/title,contracts/0/documents/0/description,contracts/0/documents/0/url,contracts/0/documents/0/format +a096d627-72e1-4f9b-b129-951b1737bff4,1,NextGen Phase 1 Construction Contract,Signed contract.,http://example.com/contracts/nextgen-phase1-construction.pdf,application/pdf diff --git a/examples/csv/contracts_relatedPhases.csv b/examples/csv/contracts_relatedPhases.csv new file mode 100644 index 0000000..bf38581 --- /dev/null +++ b/examples/csv/contracts_relatedPhases.csv @@ -0,0 +1,2 @@ +id,contracts/0/id,contracts/0/relatedPhases/0/id,contracts/0/relatedPhases/0/name +a096d627-72e1-4f9b-b129-951b1737bff4,1,1,NextGen Phase 1 diff --git a/examples/csv/links.csv b/examples/csv/links.csv new file mode 100644 index 0000000..17d2cb0 --- /dev/null +++ b/examples/csv/links.csv @@ -0,0 +1,2 @@ +id,links/0/id,links/0/name,links/0/phase/id,links/0/phase/name,links/0/status,links/0/readyForServiceDate,links/0/start,links/0/end,links/0/directed,links/0/route/type,links/0/route/coordinates,links/0/physicalInfrastructureProvider/id,links/0/physicalInfrastructureProvider/name,links/0/networkProvider/id,links/0/networkProvider/name,links/0/supplier/id,links/0/supplier/name,links/0/transmissionMedium,links/0/deployment,links/0/deploymentDetails/description,links/0/darkFibre,links/0/fibreType,links/0/fibreTypeDetails/description,links/0/fibreCount,links/0/fibreLength,links/0/technologies,links/0/capacity,links/0/capacityDetails/description,links/0/countries +a096d627-72e1-4f9b-b129-951b1737bff4,1,Accra to Kumasi,1,NextGen Phase 1,operational,2018-01-01,1,2,False,LineString,"-0.173,5.626;-0.178,5.807;-0.112,5.971;-0.211,5.963;-0.321,6.170;-0.488,6.290;-0.560,6.421;-0.752,6.533;-0.867,6.607;-1.101,6.585;-1.304,6.623;-1.461,6.727;-1.628,6.713",GH-RGD-CS111111111,FibreCo,GH-RGD-CS222222222,FastWeb,GH-RGD-CS333333333,ProjectCo,fibre,belowGround,Buried in ducts,True,G.652,"CABLED STANDARD ENHANCED SINGLEMODE FIBRE ESMF, LOW WATER PEAK SINGLE MODE FIBRE G.652.D, OS2",24,276000,sdh,4.976,2xSTM-16,GH diff --git a/examples/csv/networks.csv b/examples/csv/networks.csv new file mode 100644 index 0000000..9f8e656 --- /dev/null +++ b/examples/csv/networks.csv @@ -0,0 +1,2 @@ +id,name,website,publisher/id,publisher/name,publisher/identifier/id,publisher/identifier/scheme,publisher/identifier/legalName,publisher/identifier/uri,publisher/country,publisher/roles,publisher/roleDetails,publisher/website,publisher/logo,publicationDate,collectionDate,crs/name,crs/uri,accuracy,accuracyDetails,language +a096d627-72e1-4f9b-b129-951b1737bff4,Ghana Fibre Network,http://example.com/network,GH-RGD-CS111111111,FibreCo,CS111111111,GH-RGD,FibreCo Ghana Limited,https://example.com/companies/CS111111111,GH,,,https://www.example.com,https://www.example.com/logo.png,2022-01-01,2021-09-30,urn:ogc:def:crs:OGC::CRS84,http://www.opengis.net/def/crs/OGC/1.3/CRS84,250,Measured according to the US National Standard for Spatial Data Accuracy.,en diff --git a/examples/csv/nodes.csv b/examples/csv/nodes.csv new file mode 100644 index 0000000..8ee44e5 --- /dev/null +++ b/examples/csv/nodes.csv @@ -0,0 +1,3 @@ +id,nodes/0/id,nodes/0/name,nodes/0/phase/id,nodes/0/phase/name,nodes/0/status,nodes/0/location/type,nodes/0/location/coordinates,nodes/0/address/streetAddress,nodes/0/address/locality,nodes/0/address/region,nodes/0/address/postalCode,nodes/0/address/country,nodes/0/type,nodes/0/accessPoint,nodes/0/power,nodes/0/technologies,nodes/0/physicalInfrastructureProvider/id,nodes/0/physicalInfrastructureProvider/name,nodes/0/networkProvider/id,nodes/0/networkProvider/name +a096d627-72e1-4f9b-b129-951b1737bff4,1,Accra,1,NextGen Phase 1,operational,Point,-0.174;5.625,Boundary Rd,Shiashie,Accra,12345,GH,pop,True,True,ip,GH-RGD-CS111111111,FibreCo,GH-RGD-CS222222222,FastWeb +a096d627-72e1-4f9b-b129-951b1737bff4,2,Kumasi,1,NextGen Phase 1,operational,Point,-1.628;6.711,Kejetia Road,Bantama,Kumasi,00000,GH,pop,True,True,ip,GH-RGD-CS111111111,FibreCo,GH-RGD-CS222222222,FastWeb diff --git a/examples/csv/nodes_internationalConnections.csv b/examples/csv/nodes_internationalConnections.csv new file mode 100644 index 0000000..6546dcd --- /dev/null +++ b/examples/csv/nodes_internationalConnections.csv @@ -0,0 +1,2 @@ +id,nodes/0/id,nodes/0/internationalConnections/0/streetAddress,nodes/0/internationalConnections/0/locality,nodes/0/internationalConnections/0/region,nodes/0/internationalConnections/0/postalCode,nodes/0/internationalConnections/0/country +a096d627-72e1-4f9b-b129-951b1737bff4,1,,,Lomé,,TG diff --git a/examples/csv/organisations.csv b/examples/csv/organisations.csv new file mode 100644 index 0000000..04397ea --- /dev/null +++ b/examples/csv/organisations.csv @@ -0,0 +1,5 @@ +id,organisations/0/id,organisations/0/name,organisations/0/identifier/id,organisations/0/identifier/scheme,organisations/0/identifier/legalName,organisations/0/identifier/uri,organisations/0/country,organisations/0/roles,organisations/0/roleDetails,organisations/0/website,organisations/0/logo +a096d627-72e1-4f9b-b129-951b1737bff4,GH-RGD-CS111111111,FibreCo,CS111111111,GH-RGD,FibreCo Ghana Limited,https://example.com/companies/CS111111111,GH,physicalInfrastructureProvider,FibreCo owns and maintains the physical infrastructure.,https://www.example.com,https://www.example.com/logo.png +a096d627-72e1-4f9b-b129-951b1737bff4,GH-RGD-CS222222222,FastWeb,CS222222222,GH-RGD,FastWeb Ghana Limited,https://example.com/companies/CS222222222,GH,networkProvider,FastWeb provides wholesale services to service providers and dark fibre access to other network providers.,https://www.example.com,https://www.example.com/logo.png +a096d627-72e1-4f9b-b129-951b1737bff4,GH-RGD-CS333333333,ProjectCo,CS333333333,GH-RGD,ProjectCo Ghana Limited,https://example.com/companies/CS333333333,GH,supplier,ProjectCo was responsible for the construction of phase 1 of the NextGen network.,https://www.example.com,https://www.example.com/logo.png +a096d627-72e1-4f9b-b129-951b1737bff4,1,Ghana Infrastructure Investment Fund,,,,,GH,funder,The Ghana Infrastructure Investment Fund provided equity financing for the construction of phase 1 of the NextGen network.,https://www.example.com,https://www.example.com/logo.png diff --git a/examples/csv/phases.csv b/examples/csv/phases.csv new file mode 100644 index 0000000..48d54c3 --- /dev/null +++ b/examples/csv/phases.csv @@ -0,0 +1,2 @@ +id,phases/0/id,phases/0/name,phases/0/description +a096d627-72e1-4f9b-b129-951b1737bff4,1,NextGen Phase 1,The first phase of the Ghana Fibre Network NextGen roll-out. diff --git a/examples/csv/phases_funders.csv b/examples/csv/phases_funders.csv new file mode 100644 index 0000000..acac887 --- /dev/null +++ b/examples/csv/phases_funders.csv @@ -0,0 +1,2 @@ +id,phases/0/id,phases/0/funders/0/id,phases/0/funders/0/name +a096d627-72e1-4f9b-b129-951b1737bff4,1,1,Ghana Infrastructure Investment Fund diff --git a/examples/csv/relatedResources.csv b/examples/csv/relatedResources.csv new file mode 100644 index 0000000..ae29817 --- /dev/null +++ b/examples/csv/relatedResources.csv @@ -0,0 +1 @@ +id,relatedResources/0/href,relatedResources/0/rel diff --git a/examples/csv/template/contracts.csv b/examples/csv/template/contracts.csv new file mode 100644 index 0000000..4a20e6c --- /dev/null +++ b/examples/csv/template/contracts.csv @@ -0,0 +1 @@ +id,contracts/0/id,contracts/0/title,contracts/0/description,contracts/0/type,contracts/0/value/amount,contracts/0/value/currency,contracts/0/dateSigned diff --git a/examples/csv/template/contracts_documents.csv b/examples/csv/template/contracts_documents.csv new file mode 100644 index 0000000..30955bf --- /dev/null +++ b/examples/csv/template/contracts_documents.csv @@ -0,0 +1 @@ +id,contracts/0/id,contracts/0/documents/0/title,contracts/0/documents/0/description,contracts/0/documents/0/url,contracts/0/documents/0/format diff --git a/examples/csv/template/contracts_relatedPhases.csv b/examples/csv/template/contracts_relatedPhases.csv new file mode 100644 index 0000000..b60910c --- /dev/null +++ b/examples/csv/template/contracts_relatedPhases.csv @@ -0,0 +1 @@ +id,contracts/0/id,contracts/0/relatedPhases/0/id,contracts/0/relatedPhases/0/name diff --git a/examples/csv/template/links.csv b/examples/csv/template/links.csv new file mode 100644 index 0000000..2f98ab1 --- /dev/null +++ b/examples/csv/template/links.csv @@ -0,0 +1 @@ +id,links/0/id,links/0/name,links/0/phase/id,links/0/phase/name,links/0/status,links/0/readyForServiceDate,links/0/start,links/0/end,links/0/directed,links/0/route/type,links/0/route/coordinates,links/0/physicalInfrastructureProvider/id,links/0/physicalInfrastructureProvider/name,links/0/networkProvider/id,links/0/networkProvider/name,links/0/supplier/id,links/0/supplier/name,links/0/transmissionMedium,links/0/deployment,links/0/deploymentDetails/description,links/0/darkFibre,links/0/fibreType,links/0/fibreTypeDetails/description,links/0/fibreCount,links/0/fibreLength,links/0/technologies,links/0/capacity,links/0/capacityDetails/description,links/0/countries diff --git a/examples/csv/template/networks.csv b/examples/csv/template/networks.csv new file mode 100644 index 0000000..31c4bbd --- /dev/null +++ b/examples/csv/template/networks.csv @@ -0,0 +1 @@ +id,name,website,publisher/id,publisher/name,publisher/identifier/id,publisher/identifier/scheme,publisher/identifier/legalName,publisher/identifier/uri,publisher/country,publisher/roles,publisher/roleDetails,publisher/website,publisher/logo,publicationDate,collectionDate,crs/name,crs/uri,accuracy,accuracyDetails,language diff --git a/examples/csv/template/nodes.csv b/examples/csv/template/nodes.csv new file mode 100644 index 0000000..3822065 --- /dev/null +++ b/examples/csv/template/nodes.csv @@ -0,0 +1 @@ +id,nodes/0/id,nodes/0/name,nodes/0/phase/id,nodes/0/phase/name,nodes/0/status,nodes/0/location/type,nodes/0/location/coordinates,nodes/0/address/streetAddress,nodes/0/address/locality,nodes/0/address/region,nodes/0/address/postalCode,nodes/0/address/country,nodes/0/type,nodes/0/accessPoint,nodes/0/power,nodes/0/technologies,nodes/0/physicalInfrastructureProvider/id,nodes/0/physicalInfrastructureProvider/name,nodes/0/networkProvider/id,nodes/0/networkProvider/name diff --git a/examples/csv/template/nodes_internationalConnections.csv b/examples/csv/template/nodes_internationalConnections.csv new file mode 100644 index 0000000..8aed12d --- /dev/null +++ b/examples/csv/template/nodes_internationalConnections.csv @@ -0,0 +1 @@ +id,nodes/0/id,nodes/0/internationalConnections/0/streetAddress,nodes/0/internationalConnections/0/locality,nodes/0/internationalConnections/0/region,nodes/0/internationalConnections/0/postalCode,nodes/0/internationalConnections/0/country diff --git a/examples/csv/template/organisations.csv b/examples/csv/template/organisations.csv new file mode 100644 index 0000000..bd69c0d --- /dev/null +++ b/examples/csv/template/organisations.csv @@ -0,0 +1 @@ +id,organisations/0/id,organisations/0/name,organisations/0/identifier/id,organisations/0/identifier/scheme,organisations/0/identifier/legalName,organisations/0/identifier/uri,organisations/0/country,organisations/0/roles,organisations/0/roleDetails,organisations/0/website,organisations/0/logo diff --git a/examples/csv/template/phases.csv b/examples/csv/template/phases.csv new file mode 100644 index 0000000..1b8927f --- /dev/null +++ b/examples/csv/template/phases.csv @@ -0,0 +1 @@ +id,phases/0/id,phases/0/name,phases/0/description diff --git a/examples/csv/template/phases_funders.csv b/examples/csv/template/phases_funders.csv new file mode 100644 index 0000000..302d9c6 --- /dev/null +++ b/examples/csv/template/phases_funders.csv @@ -0,0 +1 @@ +id,phases/0/id,phases/0/funders/0/id,phases/0/funders/0/name diff --git a/examples/csv/template/relatedResources.csv b/examples/csv/template/relatedResources.csv new file mode 100644 index 0000000..ae29817 --- /dev/null +++ b/examples/csv/template/relatedResources.csv @@ -0,0 +1 @@ +id,relatedResources/0/href,relatedResources/0/rel diff --git a/examples/geojson/links.geojson b/examples/geojson/links.geojson index 1db5023..2bdc259 100644 --- a/examples/geojson/links.geojson +++ b/examples/geojson/links.geojson @@ -3,293 +3,252 @@ "features": [ { "type": "Feature", - "geometry": null, + "geometry": { + "type": "LineString", + "coordinates": [ + [ + -0.173, + 5.626 + ], + [ + -0.178, + 5.807 + ], + [ + -0.112, + 5.971 + ], + [ + -0.211, + 5.963 + ], + [ + -0.321, + 6.17 + ], + [ + -0.488, + 6.29 + ], + [ + -0.56, + 6.421 + ], + [ + -0.752, + 6.533 + ], + [ + -0.867, + 6.607 + ], + [ + -1.101, + 6.585 + ], + [ + -1.304, + 6.623 + ], + [ + -1.461, + 6.727 + ], + [ + -1.628, + 6.713 + ] + ] + }, "properties": { - "id": "in est Lorem", - "capacity": 65027666.72739151, - "ownership": { - "title": "Ownership", - "$comment": "Work in progress" + "id": "1", + "name": "Accra to Kumasi", + "phase": { + "id": "1", + "name": "NextGen Phase 1" + }, + "status": "operational", + "readyForServiceDate": "2018-01-01", + "start": "1", + "end": "2", + "directed": false, + "physicalInfrastructureProvider": { + "id": "GH-RGD-CS111111111", + "name": "FibreCo" + }, + "networkProvider": { + "id": "GH-RGD-CS222222222", + "name": "FastWeb" }, - "readyForServiceDate": "2007-07-29", - "darkFibre": false, - "status": "proposed", "supplier": { - "name": "qui", - "id": "dolore elit eu sint", - "quis559": false + "id": "GH-RGD-CS333333333", + "name": "ProjectCo" }, - "fibreLength": -7882241.099844724, - "capacityDetails": { - "title": "Capacity details", - "$comment": "Work in progress" + "transmissionMedium": [ + "fibre" + ], + "deployment": [ + "belowGround" + ], + "deploymentDetails": { + "description": "Buried in ducts" + }, + "darkFibre": true, + "fibreType": "G.652", + "fibreTypeDetails": { + "description": "CABLED STANDARD ENHANCED SINGLEMODE FIBRE ESMF, LOW WATER PEAK SINGLE MODE FIBRE G.652.D, OS2" }, + "fibreCount": 24, + "fibreLength": 276000, "technologies": [ - "sunt non occaecat elit enim", - "qui reprehenderit sint enim", - "amet ut ullamco", - "sit aute nisi" + "sdh" ], - "end": "Lorem in", - "deployment": "belowGround", - "country": null, - "fibreCount": 61818760, - "networkProvider": { - "id": "est velit aute nulla", - "name": "est id dolor nostrud" + "capacity": 4.976, + "capacityDetails": { + "description": "2xSTM-16" }, - "network": { - "identifier": "ullamco eiusmod mollit occaecat in", - "language": "ex anim occaecat sed", - "contracts": [ - { - "id": "proident", - "relatedPhases": [ - { - "id": "laboris ad id", - "name": "Excepteur quis in qui", - "enim_7": "dolor", - "ut7c": "consequat enim laborum" - } - ], - "title": "eu", - "value": { - "currency": null, - "sint_": 76573854 - }, - "documents": [ - { - "minim_1": "non", - "do_7b4": false - }, - { - "ut6": 5521727.84443976 - }, - { - "cillum1": 19961553.435848683 - }, - { - "tempore6b": false - } - ], - "type": "ipsum Excepteur", - "description": "officia cillum in reprehenderit" - } + "countries": [ + "GH" + ], + "endpoint": { + "id": "2", + "name": "Kumasi", + "phase": { + "id": "1", + "name": "NextGen Phase 1" + }, + "status": "operational", + "address": { + "streetAddress": "Kejetia Road", + "locality": "Bantama", + "region": "Kumasi", + "postalCode": "00000", + "country": "GH" + }, + "type": [ + "pop" ], - "crs": { - "name": "urn:ogc:def:crs:OGC::CRS84", - "uri": "http://www.opengis.net/def/crs/OGC/1.3/CRS84" + "accessPoint": true, + "power": true, + "technologies": [ + "ip" + ], + "physicalInfrastructureProvider": { + "id": "GH-RGD-CS111111111", + "name": "FibreCo" }, - "name": "minim", - "accuracyDetails": "nulla", - "collectionDate": "2014-06-22", - "accuracy": -8557076.28308025, - "publisher": { - "id": "sit commodo", - "listing.symbol": "aliqua commodo", - "role": [ - "Duis", - "quis elit sunt" + "networkProvider": { + "id": "GH-RGD-CS222222222", + "name": "FastWeb" + }, + "network": { + "id": "a096d627-72e1-4f9b-b129-951b1737bff4", + "name": "Ghana Fibre Network", + "contracts": [ + { + "id": "1", + "title": "NextGen Phase 1 Construction Contract", + "description": "Contract for the construction of phase 1 of the NextGen network.", + "type": "private", + "value": { + "amount": 1537459500.0, + "currency": "GHS" + }, + "dateSigned": "2016-06-30", + "documents": [ + { + "title": "NextGen Phase 1 Construction Contract", + "description": "Signed contract.", + "url": "http://example.com/contracts/nextgen-phase1-construction.pdf", + "format": "application/pdf" + } + ], + "relatedPhases": [ + { + "id": "1", + "name": "NextGen Phase 1" + } + ] + } ], - "classification": "tempor", - "listing.exchange": null, - "logo": "https://TpMgpkwTJwkbQjVIEkPUIYqXKRE.rdvmK54YlyOGJ6-z39Vu+z", - "name": "proident reprehenderit cupidatat labore ut", - "website": "https://fUjMQRln.iallzj-b81TrBkN31DSC9Vq", - "identifier": { - "uri": "http://xasIfEgWXaI.hfwKP-c-I45vyMfKZnhcq76Waq9ZlRyPb4,7i-LA5qHsxWfAIzXLPlxUF8JZKzy", - "id": "pariatur", - "legalName": "in", - "Excepteur7": -73661482 + "website": "http://example.com/network", + "publisher": { + "id": "GH-RGD-CS111111111", + "name": "FibreCo", + "identifier": { + "id": "CS111111111", + "scheme": "GH-RGD", + "legalName": "FibreCo Ghana Limited", + "uri": "https://example.com/companies/CS111111111" + }, + "country": "GH", + "website": "https://www.example.com", + "logo": "https://www.example.com/logo.png" }, - "country": null + "publicationDate": "2022-01-01", + "collectionDate": "2021-09-30", + "crs": { + "name": "urn:ogc:def:crs:OGC::CRS84", + "uri": "http://www.opengis.net/def/crs/OGC/1.3/CRS84" + }, + "accuracy": 250, + "accuracyDetails": "Measured according to the US National Standard for Spatial Data Accuracy.", + "language": "en" } - } - } - }, - { - "type": "Feature", - "geometry": null, - "properties": { - "id": "dolore", - "supplier": { - "name": "in", - "id": "voluptate nulla sunt irure do", - "fugiat0": 30056113.613429964 - }, - "transmissionMedium": "microwave", - "phase": { - "occaecat_f6": true }, "network": { - "identifier": "ullamco eiusmod mollit occaecat in", - "language": "ex anim occaecat sed", + "id": "a096d627-72e1-4f9b-b129-951b1737bff4", + "name": "Ghana Fibre Network", "contracts": [ { - "id": "proident", - "relatedPhases": [ - { - "id": "laboris ad id", - "name": "Excepteur quis in qui", - "enim_7": "dolor", - "ut7c": "consequat enim laborum" - } - ], - "title": "eu", + "id": "1", + "title": "NextGen Phase 1 Construction Contract", + "description": "Contract for the construction of phase 1 of the NextGen network.", + "type": "private", "value": { - "currency": null, - "sint_": 76573854 + "amount": 1537459500.0, + "currency": "GHS" }, + "dateSigned": "2016-06-30", "documents": [ { - "minim_1": "non", - "do_7b4": false - }, - { - "ut6": 5521727.84443976 - }, - { - "cillum1": 19961553.435848683 - }, - { - "tempore6b": false + "title": "NextGen Phase 1 Construction Contract", + "description": "Signed contract.", + "url": "http://example.com/contracts/nextgen-phase1-construction.pdf", + "format": "application/pdf" } ], - "type": "ipsum Excepteur", - "description": "officia cillum in reprehenderit" - } - ], - "crs": { - "name": "urn:ogc:def:crs:OGC::CRS84", - "uri": "http://www.opengis.net/def/crs/OGC/1.3/CRS84" - }, - "name": "minim", - "accuracyDetails": "nulla", - "collectionDate": "2014-06-22", - "accuracy": -8557076.28308025, - "publisher": { - "id": "sit commodo", - "listing.symbol": "aliqua commodo", - "role": [ - "Duis", - "quis elit sunt" - ], - "classification": "tempor", - "listing.exchange": null, - "logo": "https://TpMgpkwTJwkbQjVIEkPUIYqXKRE.rdvmK54YlyOGJ6-z39Vu+z", - "name": "proident reprehenderit cupidatat labore ut", - "website": "https://fUjMQRln.iallzj-b81TrBkN31DSC9Vq", - "identifier": { - "uri": "http://xasIfEgWXaI.hfwKP-c-I45vyMfKZnhcq76Waq9ZlRyPb4,7i-LA5qHsxWfAIzXLPlxUF8JZKzy", - "id": "pariatur", - "legalName": "in", - "Excepteur7": -73661482 - }, - "country": null - } - } - } - }, - { - "type": "Feature", - "geometry": { - "type": "dolor proident", - "coordinates": [ - [], - [] - ], - "Duisd7": "enim officia magna", - "nulla_f": 79707577 - }, - "properties": { - "id": "eiusmod dolor commodo ut", - "start": "in elit id eu", - "status": "operational", - "country": null, - "physicalInfrastructureProvider": { - "id": "pariatur nulla voluptate sed", - "name": "fugiat in" - }, - "technologies": [ - "quis", - "culpa consectetur ullamco officia ipsum", - "nisi sed", - "in magna consequat laborum dolor", - "minim dolor fugiat magna nostrud" - ], - "supplier": { - "name": "voluptate in magna", - "dolor5": 87693292.69140774, - "nulla_b": "pariatur", - "ut_f": -99279607, - "cupidatat_e59": 87396229.22938937 - }, - "network": { - "identifier": "ullamco eiusmod mollit occaecat in", - "language": "ex anim occaecat sed", - "contracts": [ - { - "id": "proident", "relatedPhases": [ { - "id": "laboris ad id", - "name": "Excepteur quis in qui", - "enim_7": "dolor", - "ut7c": "consequat enim laborum" - } - ], - "title": "eu", - "value": { - "currency": null, - "sint_": 76573854 - }, - "documents": [ - { - "minim_1": "non", - "do_7b4": false - }, - { - "ut6": 5521727.84443976 - }, - { - "cillum1": 19961553.435848683 - }, - { - "tempore6b": false + "id": "1", + "name": "NextGen Phase 1" } - ], - "type": "ipsum Excepteur", - "description": "officia cillum in reprehenderit" + ] } ], + "website": "http://example.com/network", + "publisher": { + "id": "GH-RGD-CS111111111", + "name": "FibreCo", + "identifier": { + "id": "CS111111111", + "scheme": "GH-RGD", + "legalName": "FibreCo Ghana Limited", + "uri": "https://example.com/companies/CS111111111" + }, + "country": "GH", + "website": "https://www.example.com", + "logo": "https://www.example.com/logo.png" + }, + "publicationDate": "2022-01-01", + "collectionDate": "2021-09-30", "crs": { "name": "urn:ogc:def:crs:OGC::CRS84", "uri": "http://www.opengis.net/def/crs/OGC/1.3/CRS84" }, - "name": "minim", - "accuracyDetails": "nulla", - "collectionDate": "2014-06-22", - "accuracy": -8557076.28308025, - "publisher": { - "id": "sit commodo", - "listing.symbol": "aliqua commodo", - "role": [ - "Duis", - "quis elit sunt" - ], - "classification": "tempor", - "listing.exchange": null, - "logo": "https://TpMgpkwTJwkbQjVIEkPUIYqXKRE.rdvmK54YlyOGJ6-z39Vu+z", - "name": "proident reprehenderit cupidatat labore ut", - "website": "https://fUjMQRln.iallzj-b81TrBkN31DSC9Vq", - "identifier": { - "uri": "http://xasIfEgWXaI.hfwKP-c-I45vyMfKZnhcq76Waq9ZlRyPb4,7i-LA5qHsxWfAIzXLPlxUF8JZKzy", - "id": "pariatur", - "legalName": "in", - "Excepteur7": -73661482 - }, - "country": null - } + "accuracy": 250, + "accuracyDetails": "Measured according to the US National Standard for Spatial Data Accuracy.", + "language": "en" } } } diff --git a/examples/geojson/nodes.geojson b/examples/geojson/nodes.geojson index 3a940c4..df28ba8 100644 --- a/examples/geojson/nodes.geojson +++ b/examples/geojson/nodes.geojson @@ -3,174 +3,199 @@ "features": [ { "type": "Feature", - "geometry": null, + "geometry": { + "type": "Point", + "coordinates": [ + -0.174, + 5.625 + ] + }, "properties": { - "id": "Excepteur", - "accessPoint": true, - "rackspace": { - "title": "Node rackspace", - "$comment": "Work in progress" + "id": "1", + "name": "Accra", + "phase": { + "id": "1", + "name": "NextGen Phase 1" }, + "status": "operational", "address": { - "streetAddress": "et amet dolor", - "locality": "ad est elit" + "streetAddress": "Boundary Rd", + "locality": "Shiashie", + "region": "Accra", + "postalCode": "12345", + "country": "GH" }, - "status": "underConstruction", - "phase": { - "id": "nisi dolore ad proident officia", - "name": "qui esse ut veniam" + "type": [ + "pop" + ], + "accessPoint": true, + "internationalConnections": [ + { + "region": "Lom\u00e9", + "country": "TG" + } + ], + "power": true, + "technologies": [ + "ip" + ], + "physicalInfrastructureProvider": { + "id": "GH-RGD-CS111111111", + "name": "FibreCo" + }, + "networkProvider": { + "id": "GH-RGD-CS222222222", + "name": "FastWeb" }, - "internationalConnections": [], "network": { - "identifier": "ullamco eiusmod mollit occaecat in", - "language": "ex anim occaecat sed", + "id": "a096d627-72e1-4f9b-b129-951b1737bff4", + "name": "Ghana Fibre Network", "contracts": [ { - "id": "proident", - "relatedPhases": [ - { - "id": "laboris ad id", - "name": "Excepteur quis in qui", - "enim_7": "dolor", - "ut7c": "consequat enim laborum" - } - ], - "title": "eu", + "id": "1", + "title": "NextGen Phase 1 Construction Contract", + "description": "Contract for the construction of phase 1 of the NextGen network.", + "type": "private", "value": { - "currency": null, - "sint_": 76573854 + "amount": 1537459500.0, + "currency": "GHS" }, + "dateSigned": "2016-06-30", "documents": [ { - "minim_1": "non", - "do_7b4": false - }, - { - "ut6": 5521727.84443976 - }, - { - "cillum1": 19961553.435848683 - }, - { - "tempore6b": false + "title": "NextGen Phase 1 Construction Contract", + "description": "Signed contract.", + "url": "http://example.com/contracts/nextgen-phase1-construction.pdf", + "format": "application/pdf" } ], - "type": "ipsum Excepteur", - "description": "officia cillum in reprehenderit" + "relatedPhases": [ + { + "id": "1", + "name": "NextGen Phase 1" + } + ] } ], + "website": "http://example.com/network", + "publisher": { + "id": "GH-RGD-CS111111111", + "name": "FibreCo", + "identifier": { + "id": "CS111111111", + "scheme": "GH-RGD", + "legalName": "FibreCo Ghana Limited", + "uri": "https://example.com/companies/CS111111111" + }, + "country": "GH", + "website": "https://www.example.com", + "logo": "https://www.example.com/logo.png" + }, + "publicationDate": "2022-01-01", + "collectionDate": "2021-09-30", "crs": { "name": "urn:ogc:def:crs:OGC::CRS84", "uri": "http://www.opengis.net/def/crs/OGC/1.3/CRS84" }, - "name": "minim", - "accuracyDetails": "nulla", - "collectionDate": "2014-06-22", - "accuracy": -8557076.28308025, - "publisher": { - "id": "sit commodo", - "listing.symbol": "aliqua commodo", - "role": [ - "Duis", - "quis elit sunt" - ], - "classification": "tempor", - "listing.exchange": null, - "logo": "https://TpMgpkwTJwkbQjVIEkPUIYqXKRE.rdvmK54YlyOGJ6-z39Vu+z", - "name": "proident reprehenderit cupidatat labore ut", - "website": "https://fUjMQRln.iallzj-b81TrBkN31DSC9Vq", - "identifier": { - "uri": "http://xasIfEgWXaI.hfwKP-c-I45vyMfKZnhcq76Waq9ZlRyPb4,7i-LA5qHsxWfAIzXLPlxUF8JZKzy", - "id": "pariatur", - "legalName": "in", - "Excepteur7": -73661482 - }, - "country": null - } + "accuracy": 250, + "accuracyDetails": "Measured according to the US National Standard for Spatial Data Accuracy.", + "language": "en" } } }, { "type": "Feature", - "geometry": null, + "geometry": { + "type": "Point", + "coordinates": [ + -1.628, + 6.711 + ] + }, "properties": { - "id": "adipisicing ut eu", - "power": false, - "rackspace": { - "title": "Node rackspace", - "$comment": "Work in progress" + "id": "2", + "name": "Kumasi", + "phase": { + "id": "1", + "name": "NextGen Phase 1" + }, + "status": "operational", + "address": { + "streetAddress": "Kejetia Road", + "locality": "Bantama", + "region": "Kumasi", + "postalCode": "00000", + "country": "GH" + }, + "type": [ + "pop" + ], + "accessPoint": true, + "power": true, + "technologies": [ + "ip" + ], + "physicalInfrastructureProvider": { + "id": "GH-RGD-CS111111111", + "name": "FibreCo" }, - "name": "laboris", "networkProvider": { - "id": "veniam", - "name": "voluptate" + "id": "GH-RGD-CS222222222", + "name": "FastWeb" }, "network": { - "identifier": "ullamco eiusmod mollit occaecat in", - "language": "ex anim occaecat sed", + "id": "a096d627-72e1-4f9b-b129-951b1737bff4", + "name": "Ghana Fibre Network", "contracts": [ { - "id": "proident", - "relatedPhases": [ - { - "id": "laboris ad id", - "name": "Excepteur quis in qui", - "enim_7": "dolor", - "ut7c": "consequat enim laborum" - } - ], - "title": "eu", + "id": "1", + "title": "NextGen Phase 1 Construction Contract", + "description": "Contract for the construction of phase 1 of the NextGen network.", + "type": "private", "value": { - "currency": null, - "sint_": 76573854 + "amount": 1537459500.0, + "currency": "GHS" }, + "dateSigned": "2016-06-30", "documents": [ { - "minim_1": "non", - "do_7b4": false - }, - { - "ut6": 5521727.84443976 - }, - { - "cillum1": 19961553.435848683 - }, - { - "tempore6b": false + "title": "NextGen Phase 1 Construction Contract", + "description": "Signed contract.", + "url": "http://example.com/contracts/nextgen-phase1-construction.pdf", + "format": "application/pdf" } ], - "type": "ipsum Excepteur", - "description": "officia cillum in reprehenderit" + "relatedPhases": [ + { + "id": "1", + "name": "NextGen Phase 1" + } + ] } ], + "website": "http://example.com/network", + "publisher": { + "id": "GH-RGD-CS111111111", + "name": "FibreCo", + "identifier": { + "id": "CS111111111", + "scheme": "GH-RGD", + "legalName": "FibreCo Ghana Limited", + "uri": "https://example.com/companies/CS111111111" + }, + "country": "GH", + "website": "https://www.example.com", + "logo": "https://www.example.com/logo.png" + }, + "publicationDate": "2022-01-01", + "collectionDate": "2021-09-30", "crs": { "name": "urn:ogc:def:crs:OGC::CRS84", "uri": "http://www.opengis.net/def/crs/OGC/1.3/CRS84" }, - "name": "minim", - "accuracyDetails": "nulla", - "collectionDate": "2014-06-22", - "accuracy": -8557076.28308025, - "publisher": { - "id": "sit commodo", - "listing.symbol": "aliqua commodo", - "role": [ - "Duis", - "quis elit sunt" - ], - "classification": "tempor", - "listing.exchange": null, - "logo": "https://TpMgpkwTJwkbQjVIEkPUIYqXKRE.rdvmK54YlyOGJ6-z39Vu+z", - "name": "proident reprehenderit cupidatat labore ut", - "website": "https://fUjMQRln.iallzj-b81TrBkN31DSC9Vq", - "identifier": { - "uri": "http://xasIfEgWXaI.hfwKP-c-I45vyMfKZnhcq76Waq9ZlRyPb4,7i-LA5qHsxWfAIzXLPlxUF8JZKzy", - "id": "pariatur", - "legalName": "in", - "Excepteur7": -73661482 - }, - "country": null - } + "accuracy": 250, + "accuracyDetails": "Measured according to the US National Standard for Spatial Data Accuracy.", + "language": "en" } } } diff --git a/examples/json/multiple-networks.json b/examples/json/multiple-networks.json new file mode 100644 index 0000000..295e500 --- /dev/null +++ b/examples/json/multiple-networks.json @@ -0,0 +1,12 @@ +{ + "networks": [ + { + "id": "fd7b30d6-f514-4cd0-a5ac-29a774f53a43", + "name": "Ghana Fibre Network" + }, + { + "id": "acafe566-7ffa-416a-b3b4-84a52386a586", + "name": "Togo Fibre Network" + } + ] +} \ No newline at end of file diff --git a/examples/json/network-package.json b/examples/json/network-package.json index 295e500..cb48b72 100644 --- a/examples/json/network-package.json +++ b/examples/json/network-package.json @@ -1,12 +1,331 @@ { "networks": [ { - "id": "fd7b30d6-f514-4cd0-a5ac-29a774f53a43", - "name": "Ghana Fibre Network" - }, - { - "id": "acafe566-7ffa-416a-b3b4-84a52386a586", - "name": "Togo Fibre Network" + "id": "a096d627-72e1-4f9b-b129-951b1737bff4", + "name": "Ghana Fibre Network", + "nodes": [ + { + "id": "1", + "name": "Accra", + "phase": { + "id": "1", + "name": "NextGen Phase 1" + }, + "status": "operational", + "location": { + "type": "Point", + "coordinates": [ + -0.174, + 5.625 + ] + }, + "address": { + "streetAddress": "Boundary Rd", + "locality": "Shiashie", + "region": "Accra", + "postalCode": "12345", + "country": "GH" + }, + "type": [ + "pop" + ], + "accessPoint": true, + "internationalConnections": [ + { + "region": "Lomé", + "country": "TG" + } + ], + "power": true, + "technologies": [ + "ip" + ], + "physicalInfrastructureProvider": { + "id": "GH-RGD-CS111111111", + "name": "FibreCo" + }, + "networkProvider": { + "id": "GH-RGD-CS222222222", + "name": "FastWeb" + } + }, + { + "id": "2", + "name": "Kumasi", + "phase": { + "id": "1", + "name": "NextGen Phase 1" + }, + "status": "operational", + "location": { + "type": "Point", + "coordinates": [ + -1.628, + 6.711 + ] + }, + "address": { + "streetAddress": "Kejetia Road", + "locality": "Bantama", + "region": "Kumasi", + "postalCode": "00000", + "country": "GH" + }, + "type": [ + "pop" + ], + "accessPoint": true, + "power": true, + "technologies": [ + "ip" + ], + "physicalInfrastructureProvider": { + "id": "GH-RGD-CS111111111", + "name": "FibreCo" + }, + "networkProvider": { + "id": "GH-RGD-CS222222222", + "name": "FastWeb" + } + } + ], + "links": [ + { + "id": "1", + "name": "Accra to Kumasi", + "phase": { + "id": "1", + "name": "NextGen Phase 1" + }, + "status": "operational", + "readyForServiceDate": "2018-01-01", + "start": "1", + "end": "2", + "directed": false, + "route": { + "type": "LineString", + "coordinates": [ + [ + -0.173, + 5.626 + ], + [ + -0.178, + 5.807 + ], + [ + -0.112, + 5.971 + ], + [ + -0.211, + 5.963 + ], + [ + -0.321, + 6.170 + ], + [ + -0.488, + 6.290 + ], + [ + -0.560, + 6.421 + ], + [ + -0.752, + 6.533 + ], + [ + -0.867, + 6.607 + ], + [ + -1.101, + 6.585 + ], + [ + -1.304, + 6.623 + ], + [ + -1.461, + 6.727 + ], + [ + -1.628, + 6.713 + ] + ] + }, + "physicalInfrastructureProvider": { + "id": "GH-RGD-CS111111111", + "name": "FibreCo" + }, + "networkProvider": { + "id": "GH-RGD-CS222222222", + "name": "FastWeb" + }, + "supplier": { + "id": "GH-RGD-CS333333333", + "name": "ProjectCo" + }, + "transmissionMedium": [ + "fibre" + ], + "deployment": [ + "belowGround" + ], + "deploymentDetails": { + "description": "Buried in ducts" + }, + "darkFibre": true, + "fibreType": "G.652", + "fibreTypeDetails": { + "description": "CABLED STANDARD ENHANCED SINGLEMODE FIBRE ESMF, LOW WATER PEAK SINGLE MODE FIBRE G.652.D, OS2" + }, + "fibreCount": 24, + "fibreLength": 276000, + "technologies": [ + "sdh" + ], + "capacity": 4.976, + "capacityDetails": { + "description": "2xSTM-16" + }, + "countries": [ + "GH" + ] + } + ], + "phases": [ + { + "id": "1", + "name": "NextGen Phase 1", + "description": "The first phase of the Ghana Fibre Network NextGen roll-out.", + "funders": [ + { + "id": "1", + "name": "Ghana Infrastructure Investment Fund" + } + ] + } + ], + "organisations": [ + { + "id": "GH-RGD-CS111111111", + "name": "FibreCo", + "identifier": { + "id": "CS111111111", + "scheme": "GH-RGD", + "legalName": "FibreCo Ghana Limited", + "uri": "https://example.com/companies/CS111111111" + }, + "country": "GH", + "roles": [ + "physicalInfrastructureProvider" + ], + "roleDetails": "FibreCo owns and maintains the physical infrastructure.", + "website": "https://www.example.com", + "logo": "https://www.example.com/logo.png" + }, + { + "id": "GH-RGD-CS222222222", + "name": "FastWeb", + "identifier": { + "id": "CS222222222", + "scheme": "GH-RGD", + "legalName": "FastWeb Ghana Limited", + "uri": "https://example.com/companies/CS222222222" + }, + "country": "GH", + "roles": [ + "networkProvider" + ], + "roleDetails": "FastWeb provides wholesale services to service providers and dark fibre access to other network providers.", + "website": "https://www.example.com", + "logo": "https://www.example.com/logo.png" + }, + { + "id": "GH-RGD-CS333333333", + "name": "ProjectCo", + "identifier": { + "id": "CS333333333", + "scheme": "GH-RGD", + "legalName": "ProjectCo Ghana Limited", + "uri": "https://example.com/companies/CS333333333" + }, + "country": "GH", + "roles": [ + "supplier" + ], + "roleDetails": "ProjectCo was responsible for the construction of phase 1 of the NextGen network.", + "website": "https://www.example.com", + "logo": "https://www.example.com/logo.png" + }, + { + "id": "1", + "name": "Ghana Infrastructure Investment Fund", + "country": "GH", + "roles": [ + "funder" + ], + "roleDetails": "The Ghana Infrastructure Investment Fund provided equity financing for the construction of phase 1 of the NextGen network.", + "website": "https://www.example.com", + "logo": "https://www.example.com/logo.png" + } + ], + "contracts": [ + { + "id": "1", + "title": "NextGen Phase 1 Construction Contract", + "description": "Contract for the construction of phase 1 of the NextGen network.", + "type": "private", + "value": { + "amount": 1537459500.00, + "currency": "GHS" + }, + "dateSigned": "2016-06-30", + "documents": [ + { + "title": "NextGen Phase 1 Construction Contract", + "description": "Signed contract.", + "url": "http://example.com/contracts/nextgen-phase1-construction.pdf", + "format": "application/pdf" + } + ], + "relatedPhases": [ + { + "id": "1", + "name": "NextGen Phase 1" + } + ] + } + ], + "website": "http://example.com/network", + "publisher": { + "id": "GH-RGD-CS111111111", + "name": "FibreCo", + "identifier": { + "id": "CS111111111", + "scheme": "GH-RGD", + "legalName": "FibreCo Ghana Limited", + "uri": "https://example.com/companies/CS111111111" + }, + "country": "GH", + "website": "https://www.example.com", + "logo": "https://www.example.com/logo.png" + }, + "publicationDate": "2022-01-01", + "collectionDate": "2021-09-30", + "crs": { + "name": "urn:ogc:def:crs:OGC::CRS84", + "uri": "http://www.opengis.net/def/crs/OGC/1.3/CRS84" + }, + "accuracy": 250, + "accuracyDetails": "Measured according to the US National Standard for Spatial Data Accuracy.", + "language": "en" } ] } \ No newline at end of file diff --git a/examples/json/network-separate-endpoints.json b/examples/json/network-separate-endpoints.json index 67ac51b..c38a5cf 100644 --- a/examples/json/network-separate-endpoints.json +++ b/examples/json/network-separate-endpoints.json @@ -1,13 +1,18 @@ { - "id": "1", - "relatedResources": [ + "networks": [ { - "href": "http://example.com/network/1/nodes", - "rel": "tag:opentelecomdata.net,2022:nodesAPI" - }, - { - "href": "http://example.com/network/1/links", - "rel": "tag:opentelecomdata.net,2022:linksAPI" - } + "id": "a096d627-72e1-4f9b-b129-951b1737bff4", + "name": "Ghana Fibre Network", + "relatedResources": [ + { + "href": "http://example.com/networks/a096d627-72e1-4f9b-b129-951b1737bff4/nodes", + "rel": "tag:opentelecomdata.net,2022:nodesAPI" + }, + { + "href": "http://example.com/networks/a096d627-72e1-4f9b-b129-951b1737bff4/links", + "rel": "tag:opentelecomdata.net,2022:linksAPI" + } + ] + } ] } \ No newline at end of file diff --git a/examples/json/network-separate-files.json b/examples/json/network-separate-files.json index 09444b2..efbcf96 100644 --- a/examples/json/network-separate-files.json +++ b/examples/json/network-separate-files.json @@ -1,13 +1,18 @@ { - "id": "1", - "relatedResources": [ + "networks": [ { - "href": "http://example.com/network/1/nodes.jsonl", - "rel": "tag:opentelecomdata.net,2022:nodesFile" - }, - { - "href": "http://example.com/network/1/links.jsonl", - "rel": "tag:opentelecomdata.net,2022:linksFile" - } + "id": "a096d627-72e1-4f9b-b129-951b1737bff4", + "name": "Ghana Fibre Network", + "relatedResources": [ + { + "href": "http://example.com/networks/a096d627-72e1-4f9b-b129-951b1737bff4/nodes.jsonl", + "rel": "tag:opentelecomdata.net,2022:nodesFile" + }, + { + "href": "http://example.com/networks/a096d627-72e1-4f9b-b129-951b1737bff4/links.jsonl", + "rel": "tag:opentelecomdata.net,2022:linksFile" + } + ] + } ] } \ No newline at end of file diff --git a/examples/json/network.json b/examples/json/network.json deleted file mode 100644 index 244a21d..0000000 --- a/examples/json/network.json +++ /dev/null @@ -1,330 +0,0 @@ -{ - "id": "a096d627-72e1-4f9b-b129-951b1737bff4", - "name": "Ghana Fibre Network", - "nodes": [ - { - "id": "1", - "name": "Accra", - "phase": { - "id": "1", - "name": "NextGen Phase 1" - }, - "status": "operational", - "location": { - "type": "Point", - "coordinates": [ - [ - -0.174, - 5.625 - ] - ] - }, - "address": { - "streetAddress": "Boundary Rd", - "locality": "Shiashie", - "region": "Accra", - "postalCode": "12345", - "country": "GH" - }, - "type": [ - "pop" - ], - "accessPoint": true, - "internationalConnections": [ - { - "region": "Lomé", - "country": "TG" - } - ], - "power": true, - "technologies": [ - "ip" - ], - "physicalInfrastructureProvider": { - "id": "GH-RGD-CS111111111", - "name": "FibreCo" - }, - "networkProvider": { - "id": "GH-RGD-CS222222222", - "name": "FastWeb" - } - }, - { - "id": "2", - "name": "Kumasi", - "phase": { - "id": "1", - "name": "NextGen Phase 1" - }, - "status": "operational", - "location": { - "type": "Point", - "coordinates": [ - [ - -1.628, - 6.711 - ] - ] - }, - "address": { - "streetAddress": "Kejetia Road", - "locality": "Bantama", - "region": "Kumasi", - "postalCode": "00000", - "country": "GH" - }, - "type": [ - "pop" - ], - "accessPoint": true, - "power": true, - "technologies": [ - "ip" - ], - "physicalInfrastructureProvider": { - "id": "GH-RGD-CS111111111", - "name": "FibreCo" - }, - "networkProvider": { - "id": "GH-RGD-CS222222222", - "name": "FastWeb" - } - }], - "links": [ - { - "id": "1", - "name": "Accra to Kumasi", - "phase": { - "id": "1", - "name": "NextGen Phase 1" - }, - "status": "operational", - "readyForServiceDate": "2018-01-01", - "start": "1", - "end": "2", - "directed": false, - "route": { - "type": "LineString", - "coordinates": [ - [ - -0.173, - 5.626 - ], - [ - -0.178, - 5.807 - ], - [ - -0.112, - 5.971 - ], - [ - -0.211, - 5.963 - ], - [ - -0.321, - 6.170 - ], - [ - -0.488, - 6.290 - ], - [ - -0.560, - 6.421 - ], - [ - -0.752, - 6.533 - ], - [ - -0.867, - 6.607 - ], - [ - -1.101, - 6.585 - ], - [ - -1.304, - 6.623 - ], - [ - -1.461, - 6.727 - ], - [ - -1.628, - 6.713 - ] - ] - }, - "physicalInfrastructureProvider": { - "id": "GH-RGD-CS111111111", - "name": "FibreCo" - }, - "networkProvider": { - "id": "GH-RGD-CS222222222", - "name": "FastWeb" - }, - "supplier": { - "id": "GH-RGD-CS333333333", - "name": "ProjectCo" - }, - "transmissionMedium": [ - "fibre" - ], - "deployment": [ - "belowGround" - ], - "deploymentDetails": { - "description": "Buried in ducts" - }, - "darkFibre": true, - "fibreType": "G.652", - "fibreTypeDetails": { - "description": "CABLED STANDARD ENHANCED SINGLEMODE FIBRE ESMF, LOW WATER PEAK SINGLE MODE FIBRE G.652.D, OS2" - }, - "fibreCount": 24, - "fibreLength": 276000, - "technologies": [ - "sdh" - ], - "capacity": 4.976, - "capacityDetails": { - "description": "2xSTM-16" - }, - "countries": [ - "GH" - ] - } - ], - "phases": [ - { - "id": "1", - "name": "NextGen Phase 1", - "description": "The first phase of the Ghana Fibre Network NextGen roll-out.", - "funders": [ - { - "id": "1", - "name": "Ghana Infrastructure Investment Fund" - } - ] - } - ], - "organisations": [ - { - "id": "GH-RGD-CS111111111", - "name": "FibreCo", - "identifier": { - "id": "CS111111111", - "scheme": "GH-RGD", - "legalName": "FibreCo Ghana Limited", - "uri": "https://example.com/companies/CS111111111" - }, - "country": "GH", - "roles": [ - "physicalInfrastructureProvider" - ], - "roleDetails": "FibreCo owns and maintains the physical infrastructure.", - "website": "https://www.example.com", - "logo": "https://www.example.com/logo.png" - }, - { - "id": "GH-RGD-CS222222222", - "name": "FastWeb", - "identifier": { - "id": "CS222222222", - "scheme": "GH-RGD", - "legalName": "FastWeb Ghana Limited", - "uri": "https://example.com/companies/CS222222222" - }, - "country": "GH", - "roles": [ - "networkProvider" - ], - "roleDetails": "FastWeb provides wholesale services to service providers and dark fibre access to other network providers.", - "website": "https://www.example.com", - "logo": "https://www.example.com/logo.png" - }, - { - "id": "GH-RGD-CS333333333", - "name": "ProjectCo", - "identifier": { - "id": "CS333333333", - "scheme": "GH-RGD", - "legalName": "ProjectCo Ghana Limited", - "uri": "https://example.com/companies/CS333333333" - }, - "country": "GH", - "roles": [ - "supplier" - ], - "roleDetails": "ProjectCo was responsible for the construction of phase 1 of the NextGen network.", - "website": "https://www.example.com", - "logo": "https://www.example.com/logo.png" - }, - { - "id": "1", - "name": "Ghana Infrastructure Investment Fund", - "country": "GH", - "roles": [ - "funder" - ], - "roleDetails": "The Ghana Infrastructure Investment Fund provided equity financing for the construction of phase 1 of the NextGen network.", - "website": "https://www.example.com", - "logo": "https://www.example.com/logo.png" - } - ], - "contracts": [ - { - "id": "1", - "title": "NextGen Phase 1 Construction Contract", - "description": "Contract for the construction of phase 1 of the NextGen network.", - "type": "private", - "value": { - "amount": 1537459500.00, - "currency": "GHS" - }, - "dateSigned": "2016-06-30", - "documents": [ - { - "title": "NextGen Phase 1 Construction Contract", - "description": "Signed contract.", - "url": "http://example.com/contracts/nextgen-phase1-construction.pdf", - "format": "application/pdf" - } - ], - "relatedPhases": [ - { - "id": "1", - "name": "NextGen Phase 1" - } - ] - } - ], - "website": "http://example.com/network", - "publisher": { - "id": "GH-RGD-CS111111111", - "name": "FibreCo", - "identifier": { - "id": "CS111111111", - "scheme": "GH-RGD", - "legalName": "FibreCo Ghana Limited", - "uri": "https://example.com/companies/CS111111111" - }, - "country": "GH", - "website": "https://www.example.com", - "logo": "https://www.example.com/logo.png" - }, - "publicationDate": "2022-01-01", - "collectionDate": "2021-09-30", - "crs": { - "name": "urn:ogc:def:crs:OGC::CRS84", - "uri": "http://www.opengis.net/def/crs/OGC/1.3/CRS84" - }, - "accuracy": 250, - "accuracyDetails": "Measured according to the US National Standard for Spatial Data Accuracy.", - "language": "en" -} \ No newline at end of file diff --git a/manage.py b/manage.py index e80e8f2..f4279f0 100755 --- a/manage.py +++ b/manage.py @@ -442,36 +442,37 @@ def pre_commit(): @click.argument('filename', type=click.Path(exists=True)) def convert_to_geojson(filename): """ - Convert a JSON-format OFDS network to two GeoJSON files: nodes.geojson and links.geojson. + Convert a network package to two GeoJSON files: nodes.geojson and links.geojson. """ # Load data with open(filename, 'r') as f: - network = json.load(f) - - nodes = network.pop("nodes", []) - links = network.pop("links", []) - # TO-DO: Consider how to handle unreferenced phases and organisations. Currently, they are dropped from the geoJSON output - phases = network.pop("phases", []) - organisations = network.pop("organisations", []) + package = json.load(f) nodeFeatures = [] linkFeatures = [] - - # Dereference `contracts.relatedPhases` - if "contracts" in network: - for contract in network["contracts"]: - if "relatedPhases" in contract: - for phase in contract["relatedPhases"]: - phase = dereference_object(phase, phases) - - # Convert nodes to features - for node in nodes: - nodeFeatures.append(convert_to_feature(node, ['physicalInfrastructureProvider', 'networkProvider'], network, organisations, phases, nodes)) - - # Convert links to features - for link in links: - linkFeatures.append(convert_to_feature(link, ['physicalInfrastructureProvider', 'networkProvider'], network, organisations, phases, nodes)) + + for network in package["networks"]: + nodes = network.pop("nodes", []) + links = network.pop("links", []) + # TO-DO: Consider how to handle unreferenced phases and organisations. Currently, they are dropped from the geoJSON output + phases = network.pop("phases", []) + organisations = network.pop("organisations", []) + + # Dereference `contracts.relatedPhases` + if "contracts" in network: + for contract in network["contracts"]: + if "relatedPhases" in contract: + for phase in contract["relatedPhases"]: + phase = dereference_object(phase, phases) + + # Convert nodes to features + for node in nodes: + nodeFeatures.append(convert_to_feature(node, ['physicalInfrastructureProvider', 'networkProvider'], network, organisations, phases, nodes)) + + # Convert links to features + for link in links: + linkFeatures.append(convert_to_feature(link, ['physicalInfrastructureProvider', 'networkProvider'], network, organisations, phases, nodes)) with open('nodes.geojson', 'w') as f: featureCollection = { diff --git a/schema/network-schema.json b/schema/network-schema.json index bd7d854..9e42ac6 100644 --- a/schema/network-schema.json +++ b/schema/network-schema.json @@ -1228,7 +1228,7 @@ }, "coordinates": { "title": "Coordinates", - "description": "One or more [GeoJSON positions](https://datatracker.ietf.org/doc/html/rfc7946#section-3.1.1). For geometries of type 'Point', the coordinates member must be a single position. For geometries of type 'LineString' the coordinates member must be an array of positions.\n\nEach position is an array of numbers with two or more elements. The first two elements are longitude and latitude, or easting and northing, precisely in that order. Longitude and latitude must be expressed using the World Geodetic System 1984 (WGS 84)[https://datatracker.ietf.org/doc/html/rfc7946#ref-WGS84] datum in units of decimal degrees. Altitude or elevation may be included as an optional third element and must be expressed as the height in meters above or below the WGS 84 reference ellipsoid\n\nTherefore, geometries of type 'Point' must be a single array, e.g. [longitude, latitude], and geometries of type 'LineString' must be an array of arrays, e.g. [[longitude, latitude], [longitude, latitude]].", + "description": "One or more [GeoJSON positions](https://datatracker.ietf.org/doc/html/rfc7946#section-3.1.1). For geometries of type 'Point', the coordinates member must be a single position. For geometries of type 'LineString' the coordinates member must be an array of positions.\n\nEach position is an array of numbers with two or more elements. The first two elements are longitude and latitude, or easting and northing, precisely in that order. Longitude and latitude must be expressed using the World Geodetic System 1984 [WGS 84](https://datatracker.ietf.org/doc/html/rfc7946#ref-WGS84) datum in units of decimal degrees. Altitude or elevation may be included as an optional third element and must be expressed as the height in meters above or below the WGS 84 reference ellipsoid\n\nTherefore, geometries of type 'Point' must be a single array, e.g. [longitude, latitude], and geometries of type 'LineString' must be an array of arrays, e.g. [[longitude, latitude], [longitude, latitude]].", "type": "array", "$comment": "", "items": {