Homepage

ServiceMap API: Service Info

RETURN to main page of SERVICEMAP API

GET: Sii-Mobility Km4City: Smart City API, version 1 smart city API

 

--- the rest has been deprecated ---

http://servicemap.disit.org/WebAppGrafo/api/v1?serviceUri =URI& format=[json|html]

This API provides results about a service, given the serviceUri. It is possible to choose the format of result, as json or html. The system query the km4city ontology taking information on the service, and depending on type, give results for static services, weather predictions or real time data.
If the format chosen is html, the result will be displayed on ServiceMap portal.

In this case, the API provide results coming from the query on the km4city Ontology based on the Uri services.
Services can be:
·       Static services as Restaurant, Hotels, Financial Services, Entertainment. etc,
·       Weather Predictions based on municipality,
·       Real TimeServices, as Bus Stops, Parking Status, Road Sensors
 

Static Service

Navigating on Service Map, it is possible to make queries on the portal and view results on the map. With this API it is possible to save a pin, clicking on it (figure 1).

Figure 1: saving a service on Service Map

A popup dialog appears, asking email, a title and description of what user decided to save, and in which format he wants to receive the information about the service (Palazzo Medici Ricciardi in this example).
The user will receive by email a link as:
http://servicemap.disit.org/WebAppGrafo/api/v1?serviceUri=http://www.disit.org/km4city/resource/76933db4b76647226ddabbb62477cd12&format=json
 
Clicking on it, the results will be shown in json format as:
{  
  "Service":{  
    "type":"FeatureCollection",
    "features":[  
      {  
        "geometry":{  
          "type":"Point",
          "coordinates":[ 11.256, 43.7752 ]
        },
        "type":"Feature",
        "properties":{  
          "name":"PALAZZO_MEDICI_RICCARDI",
          "typeLabel":"Monument location",
          "serviceType":"CulturalActivity_Monument_location",
          "phone":"",
          "fax":"",
          "website":"",
          "province":"FI",
          "city":"FIRENZE",
          "cap":"50100",
          "email":"",
          "note":"",
          "linkDBpedia" : [],
          "description":"",
          "description2":"",
          "multimedia":"",
          "serviceUri":"http://www.disit.org/km4city/resource/76933db4b76647226ddabbb62477cd12",
          "address":"VIA CAVOUR",
          "civic":"3"
        },
        "id":1
      }
    ]
  }
}

The information in the json format result are related to the geographic position and properties of it as name, type, address, email, notes, etc.

 
If user wants to view the HTML version of these information, he will be redirected on the Service Map, as in figure 2.

Figure 2: HTML results for Palazzo Medici Ricciardi
 

Weather Forecast


Figure 3:Meteo in Florence

http://www.disit.org/ServiceMap/api/v1/?serviceUri=http://www.disit.org/km4city/resource/048017&format=json

In this case it is possible to save the Uri of Meteo in Florence. This could be useful in order to actualize in another app, the weather prediction in the municipality of Florence.
Choosing the JSON format, for example, the result will be:
{
    "head": {
        "location": "FIRENZE",
        "vars": [
            "day",
            "description",
            "minTemp",
            "maxTemp",
            "instantDateTime"
        ]
    },
    "results": {
        "bindings": [
            {
                "day": {
                    "type": "literal",
                    "value": "Giovedi"
                },
                "description": {
                    "type": "literal",
                    "value": "sereno"
                },
                "minTemp": {
                    "type": "literal",
                    "value": "7"
                },
                "maxTemp": {
                    "type": "literal",
                    "value": "15"
                },
                "instantDateTime": {
                    "type": "literal",
                    "value": "2015-02-19T08:46:00.00+02:00"
                }
            },
            {
                "day": {
                    "type": "literal",
                    "value": "Venerdi"
                },
                "description": {
                    "type": "literal",
                    "value": "nuvoloso"
                },
                "minTemp": {
                    "type": "literal",
                    "value": "-1"
                },
                "maxTemp": {
                    "type": "literal",
                    "value": "14"
                },
                "instantDateTime": {
                    "type": "literal",
                    "value": "2015-02-19T08:46:00.00+02:00"
                }
            },
            {
                "day": {
                    "type": "literal",
                    "value": "Sabato"
                },
                "description": {
                    "type": "literal",
                    "value": "pioggia debole"
                },
                "minTemp": {
                    "type": "literal",
                    "value": "4"
                },
                "maxTemp": {
                    "type": "literal",
                    "value": "12"
                },
                "instantDateTime": {
                    "type": "literal",
                    "value": "2015-02-19T08:46:00.00+02:00"
                }
            },
            {
                "day": {
                    "type": "literal",
                    "value": "Domenica"
                },
                "description": {
                    "type": "literal",
                    "value": "pioggia debole e schiarite"
                },
                "minTemp": {
                    "type": "literal",
                    "value": ""
                },
                "maxTemp": {
                    "type": "literal",
                    "value": ""
                },
                "instantDateTime": {
                    "type": "literal",
                    "value": "2015-02-19T08:46:00.00+02:00"
                }
            },
            {
                "day": {
                    "type": "literal",
                    "value": "Lunedi"
                },
                "description": {
                    "type": "literal",
                    "value": "poco nuvoloso"
                },
                "minTemp": {
                    "type": "literal",
                    "value": ""
                },
                "maxTemp": {
                    "type": "literal",
                    "value": ""
                },
                "instantDateTime": {
                    "type": "literal",
                    "value": "2015-02-19T08:46:00.00+02:00"
                }
            }
        ]
    }
}
 

