Practical Semantic Mediawiki: Difference between revisions

From zooid Wiki
Jump to navigation Jump to search
No edit summary
 
(27 intermediate revisions by 2 users not shown)
Line 26: Line 26:
* Semantic Mediawiki adds structured information and views (Wikipedia [http://www.gossamer-threads.com/lists/wiki/foundation/216574#216574 considers their approach])
* Semantic Mediawiki adds structured information and views (Wikipedia [http://www.gossamer-threads.com/lists/wiki/foundation/216574#216574 considers their approach])
** '''We are going to learn markup encoding in order to have more control over content and appearance'''
** '''We are going to learn markup encoding in order to have more control over content and appearance'''
=== To add ===
* culture, content, technology
* distributing content
== The wiki model ==
pages, links, categories


== Access models ==
== Access models ==
Line 141: Line 149:
** Brainstorm using links
** Brainstorm using links


{{Practice|Create a new page that's a unique generally recognized placename, include a link to another page and another site.}}
{{Practice|Create a new page that's a unique generally recognized world [[:Category:Place|city]], include a link to another wiki page and another site.}}
 
===Categories===


* Categories <nowiki>[[Category:Places with rivers]]</nowiki>
* Categories <nowiki>[[Category:Places with rivers]]</nowiki>
** Subcategories <nowiki>[[Category:Places with immediate access to water]]</nowiki>
** Subcategories <nowiki>[[Category:Places with immediate access to water]]</nowiki>
''It's a good practice to put every page in at least one category.''


{{Practice|Put your page in a category, put that category in a sub-category}}
{{Practice|Put your page in a category, put that category in a sub-category}}
===Images and files ===


* Uploading images and files
* Uploading images and files
=== Page maintenance===


* Moving pages
* Moving pages
Line 158: Line 174:
* Deleting pages
* Deleting pages


* Templates - used for consistently reused content
=== Templates ===
 
* Templates - used for consistently reused content or formatting
 
* Like a page link, for the first instance just enter a template placeholder, using two curly brackets instead of square. <nowiki>{{My template}}</nowiki>
* Then follow the red link to fill in the template, and use it on other pages.
* Templates can accept parameters, separated by the pipe symbol. <nowiki>{{{Template|Parameter1|Parameter2|...}}</nowiki> Parameters are available in the template as <nowiki>{{{1}}}, {{{2}}}</nowiki>, etc.
 
* [[Template example]]


=== Making pages look good ===
=== Making pages look good ===
Line 171: Line 195:
* Possible to hide MW's menus and change the 'skin'
* Possible to hide MW's menus and change the 'skin'


{{Practice|Add <nowiki><div class="noticebox">...</div></nowiki> to some page content}}
{{Practice|Add <nowiki><div class="noticebox" style="float: right">...</div></nowiki> around some page content, add <nowiki><br class="cleared" /></nowiki> after}}


{{Bonus practice|Move your div to a reusable template}}
{{Bonus practice|Move your div to a reusable template}}
Line 212: Line 236:
</div>
</div>


{{Practice|Add a population annotation to your place.}}
{{Practice|Add a population annotation to your [[:Category:Place|place]].}}


* [http://semantic-mediawiki.org/wiki/Help:Properties_and_types#List_of_data_types Built-in types]
* [http://semantic-mediawiki.org/wiki/Help:Properties_and_types#List_of_data_types Built-in types]
Line 219: Line 243:
* Subtypes
* Subtypes
** A city is a place
** A city is a place
* '''With inline properties, you can annotate any page in a freeform way, and query those annotations on other pages, using views like maps and timelines, simple lists for todo items, sums for numbers, etc'''


== Queries ==
== Queries ==
Line 232: Line 258:


''Instead of using inline property assignments, semantic classes use templates with value assignments. This allows display formatting and further, consistent semantic interaction according to the template name (which is usually the category).''
''Instead of using inline property assignments, semantic classes use templates with value assignments. This allows display formatting and further, consistent semantic interaction according to the template name (which is usually the category).''
{{Practice|Change your page so it's a an Entity.}}
{{Practice|Change your page so it's a an Entity.}}


Line 243: Line 268:
<nowiki>}}</nowiki>
<nowiki>}}</nowiki>
</div>
</div>
Classes are composed of:
* A '''template''', which both assigns properties and displays them. You can change it to have all the pages look the same.
* '''Properties''', which is the collection of distinct data about that class
* A '''form''', which makes it easier to enter new page in that class


* {{PSITE|Special:CreateClass}} (template, properties, forms)
* {{PSITE|Special:CreateClass}} (template, properties, forms)
Line 339: Line 371:
Forms and templates can support multiple properties per field.
Forms and templates can support multiple properties per field.


{{Practice|Create your own semantic class with template, properties, form. Add pages to it {{PSITE|Special:CreateClass}} }}
{{Practice|Create your own semantic class using {{PSITE|Special:CreateClass}} with template, properties, form. Add pages to it Include a Place field that has a type of Page }}
{{Bonus practice|Add a map to the template if the page has a location that can be geocoded}}
 
{{See|[http://www.mediawiki.org/wiki/Extension:Semantic_Forms Semantic Forms documentation].}}


== Views ==
== Views ==
Line 367: Line 400:


''If the page's population is greater than 50000, then put it in the category of city.''
''If the page's population is greater than 50000, then put it in the category of city.''
* ''If it's within 500m of a place...''
* ''If it has been visited in the last 4 months''
* ''If it has a picture...''
* ''If it has more than one relation...''


This is a simple form of artificial intelligence, that can be very useful for large sets of pages for arbitrary classifications.
This is a simple form of artificial intelligence, that can be very useful for large sets of pages for arbitrary classifications.
{{See|[http://www.mediawiki.org/wiki/Extension:Parser_function_extensions parser functions documentation].}}


== Future directions==
== Future directions==
Line 399: Line 439:
= Hosting =
= Hosting =


* Export a site, modularize by category
* [[Special:Export]] a site, modularize by category
** Complete site export
** Complete site export
* [[Special:Version]]
* [[Special:Version]]
Line 412: Line 452:
* Mediawiki help sites and community
* Mediawiki help sites and community
* Semantic mediawiki help sites and community
* Semantic mediawiki help sites and community
* If it's for an open cause, ask me
* If it's for an open cause, ask me or other [semantic] wikiers
** User group
** User group


Line 420: Line 460:


[[Category:SemWeb]]
[[Category:SemWeb]]
 
[[Category:Practical Semantic Mediawiki]]


{{Blikied|Nov 25, 2010}}
{{Blikied|Nov 25, 2010}}

Latest revision as of 00:28, 22 April 2014

This free hands-on workshop for non technical users emphasizes the "need to know" aspects of Web publishing, wikis, information design and Semantic Mediawiki for flexible, structured, practical re-usable content that fits into the Web of Data. It is not expected participants will become experts in all these topics, but will be able to create a site, and have an overview of what can be done as a basis of progressive learning. The workshop comes with unlimited free support for any open cause (as practical).

I will be guiding this workshop November 26, 2010 at ecto coop in Montreal from 10AM till 1PM.


Forward

Practice site: http://practice.zooid.org/wiki/Practice

Acronyms

  • MW: Mediawiki
  • SMW: Semantic Mediawiki

Web publishing

Difference between Semantic Mediawiki and static web sites, CMS, Mediawiki

  • Designing information well makes it easier to find, consistent and re-usable.


  • Static web sites can be more difficult to manage active content, it's harder to re-use content. They can require more technical knowledge to edit consistently.
  • Content management systems use forms to guide content editing, but they tend to require low level changes (database, programming), and most users have constrained access to the site
  • Mediawiki is designed to organize large sets of pages, potentially with many involved people, with potentially less constrained access
  • It is the same software the world-changing Wikipedia uses
  • Semantic Mediawiki adds structured information and views (Wikipedia considers their approach)
    • We are going to learn markup encoding in order to have more control over content and appearance

To add

  • culture, content, technology
  • distributing content

The wiki model

pages, links, categories

Access models

  • Fully open, no login required
  • Require login for editing
  • Require created accounts to edit (closed editing)
  • Require created accounts to access (fully private)
    • Encryption to avoid snooping

Access models can be changed over time; avoid starting a wiki with jargon or unsympathetic content.

Site users

  • Levels
    • De-emphasize control, make it as flat as possible
    • Bureaucrats still exist - edit site-wide content and styles, block pages and users
  • OpenID signin allows people to use account information from other OpenID sites



Practice: Create an account and sign in

Accessibility

Here, accessibility refers to supporting people with vision, keyboard control or cognitive impediments.

  • Making sites accessible generally increases usability
    • Works on more devices from text browser to handheld
    • Typically more straightforward navigation
    • Accessible hot keys can be used by any expert user
    • The curb cuts principle
  • Mediawiki is accessible, SMW has issues (forms)
  • Value content over appearance
  • Use good captions for images ([[File:Orange.png|A square of the colour orange]]) , image maps

Terms of use

Copyright continuum, from traditional copyright to public domain
  • Creative Commons - share with options for attribution, non-commercial, changes
  • Traditional copyright - by permission only


Using Mediawiki

MediaWiki logo without tagline.png

Mediawiki is the underlying software of Wikipedia. It is robust, relatively easy to host (and there are lots of easy to use free and low cost hosting sites), and supported by a large community and supports hundreds of useful extensions.


Progressive uses

  • Basic site with pages and categories
    • You just need to know a few things for your wiki to be as useful as most Web sites
  • Add widgets for more interactivity
  • Wiki gardening to reorganize content
  • Add semantic classes for reusable data


  • Typical users of a site
    • Viewer
    • Casual editor
    • Advanced editor (defines new templates, categories)
    • Gardener (organizes site content)
    • Helper (helps others)
    • Semantic coder
  • Third party sites
    • Media
    • Page links
    • Semantic content
  • Ideally online people will get to know each other through user pages (example)

Creating pages

  • How to name pages
    • One topic per page
  • Short, avoid special symbols, use sentence type capitalization, avoid Title Case unless appropriate

Basic markup

A picture of clouds with the sun poking through in case people start to panic

Rather than using a rich text editor, Mediawiki uses a progressively learned set of markup, that's designed to be human-readable, consistent and enforces meaning over appearance. It's not dependant on special programs, and could be carved into a park bench and retain its meaning.

  • ''Italic'', '''Bold'''
  • * List heading level one — use # for numbered list
    • ** List level two — ## for numbered list
      • ...
  • =Heading one=
    • ==Heading two==
      • ...
  • [[Mypage]] — A wiki link
    • "Red links" are links to pages that don't exist
    • [[File:Mypicture.png]] — Media (inline or link)
      • A shortcut to creating images is to create the File: link first, then follow the red link to the upload form
    • [[Mypage|This is my page]] Alternate link text (using pipe symbol)
  • http://theirsite.com — A non-wiki link
    • Use [] brackets and space after the link to use your own link text. [http://theirsite.com Their site].
  • {{My Template}} — A template of page-included content (reusable content, function or site value).. templates are included from the inside out — {{second{{first}} }}
    • Don't Repeat Yourself
    • Pipe symbol is used to pass parameters — {{Highlight|Anything}} can be used to consistently apply an appearance to anything passed as a parameter
  • {{ #geocode: Montréal, Quebec}} — Template function, in this case geocode turns a place name into geographic coordinates
  • {{{1}}} — SMW variable, in this case the first value passed to a template

The most important rule is make sure your brackets match.

  • Finding or starting pages using go/search
  • Proactive linking
    • Brainstorm using links



Practice: Create a new page that's a unique generally recognized world city, include a link to another wiki page and another site.

Categories

  • Categories [[Category:Places with rivers]]
    • Subcategories [[Category:Places with immediate access to water]]

It's a good practice to put every page in at least one category.



Practice: Put your page in a category, put that category in a sub-category

Images and files

  • Uploading images and files

Page maintenance

  • Moving pages
    • Moving preserves the original link, can be useful for "also known as"



Practice: Move your page to a more specific location (Placename, Region), observe Special:RecentChanges


Bonus practice: Add an image, place it on the right and include a caption.

  • Deleting pages

Templates

  • Templates - used for consistently reused content or formatting
  • Like a page link, for the first instance just enter a template placeholder, using two curly brackets instead of square. {{My template}}
  • Then follow the red link to fill in the template, and use it on other pages.
  • Templates can accept parameters, separated by the pipe symbol. {{{Template|Parameter1|Parameter2|...}} Parameters are available in the template as {{{1}}}, {{{2}}}, etc.

Making pages look good

CSS is the style system of Web pages and can also be used in Mediawiki. Like wiki markup, learning can be progressive.

Placeography | Biofuel Visions

  • Re-using CSS styling <div style="background: orange">Hello world</div>
    • Avoid losing meaning (don't use <big> for headers), keep it simple
  • Re-using styles MediaWiki:Common.css
  • Possible to hide MW's menus and change the 'skin'



Practice: Add <div class="noticebox" style="float: right">...</div> around some page content, add <br class="cleared" /> after


Bonus practice: Move your div to a reusable template

Semantic Mediawiki

SMW logo 180px.png

SMW is an extension ecology of MW that allows marking up content for re-use, and creating easier to use forms and views.


  • Meaning through annotations and relationships
    • You define the relationships for your application
    • Triples — subject, predicate, object
      • Subject — what we're talking about
      • Predicate — the relationship type
      • Object - what the subject is being related to
    • Combine them and you can flexibly describe anything
    • Montréal is a place
    • Montréal has population 1,906,811
    • Montréal has geographic coordinates 45.5088889, -73.5541667 (latitude and longitude)
  • What properties does your content need to be useful?

Inline property annotation

Single instances of data can be marked-up using annotations. Annotations look like categories, but they use a double colon. The first part is the relationship type, the second either a value or object page.

  • [[Date::Jan 1, 2011]] — A date value that adds a date to the page it's on.
  • [[asserted by::David Mason]] — A page link that asserts the page it's on


Page: Montreal

  • [[A::Place]]
  • [[Population::1906811]]
  • [[Geographic coordinates::45.5088889, -73.5541667]]



Practice: Add a population annotation to your place.

  • With inline properties, you can annotate any page in a freeform way, and query those annotations on other pages, using views like maps and timelines, simple lists for todo items, sums for numbers, etc

Queries

"Ask" queries can be added to any page to add links or values from other pages according to parameters, for example, by category, pages that have particular values, etc.

    • {{ #ask: [[A::Place]] }}
    • {{ #ask: [[Category:City]] }}

Classes

Instead of using inline property assignments, semantic classes use templates with value assignments. This allows display formatting and further, consistent semantic interaction according to the template name (which is usually the category).

Practice: Change your page so it's a an Entity.

Page: Montréal

{{Entity
|A=Place
|Population=10000
}}


Classes are composed of:

  • A template, which both assigns properties and displays them. You can change it to have all the pages look the same.
  • Properties, which is the collection of distinct data about that class
  • A form, which makes it easier to enter new page in that class

Examples

  • Class templates will often contain queries that show linked classes

Use cases of Semantic Mediawiki's classes

Discourse DB

http://www.discoursedb.org (example) stores discourse relationships (position) for articles on current topics in a structured system.

{{Item
|author=The author or authors of the item; if there is more than one, separate their names with comas
|source=The publication in which it was printed/posted
|date=The date of publication
|url=A URL at which it can be found, if one exists
|quote=A one-to-four-sentence quote from the item, that captures the spirit of the opinion it holds
}}

The template includes a query for positions on this Item.

{{#ask:[[Category:Positions]][[Addresses topic::{{PAGENAME}}]]|format=topiclayout}}, which uses the isfor, isagainst, and ismixed properties.

{{#ask: [[is for::{{PAGENAME}}]]
  |format=template
  |template=ItemQuery
  |sort=Was published on
  |order=descending
  |link=subject
  |? Was written by
  |? Was published by
  |? Was published on
  |? Has URL
  |? Has quote
}}

Placeography

http://www.placeography.org (example) documents information about places. Its properties show some of the ambiguities when trying to describe things.

{{Infobox Building
|Building name
|Image
|Address
|Neighbourhood
|City-locality
|State-province
|County
|Country
|Year built
|Year razed
|Primary style
|Secondary style
|Additions
|Major Alterations
|Moved from Location
|Historic Function
|Current Function
|Architect or source of design
|Builder
|...
}}

Asian Canadian Wiki

http://www.asiancanadianwiki.org (example) AAType is used for artists and organizations.

{{AAType
|Image=uploaded picture
|Home page=URL
|Arts=acting, dance, ...
|Type=Person or Group
|Aspects=Developer, Moderator, Prominent
}}

The template includes queries for Events for the current page.


Forms and templates can support multiple properties per field.



Practice: Create your own semantic class using http://practice.zooid.org/wiki/Special:CreateClass with template, properties, form. Add pages to it Include a Place field that has a type of Page

Views

  • Format= parameter to queries
    • {{ #ask: [[Geographic coordinate::+]]|format=map}}



Practice: Create a facet view for entered places


Basic inference

Inference is used to derive information from basic details.

{{#ifexpr: {{{Population|}}} > 50000 | [[Category:City]] }}

If the page's population is greater than 50000, then put it in the category of city.

  • If it's within 500m of a place...
  • If it has been visited in the last 4 months
  • If it has a picture...
  • If it has more than one relation...

This is a simple form of artificial intelligence, that can be very useful for large sets of pages for arbitrary classifications.

Future directions

  • Relating ontologies (categories and properties) between sites
  • Reusing content
    • Open data — information from government and other sources is becoming available
  • Easier to use interfaces
    • But it always helps to have an understanding of the details
  • Creating a big picture across the web where anyone can ask questions and add their data


Mediawiki Widgets

Mediawiki Widgets allow embedding third-party site content for rich media (Youtube, photo sites, etc) and interactive discussions (DISQUS, Twitter, etc) without needing to set it up or host it on your site.

  • DISQUS discussion
    • Register with DISQUS
    • Get key
    • Create widget
    • Embed widget on pages

Converting content or sites

Hosting

  • Special:Export a site, modularize by category
    • Complete site export
  • Special:Version
  • Free light/startup hosting
  • Inexpensive Mediawiki with SMW option
  • Wikia
  • Self-hosting

Getting help

  • View source of pages
  • Mediawiki help sites and community
  • Semantic mediawiki help sites and community
  • If it's for an open cause, ask me or other [semantic] wikiers
    • User group

Reusing this workshop

Material on this page is free to re-use under a Creative Commons by-sa license, please attribute wiki.zooid.org.



RSS

Blikied on Nov 25, 2010