semantic web final assignment

29
‘My College Spot’ “The App for foreign students” By: Selvi Ratnasingan Barry Kollee Group number: 41 Assignment: Final assignment Course: Semantic Web

Upload: barryk88

Post on 20-Aug-2015

935 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Semantic web final assignment

 

 

‘My College Spot’

“The App for foreign students”

 

 

 

By: Selvi Ratnasingan Barry Kollee Group number: 41 Assignment: Final assignment Course: Semantic Web

Page 2: Semantic web final assignment

2   MY  COLLEGE  SPOT    

 

Inhoud Application and Knowledge Design ................................................................ 3

1. Description of our ontology. ................................................................... 3 2. Consider reusing existing ontologies. .................................................... 3 3. Enumerate important terms in the ontology. .......................................... 4 4. Define the classes and the class hierarchy. .......................................... 5 5. Define the classes and the class hierarchy. .......................................... 6 6. Define the properties of these properties. ............................................. 7

Integrating Information ................................................................................... 10 Get RDF from timesharing database .......................................................... 10 Data from external ontologies .................................................................... 10

DBPedia (for collecting information about universities) .......................... 11 LinkedGeoData ....................................................................................... 12 DBPedia (for collecting information about the spots) ............................. 13

RDF-files we used to query data ................................................................ 13 Application Interface ...................................................................................... 15 Appendixes .................................................................................................... 18    

   

Page 3: Semantic web final assignment

MY  COLLEGE  SPOT   3      

Application and Knowledge Design  

Firstly we designed our ontology according to the ontology building methodology.

1. Description of our ontology. The domain of our ontology is ‘Spot’s nearby Universities’. Our goal is to give users of our application the opportunity to get information about all kinds of ‘spots’ nearby universities. Examples of these sightseeing spots are museums, monuments and restaurants.

Our first priority is to let our application support a distance measurer, where we compare the geolocation (longitude & latitude) of the selected university and the ‘spot’ where the user refers to.

With the names of our ‘spot’ in mind we can get lots of information from the web which gives information about our ‘spot’. We want to create a small pocket guide which shows:

• Main info; give users insight in a description of the ‘spot’. • Year; the year that the ‘spot’ has been created or built. • Number of visitors; this will be the indicator of the popularity of the spot. • Geolocation; this info is critical to compare the distance between the user’s

university and the actual ‘spot’.

Queries

To get all required information we need to perform several queries throughout the web. Coupled to the information we need we can state that we need to perform the following queries. These queries listed below should

• getSpotsNearbyUniversity: o getGeoLocationOfUniversity: o getGeoLocationOfSpot:

• getMainInfoOfSpot: • getFoundingYearOfSpot: • getNumberOfVisitors: • getGeoLocationOfSpot:

2. Consider reusing existing ontologies. To make an application which fullfills the requirements we need, we’ve chosen to include the following ontologies:

• LinkedGeoData. This is the main ontology which we need because our first priority is to compare the geolocation of the universtity with our ‘spot’. We need to get the geolocation of the requested university and ‘spot’, the type of ‘spot’, and the names of the ‘spot’s’ nearby from geonames.org. We can state that we need the following types:

o GeoMetry o Longitude o Latitude o Name

• DBpedia. We want to use DBpedia to cover our small pocket guide. If we’re

able to retrieve all the names of the ‘spot’s’ we’ve requested we should be

Page 4: Semantic web final assignment

4   MY  COLLEGE  SPOT    

able to get some information about our ‘spot’s’ from DBpedia. The information from DBpedia which we need are.

o Abstract (regular information about the ‘spot’) o NumberOfVisitors o FoundingYear

• We also make use of the university database which covers 200 Universities

throughout the world. This database is filled with names and ratings of several universities. In our concept we are only interested in the name of the university.

o NameOfUniversity o Ratings

3. Enumerate important terms in the ontology. We’ve thought of important terms throughout our brainstorm which should cover the concept and goal we want to establish.

• Sightseeing o Museums o Monument o Theater o Zoo o Park o Restaurant

• University • Location

o City o Country o Geolocation

• Departments • Type Of spot • To see, to eat, to relax • International rating • Number of Visitors • Famous people • Description of spot • Founding year • Cultural / non-Cultural

Page 5: Semantic web final assignment

MY  COLLEGE  SPOT   5      

4. Define the classes and the class hierarchy.

With the terms of brainstorm session we started to define classes and then we thought about the hierarchical relationship between classes. As you can see we divided the spots into Cultural and Non-Cultural Spots.

Page 6: Semantic web final assignment

6   MY  COLLEGE  SPOT    

5. Define the properties After writing the properties for each classes we find out that some classes have same literal properties like name, abstract, etc. So we defined one new class for this common properties, BasicClass, as shown in the figure below. In this diagram the data type properties are displayed under their own classes. For example GeoLocation has latitude and longitude as data type properties.

Page 7: Semantic web final assignment

MY  COLLEGE  SPOT   7      

