Test Case Title |
TC5.19 - Using ServiceMap as a Tools for Developing web and mobile apps and micro applications |
Goal |
I can use Servicemap as an acceleration tool for AreaManager, developers to: Request to the ServiceMap tool to send to me an email with the last visual queries I performed for the above discovering on knowledge base. Thus, I can obtain the same data results of the above actions of discovering by using the links the system provide to be which are based on the Advanced Smart City API, which return JSON or HTML data results. Please note that with the Advanced Smart city API the developers can get much more details. Get results in Json which are easily used for developing Web and Mobile applications Get results in HTML, which are easily used for embedding results in other applications: Dashboards, web and mobile App, IOT applications, etc. Get URLS for using the above saved visual queries directly without writing a complex REST Call. I receive a code for changing them, and a code that can be passed to friend or pasted into application making them dynamically depending on may changes. Thus, sharing with colleagues experiences and queries. This allows working on Knowledge Base at different level of complexity. |
Prerequisites |
Using a PC or Mobile with a web browser. Access to ServiceMap, Knowledge base with data. Several of them are available with different number of data triples: (i) Florence and whole Tuscany, (ii) Helsinki, Antwerp and Bologna, .... The following functionalities are available only for specific Snap4city users with specific privileges. |
Expected successful result |
Learn how to use the ServiceMap to receive examples of the usage of: (i) the Advanced Smart City API, (ii) knowledge base, (iii) ServiceMap itself for creating links that can be used into Dashboard as views of the city, (iv) get examples about routing algorithms, (v) get example about search and discovery algorithms, etc. |
Steps |
Please note that some of the following links could be accessible only for registered users.
Example 1: Visually perform queries on the elements of the city and thus on the Knowledge Base and save/share the performed query and results via email with other developers.
- Open https://servicemap.disit.org
- ServiceMap allows to share performed queries on the ServiceMap user interface as direct SPARQL queries and/or call to Smart City API.
- ServiceMap can be used to visually define queries on the elements of the city and thus on the Knowledge Base and save/share the performed query and results via email with other developers.
2: Perform a query on Service map to obtain something similar:
- clicking in a point of the city
- selecting desired services
- selecting 100 results
- within a distance from the selected point of 200 mt
- obtaining https://servicemap.disit.org/WebAppGrafo/api/v1/?queryId=3bb85eed95823e1170a7431ab2d8c21e&format=html
3. Requesting sending queries and call via email, for sharing and reuse.
- ServiceMap menu and dialog present in several points small icons as . If clicked after a query the tool will to send an email with the last query and all the links to be shared and to return to same identical position.
- You can share some of the links according to your purposes.
- Example of the email:
Thanks a lot for using Service Map by DISIT at https://servicemap.disit.org
Your query "A query" has been saved.
Description:No description provided.
You can access to the query results on Service Map by clicking on these links:
Link for read only result in format json: 'https://servicemap.disit.org/WebAppGrafo/api/v1/?queryId=3bb85eed95823e1170a7431ab2d8c21e&format=json'
Link for read only result in html: 'https://servicemap.disit.org/WebAppGrafo/api/v1/?queryId=3bb85eed95823e1170a7431ab2d8c21e&format=html'
Link for overwrite this query on Service Map: 'https://servicemap.disit.org/WebAppGrafo/api/?queryId=85469444354f0ed504fe05610dc3e81d'
Link to obtain results in format json based on the coordinates of selection: 'https://servicemap.disit.org/WebAppGrafo/api/v1/?selection=43.77140371265752%3B11.254291534423828&categories=Service%3BBusStop%3BSensorSite&maxResults=0&maxDists=0.2&format=json'
Link to obtain results in format html based on the coordinates of selection: 'https://servicemap.disit.org/WebAppGrafo/api/v1/?selection=43.77140371265752%3B11.254291534423828&categories=Service%3BBusStop%3BSensorSite&maxResults=0&maxDists=0.2&format=html'
or copy paste it on your browser.
You can share the link with your friends.
Best regards
ServiceMap.disit.org team
You can contact us at info@disit.org or visit our web page at http://www.disit.org
- Test the above links to see the differences. ..
4. Get results in Json which are easily used for developing Web and Mobile applications
- The above email provides results also in JSON such as link: https://servicemap.disit.org/WebAppGrafo/api/v1/?selection=43.77140371265752%3B11.254291534423828&categories=Service%3BBusStop%3BSensorSite&maxResults=0&maxDists=0.2&format=json
- Resulting on
{
"BusStops": {
"fullCount": 7,
"type": "FeatureCollection",
"features":[
{
"geometry":{"type": "Point","coordinates":[11.253586, 43.771355]},
"type": "Feature",
"properties": {
"name": "Piazza Della Repubblica",
"typeLabel": "BusStop",
"tipo": "fermata",
"serviceType": "TransferServiceAndRenting_BusStop",
"busLines": "C2",
"serviceUri": "http://www.disit.org/km4city/resource/Bus_ataflinea_Stop_FM1897_5",
"distance": "0.056895255586094456",
"agency": "Ataf&Linea",
"agencyUri": "http://www.disit.org/km4city/resource/Bus_ataflinea_Agency_172",
"photoThumbs": []
},
"id": 1
},
{
"geometry":{"type": "Point","coordinates":[11.254611, 43.770912]},
"type": "Feature",
"properties": {
"name": "Orsanmichele",
"typeLabel": "BusStop",
"tipo": "fermata",
"serviceType": "TransferServiceAndRenting_BusStop",
"busLines": "C2",
"serviceUri": "http://www.disit.org/km4city/resource/Bus_ataflinea_Stop_FM5126_5",
"distance": "0.060343757711833736",
"agency": "Ataf&Linea",
"agencyUri": "http://www.disit.org/km4city/resource/Bus_ataflinea_Agency_172",
"photoThumbs": []
},
"id": 2
},
..
Example 2: Using ServiceMap for developer with integrated tools
The proposed Snap4City solution provides a Knowledge Base grounded on Km4City ontology that is adopted to cover a number of Smart City applications, cities, regions, etc., supporting a large range of entities. Km4City ontology covers multiple domains such as: energy, culture, tourism, environment, mobility, transport, point of interest, bank, governmental, education, accommodation, food and wine, entertainment, resilience, trajectories, routing, IOT/IOE, etc.
Example 3: Km4City model and tools to manage data
- has been tuned to provide high performance in making complex geographics queries on RDF stores: around a point, along a line, into a polyline, into an area, by text, etc.
- keep the links to a storage with referral historical data.
- For example, the SPARQL query
SELECT ?s { ?s a km4c:Car_park}
can be used retrieve the list of car parks, for example using link: https://servicemap.disit.org/WebAppGrafo/sparql?query=SELECT%20?s%20{%20?s%20a%20km4c:Car_park}
- Once identified the car park, the real-time data can be accessed using SOLR interface, for example using:
https://devdash.snap4city.org/solr/sensori/select?indent=on&q=serviceUri:%22http://www.disit.org/km4city/resource/CarParkS.Lorenzo%22&wt=json
- allows to share performed queries on the ServiceMap user interface as direct SPARQL queries and/or call to Smart City API. ServiceMap can be used to visually define queries on the elements of the city and thus on the Knowledge Base and save/share the performed query and results via email with other developers. Thus, ServiceMap menu and dialog present in several points small icons as . If clicked after a query the tool will to send an email with the last query and all the links to be shared and to return to same identical position.
- To test click on the link to see a live example following a link provided by the tool: https://servicemap.disit.org/WebAppGrafo/api/v1?queryId=b34803d5397ed83edf919be2b70e8d0e&format=html
- Allows to collect data of IOT devices, resolving their classifications, discovering their positions and references. In addition,
- Can be feed to initialize it by using Open Street Map exploiting a number of DISIT tools. The obtained structural model of the city can be obtained from data of the street graph of the Municipality, or only enriched by those local data. Typically, local data may contain more information on the precise location of the civic numbers, on updated information about the ordinances for civil works on the city, etc.
- The process for passing from OSM to Km4City is described into the manual loaded in the Google Drive: From the Open Street Map to the Km4City street graph.pdf
- To test click on the link to see a live example:
- LINKED OPEN GRAPH to see the relations of this entity in the Knowledge Graph, Exploring the relations the following graph. The navigation result was saved and can be retrieved at the following url: https://log.disit.org/service/?graph=453ad2bf5261655b408819c4397c406b
- As reported in Appendix L and in the above example, the services of the Knowledge base are accessible via MicroServices for Snap4City IOT Application exploiting Advanced Smart City API:
Go on left and scroll to see the list of MicroServices available from Smart City API
Select one of them: get the short cut help and if you drag and drop on the editor you can get a larger help describing all the features as reported in Appendix L.
Example 4: Integrating ServiceMap into City Dashboards or third party tools
- ServiceMap, as well as ServiceMap3D allows to be embed into web pages of the third party. For ServiceMap one can use the Embed Button on bottom right corner of Service Map with shape as:
That button can be activated only after to have saved a query by using . ServiceMap menu and dialog present in several points . They have to be exploited to ask at the tool to send an email with the last query and all the links to be shared and to return to same identical position. So that once saved a query you can ask to the ServiceMap to use that query for providing an embeddable version of the map. During the Embedding, you can decide to see or not the menu, the size, and other parameters. The solution provides you the HTML code for embedding the solution as an IFRAME in your HTML portal.