HOW TO: Exploit Special Widgets

   

Civil Protection is a custom widget

it requests directly data to the tuscany civil protection web sites

http://www.cfr.toscana.it/banner/banner_cfr.php

http://protezionecivile.comune.fi.it/?cat=5&feed=json

for meteo altert information (returned as html page) and civil protection data in a json containing a hml message, the widget on the browser side locate data of interest in the html using jquery expressions and produces output html. http://www.cfr.toscana.it/banner/banner_cfr.php

The data is requested using the management/iframeProxy.php script that performs the requests on the serverside and returns to the client.

The General information is provided via http://protezionecivile.comune.fi.it/?cat=5&feed=json as JSON with included HTML page of the information

The FirstAid widget uses data from the servicemap and KB, in the widget configuration are present a list of FirstAid serviceUris, now this widget performs the query directly to the tuscany servicemap, e.g.

https://servicemap.km4city.org/WebAppGrafo/api/v1/?serviceUri=http://www.disit.org/km4city/resource/fe24f1f0f03a39e15521df0bb4748eb8

the data is get from the json returned and shown in the widget.

The current implementation it is bound to tuscany services but with few generalizations it may be used in different places.

This widget may be used with iot devices and it can be partially working as it can support only one row status otherwise it can be fully functioning storing data on the KB.

The list of services can be automatically generated using the wizard.

In the platform there is a ETL that collect these data and produce triples for the KB. It could be possible for the simple version with only one line of data for each first aid to create an IOT Device and thus to pass via the IOT Broker.

Please note that there is a set of possible visualization for the first AID. Some of the them are related to the single hospital (with details and without details), and those reporting the status of several first AID services. The one reported in the example describes the detailed status of one single first aid service in real time.

The widgetEvents/widgetEventsNew is used to display cultural events of the florence municipality accessible from the servicemap KB using API:

http://servicemap.km4city.org/WebAppGrafo/api/v1/nextPOS/?categories=Event&range=month

The servicemap, KB, from which to get data can be configured, data about the events should be loaded in the KB as triples. To pass from the IOT broker as IOT device would be difficult since each event could provide a standard schema ma different location and lifespan. So that each new even would be a new device. A solution could produce triples for the KB or feed the KB directly from the IOT App.

The triples used for each event is reported in the following, see (*)

Please note that these is a number of events widgets that can be used:

  • events of entertainment that can collect also data f rom the KB in different locations and areas (that represented in the example)
  • events of traffic (next example)
  • events of operators, that can be generated by operator with the IOT Applications and send directly to the IOT Broker, etc....

 

The widgetPrevMeteo is used to dispaly the weather information, it also gets its data from servicemap and the KB. in effect there is a range of differetn weather forecast widget that can be used, horizontl, vertical, coincise. They have graphics and different styles also.

https://servicemap.km4city.org/WebAppGrafo/api/v1/?serviceUri=http://www.disit.org/km4city/resource/048001

The service uri should refer to a municipality on the KB.

Using the appliance VMs it should be possible to create an IoTApp that generates the triples needed for these widgets and upload them on the KB.  The triples to be used for the weather data of a municipality is reported in the following, see (**)

It could be possible to create an IOT Device modeling the meteo forecast, and thus pass from the IOT broker, etc. Please note that in the MicroApplications there is different view of Weather forecast that can be also used and include also a widget for Wind intensity and direction.

 

(*) triples for one event:

<http://www.disit.org/km4city/resource/Event_00001> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.disit.org/km4city/schema#Event> .
<http://www.disit.org/km4city/resource/Event_00001> <http://purl.org/dc/terms/identifier> "Event_00001" .
<http://www.disit.org/km4city/resource/Event_00001> <http://schema.org/name> "\"Evento di esempio\""@it .
<http://www.disit.org/km4city/resource/Event_00001> <http://schema.org/name> "Example event"@en .
<http://www.disit.org/km4city/resource/Event_00001> <http://schema.org/url> "www.teatrodellapergola.com" .
<http://www.disit.org/km4city/resource/Event_00001> <http://schema.org/startDate> "2020-03-08"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
<http://www.disit.org/km4city/resource/Event_00001> <http://schema.org/endDate> "2020-03-08"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
<http://www.disit.org/km4city/resource/Event_00001> <http://www.disit.org/km4city/schema#eventTime> "10.00; 11.00; 12.00" .
<http://www.disit.org/km4city/resource/Event_00001> <http://www.disit.org/km4city/schema#freeEvent> "NO" .
<http://www.disit.org/km4city/resource/Event_00001> <http://schema.org/price> "15-12Euro" .
<http://www.disit.org/km4city/resource/Event_00001> <http://www.disit.org/km4city/schema#placeName> "TEATRO DELLA PERGOLA " .
<http://www.disit.org/km4city/resource/Event_00001> <http://www.w3.org/2003/01/geo/wgs84_pos#lat> "43.9770"^^<http://www.w3.org/2001/XMLSchema#float> .
<http://www.disit.org/km4city/resource/Event_00001> <http://www.w3.org/2003/01/geo/wgs84_pos#long> "11.2637"^^<http://www.w3.org/2001/XMLSchema#float> .
<http://www.disit.org/km4city/resource/Event_00001> <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> "POINT(11.2637 43.9770)"^^<http://www.openlinksw.com/schemas/virtrdf#Geometry> .
<http://www.disit.org/km4city/resource/Event_00001> <http://schema.org/streetAddress> "VIA DELLA PERGOLA" .
<http://www.disit.org/km4city/resource/Event_00001> <http://www.disit.org/km4city/schema#houseNumber> "12" .
<http://www.disit.org/km4city/resource/Event_00001> <http://schema.org/addressLocality> "Firenze" .
<http://www.disit.org/km4city/resource/Event_00001> <http://schema.org/addressRegion> "FI" .
<http://www.disit.org/km4city/resource/Event_00001> <http://schema.org/telephone> "333 2284784" .
<http://www.disit.org/km4city/resource/Event_00001> <http://www.disit.org/km4city/schema#eventCategory> "Teatro"@it .
<http://www.disit.org/km4city/resource/Event_00001> <http://www.disit.org/km4city/schema#eventCategory> "Theatre"@en .
<http://www.disit.org/km4city/resource/Event_00001> <http://schema.org/description> "nessuna descrizione"@it .
<http://www.disit.org/km4city/resource/Event_00001> <http://schema.org/description> "no description"@en .
<http://www.disit.org/km4city/resource/Event_00001> <http://www.w3.org/2004/02/skos/core#note> "INFO: 333 2284784" .

(**) triples for weather prediction on a municipality

<http://www.disit.org/km4city/resource/Rome> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.disit.org/km4city/schema#Municipality> .
<http://www.disit.org/km4city/resource/Rome> <http://xmlns.com/foaf/0.1/name> "Rome" .
<http://www.disit.org/km4city/resource/Rome> <http://www.disit.org/km4city/schema#hasWeatherReport> <http://www.disit.org/km4city/resource/Rome1582096973000> .

<http://www.disit.org/km4city/resource/1582096973000> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2006/time#Instant> .
<http://www.disit.org/km4city/resource/1582096973000> <http://www.disit.org/km4city/schema#instantWReport> <http://www.disit.org/km4city/resource/Rome1582096973000> .
<http://www.disit.org/km4city/resource/1582096973000> <http://schema.org/value> "2020-02-19T08:22:00.00+01:00"^^<http://www.w3.org/2001/XMLSchema#dateTime> .

<http://www.disit.org/km4city/resource/Rome1582096973000> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.disit.org/km4city/schema#WeatherReport> .
<http://www.disit.org/km4city/resource/Rome1582096973000> <http://www.disit.org/km4city/schema#updateTime> <http://www.disit.org/km4city/resource/1582096973000> .

<http://www.disit.org/km4city/resource/Rome15820969730001giorno> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.disit.org/km4city/schema#WeatherPrediction> .
<http://www.disit.org/km4city/resource/Rome15820969730001giorno> <http://www.disit.org/km4city/schema#day> "Mercoledi" .
<http://www.disit.org/km4city/resource/Rome15820969730001giorno> <http://www.disit.org/km4city/schema#hour> "giorno" .
<http://www.disit.org/km4city/resource/Rome15820969730001giorno> <http://www.disit.org/km4city/schema#minTemp> "8"^^<http://www.w3.org/2001/XMLSchema#integer> .
<http://www.disit.org/km4city/resource/Rome15820969730001giorno> <http://www.disit.org/km4city/schema#maxTemp> "14"^^<http://www.w3.org/2001/XMLSchema#integer> .
<http://www.disit.org/km4city/resource/Rome15820969730001giorno> <http://purl.org/dc/terms/description> "pioggia e schiarite" .
<http://www.disit.org/km4city/resource/Rome1582096973000> <http://www.disit.org/km4city/schema#hasPrediction> <http://www.disit.org/km4city/resource/Rome15820969730001giorno> .