6. Define the properties of these properties. In step 6 we define properties of defined properties and that means we add more information to the properties. Besides of symmetric and inverse properties we introduced in this step a restriction class which based on the property “distanceBetween” . In this diagram the inverse properties are in red color and symmetric properties are in blue.

Page 8: Semantic web final assignment

8   MY  COLLEGE  SPOT    

In the ontology we define the restriction class ‘NearbySpot’as follows:

rankings:NearbySpot rdfs:subClassOf rankings:Spot ; rdfs:subClassOf [ rdf:type owl:Restriction ; owl:onProperty rankings:distanceBetween ; owl:hasValue [ rdf:type rdfs:Datatype ; owl:onDatatype xsd:float ; owl:withRestriction ( [xsd:maxExclusive "5"^^xsd:float] ) ] ] .  

 

Page 9: Semantic web final assignment

MY  COLLEGE  SPOT   9      

After inferencing we get the following diagram of ontology. The green color shows the equivalent class of the particular class and the equivalent properties are displayed between the brackets.

For inferencing we followed the steps below:

• Syntax comparison (like searching for classes with same labels)

• Hierarchy comparison (like common parents of instances) (we pick one or two instances of different countries and searching for common parents)

Page 10: Semantic web final assignment

10   MY  COLLEGE  SPOT    

Integrating Information We now have a clear view on what our ontology should look like and we’re ready to search for the components which we want to use in our application.

Get RDF from timesharing database At first we started of with creating our own local database consisting of RDF. We’ve used the timeshigher.sql file to build a mapping file. Within this mapping file we’ve renamed the naming conventions of every subclass of the universities.

Because we’d like to perform queries to the DBpedia pages of the universities we’ve adjusted a small part of the mapping file which is needed for the program D2RQ. We wanted to have a direct useable URI object where we could query DBpedia with directly. We’ve done this by adding the value uriPattern1 to the university it’s name.

For generating RDF dump of our database we’ve used the program D2RQ. This program allows us to build the .ttl files which holds all information of timesharing database what we need for our semantic web application. This .ttl file consists of an N-Triple syntax. These dump files are necessary for us to perform queries to and eventually to give the requested data we need.

Data from external ontologies The most important information which we need is the ‘names’ of all the universities which are listed in the timeshigher.sql file. We want to reuse the name of the university to perform several queries to dbpedia.org and linkedgeodata.org.

Because of the complexity of our application we decided to copy the data from the external ontologies as a dump file. For getting all the info we need we perform the following queries:

                                                                                                               11  d2rq:uriPattern  "http://dbpedia.org/resource/@@rankings.university|urlify@@";  

Page 11: Semantic web final assignment

MY  COLLEGE  SPOT   11    

DBPedia (for collecting information about universities) Get the DBPedia resources of all the universities which we request. To give information about the university we perform queries for we use several properties which are listed in the DBpedia pages for a university

• Abstract (main info about the requested university) • City (place where the university is located) • Country (country where the university is located) • Image (image of the university) • Latitude • Longitude

prefix rankings: <http://www.example.org/vocab/> construct { ?uni rankings:country <http://dbpedia.org/resource/Netherlands> ; rankings:city ?city ; rankings:image ?image ; rankings:abstract ?abstract; rankings:long ?long ; rankings:lat ?lat ; rankings:name ?name . } WHERE { ?uni rdf:type <http://dbpedia.org/ontology/EducationalInstitution> . ?uni <http://dbpedia.org/ontology/country> <http://dbpedia.org/resource/Netherlands> . ?uni <http://dbpedia.org/property/city> ?city . ?uni <http://dbpedia.org/property/name> ?name . ?uni <http://dbpedia.org/ontology/thumbnail> ?image . ?uni <http://dbpedia.org/ontology/abstract> ?abstract . ?uni <http://www.w3.org/2003/01/geo/wgs84_pos#long> ?long . ?uni <http://www.w3.org/2003/01/geo/wgs84_pos#lat> ?lat . FILTER(langMatches(lang(?name), "EN") && langMatches(lang(?abstract), "EN") )  

 

In this query as you see we get only information of the universities in The Netherlands, because of memory issues we decided to scope our application only in The Netherlands.

Page 12: Semantic web final assignment

12   MY  COLLEGE  SPOT    

LinkedGeoData We use linkedgeodata to check if a certain spot is within a particular range of the university. With the query listed below we want to receive the following information of all the retrieved results.

• Longitude (is a part of the geolocation) • Latitude (is a part of the geolocation) • Name of the spot.

The following query is utilized to compare the geolocation of university and spots to get all tourist spots within a radius of 5 km.

Prefix lgd: <http://linkedgeodata.org/> Prefix lgdo: http://linkedgeodata.org/ontology/ Select ?spot ?name ?spotgeo from <http://linkedgeodata.org> { ?uni owl:sameAs <http://dbpedia.org/resource/University_of_Amsterdam> . ?uni geo:geometry ?unigeo . ?spot a lgdo:Tourism . OPTIONAL { ?spot rdfs:label ?name . } ?spot geo:geometry ?spotgeo . Filter(bif:st_intersects(?unigeo, ?spotgeo, 5)) }

 

