TC5.3 - Knowledge Base Semantic Search via SPARQL

×

Warning message

  • You can't delete this newsletter because it has not been sent to all its subscribers.
  • You can't delete this newsletter because it has not been sent to all its subscribers.

Test Case Title

TC5.3 - Knowledge Base Semantic Search via SPARQL

Goal

Performing direction SPARQL queries searching for relationships among city entities, semantic search, modelled in the knowledge base as graph database à FLINT

Prerequisites

Using a PC or Mobile with a web browser. Knowledge about the RDF, OWL concepts. Knowledge about SPARQL. Access to ServiceMap, Knowledge base with data. Several of them are available with different number of data: (i) Florence and whole Tuscany, (ii) Helsinki, Antwerp and Bologna, (iii) Venezia, etc.

The following functionalities are available only for specific Snap4city users with specific privileges.

Expected successful result

The possibility of visually inspecting the graph database structure of the knowledge base to understand the relationships among city entities. From the LOG tools it is possible to learn how to formalize SPARQL queries to search into the knowledge base. This approach may be used to extend the Smart City API, or to perform a direct access to the KB to get specific data and relationships, and to share experience with others users. For example, for implementing some data analytics for routing, traffic flow reconstruction, etc. Once learned the semantic queries in SPARQL can be tested using FLINT, the second tool. Please note that the disit.org">LOG.disit.org tool can be used discover Linked Open Data worldwide since a global index is provided. FLINT tool can be used as well on the many SPARQL repository listed in disit.org">LOG.disit.org.

Steps

 

 

Please note that some of the following links could be accessible only for registered users.

Example 1: Performing direction SPARQL queries searching for relationships among city entities, semantic search, modelled in the knowledge base as graph database à FLINT

 

  • It is a DISIT modified version of the Flint tool in which the engine for data licensing verification is also present.
  • If you click on the button in the circle you just perform a SPARQL query on Km4City and the triples appear below as in the figure. If you click on the microbutton marked with the arrow, a window is open with some examples.

For example, the SPARQL query

 

SELECT * WHERE {

   ?s a km4c:Museum.

   ?s schema:name ?name.

   ?s schema:addressLocality "FIRENZE".

} ORDER BY ?name LIMIT 100

 

retrieves the name ordered list of all the musems of the city of Florence.

A slightly more complex query like:

SELECT * WHERE {

   ?s a km4c:Museum.

   ?s schema:name ?name.

   ?s schema:addressLocality "FIRENZE".

   ?s geo:geometry ?g1.

  

   ?x a km4c:Green_areas.

   ?x schema:name ?name2.

   ?x geo:geometry ?g2.

   FILTER(bif:st_distance(?g1,?g2)<0.1)

} limit 10

 

Search for a florence museum with a green area within 100 meters.

  • By clicking on the links returned (e.g. the ones in the “s” or “x” column) they can be explored using the LOG tool, in this way more relations can be explored and used to enhance the query. The following is an example:

TC5.3 - Knowledge Base Semantic Search via SPARQL | Snap4City

Error

×

Error message

  • Notice: Trying to get property of non-object in user_is_logged_in() (line 1576 of /var/www/html/drupal/modules/user/user.module).
  • Notice: Trying to get property of non-object in user_is_logged_in() (line 1576 of /var/www/html/drupal/modules/user/user.module).
  • Notice: Trying to get property of non-object in og_field_access() (line 578 of /var/www/html/drupal/sites/default/modules/og/og.module).
  • Notice: Trying to get property of non-object in user_access() (line 806 of /var/www/html/drupal/modules/user/user.module).
  • Notice: Trying to get property of non-object in user_access() (line 818 of /var/www/html/drupal/modules/user/user.module).
  • Notice: Trying to get property of non-object in user_access() (line 819 of /var/www/html/drupal/modules/user/user.module).
  • Notice: Trying to get property of non-object in user_access() (line 825 of /var/www/html/drupal/modules/user/user.module).
  • Notice: Trying to get property of non-object in user_access() (line 828 of /var/www/html/drupal/modules/user/user.module).
  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/drupal/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/drupal/includes/bootstrap.inc).
  • Error: __clone method called on non-object in og_user_access_entity() (line 2249 of /var/www/html/drupal/sites/default/modules/og/og.module).
The website encountered an unexpected error. Please try again later.