From 64f19aaec4242837e7685d916a62f001cc5ebdfe Mon Sep 17 00:00:00 2001 From: Duncan Dewhurst Date: Thu, 15 Sep 2022 10:23:13 +1200 Subject: [PATCH 01/14] examples/json/network.json: Fix node geometries --- examples/json/network.json | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/examples/json/network.json b/examples/json/network.json index 244a21d..87c76ac 100644 --- a/examples/json/network.json +++ b/examples/json/network.json @@ -13,10 +13,8 @@ "location": { "type": "Point", "coordinates": [ - [ - -0.174, - 5.625 - ] + -0.174, + 5.625 ] }, "address": { @@ -60,10 +58,8 @@ "location": { "type": "Point", "coordinates": [ - [ - -1.628, - 6.711 - ] + -1.628, + 6.711 ] }, "address": { @@ -89,7 +85,8 @@ "id": "GH-RGD-CS222222222", "name": "FastWeb" } - }], + } + ], "links": [ { "id": "1", From 47e709e5e330063a5d53ccb65b5aefc12c3cf04b Mon Sep 17 00:00:00 2001 From: Duncan Dewhurst Date: Thu, 15 Sep 2022 10:23:44 +1200 Subject: [PATCH 02/14] examples/json: Rename network.json to network-package.json, add package --- examples/json/network-package.json | 331 ++++++++++++++++++++++++++++- examples/json/network.json | 327 ---------------------------- 2 files changed, 325 insertions(+), 333 deletions(-) delete mode 100644 examples/json/network.json 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.json b/examples/json/network.json deleted file mode 100644 index 87c76ac..0000000 --- a/examples/json/network.json +++ /dev/null @@ -1,327 +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 From e95199ea13eb7deba3a902bcbd432689b292a4c0 Mon Sep 17 00:00:00 2001 From: Duncan Dewhurst Date: Thu, 15 Sep 2022 10:24:06 +1200 Subject: [PATCH 03/14] examples/json: Reanme network-package.json to multiple-networks.json --- examples/json/multiple-networks.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 examples/json/multiple-networks.json 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 From 8bf31bbafe398da2e623b687f57e8bb057823b07 Mon Sep 17 00:00:00 2001 From: Duncan Dewhurst Date: Thu, 15 Sep 2022 10:26:21 +1200 Subject: [PATCH 04/14] manage.py: convert-to-geojson - add support for network packages --- manage.py | 47 ++++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 23 deletions(-) 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 = { From dad404b0ac512a0832cb40c3f59544a0812bc3fa Mon Sep 17 00:00:00 2001 From: Duncan Dewhurst Date: Thu, 15 Sep 2022 10:27:09 +1200 Subject: [PATCH 05/14] examples/geojson: Use convert-to-geojson to generate examples --- examples/geojson/links.geojson | 469 +++++++++++++++------------------ examples/geojson/nodes.geojson | 273 ++++++++++--------- 2 files changed, 363 insertions(+), 379 deletions(-) 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" } } } From f75d6b3515917c3e8fafcda09471391edf28a742 Mon Sep 17 00:00:00 2001 From: Duncan Dewhurst Date: Thu, 15 Sep 2022 10:27:57 +1200 Subject: [PATCH 06/14] docs/guidance/publication.md: Update convert-to-geojson instructions --- docs/guidance/publication.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/guidance/publication.md b/docs/guidance/publication.md index 9359fff..7e91564 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 ``` ::: From 8c3676efde7e65f7a595a637fded13363cd7bc1a Mon Sep 17 00:00:00 2001 From: Duncan Dewhurst Date: Thu, 15 Sep 2022 10:29:52 +1200 Subject: [PATCH 07/14] docs/reference: Update examples to reference network-package.json --- docs/reference/identifiers.md | 4 +- docs/reference/publication_formats.md | 2 +- docs/reference/schema.md | 73 ++++++++++++++------------- 3 files changed, 40 insertions(+), 39 deletions(-) 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..c424ecc 100644 --- a/docs/reference/publication_formats.md +++ b/docs/reference/publication_formats.md @@ -43,7 +43,7 @@ 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: ``` ::: diff --git a/docs/reference/schema.md b/docs/reference/schema.md index 4ea0db3..d614fa3 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,8 @@ 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 ``` ::: @@ -173,8 +173,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 +203,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 +233,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 +259,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 +289,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 +314,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 +340,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 +365,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 +391,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 +417,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 +460,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 ``` ::: @@ -521,8 +521,8 @@ Each `FibreTypeDetails` has the following fields: :::{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 ``` ::: @@ -552,8 +552,8 @@ Each `DeploymentDetails` has the following fields: :::{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 +582,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 From 773cb14e84a7e3e5e45accaf87e75d7e0c505647 Mon Sep 17 00:00:00 2001 From: Duncan Dewhurst Date: Thu, 15 Sep 2022 10:31:17 +1200 Subject: [PATCH 08/14] docs/reference/schema.md: Remove empty code blocks --- docs/reference/schema.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/reference/schema.md b/docs/reference/schema.md index d614fa3..b2b9ee6 100644 --- a/docs/reference/schema.md +++ b/docs/reference/schema.md @@ -516,7 +516,6 @@ Each `FibreTypeDetails` has the following fields: :pointer: /definitions/FibreTypeDetails :collapse: description ``` -``` ::: :::{tab-item} Example @@ -547,7 +546,6 @@ Each `DeploymentDetails` has the following fields: :pointer: /definitions/DeploymentDetails :collapse: description ``` -``` ::: :::{tab-item} Example From eeff6f1ebca1c98987cb2d1177c60d03e4cb9ca6 Mon Sep 17 00:00:00 2001 From: Duncan Dewhurst Date: Thu, 15 Sep 2022 10:35:00 +1200 Subject: [PATCH 09/14] docs/_static/renderjson.css: Update css to match codeblock formatting --- docs/_static/renderjson.css | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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 From 76a478df3e6d0f0a110f94c38a09b53facf5e414 Mon Sep 17 00:00:00 2001 From: Duncan Dewhurst Date: Thu, 15 Sep 2022 10:36:09 +1200 Subject: [PATCH 10/14] docs/_static/renderjson.js: Update expand/collapse icons --- docs/_static/renderjson.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"); From 7b1fab09ccf68918ac9c6bdc05c0a7ea8975550c Mon Sep 17 00:00:00 2001 From: Duncan Dewhurst Date: Thu, 15 Sep 2022 10:40:24 +1200 Subject: [PATCH 11/14] docs: Add jsonschema.css --- docs/_static/jsonschema.css | 3 +++ docs/_templates/layout.html | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 docs/_static/jsonschema.css 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/_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 From d21cbd5aab07b5cd4f5383ce732de1e6788b19ee Mon Sep 17 00:00:00 2001 From: Duncan Dewhurst Date: Thu, 15 Sep 2022 10:45:41 +1200 Subject: [PATCH 12/14] docs/reference/schema.md: Add missing example title --- docs/reference/schema.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/reference/schema.md b/docs/reference/schema.md index b2b9ee6..1d43832 100644 --- a/docs/reference/schema.md +++ b/docs/reference/schema.md @@ -150,6 +150,7 @@ Each `Link` has the following fields: ```{eval-rst} .. jsoninclude:: ../../examples/json/network-package.json :jsonpointer: /networks/0/links + :title: Example ``` ::: From a7e96056d56687fbe4fda3c191680fac82df5760 Mon Sep 17 00:00:00 2001 From: Duncan Dewhurst Date: Thu, 15 Sep 2022 11:03:10 +1200 Subject: [PATCH 13/14] Add packages to examples, update directives --- docs/guidance/publication.md | 15 +++++++----- docs/reference/publication_formats.md | 5 ++++ docs/reference/schema.md | 4 ++-- examples/json/network-separate-endpoints.json | 23 +++++++++++-------- examples/json/network-separate-files.json | 23 +++++++++++-------- 5 files changed, 44 insertions(+), 26 deletions(-) diff --git a/docs/guidance/publication.md b/docs/guidance/publication.md index 7e91564..18ebec3 100644 --- a/docs/guidance/publication.md +++ b/docs/guidance/publication.md @@ -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/publication_formats.md b/docs/reference/publication_formats.md index c424ecc..1500e33 100644 --- a/docs/reference/publication_formats.md +++ b/docs/reference/publication_formats.md @@ -45,6 +45,7 @@ Click on schema elements to expand the tree, or use the '+' icon to expand all e The following example shows a network package containing two networks: ```{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: diff --git a/docs/reference/schema.md b/docs/reference/schema.md index 1d43832..d951c63 100644 --- a/docs/reference/schema.md +++ b/docs/reference/schema.md @@ -492,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 ``` ::: 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 From 4ad8658a5e1f30e3ef01f683b779e87d740a831f Mon Sep 17 00:00:00 2001 From: Duncan Dewhurst Date: Thu, 15 Sep 2022 11:15:03 +1200 Subject: [PATCH 14/14] schema/network-schema.json: Fix link formatting --- schema/network-schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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": {