In this query we are giving in two inputs.

• Type of spot (i.e. Tourism, Theatre, SportsCentre, Monument and others) • DBpedia resource of the spot where we should compare with

In our demo application we’ve only used the University of Amsterdam as the DBPedia input.

Page 13: Semantic web final assignment

MY  COLLEGE  SPOT   13    

DBPedia (for collecting information about the spots) With the above information we are already able to give a map view of all the universities inside the timeshigher.sql file and the spots where we want to refer to. To give a more broader view on all the ‘spots’ nearby the university we want to perform some queries to DBpedia.org. We do this for retrieving the info of all the spots nearby the requested university. The info which we want to retrieve is:

• Name (The name of the requested spot) • Abstract (a small description of the spot) • Image (image of the spot) • Founding year (for some spots we want to give info about the founding year,

i.e. monuments) • Number of visitors (for some spots we want to give an indicator of it’s

popularity. We do this with the number of visitors) • Year completed (for some spots we want to show the completion year (i.e. a

church)). • Resting place of, (in some cases we want to show the persons resting place

of a spot. (i.e. Gaudi of the ‘Sagrada Familia’ in Barcelona)

Within this querie we request for main info about the requested spot. This spot is retrieved via the geolocation comparison query. In the example listed below *name* is the name of the requested spot. The implementation of the data of this spot isn’t implemented inside the demo application. But we can state that we would be able to implement this pretty easily and reuse the data which is generated by this query.

CONSTRUCT { <http://dbpedia.org/resource/*name*> ?p ?o . ?s ?p2 <http://dbpedia.org/resource/*name*>. } WHERE { { <http://dbpedia.org/resource/*name*> ?p ?o } UNION {

?s ?p2 <http://dbpedia.org/resource/*name*> } }    

Page 14: Semantic web final assignment

14   MY  COLLEGE  SPOT    

RDF-files we used to query data

• Our own ontology. In this file we define the class Ranking. This has 2 properties which we use in our web application. These two properties which we want to reuse in our application.

o The name of the university

o The rank of the university

• The university data, within this file all the info from the timeshigher database is listed. In here we also define our direct URL to the DBpedia page from the actual university.

• Individual information of every university. This file holds all the information which we need from every single university for our application. The content of this a dump file is from DBpedia.org.

• Location based information about the university and the spots nearby. We want to know what the exact geolocation is of the requested university. We also need to reuse this longitude and latitude to get some spots. We are interested in the geolocation of the universities and spots and the names of the spots. This information should be retrieved from linkedgeodata.org and geonames.org.

• Information about spots. We want to give some information (abstract) about the spots and the properties which are listed in our own ontology (i.e. numberOfVisitors). This information is being retrieved from DBpedia

To finish up our setup and to get information about the spots and the universities we needed to setup a SPARQL server which enables us to perform queries on our localhost. For retrieving our final goal we’ve configured Joseki2. We place all the created dump files into Joseki together with our own ontology (the university list) and Joseki has been configured completely.

   

                                                                                                               2  http://www.joseki.org/  

Page 15: Semantic web final assignment

MY  COLLEGE  SPOT   15    

Application Interface With Joseki installed and our RDF files in place we’re ready to go to perform our SPARQL queries to all our dump files we created. Within our localhost we use SPARQLer to give us the results on certain requests we make. These requests will be used later on within the top layer of our application. The results of these requests will be displayed later on within the web browse. The actual result of our website and the html code which we used can be found in the appendix.

List of queries which we used to display the information on our webpage:

Query 1: Get a particular University from the timeshigher database based on it’s rank and give regular info about this university

PREFIX rankings: <http://www.example.org/vocab/> PREFIX dc: <http://purl.org/dc/elements/1.1/> prefix dbpedia: <http://dbpedia.org/ontology/#> prefix owl: <http://www.w3.org/2002/07/owl#> prefix xsd: <http://www.w3.org/2001/XMLSchema#> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?Name ?Abstract ?Rank WHERE{ ?uni rankings:idOfRanking '92'^^xsd:integer . ?uni rankings:orderOfRanking ?Rank . ?uni rankings:belongsTo ?link . ?link rankings:name ?Name . ?link rankings:abstract ?Abstract . } LIMIT 10 Query 2: Get the name and location of the university based on it’s idOfRanking

PREFIX rankings: <http://www.example.org/vocab/> PREFIX dc: <http://purl.org/dc/elements/1.1/> prefix dbpedia: <http://dbpedia.org/ontology/#> prefix owl: <http://www.w3.org/2002/07/owl#> prefix xsd: <http://www.w3.org/2001/XMLSchema#> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?lat ?long ?name ?uni WHERE{ ?uni rankings:idOfRanking '92'^^xsd:integer . ?uni rankings:belongsTo ?link . ?link rankings:name ?name . ?link rankings:lat ?lat . ?link rankings:long ?long .        }

Page 16: Semantic web final assignment

16   MY  COLLEGE  SPOT    

 

Query 3: Compare the geolocation of the university and spots nearby and get all the tourist spots within a radius of 5 km.

PREFIX rankings: <http://www.example.org/vocab/> PREFIX dc: <http://purl.org/dc/elements/1.1/> prefix dbpedia: <http://dbpedia.org/ontology/#> prefix owl: <http://www.w3.org/2002/07/owl#> prefix xsd: <http://www.w3.org/2001/XMLSchema#> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?Touristspot WHERE{ ?uni rankings:idOfRanking '92'^^xsd:integer . ?uni rankings:belongsTo ?link . ?link rankings:name ?name . ?link rankings:abstract ?abstract . ?spot rankings:isNearBy ?link .

?spot rankings:name ?Touristspot . ?spot rankings:hasGeo ?spotGeo . }    

Page 17: Semantic web final assignment

MY  COLLEGE  SPOT   17    

The demo setup

To use our application in an online environment where we can display the content to the user we need to be able to host our application and give it a front end. We do this by using the tool SGVizler. We imported the given queries within our .html code for displaying our data within components which are available within SGVizler. Both the source code and the screenshots of our final demo application can be found in the Appendixes.

   

Page 18: Semantic web final assignment

18   MY  COLLEGE  SPOT    

Appendix 1: D2RQ Mapping file  @prefix map: <#> . @prefix db: <> . @prefix vocab: <vocab/> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> . @prefix jdbc: <http://d2rq.org/terms/jdbc/> . @prefix owl: <http://www.w3.org/2002/07/owl#> . map:database a d2rq:Database; d2rq:jdbcDriver "com.mysql.jdbc.Driver"; d2rq:jdbcDSN "jdbc:mysql://localhost:3306/VUDatabase"; d2rq:username "root"; d2rq:password "test"; jdbc:autoReconnect "true"; jdbc:zeroDateTimeBehavior "convertToNull"; . # Table rankings map:rankings a d2rq:ClassMap; d2rq:dataStorage map:database; d2rq:uriPattern "rankings/@@rankings.id@@"; d2rq:class vocab:rankings; d2rq:classDefinitionLabel "rankings"; . map:rankings__label a d2rq:PropertyBridge; d2rq:belongsToClassMap map:rankings; d2rq:property rdfs:label; d2rq:pattern "rankings #@@rankings.id@@"; . map:rankings_id a d2rq:PropertyBridge; d2rq:belongsToClassMap map:rankings; d2rq:property vocab:idOfRanking; d2rq:propertyDefinitionLabel "rankings id"; d2rq:column "rankings.id"; d2rq:datatype xsd:integer; . map:rankings_order a d2rq:PropertyBridge; d2rq:belongsToClassMap map:rankings; d2rq:property vocab:orderOfRanking; d2rq:propertyDefinitionLabel "rankings order"; d2rq:column "rankings.order"; d2rq:datatype xsd:integer; . map:rankings_university a d2rq:ObjectPropertyBridge; d2rq:belongsToClassMap map:rankings; d2rq:property vocab:belongsTo ; d2rq:propertyDefinitionLabel "rankings university"; d2rq:uriPattern "http://dbpedia.org/resource/@@rankings.university|urlify@@"; . map:rankings_overall_score a d2rq:PropertyBridge; d2rq:belongsToClassMap map:rankings; d2rq:property vocab:overallScoreOfRanking; d2rq:propertyDefinitionLabel "rankings overall_score"; d2rq:column "rankings.overall_score"; d2rq:datatype xsd:double; . map:rankings_teaching a d2rq:PropertyBridge; d2rq:belongsToClassMap map:rankings; d2rq:property vocab:teachingRanking; d2rq:propertyDefinitionLabel "rankings teaching"; d2rq:column "rankings.teaching"; d2rq:datatype xsd:double; . map:rankings_international_mix a d2rq:PropertyBridge; d2rq:belongsToClassMap map:rankings; d2rq:property vocab:internationalMixOfRanking; d2rq:propertyDefinitionLabel "rankings international_mix"; d2rq:column "rankings.international_mix"; d2rq:datatype xsd:double; . map:rankings_industry_income a d2rq:PropertyBridge; d2rq:belongsToClassMap map:rankings;

Page 19: Semantic web final assignment

MY  COLLEGE  SPOT   19    

d2rq:property vocab:industryIncomeOfRanking; d2rq:propertyDefinitionLabel "rankings industry_income"; d2rq:column "rankings.industry_income"; d2rq:datatype xsd:double; . map:rankings_research a d2rq:PropertyBridge; d2rq:belongsToClassMap map:rankings; d2rq:property vocab:researchRanking; d2rq:propertyDefinitionLabel "rankings research"; d2rq:column "rankings.research"; d2rq:datatype xsd:double; . map:rankings_citations a d2rq:PropertyBridge; d2rq:belongsToClassMap map:rankings; d2rq:property vocab:citationsRanking; d2rq:propertyDefinitionLabel "rankings citations"; d2rq:column "rankings.citations"; d2rq:datatype xsd:double; .

Page 20: Semantic web final assignment

20   MY  COLLEGE  SPOT    

Appendix 2: Our ontology

 

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix owl: <http:// www.w3.org/2002/07/owl#> . @prefix dbp-owl: <http://live.dbpedia.org/ontology/#> . @prefix dbp-prop: <http://live.dbpedia.org/property/#> . @prefix dbp-yago: <http://dbpedia.org/class/yago/#> . @prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> . @prefix rankings: <http://www.example.org/vocab/#> . rankings:BasicClass a rdfs:Class . rankings:name a rdfs:Property ; rdfs:domain rankings:BasicClass; rdfs:range xsd:string . rankings:name owl:equivalentProperty dbp-prop:name . rankings:abstract a rdfs:Property; rdfs:domain rankings:BasicClass; rdfs:range xsd:string . rankings:abstract owl:equivalentProperty dbp-owl:abstract . rankings:image a rdfs:Property ; rdfs:domain rankings:BasicClass; rdfs:range xsd:string . rankings:image owl:equivalentProperty dbp-owl:thumbnail . rankings:University a rdfs:Class; rdfs:subClassOF rankings:BasicClass ; rdfs:subClassOf rankings:GeoLocation . rankings:University owl:equivalentClass dbp-owl:University . rankings:Ranking a rdfs:Class . rankings:orderOfRanking a rdfs:Property; rdfs:domain rankings:Ranking ; rdfs:range xsd:integer . rankings:belongsTo a rdfs:Property; rdfs:domain rankings:Ranking; rdfs:range rankings:University . rankings:has a rdfs:Property; rdfs:domain rankings:University; rdfs:range rankings:Ranking . rankings:has owl:inverseOf rankings:belongsTo . rankings:GeoLocation a rdfs:Class . rankings:GeoLocation owl:equivalentClass geo:GeoMetry . rankings:lat a rdfs:Property ; rdfs:domain rankings:GeoLocation; rdfs:range xsd:float . rankings:lat owl:equivalentProperty geo:lat . rankings:long a rdfs:Property ; rdfs:domain rankings:GeoLocation; rdfs:range xsd:float . rankings:long owl:equivalentProperty geo:long .

Page 21: Semantic web final assignment

MY  COLLEGE  SPOT   21    

rankings:Country a rdfs:Class; rdfs:subClassOf rankings:BasicClass ; rdfs:subClassOf rankings:GeoLocation . rankings:Country owl:equivalentClass dbp-owl:Country . rankings:City a rdfs:Class; rdfs:subClassOf rankings:BasicClass ; rdfs:subClassOf rankings:GeoLocation . rankings:City owl:equivalentClass dbp-owl:City . rankings:parentCountry a rdfs:Property ; rdfs:domain rankings:Country; rdfs:range rankings:City . rankings:Spot a rdfs:Class; rdfs:subClassOF rankings:BasicClass ; rdfs:subClassOf rankings:GeoLocation . rankings:Spot owl:equivalentClass dbp-owl:Organisation . rankings:distanceBetween rdf:type owl:symmetricProperty; rdfs:domain rankings:University; rdfs:range rankings:Spot . rankings:NearbySpot rdfs:subClassOf rankings:Spot ; rdfs:subClassOf [ rdf:type owl:Restriction ; owl:onProperty rankings:distanceBetween ; owl:hasValue [ rdf:type rdfs:Datatype ; owl:onDatatype xsd:float ; owl:withRestriction ( [xsd:maxExclusive "5"^^xsd:float] ) ] ] . rankings:Cultural_Spot a rdfs:Class; rdfs:subClassOf rankings:Spot . rankings:Non-cultural_Spot a rdfs:Class; rdfs:subClassOf rankings:Spot . rankings:established a rdfs:Property; rdfs:domain rankings:Cultural_Spot; rdfs:range xsd:integer . rankings:established owl:equivalentProperty dbp-prop:established . rankings:yearCompleted a rdfs:Property; rdfs:domain rankings:Cultural_Spot; rdfs:range xsd:integer . rankings:yearCompleted owl:equivalentProperty dbp-prop:yearCompleted . rankings:Park a rdfs:Class; rdfs:subClassOf rankings:Non-cultural_Spot . rankings:Zoo a rdfs:Class; rdfs:subClassOf rankings:Non-cultural_Spot . rankings:Cafe a rdfs:Class; rdfs:subClassOf rankings:Non-cultural_Spot .

Page 22: Semantic web final assignment

22   MY  COLLEGE  SPOT    

rankings:Restaurant a rdfs:Class; rdfs:subClassOf rankings:Non-cultural_Spot . rankings:Theater a rdfs:Class; rdfs:subClassOf rankings:Non-cultural_Spot . rankings:Church a rdfs:Class; rdfs:subClassOf rankings:Cultural_Spot . rankings:Monument a rdfs:Class; rdfs:subClassOf rankings:Cultural_Spot . rankings:Museum a rdfs:Class; rdfs:subClassOf rankings:Cultural_Spot . rankings:Art a rdfs:Class; rdfs:subClassOf rankings:BasicClass . rankings:has a rdfs:Property; rdfs:domain rankings:Museum; rdfs:range rankings:Art . rankings:has owl:equivalentProperty dbp-prop:museum . rankings:isPlacedIn a rdfs:Property; rdfs:domain rankings:Art; rdfs:range rankings:Museum . rankings:has owl:inverseOf rankings:isPlacedIn . rankings:Person a rdfs:Class; rdfs:subClassOf rankings:BasicClass . rankings:Person owl:equivalentClass dbp-owl:Person . rankings:birthDate a rdfs:Property; rdfs:domain rankings:Person; rdfs:range xsd:date . rankings:birthDate owl:equivalentProperty dbp-owl:birthDate . rankings:deathDate a rdfs:Property; rdfs:domain rankings:Person; rdfs:range xsd:date . rankings:deathDate owl:equivalentProperty dbp-owl:deathDate . rankings:createdBy a rdfs:Property; rdfs:domain rankings:Art; rdfs:range rankings:Person . rankings:createdBy owl:equivalentProperty dbp-prop:artist . rankings:created a rdfs:Property; rdfs:domain rankings:Person; rdfs:range rankings:Art . rankings:createdBy owl:inverseOf rankings:created .

Page 23: Semantic web final assignment

MY  COLLEGE  SPOT   23    

Appendix 3: Snippet of the Education information dump file @prefix ns0: <http://www.example.org/vocab/> . @prefix dbpedia: <http://dbpedia.org/resource/> . dbpedia:Eindhoven_University_of_Technology ns0:name "Eindhoven University of Technology"@en ; ns0:city dbpedia:Eindhoven . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . dbpedia:Eindhoven_University_of_Technology ns0:lat "51.4481"^^xsd:float ; ns0:abstract "The Eindhoven University of Technology is a university of technology located in Eindhoven, Netherlands. The motto of the university is: Mens agitat molem (The mind brings matter into motion). The university was the second of its kind in the Netherlands, only Delft University of Technology existed previously. Until mid-1980 it was known as the Technische Hogeschool Eindhoven (abbr. THE). In 2011 QS World University Rankings placed Eindhoven at 146th internationally, but 61st globally for Engineering & IT. Furthermore, in 2011 Academic Ranking of World Universities (ARWU) rankings, TU/e was placed at the 52-75 bucket internationally in Engineering/Technology and Computer Science (ENG) category and at 34th place internationally in the Computer Science subject field."@en ; ns0:long "5.48972"^^xsd:float ; ns0:image <http://upload.wikimedia.org/wikipedia/commons/thumb/5/51/TU_Eindhoven.jpg/200px-TU_Eindhoven.jpg> ; ns0:country dbpedia:Netherlands . dbpedia:University_of_Twente ns0:name "University of Twente"@en ; ns0:city dbpedia:Enschede ; ns0:lat "52.2427"^^xsd:float ; ns0:abstract "University of Twente is a university located in Enschede, Netherlands. It offers research and degree programmes in the social and behavioral sciences and in engineering. In keeping with its entrepreneurial spirit, the University is committed to making economic and social contribution to the region of the Netherlands where it is based. The UT collaborates with Delft University of Technology and Eindhoven University of Technology under the umbrella of the 3TU. Federation, and is also a partner in the European Consortium of Innovative Universities (ECIU)."@en ; ns0:long "6.85326"^^xsd:float ; ns0:image <http://upload.wikimedia.org/wikipedia/commons/thumb/4/43/University_of_Twente_logo_-_english_version.png/200px-University_of_Twente_logo_-_english_version.png> ; ns0:country dbpedia:Netherlands .

Page 24: Semantic web final assignment

24   MY  COLLEGE  SPOT    

Appendix 4: Snippet of the spot information (in this snippet Rijksmuseum is listed) @prefix dbpprop: <http://dbpedia.org/property/> . @prefix dbpedia: <http://dbpedia.org/resource/> . <http://dbpedia.org/resource/The_Milkmaid_(Vermeer)> dbpprop:museum dbpedia:Rijksmuseum . dbpedia:Pierre_Cuypers dbpprop:significantBuildings dbpedia:Rijksmuseum . @prefix dbpedia-owl: <http://dbpedia.org/ontology/> . dbpedia:Pierre_Cuypers dbpedia-owl:significantBuilding dbpedia:Rijksmuseum . <http://dbpedia.org/resource/The_Love_Letter_(Vermeer)> dbpprop:museum dbpedia:Rijksmuseum . <http://dbpedia.org/resource/Syndics_of_the_Drapers\u0027_Guild> dbpprop:museum dbpedia:Rijksmuseum . dbpedia:The_Feast_of_Saint_Nicholas dbpprop:museum dbpedia:Rijksmuseum . dbpedia:The_Gallant_Conversation dbpprop:museum dbpedia:Rijksmuseum . dbpedia:The_Jewish_Bride dbpprop:museum dbpedia:Rijksmuseum . dbpedia:The_Floating_Feather dbpprop:museum dbpedia:Rijksmuseum . dbpedia:Holy_Kinship dbpprop:museum dbpedia:Rijksmuseum . dbpedia:Woman_in_Blue_Reading_a_Letter dbpprop:museum dbpedia:Rijksmuseum . <http://dbpedia.org/resource/The_Little_Street_(Vermeer)> dbpprop:museum dbpedia:Rijksmuseum . <http://dbpedia.org/resource/The_Night_Watch_(painting)> dbpprop:museum dbpedia:Rijksmuseum . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . dbpedia:Rijksmuseum rdf:type dbpedia-owl:Building , dbpedia-owl:Museum , dbpedia-owl:Place , dbpedia-owl:ArchitecturalStructure . @prefix ns4: <http://schema.org/> . dbpedia:Rijksmuseum rdf:type ns4:Place , ns4:Museum . @prefix owl: <http://www.w3.org/2002/07/owl#> . dbpedia:Rijksmuseum rdf:type owl:Thing . @prefix yago: <http://dbpedia.org/class/yago/> . dbpedia:Rijksmuseum rdf:type yago:GeoclassMuseum . @prefix ns7: <http://www.opengis.net/gml/> . dbpedia:Rijksmuseum rdf:type ns7:_Feature , yago:NationalMuseumsOfTheNetherlands ; owl:sameAs <http://it.dbpedia.org/resource/Rijksmuseum_(Amsterdam)> . @prefix ns8: <http://pt.dbpedia.org/resource/> . dbpedia:Rijksmuseum owl:sameAs ns8:Rijksmuseum . @prefix ns9: <http://ja.dbpedia.org/resource/>

Page 25: Semantic web final assignment

MY  COLLEGE  SPOT   25    

Appendix 5: Screenshots of our application Overal view with information about the University of Amsterdam, i t ’s location on the map, the spots that are nearby and these spots within a mapview.

Main info about the university of Amsterdam

Page 26: Semantic web final assignment

26   MY  COLLEGE  SPOT    

Selection of the spots nearby the University of Amsterdam

Mapview of the spots nearby the university of Amsterdam  

 

Page 27: Semantic web final assignment

MY  COLLEGE  SPOT   27    

Appendix 6: Source code of our webpage (SGVizler)  <!DOCTYPE HTML> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Sgvizler</title> <meta charset="UTF-8"/> <link rel="shortcut icon" href="http://sgvizler.googlecode.com/svn/www/favicon.ico" /> <link rel="stylesheet" type="text/css" href="http://sgvizler.googlecode.com/svn/www/sgvizler.css" /> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> <script type="text/javascript" src="https://www.google.com/jsapi"></script> <script type="text/javascript" id="sgvzlr_script" src="http://sgvizler.googlecode.com/svn/release/0.4/sgvizler.js"></script> <script type="text/javascript"> // CONFIGURATION Sgvizler 0.4: Set variables to fit your setup. // NB! Do not let the last item in a list end with a comma. //// Query settings. The defaults settings are listed. sgvizler.queryOptions = { // Default query. //'query': "SELECT ?class (count(?instance) AS ?noOfInstances)\nWHERE{ ?instance a ?class }\nGROUP BY ?class\nORDER BY ?class", // Endpoint URL. 'endpoint': "http://localhost:2020/sparql", // Endpoint output format. 'endpoint_output': 'json', // 'xml' or 'json' // This string is appended the 'endpoint' variable and the query to it again to give a link to the "raw" query results. 'endpoint_query_url': "?output=text&amp;query=", // URL to SPARQL validation service. The query is appended to it. //'validator_query_url': "http://www.sparql.org/query-validator?languageSyntax=SPARQL&amp;outputFormat=sparql&amp;linenumbers=true&amp;query=", // Default chart type. //'chart': 'gLineChart' // Default log level. Must be either 0, 1, or 2. 'loglevel': 2 }; //// Prefixes // Add convenient prefixes for your dataset. rdf, rdfs, xsd, owl // are already set. Examples: sgvizler.namespaces['wd'] = 'http://sws.ifi.uio.no/d2rq/resource/'; sgvizler.namespaces['w'] = 'http://sws.ifi.uio.no/ont/world.owl#'; //// Your chart drawing preferences. The defaults are listed. // See the Google visualization API for available options for // Google charts, and the Sgvizler homepage for other // options. Options applicable to all charts are put in the // "root" of sgvizler.chartOptions. Chart specific options are // put in a "child" with the chart's id as name, // e.g. 'gGeoMap'. sgvizler.chartOptions = { //'width': '800', //'height': '400', //'chartArea': { left: '5%', top: '5%', width: '75%', height: '80%' }, // 'gGeoMap': { // 'dataMode': 'markers' // }, // 'gMap': { // 'dataMode': 'markers', // }, // 'sMap': { // 'dataMode': 'markers', // 'showTip': true, // 'useMapTypeControl': true // }

Page 28: Semantic web final assignment

28   MY  COLLEGE  SPOT    

}; //// Leave this as is. Ready, steady, GO! $(document).ready(sgvizler.go()); </script> </head> <body> <div id="logo"> <a href="http://code.google.com/p/sgvizler/"> <img src="http://sgvizler.googlecode.com/svn/www/mr.sgvizler.png" alt="mr.sgvizler.png"/> </a><br/>Mr. Sgvizler </div> <h1>My College Spot</h1> <h2>University of Amsterdam</h2> <table> <tr style="width:100%; height:500px;"> <td style="width:50%;"> <div id="sgvzl_example2" data-sgvizler-query=" PREFIX rankings: <http://www.example.org/vocab/> PREFIX dc: <http://purl.org/dc/elements/1.1/> prefix dbpedia: <http://dbpedia.org/ontology/#> prefix owl: <http://www.w3.org/2002/07/owl#> prefix xsd: <http://www.w3.org/2001/XMLSchema#> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?Name ?Abstract ?Rank WHERE{ ?uni rankings:idOfRanking '92'^^xsd:integer . ?uni rankings:orderOfRanking ?Rank . ?uni rankings:belongsTo ?link . ?link rankings:name ?Name . ?link rankings:abstract ?Abstract . } LIMIT 10 " data-sgvizler-chart="gTable" data-sgvizler-loglevel="1" style="width:800px; height:400px;" ></div> </td> <td style="width:50%;"> <div id="sgvzl_example4" data-sgvizler-query=" PREFIX rankings: <http://www.example.org/vocab/> PREFIX dc: <http://purl.org/dc/elements/1.1/> prefix dbpedia: <http://dbpedia.org/ontology/#> prefix owl: <http://www.w3.org/2002/07/owl#> prefix xsd: <http://www.w3.org/2001/XMLSchema#> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?lat ?long ?name ?uni WHERE{ ?uni rankings:idOfRanking '92'^^xsd:integer . ?uni rankings:belongsTo ?link . ?link rankings:name ?name . ?link rankings:lat ?lat . ?link rankings:long ?long . } " data-sgvizler-chart="sMap" data-sgvizler-loglevel="2" style="width:600px; height:400px;"> </div> </td> </tr>

