Tutorial Challenge: Semantic Yellow Pages

According to the Get Involved page each blog post has to start with a short introduction:
Hello, I am Konrad Höffner and I am a student of computer science at the at University of Leipzig. I love living in the future but one of the things that I am still dissatisfied with is yellow pages. They are nationally limited, pestered by advertisments (and I *hate* ads),  don’t understand synonyms, are only indexed in the language of the country of origin and/or are generell dumb (try searching for “delicious pizza nearby” in Google Maps). Fortunately I think the Semantic Web is the technology that can alleviate this nuisance and it’s only *you* who can save the world!


Your goal is to create a Semantic Yellow Pages Search for . In a simple html search form a user can enter keywords or a search sentence. For the search the following needs to be extracted:

  1. a location
  2. an amenity
  3. (optional) a restriction or filter condition

This information is now to be used to construct SPARQL queries on the (or another knowledge base if you like) and present the result to the user. Note that if no location can be found in the search string, the user’s current location should be used instead. The position can be found out via the HTML 5 feature geolocation (or given in another input text field for testing ).

Example 1

“I am looking for a optician in Paris.” Here the location is the city of and the amenity is . There is no restriction or filter in this example. The city Paris only has a single geo point (her center). Since it is a a radius of 5 km is appropriate. Here is an example SPARQL query():

Prefix lgd: 
Prefix lgdo: 
Select ?optician ?name ?opticiangeo from  {
   ?paris owl:sameAs  .
   ?paris geo:geometry ?parisgeo .
   ?optician a lgdo:Optician .
   OPTIONAL {?optician rdfs:label ?name . }
   ?optician geo:geometry ?opticiangeo .
   Filter(bif:st_intersects(?parisgeo, ?opticiangeo, 5))

As an additional challenge you can adjust the radius not only for the type of the location (city:5km, country:100km), but also for the searched amenity ( 5 km, 0.4 km)

Example 2

“cheap restaurant”: Here the task is to find cheap restaurants near the position of the user. The amenity in this case is . The restriction is hard to extract here and could best be translated to “below a certain price point” which even then still requires the application to a) find out the restaurant’s prices and b) determine where that price lies (e.g. below the median or at least one standard deviation to the left of the average). Because the restriction handling is quite challenging, it is ok if you don’t implement restrictions or only do it for basic cases like “within 500 m”. If a restriction is present and the results are shown as a list, the results should be ordered according to the restriction criterion, e.g. for “within 500 m” they should be ordered by distance, ascending.


Most of the following requirements should be met:

  • Synonyms should be included, i.e. searching for “tooth doctor” returns the same result as “dentist”.
  • Other languages should be included, i.e. searching for “Zahnarzt” returns the same result as “dentist”.
  • Search results should be shown as a table. The geo position and the name of the amenities should be shown along with their relevant properties (distance, opening times, etc. )

Suggested resources

Some suggestions of resources that can be used, i.e. you can use anything else.

  • (recommended for both the ontology, the instances itself and the queries)
  • . Note that there are already many multilingual labels included.
  • Wortschatz Universität Leipzig for the synonyms. AFAIK the synonyms are only included for the German language so it is ok if synonyms are only used for German. A prepared table of synonyms specifically for the LinkedGeoData ontology will be available soon, so that you don’t have to work with the Wortschatz interface.
  • LinkedGeoData supports the REST interface and can thus be queried like this: . Further details can be found at .
This entry was posted in Tutorial Challenges. Bookmark the permalink.

Comments are closed.