These result will change every time an update will be uploaded on Service Map ontology km4city, so that clicking on the same link, the results will change.
 

Real Time Service

Real time services are: Bus Stop real time AVM in the municipality of Florence, Road Sensors, Parking status.
It is possible, as for the other services, save the pin clicking on the save icon.
Differently from the Static Services, the results are composed by a static information and a real time information.
Real time services are: Bus Stop real time AVM in the municipality of Florence, Road Sensors, Parking status.
 
 
Sensore Empoli.PNG
 
http://servicemap.disit.org/WebAppGrafo/api/v1?serviceUri=http://www.disit.org/km4city/resource/EM0100102&format=json
 
 
Stazione Pensilina.PNG
 
http://servicemap.disit.org/WebAppGrafo/api/v1?serviceUri=http://www.disit.org/km4city/resource/FM0022&format=json
 
 
ParcheggioEmpoli.PNG
 
http://servicemap.disit.org/WebAppGrafo/api/v1?serviceUri=http://www.disit.org/km4city/resource/RT048014PK002EM_PO&format=json
 
 
Figure 4: Examples of real time services on Service Map
 
It is possible, as for the other services, save the pin clicking on the save icon.
Differently from the Static Services, the results are composed by a static information and a real time information.
We save, for example a Bus Stop, Stazione Pensilina.
Clicking on the link above, with json format, we obtain:
{
    "Fermata": {
        "type": "FeatureCollection",
        "features": [
            {
                "geometry": {
                    "type": "Point",
                    "coordinates": [
                        11.249076423532143,
                        43.7764653220976
                    ]
                },
                "type": "Feature",
                "properties": {
                    "name": "STAZIONE PENSILINA",
                    "serviceUri": "http://www.disit.org/km4city/resource/FM0022",
                    "typeLabel": "TransferServiceAndRenting_BusStop"
                },
                "id": 1
            }
        ]
    },
    "linee": {
        "head": {
            "BusStop": "STAZIONE PENSILINA",
            "vars": "busLine"
        },
        "results": {
            "bindings": [
                {
                    "busLine": {
                        "type": "literal",
                        "value": "11"
                    }
                },
                {
                    "busLine": {
                        "type": "literal",
                        "value": "17"
                    }
                },
                {
                    "busLine": {
                        "type": "literal",
                        "value": "22"
                    }
                },
                {
                    "busLine": {
                        "type": "literal",
                        "value": "23"
                    }
                },
                {
                    "busLine": {
                        "type": "literal",
                        "value": "36"
                    }
                },
                {
                    "busLine": {
                        "type": "literal",
                        "value": "4"
                    }
                },
                {
                    "busLine": {
                        "type": "literal",
                        "value": "52"
                    }
                },
                {
                    "busLine": {
                        "type": "literal",
                        "value": "54"
                    }
                },
                {
                    "busLine": {
                        "type": "literal",
                        "value": "6"
                    }
                }
            ]
        }
    },
    "realtime": {
        "head": {
            "busStop": [
                "STAZIONE PENSILINA"
            ],
            "vars": [
                "arrivalTime",
                "busLine",
                "state",
                "direction",
                "ride"

            ]
        },
        "results": {
            "bindings": [
                  {
                    "arrivalTime": {
                        "type": "literal",
                        "value": "15:16:54"
                    },
                    "busLine": {
                        "type": "literal",
                        "value": "4"
                    },
                    "state": {
                        "type": "literal",
                        "value": "Ritardo"
                    },
                    "ride": {
                        "type": "literal",
                        "value": "5084785"
                    },
                    "direction": {
                        "type": "literal",
                        "value": "CAPPUCCINI"
                    }             
            ]
        }
    }
}
0
Your rating: None


Warning: Table '.\drupal\sessions' is marked as crashed and should be repaired query: UPDATE sessions SET uid = 0, cache = 0, hostname = '192.168.0.44', session = 'hidePDA|s:1:\"0\";', timestamp = 1713868069 WHERE sid = 'f15189f2ea4a90112963957c195f9da2' in C:\Programmi\Apache Software Foundation\Apache2.2\htdocs\drupal\includes\database.mysqli.inc on line 128