Page 29: Semantic web final assignment

MY  COLLEGE  SPOT   29    

</table> <table> <tr style="width:100%"> <td style="width:50%"> <div id="sgvzl_example3" data-sgvizler-query=" PREFIX rankings: <http://www.example.org/vocab/> PREFIX dc: <http://purl.org/dc/elements/1.1/> prefix dbpedia: <http://dbpedia.org/ontology/#> prefix owl: <http://www.w3.org/2002/07/owl#> prefix xsd: <http://www.w3.org/2001/XMLSchema#> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?Touristspot WHERE{ ?uni rankings:idOfRanking '92'^^xsd:integer . ?uni rankings:belongsTo ?link . ?link rankings:name ?name . ?link rankings:abstract ?abstract . ?spot rankings:isNearBy ?link . ?spot rankings:name ?Touristspot . ?spot rankings:hasGeo ?spotGeo . } LIMIT 21 " data-sgvizler-chart="gTable" data-sgvizler-loglevel="1" style="width:800px; height:600px;" ></div> </td> <td style="width:50%"> <div id="sgvzl_example5" data-sgvizler-query= " PREFIX rankings: <http://www.example.org/vocab/> PREFIX dc: <http://purl.org/dc/elements/1.1/> prefix dbpedia: <http://dbpedia.org/ontology/#> prefix owl: <http://www.w3.org/2002/07/owl#> prefix xsd: <http://www.w3.org/2001/XMLSchema#> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?spotLat ?spotLong ?name ?spot WHERE{ ?spot rankings:isNearBy ?link . ?spot rankings:name ?name . ?spot rankings:lat ?spotLat . ?spot rankings:long ?spotLong . } " data-sgvizler-chart="sMap" data-sgvizler-loglevel="2" style="width:800px; height:400px;"> </div> </td> </tr> </table> <hr/> <div id="footer"> <!-- Please leave a link to the Sgvizler homepage --> <p> Sgvizler visualizes the result of SPARQL SELECT queries using javascript and the Google Visualization API. For more information, see the <a href="http://code.google.com/p/sgvizler/">Sgvizler</a> homepage. (c) 2011 Martin G. Skj&#230;veland. </p> </div> </body> </html>