<http://www.disit.org/km4city/resource/Rome15820969730002giorno> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.disit.org/km4city/schema#WeatherPrediction> .
<http://www.disit.org/km4city/resource/Rome15820969730002giorno> <http://www.disit.org/km4city/schema#day> "Giovedi" .
<http://www.disit.org/km4city/resource/Rome15820969730002giorno> <http://www.disit.org/km4city/schema#hour> "giorno" .
<http://www.disit.org/km4city/resource/Rome15820969730002giorno> <http://www.disit.org/km4city/schema#maxTemp> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
<http://www.disit.org/km4city/resource/Rome15820969730002giorno> <http://www.disit.org/km4city/schema#minTemp> "2"^^<http://www.w3.org/2001/XMLSchema#integer> .
<http://www.disit.org/km4city/resource/Rome15820969730002giorno> <http://purl.org/dc/terms/description> "sereno" .
<http://www.disit.org/km4city/resource/Rome1582096973000> <http://www.disit.org/km4city/schema#hasPrediction> <http://www.disit.org/km4city/resource/Rome15820969730002giorno> .

<http://www.disit.org/km4city/resource/Rome15820969730003giorno> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.disit.org/km4city/schema#WeatherPrediction> .
<http://www.disit.org/km4city/resource/Rome15820969730003giorno> <http://www.disit.org/km4city/schema#day> "Venerdi" .
<http://www.disit.org/km4city/resource/Rome15820969730003giorno> <http://www.disit.org/km4city/schema#hour> "giorno" .
<http://www.disit.org/km4city/resource/Rome15820969730003giorno> <http://www.disit.org/km4city/schema#minTemp> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
<http://www.disit.org/km4city/resource/Rome15820969730003giorno> <http://www.disit.org/km4city/schema#maxTemp> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
<http://www.disit.org/km4city/resource/Rome15820969730003giorno> <http://purl.org/dc/terms/description> "nuvoloso" .
<http://www.disit.org/km4city/resource/Rome1582096973000> <http://www.disit.org/km4city/schema#hasPrediction> <http://www.disit.org/km4city/resource/Rome15820969730003giorno> .

<http://www.disit.org/km4city/resource/Rome15820969730004giorno> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.disit.org/km4city/schema#WeatherPrediction> .
<http://www.disit.org/km4city/resource/Rome15820969730004giorno> <http://www.disit.org/km4city/schema#day> "Sabato" .
<http://www.disit.org/km4city/resource/Rome15820969730004giorno> <http://www.disit.org/km4city/schema#hour> "giorno" .
<http://www.disit.org/km4city/resource/Rome15820969730004giorno> <http://purl.org/dc/terms/description> "sereno" .
<http://www.disit.org/km4city/resource/Rome1582096973000> <http://www.disit.org/km4city/schema#hasPrediction> <http://www.disit.org/km4city/resource/Rome15820969730004giorno> .

<http://www.disit.org/km4city/resource/Rome15820969730005giorno> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.disit.org/km4city/schema#WeatherPrediction> .
<http://www.disit.org/km4city/resource/Rome15820969730005giorno> <http://www.disit.org/km4city/schema#day> "Domenica" .
<http://www.disit.org/km4city/resource/Rome15820969730005giorno> <http://www.disit.org/km4city/schema#hour> "giorno" .
<http://www.disit.org/km4city/resource/Rome15820969730005giorno> <http://purl.org/dc/terms/description> "nuvoloso" .
<http://www.disit.org/km4city/resource/Rome1582096973000> <http://www.disit.org/km4city/schema#hasPrediction> <http://www.disit.org/km4city/resource/Rome15820969730005giorno> .