140 likes | 283 Views
Lab: Semantic MediaWiki Hands-On. Daniel M. Herzig, Institute AIFB, Karlsruhe Institute of Technology. Day 4 Lab Session . What we will do in this session. Create data and simple schemas in Semantic MediaWiki Create instance data with in the ASWS wiki
E N D
Lab: SemanticMediaWikiHands-On Daniel M. Herzig, Institute AIFB, Karlsruhe Institute of Technology Day 4 Lab Session
Whatwe will do in thissession • Createdata and simple schemas in SemanticMediaWiki • Create instance data with in the ASWS wiki • self descriptions using existing concepts and newly created concepts • Collaborative ontology design with SMW • Export data • About the ASWS2011 Wiki • Access is restricted to users with accounts • No anonymous access • The wiki will be delete a few weeks after the school • Feel free when editing, you can not do any wrong and each edit can be reverted! Try and error
Exercise #1 – Create your account • 1.) Go to http://km.aifb.kit.edu/teach/asws2011 • 2.) Click on “Log in” • 3.) Click on • “Createan account” • 4.) Create your account • and log into the wiki.
Assignment #2 – Creating a page • 1.) Enter your name in the searchbox and click on “Go” • 2.) Click on the red link to create the page
Assignment #3 – Provide content • Write some text about you. • Click on save.
#3.1 Edit • If you want to change or extend the text click on “Edit”.
#4.1 Annotations • (1) Add a category to your page. • To add a page P to category C type [[Category:C]] on page P • For example: [[Category:Person]] • (2) Add a property to your page • To make a typed link of type R from page P1 to page P2 type [[R::P2]] on page P1 • To state the value V of an attribute A on page P type [[A::V]] on page P • For example: [[firstname::Daniel]] Feel free to add more properties to your page! e.g. [[school::KIT]] or [[email::herzig@kit.edu]]
#4.2 RDF • Check the results of your annotations • Factbox: • shows predicates and objects. • RDF export • shows the RDF/XML provided • by this page • Click on “Browse properties” • shows also the predicates and objects provied
#5 Templates • A template defines layout and logic of a group of pages. • Put the following text on your page and replace the red placeholders with your information. • If you do not have or do not want to provide the information, leave the respective row blank. • {{Person • | Name=Your Name • | Affiliation=Your University • | Homepage=Your Homepage • | Email=Your Email • }}
#6 – Query data • Click on “Edit” • Add the following text on your page: {{#ask: [[Category:Person]] |?Name |?Affiliation }}
#6.1 Query • This query returns all cities (all pages in the category City) and their names. (1) Write this query on your page and save it. See the result. (2) Your task is to change the query, so that it also shows the population of these cities as well. {{#ask: [[Category:City]] |?Located in }}
#7 Result formats • Add this query to your page • Change the result format to another visualization, e.g. format=jqplotbar or format=googlebarformat=jqplotpieformat=googlepie format=outline {{#ask: [[Category:City]] |?population |format=table }} http://www.mediawiki.org/wiki/Extension:Semantic_Result_Formats#Formats
ASWS2011 Wiki • The wiki will stay online for the next months. • Feel free to continue exercising in this Wiki. • Keep your account details. • Creating new accounts will not be possible after tomorrow.
If you want your own Semantic MediaWiki • It is very easy to install! • You can install it on your laptop. • You find the software and all you need at: • http://semantic-mediawiki.org • http://semantic-mediawiki.org/wiki/Help:Installation