Help:SemanticMediaWiki

From Tetherless World Wiki

Jump to: navigation, search

Contents

How to Edit

source: http://semantic-mediawiki.org/wiki/Help:Editing

Examples

  • Example1: create a wiki page correspond to an instance - MIT
  • Example2: create a wiki page correspond to a class - Category:University
  • Example3: create a wiki page correspond to a property - Property:Motto
  • Example4: add triples to an instance - MIT
  • Example5: add triples to a class - Category:University
  • Example6: add triples to a property class - Property:Motto

Exercises

  • Exercise 1: What should we expect from the following SMW snippets:
   [[Category::University]]
   [[Category:University]]
   [[:Category:University]]
  • Exercise 2: What should we expect from the following SMW snippets:
   [[Motto::Mind and Hand]]
   [[location::Troy, NY]]

How to Query

source: http://semantic-mediawiki.org/wiki/Help:Semantic_search

Examples

  • Example1: Query instances of a taxonomy (RDFS inference on rdfs:subClassof)
  {{#ask:  [[Category:University]][[location::+]]  |?Category |?location}}
[Query Result] Universities:
Category Location
Massachusetts Institute of Technology University
Private University
Cambridge, Massachusetts


  • Example2: Display only a single property value for a single page
  {{#show:  MIT |?location}}
  {{#show:  [[RPI]] |?location=}}


Exercises

  • Exercise1: why this query does not work (private university and public university are included)
  {{#ask:  [[Category:University]] }}

[Query Result] Universities: Beihang University, Beijing University, Brown University, California State University at Fresno, Hefei University of Technology, Iowa State University, Jönköping University, King Abdullah University of Science and Technology, Linköping University, Manchester University, Massachusetts Institute of Technology, National University of Ireland Galway, Oxford University, Peking University, Private University, Rensselaer Polytechnic Institute, Southern Methodist University, State University of New York at Buffalo, Texas A&M University, Tsinghua University, University of California, Santa Cruz, University of Edinburg, University of Maryland Baltimore County, University of Michigan, University of Southampton, University of Toronto, University of Zürich, Yale University, and Zhejiang University

Property Naming Convention

There is a debate on naming convention.

Approach 1 uses noun for property name, e.g. we use a pair of inverse property (adviser, adviser of)

 Medha has [adviser] Jim
 Jim is [adviser of] Medha 

Approach 2 add a little bit more to property localname

 Medha [has adviser] Jim
 Jim [is adviser of] Medha
Personal tools