Skip to content

Commit 900ba92

Browse files
committed
Repair USGS Earthquake SensorML metadata
1 parent 1deebc6 commit 900ba92

1 file changed

Lines changed: 28 additions & 28 deletions

File tree

publishers/usgs_eq/bootstrap_usgs_eq.py

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ def _fdsn_query_url(event_id: str) -> str:
113113
# ── Contact ──────────────────────────────────────────────────────────────
114114
USGS_CONTACT_ORG = "U.S. Geological Survey (USGS)"
115115
USGS_CONTACT_URL = "https://www.usgs.gov/"
116+
DEFAULT_PUBLISH_INTERVAL_SECONDS = 60
116117

117118

118119
def _load_config() -> dict:
@@ -188,10 +189,12 @@ def _system_stub(config: dict) -> dict:
188189

189190
def _system_sml(config: dict) -> dict:
190191
"""Rich SensorML body for PUT after system creation."""
192+
publish_interval = config.get("pollingIntervalSeconds", DEFAULT_PUBLISH_INTERVAL_SECONDS)
191193
return {
192-
"type": "SimpleProcess",
194+
"type": "PhysicalSystem",
193195
"id": SYSTEM_UID,
194196
"uniqueId": SYSTEM_UID,
197+
"definition": "sosa:System",
195198
"name": "USGS Earthquake Feed",
196199
"label": "USGS Earthquake Feed",
197200
"description": (
@@ -202,43 +205,40 @@ def _system_sml(config: dict) -> dict:
202205
"skipped, revised events are re-published."
203206
),
204207
"identifiers": [
205-
{"label": "System UID", "value": SYSTEM_UID},
206-
{"label": "Procedure UID", "value": PROC_UID},
207-
{"label": "Short Name", "value": "USGS-EQ-Feed"},
208-
{"label": "Publisher", "value": "OSHConnect-Python"},
208+
{"definition": "http://sensorml.com/ont/swe/property/UniqueID", "label": "OS4CSAPI UID", "value": SYSTEM_UID},
209+
{"definition": "http://sensorml.com/ont/swe/property/ProcedureID", "label": "Procedure UID", "value": PROC_UID},
210+
{"definition": "http://sensorml.com/ont/swe/property/ShortName", "label": "Short Name", "value": "USGS-EQ-Feed"},
211+
{"definition": "http://sensorml.com/ont/swe/property/Publisher", "label": "Publisher", "value": "OSHConnect-Python"},
209212
],
210213
"classifiers": [
211-
{"label": "Intended Application", "value": "Seismic Event Monitoring"},
212-
{"label": "Sensor Type", "value": "Feed Adapter (not a physical sensor)"},
213-
{"label": "Data Source", "value": "USGS Earthquake Hazards Program"},
214-
{"label": "Observation Pattern", "value": "Pattern C: one event per observation"},
215-
{"label": "Coverage", "value": "Global"},
214+
{"definition": "http://sensorml.com/ont/swe/property/IntendedApplication", "label": "Intended Application", "value": "Seismic Event Monitoring"},
215+
{"definition": "http://sensorml.com/ont/swe/property/SensorType", "label": "System Type", "value": "Feed Adapter (not a physical sensor)"},
216+
{"definition": "http://sensorml.com/ont/swe/property/DataSource", "label": "Data Source", "value": "USGS Earthquake Hazards Program"},
217+
{"definition": "http://sensorml.com/ont/swe/property/SystemRole", "label": "Observation Pattern", "value": "Pattern C: one event per observation"},
218+
{"definition": "http://sensorml.com/ont/swe/property/Coverage", "label": "Coverage", "value": "Global"},
216219
],
217220
"contacts": [
218221
{
219-
"role": "http://sensorml.com/ont/swe/property/Operator",
222+
"role": "operator",
220223
"organisationName": USGS_CONTACT_ORG,
221-
"links": [
222-
{"href": USGS_CONTACT_URL, "title": "USGS"},
223-
],
224+
"contactInfo": {"onlineResource": {"linkage": USGS_CONTACT_URL}},
224225
},
225226
{
226-
"role": "http://sensorml.com/ont/swe/property/Author",
227+
"role": "publisher",
227228
"organisationName": "OS4CSAPI Project",
228-
"links": [
229-
{"href": "https://github.com/OS4CSAPI", "title": "OS4CSAPI GitHub"},
230-
],
229+
"contactInfo": {"onlineResource": {"linkage": "https://github.com/OS4CSAPI"}},
231230
},
232231
],
233232
"documents": [
234-
{"name": "USGS Earthquake Hazards Program", "description": "Program home", "link": {"href": USGS_EQ_HOME}},
235-
{"name": "GeoJSON Summary Feed Documentation", "description": "Summary feed format and variant documentation", "link": {"href": USGS_EQ_FEED_DOC}},
236-
{"name": "GeoJSON Detail Feed Documentation", "description": "Detail feed structure and product documentation", "link": {"href": USGS_EQ_DETAIL_DOC}},
237-
{"name": "Feed Lifecycle Policy", "description": "Production feed availability and deprecation policy", "link": {"href": USGS_EQ_LIFECYCLE}},
238-
{"name": "ComCat Documentation", "description": "Catalog and product documentation", "link": {"href": USGS_EQ_GLOSSARY}},
239-
{"name": "Event Terms", "description": "Official field semantics", "link": {"href": USGS_EQ_EVENT_TERMS}},
240-
{"name": "FDSN Event API", "description": "Official query interface for targeted retrieval and future backfill", "link": {"href": USGS_EQ_FDSN_EVENT_API}},
233+
{"role": "http://dbpedia.org/resource/Web_page", "name": "USGS Earthquake Hazards Program", "description": "Program home", "link": {"href": USGS_EQ_HOME, "type": "text/html"}},
234+
{"role": "http://dbpedia.org/resource/Web_page", "name": "GeoJSON Summary Feed Documentation", "description": "Summary feed format and variant documentation", "link": {"href": USGS_EQ_FEED_DOC, "type": "text/html"}},
235+
{"role": "http://dbpedia.org/resource/Web_page", "name": "GeoJSON Detail Feed Documentation", "description": "Detail feed structure and product documentation", "link": {"href": USGS_EQ_DETAIL_DOC, "type": "text/html"}},
236+
{"role": "http://dbpedia.org/resource/Web_page", "name": "Feed Lifecycle Policy", "description": "Production feed availability and deprecation policy", "link": {"href": USGS_EQ_LIFECYCLE, "type": "text/html"}},
237+
{"role": "http://dbpedia.org/resource/Web_page", "name": "ComCat Documentation", "description": "Catalog and product documentation", "link": {"href": USGS_EQ_GLOSSARY, "type": "text/html"}},
238+
{"role": "http://dbpedia.org/resource/Web_page", "name": "Event Terms", "description": "Official field semantics", "link": {"href": USGS_EQ_EVENT_TERMS, "type": "text/html"}},
239+
{"role": "http://dbpedia.org/resource/Web_page", "name": "FDSN Event API", "description": "Official query interface for targeted retrieval and future backfill", "link": {"href": USGS_EQ_FDSN_EVENT_API, "type": "text/html"}},
241240
{
241+
"role": "http://dbpedia.org/resource/Photograph",
242242
"name": "Representative Earthquake Feed Thumbnail",
243243
"description": (
244244
"Original OS4CSAPI SVG thumbnail representing the USGS earthquake event feed adapter. "
@@ -310,11 +310,11 @@ def _system_sml(config: dict) -> dict:
310310
"capabilities": [
311311
{
312312
"type": "Quantity",
313-
"name": "update_interval",
313+
"name": "publish_interval",
314314
"definition": "http://qudt.org/vocab/quantitykind/Period",
315-
"label": "Polling Interval",
315+
"label": "Publish Interval",
316316
"uom": {"code": "s"},
317-
"value": config.get("pollingIntervalSeconds", 60),
317+
"value": publish_interval,
318318
},
319319
{
320320
"type": "Text",

0 commit comments

Comments
 (0)