Your SlideShare is downloading. ×
Aswc2009 Smw Tutorial Part 2 Froms Etc From Yaron
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Aswc2009 Smw Tutorial Part 2 Froms Etc From Yaron

912
views

Published on

Part 2 of our semantic wiki tutorial for ASWC 2009. This part is from Yaron Koren.

Part 2 of our semantic wiki tutorial for ASWC 2009. This part is from Yaron Koren.


0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
912
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
31
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1.  
  • 2. We have the following statement: Barcelona is a city in Spain, with population 1,600,0000. In MediaWiki: Barcelona is a city in [[Spain]], with population 1,600,0000.
  • 3. In Semantic MediaWiki: Barcelona is a city in [[Has country::Spain]], with population [[Has population::1,600,0000]]. This adds to the database the two triples: Barcelona Has country Spain Barcelona Has population 1,600,0000 On the page is displayed: Barcelona is a city in Spain , with population 1,600,0000.
  • 4.
    • In the page "Property:Has country":
    • [[Has type::Page]]
    • In the page "Property:Has population":
    • [[Has type::Number]]
  • 5.
    • "Has type" is a "special property", i.e. a pre-defined property for meta-data. There are several other special properties.
  • 6.
    • In a page called "Property:Has priority":
    • [[Has type::String]]
    • [[Allows value::Low]], [[Allows value::Medium]], [[Allows value::High]]
  • 7.
    • Page, String, Text, Number, Date, URL, Email, Geographic coordinate, Temperature
  • 8.
    • Shows the set of data defined on a single page
  • 9.
    • Possible solution:
    • Barcelona is a [[Is a::city]] in [[Has country::Spain]], with population [[Has population::1,600,0000]].
  • 10. ...this is not done. Instead, category is used: Barcelona is a city in [[Has country::Spain]], with population [[Has population::1,600,000]]. [[Category::Cities]] Categories are used for defining class because they allow for inheritance. Example - a member of category "Cities" would also be a member of category "Locations", if "Cities" is a subcategory of "Locations".
  • 11.
    • Once the data is stored, we can query it!
    • Querying is done using the #ask parser function.
  • 12.
    • To display all the places in Spain:
    • {{#ask:[[Has country::Spain]]}}
    • All cities in Spain:
    • {{#ask:[[Category:Cities]][[Has country::Spain]]}}
  • 13.
    • Get all cities in Spain with population greater than 1,000,000:
    • {{#ask:
    • [[Category:Cities]]
    • [[Has country::Spain]]
    • [[Has population::>1,000,000]]
    • }}
  • 14.
    • A table of cities in Spain with population greater than 1,000,000, that shows both city names and their population:
    • {{#ask:
    • [[Category:Cities]]
    • [[Has country::Spain]]
    • [[Has population::>1,000,000]]
    • |? Has population
    • }}
  • 15.  
  • 16.
    • Wikipedia has thousands of category and list pages, that could be replaced by queries
  • 17.  
  • 18.  
  • 19.
    • {{#ask:[[Category:Cities]][[Has country::Spain]][[Has population::>1,000,000]]|format=ol}}
    • This displays a numbered list, i.e. the <ol> tag:
    • 1. Madrid
    • 2. Barcelona
  • 20.
    • list, table, ol, ul, template
  • 21.
    • Timeline format:
  • 22.  
  • 23.  
  • 24.  
  • 25.
    • Another extension, &quot;Semantic Maps&quot;, exists just for maps
    • Each page queried must have a property of type &quot;Geographic coordinates&quot;.
  • 26.  
  • 27.  
  • 28. Another extension, &quot;Semantic Compound Queries&quot; lets you display more than one query at the same time This is especially useful for maps - each query can get its own icon.
  • 29.  
  • 30.
    • Query formats exist for exporting data in the following formats:
    • CSV
    • JSON
    • RSS
    • iCalendar
    • vCard
    • BibTeX
  • 31.
    • Data can also be exported via RDF, RDFa and XML using various extensions.
  • 32.
    • What if we want to have a page for every city?
    • Instead of repeating the same text and semantic tags in each page, we can use MediaWiki templates to make the process easier.
  • 33. In page &quot;Template:City&quot;: {{PAGENAME}} is a city in [[Has country::{{{Country}}}]], with population [[Has population::{{{Population}}}]]. [[Category:Cities]] In page &quot;Barcelona&quot;: {{City |Country=Spain |Population=1,000,000}}
  • 34.
    • From “Shanghai” Wikipedia page:
  • 35.  
  • 36.
    • Hide semantic markup from users
    • Allow for a consistent data structure for pages of the same type
    • Pre-define the display
  • 37. But even editing of template calls might be too hard for most users! Another extension, Semantic Forms, lets you create forms to edit those template calls
  • 38.  
  • 39.  
  • 40.  
  • 41.
    • Allow for entering a table of data in a form.
  • 42.
    • In the page &quot;Category:Cities&quot;:
    • [[Has default form::City]]
    • (There are other ways, but this is the standard one)
  • 43.  
  • 44.
    • Semantic Forms supports different input types, depending on the type of the property associated with the field.
    • String, Page, Number – text entry
    • Text – textarea
    • Boolean – checkbox
    • Date – date input or Javascript datepicker
    • “ Enumeration” (Page or String with “allowed values”) - dropdown or radiobutton
    • list of &quot;Enumerations&quot; - listbox or checkboxes
  • 45.
    • Used for properties of type &quot;Geographic coordinates&quot;.
  • 46.
    • support for autocompletion on both single-value and multiple-value fields
    • makes standardizing on names easier, prevents spelling mistakes
  • 47.  
  • 48.  
  • 49. Semantic Forms also provides “helper forms”
  • 50.  
  • 51.  
  • 52.  
  • 53.  
  • 54.  
  • 55.
    • Certain pieces of information can't be stored using simple semantic triples.
    • Example: &quot;This cake recipe requires 2 cups of flour&quot;.
  • 56. This data can't be stored as a triple... instead, it requires an &quot;anonymous object&quot;: Cake recipe Requires X X Has quantity 2 X Has unit Cup X Has ingredient Flour
  • 57.
    • Defines a function, #set_internal, that creates an “anonymous object”.
    • In a page called &quot;Cake recipe&quot;:
    • {{#set_internal:
    • Is part of recipe
    • |Has quantity=2
    • |Has unit=Cup
    • |Has ingredient=Flour
    • }}
  • 58.
    • {{#ask:[[Is part of recipe::Cake recipe]]
    • |? Has quantity
    • |? Has unit
    • |? Has ingredient
    • }}
  • 59.
    • Provides a drill-down, “slice-and-dice” interface to semantic data.
  • 60.  
  • 61.
    • Provides a similar slice-and-dice interface, using Javascript
  • 62.  
  • 63.
    • Two ways to use data from the outside:
    • Import data
    • Query data, keeping it in its original location
  • 64.
    • “ Data Transfer” extension
    • Allows importing of XML and CSV - will soon support Excel as well
    • Usually: each row of data is saved as a template call in a separate page
  • 65.
    • &quot;External Data&quot; extension
    • Can query the following:
    • - web pages with data in XML, CSV or JSON format
    • - databases
    • - LDAP servers
    • Data can be queried and then displayed on the page, or even stored semantically.
  • 66.  
  • 67.
    • Because SMW can export data in CSV and JSON formats, the External Data extension can be used by one SMW wiki to get the data from another one.
  • 68.
    • semantic-mediawiki.org – Semantic MediaWiki homepage
    • smwforum.ontoprise.com – Ontoprise SMW+ user forum
    • referata.com – Referata – SMW wiki hosting
    • wikiworks.com – (shameless plug!) WikiWorks, an SMW-focused consulting company