semantic web assignment 3
DESCRIPTION
Semantic web assignment 3, Building your own Webpage with rdfa support.TRANSCRIPT
Semantic Web Assignment 3 Studentname: Barry Kollee Student number: 10349863 (UvA studentNr) Student username: bke310 (VU username) Assignment name: Semantic web Assignment 3
Connecting to the Web of Data
1. List three widely used ontologies on the Web of Data and what they are used to represent. • DBpedia. This is an ontology which covers all the exisiting Wikipedia pages. So it mainly can
give information about all exisiting Wikipedia pages or parts of it.1 • FOAF (Friend Of A Friend). This is a dictionary of named properties and classes using W3C’s
RDF technology. 2 • The GeoNames Ontology. This ontology makes it possible to add geospatial semantic
information to the Word Wide Web. 3 2. Name three formats for embedding structured data into HTML.
• RDFa Primer • Microformats • Microdata
3. What does the use of owl:sameAs imply? The built-‐in OWL property owl:sameAs inks an individual to an individual. Such an owl:sameAs statement indicates that two URI references actually refer to the same thing: the individuals have the same "identity".4 4. How can you connect a Semantic Web resource to another Semantic Web resource? Name two approaches and give an example of each.
• We can compare characters of the labels of the concepts. I.e. by searching on different languages.(Syntax matching).
• Taxonomy or Hierarchy comparison. We search for matches in the hierarchy of 2 Semantic web resources. I.e. by mapping family relationships.
5. Can the same resource have multiple representations? (Yes/No) Yes, in example a car part like a tire. We can state that this could be a subclass of a car but also a subclass of rubber transport parts.
1 www.dbpedia.org 2 http://xmlns.com/foaf/spec/ 3 http://www.geonames.org/ontology/documentation.html 4 http://www.w3.org/TR/owl-‐ref/#sameAs-‐def
Developing an RDFa Web page
Create a small web page, for example a personal web page about yourself or a page about a topic your interested in. Mark-‐up up the page using RDFa. Be sure to use at least 1 external ontology. Your web page should result in at least 10 asserted triples. Check that your web page has correct RDFa mark-‐up by using http://inspector.sindice.com (You can use the By direct input tab). Hand-‐in: Your web page as it looks in a browser; the source code (i.e. HTML) of your web page; the output of the Sindice Inspector including rea-‐oning; A paragraph describing whether the reasoning is what you expected or not.
For creating my own personal page I used a tool called Bootstrap5. This let’s you easily create a webpage.
My personal webpage made with Bootstrap
5 http://twitter.github.com/bootstrap/
Ontologies given by Sindice Inspector
Triples given by Sindice Inspector
I mostly used explicit triples within my html code. I’ve added one external ontology to foaf:Person which you can see in the diagram. The reasoning is done on all my declared span statements. I can state that I’ve got the result that I want because all my properties all listed. I however didn’t managed to notice why my diagram points to the stylesheet which is brought with Bootstrap.
The ontologies that are being retrieved are way more than I have stated in my HTML file as prefixes. It looks like that some ontologies already refer to others. That could be the reason for retrieving so many with Syndice Inspector. I do see the foaf ontology which I made which is being used for my name.
My sourcecode is listed in ‘Appendix 1 – HTML sourcecode’
Generated graph from Sindice inspector
Converting a database Use D2RQ to convert the Times Higher Education Rankings SQL database into RDF. This will be used in your final assignment. You can find the SQL database online on blackboard (timeshigher.sql). Dump the resulting RDF to a file. Also, perform one SPARQL query over the dataset. In your assignment: 1. Show a snippet of the RDF generated. 2. What syntax is it in? 3. Show the SPARQL query you performed. 1. I’ve loaded MySQL and managed to get the SGL dump running in the program ‘Sequal Pro.’
1. I’ve made a mapping.ttl file by commandline for using the D2RQ environment. Which gives me
Turtle syntax.
@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/> . 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:rankings_id; 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:rankings_order; d2rq:propertyDefinitionLabel "rankings order"; d2rq:column "rankings.order"; d2rq:datatype xsd:integer; . map:rankings_university a d2rq:PropertyBridge; d2rq:belongsToClassMap map:rankings; d2rq:property vocab:rankings_university; d2rq:propertyDefinitionLabel "rankings university"; d2rq:column "rankings.university"; . map:rankings_overall_score a d2rq:PropertyBridge; d2rq:belongsToClassMap map:rankings; d2rq:property vocab:rankings_overall_score; 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:rankings_teaching; 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:rankings_international_mix; 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; d2rq:property vocab:rankings_industry_income; 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:rankings_research; 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:rankings_citations; d2rq:propertyDefinitionLabel "rankings citations"; d2rq:column "rankings.citations"; d2rq:datatype xsd:double; .
3. We’re ready to go to perform a SPARQL query with D2RQ. I’ve chosen to list the universities with only a higher rating than 80.0 points. Which is listed in the column ‘rankings_overall_score‘.
The SPARQL query for retrieving universities only with a higher rate then 80
Appendix 1 – HTML sourcecode <!DOCTYPE html> <html version="HTML+RDFa 1.1" lang="en" xmlns="http://www.w3.org/1999/html" xmlns:rdf="http://www.w3.org/1999/02/22-‐rdf-‐syntax-‐ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-‐schema#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:dbp="http://dbpedia.org/page/"> <head> <meta charset="utf-‐8"> <title>Barry Kollee</title> <meta name="viewport" content="width=device-‐width, initial-‐scale=1.0"> <meta name="description" content=""> <meta name="author" content=""> <link href="css/bootstrap.css" rel="stylesheet"> <style type="text/css"> body { padding-‐top: 60px; padding-‐bottom: 40px; } img { -‐webkit-‐box-‐shadow: 2px 2px 6px 1px rgba(0, 0, 0, 0.33); box-‐shadow: 2px 2px 6px 1px rgba(0, 0, 0, 0.33); } </style> </head> <body> <div class="navbar navbar-‐inverse navbar-‐fixed-‐top"> <div class="navbar-‐inner"> <div class="container"> <a class="brand" href="#">Barry Kollee</a> <div class="nav-‐collapse collapse"> <ul class="nav"> <li class="active"><a href="#">About me</a></li> </ul> </div> </div> </div> </div> <div class="container"> <div class="row"> <div class="span2"> <img style="margin-‐top: 11px" src="http://a 0.twimg.com/profile_images/1441095528/Schermafbeelding_2011-‐07-‐13_om_23.09.06.png" width="200" class="img-‐rounded"> </div> <div class="span10"> <h4 property="name">Barry Kollee</h4> <blockquote style="border-‐left:0"> <p class="muted"> My name is <span typeof="foaf:Person" property="foaf:name">Barry Kollee</span>. I’m a student of the <span property="university">VU university</span>. This page has been made as an assignment for the the course Semantic web.<br><br> My current job is software development in a small company named <span property="company">Nakko</span>. We mostly develop <span property="software">applications</span> for mobile devices like <span property="mobiledevice">iPhones</span> and <span property="mobiledevice">Samsung Galaxy</span>. <br><br>On the other hand we’re also active in the world of mobile advertisement. </p> </blockquote> <h4>My interests</h4> <blockquote style="border-‐left:0"> <p class="muted">
My interests are mostly with the innovation of technique. I adore <span property="electronics">gadgets</span> and am looking forward to see how technology will evolve in the upcoming decades. <br><br> I’m also a <span property="sports">football</span> player at a local footballclub and am a fan of the football club from <span property="capitalOfHolland">Amsterdam</span> called <span property="aDutchFootballclub">Ajax</span>. </p> </blockquote> </div> </div> <hr> <footer> <p>Barry Kollee<br><br> <span property="foaf:mbox">[email protected]</span> </p> </footer> </div> <script src="js/jquery.js"></script> <script src="js/bootstrap-‐transition.js"></script> <script src="js/bootstrap-‐alert.js"></script> <script src="js/bootstrap-‐modal.js"></script> <script src="js/bootstrap-‐dropdown.js"></script> <script src="js/bootstrap-‐scrollspy.js"></script> <script src="js/bootstrap-‐tab.js"></script> <script src="js/bootstrap-‐tooltip.js"></script> <script src="js/bootstrap-‐popover.js"></script> <script src="js/bootstrap-‐button.js"></script> <script src="js/bootstrap-‐collapse.js"></script> <script src="js/bootstrap-‐carousel.js"></script> <script src="js/bootstrap-‐typeahead.js"></script> </body> </html>