Difference between revisions of "Wikispooks:Semantic Mediawiki"

From Wikispooks
Jump to navigation Jump to search
(fix)
 
(23 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{{HelpSection|image=SMW.png}}
 
{{HelpSection|image=SMW.png}}
'''Semantic Mediawiki''' (SMW) is an extends the basic Mediawiki software by providing semantic definition and querying capabilities. This offers two main benefits to the site - (i) a richer set of ways to organise and use the information, (ii) the possibility to define {{WSLink|site feeds}} to export the data in a predictable format, for others to build on.
+
'''Semantic Mediawiki''' (SMW) extends the basic Mediawiki software by providing semantic definition and querying capabilities. This offers two main benefits to the site - (i) a richer set of ways to organise and use the information, (ii) the possibility to define {{WSLink|site feeds}} to export the data in a predictable format, for others to build upon.
  
==Starting with SMW==
+
== What is ''semantic'' data? ==
Semantic Mediawiki may seem to present quite a steep learning curve for non-computer scientists, as it is a large piece of software and the idea of 'semantic data' may not be easily graspable. [[User:Robin|Robin]] has volunteered to answer any and all {{SMW}}} queries and give to beginners help where needed. If you want to get to grips with the syntax, there is a lot of help online about this, and a useful guide to the syntax - which also gives an idea of the range of SMW - is the quick reference guide, available [http://postable.net/smwqr/smw-quick-reference.pdf here]. Note that you don't actually need to understand any syntax to get started - if you can fill in a form, then you can fill in semantic data!
+
The word "''semantic''" means "''about meaning''". It is used here to refer to data that is machine-readable (i.e. stripped of nuance and subtlety and expressed in a very predictable and therefore easily processable format), rather than human-readable format you are now reading. Specifically, the semantic data here is just a set of triples, e.g. <code>(Subject, verb, object)</code>:
 +
* The <code>subject</code>s are pages, each of which should correspond to a distinct entity (most commonly a [[person]], but there are other [[Project:SMWObject|semantic objects]])
 +
* The <code>verb</code>s are called [[properties]], and functions similarly to how verbs work in human languages, i.e. it describes how the subject and object are related
 +
* The <code>object</code>s may be pages, or may also be units of measurement
  
==Use on Wikispooks==
+
=== Examples ===
{{FA|Wikispooks:SMW Best Practice}}
+
Simple sentences, e.g. "''Óscar Romero was assassinated''" may equate to a single triple:
SMW is installed on Wikispooks together with a bunch of associated extensions (Semantic Bundle). Towards the end of 2013, Wikispooks has been expanding its use of SMW. Policy and practices in this area are currently fluid a Wikispooks editors are gradually learning how to get the best out of the software, and simultaneously developing a framework for its use on the site. Some best practices are emerging:
+
([[Óscar Romero]], [[Property:Victim of]], [[Assassination]])
 +
 
 +
The subjects are pagenames, the verbs are [[properties]], the objects are either pagenames or measurements:
 +
([[John Magufuli]], [[Property:Died on]], March 2021)
 +
 
 +
Most English sentences take multiple triples to express. e.g. "''On 22 November 1963 the US deep state carried out the MLK assassination, a structural deep event that they blamed on a patsy, Lee Harvey Oswald.''":
 +
([[MLK/Assassination]], [[Property:End]], 22 November 1963)
 +
([[MLK/Assassination]], [[Property:Start]], 22 November 1963)
 +
([[MLK/Assassination]], [[Property:Constitutes]], [[Structural deep event]])
 +
([[MLK/Assassination]], [[Property:Has perpetrator]], [[US/Deep state]])
 +
([[MLK/Assassination]], [[Property:ON has perpetrator]], [[Lee Harvey Oswald]])
 +
([[Lee Harvey Oswald]], [[Property:Constitutes]], [[Patsy]])
  
==Semantic Properties==
+
=== Purposes ===
{{FA|WikiSpooks:Semantic Properties}}
+
Our main purpose of using semantic data is so that the software can read it and build pages dynamically, saving labour such as manually updating lists etc. A side benefit of using a standard semantic data format is that it allows 3<sup>rd</sup> parties to collect and process the information we have here. Since it is intended for computers to process, it is not very human readable, but should you wish to see the data, click on the small blue triangular icon with "RDF" underneath it, which is in the top tight corner of the infobox([https://wikispooks.com/w/index.php?title=Special:ExportRDF/Wikispooks:Semantic%20Mediawiki&syntax=rdf here]).
A ''property'' is the basic type of semantic data. Wikispooks currently has [[:Category:Properties|{{#expr: {{PAGESINCAT:Special Properties}}+{{PAGESINCAT:Stable Properties}}+{{PAGESINCAT:Experimental Properties}} properties]] in use, each of which is documented using [[Template:Property]].  
 
  
==Semantic Templates==
+
==Using the SMW Extension==
{{FA|WikiSpooks:Semantic Templates}}
+
[[image:Extension.png|link=http://www.mediawiki.org/wiki/Extension:Semantic_MediaWiki|left|40px|alt=SMW download page]]
If you can code ordinary [[Help:Templates|Templates]], then you should find it no trouble to code Semantic Templates. All the structure and syntax from ordinary Mediawiki applies. In addition there are a couple of parser functions to provide access to the semantic properties.
+
Thankfully, using the SMW extension (like using Mediawiki) does ''not'' require understanding how it works. Behind the scenes, SMW is doing a lot of work organising and cross-referencing pages, but all you really need to know as an editor is the magic word '''{{t|<nowiki>{{SMWDocs}}</nowiki>}}''', which should be placed just above the "references" section. This calls [[Template:SMWDocs]], which searches the site and automatically prepares  a set of tables of any relevant documents and pages.
  
==Semantic Forms==
+
==Understanding SMW==
{{FA|WikiSpooks:Semantic Forms}}
+
Semantic Mediawiki may seem to present quite a steep learning curve for non-computer scientists, as the idea of 'semantic data' may not be intuitive. [[User:Robin|Robin]] has volunteered to try to answer any and all SMW queries and to give to beginners help where needed. If you want to get to grips with the syntax, there is a lot of help online about this, and a useful guide to the syntax - which also gives an idea of the range of SMW - is the quick reference guide, available [http://postable.net/smwqr/smw-quick-reference.pdf here]. Note that you don't actually need to understand any syntax to get started - if you can fill in a form, then you can fill in semantic data!
A ''form'' is just what it sounds like - a set of boxes and checkboxes to be filled in. The 'semantic' aspect is that each of these fields is tied to particular parameters in a template. Wikispooks currently has only a few semantic forms in use, because the first priority is defining the objects and templates.
 
  
==Development==
+
==Use on Wikispooks==
SMW has considerable potential to enhance the functionality of the site. Among other things, this will require some capable programming by editors up to speed on SMW who:
+
Since November 2013, Wikispooks has made use of SMW and associated extensions (Semantic Bundle). The approach is to:
#Define a core set of semantic ''objects'' for structuring the data, with their own sets of properties and interrelationships
+
#Define a core set of [[SMWObject|semantic ''objects'']] for structuring the data, with their own sets of properties and interrelationships
#Creating a set of semantic ''templates'' to present these objects and their interrelationships
+
#Creating a set of [[:Category:Semantic Templates|semantic ''templates'']] to present these objects and their interrelationships
#Creating a set of semantic ''forms'' to present these objects and their interrelationships
+
#Creating a set of [[:Category:Semantic_Forms|semantic ''forms'']] to present these objects and their interrelationships
 
#Processing the existing content to fit it into these structures
 
#Processing the existing content to fit it into these structures
 
#Allowing for seamless creation of these structures on new pages by non-SMW aware users (i.e. through semantic forms)
 
#Allowing for seamless creation of these structures on new pages by non-SMW aware users (i.e. through semantic forms)
 +
 +
===Semantic Objects===
 +
{{FA|Wikispooks:Semantic Objects}}
 +
Wikispooks has been using a core set of semantic objects for about 4 years with only very minor changes, so they can be considered stable. By structuring the Wikispooks data, they facilitate interoperation with other projects, as well as coming with a set of forms, templates and properties to interrelate them.
 +
 +
===Semantic Properties===
 +
{{FA|Wikispooks:Semantic Properties}}
 +
A ''property'' is the basic type of semantic data. Wikispooks currently has [[:Category:Properties|{{#expr: {{PAGESINCAT:Special Properties}}+{{PAGESINCAT:Stable Properties}}+{{PAGESINCAT:Experimental Properties}}}} properties]] in use, each of which is documented using [[Template:Property]].
 +
 +
===Semantic Templates===
 +
{{FA|Wikispooks:Semantic Templates}}
 +
If you can code ordinary [[Help:Templates|Templates]], then you should find it no trouble to code Semantic Templates. All the structure and syntax from ordinary Mediawiki applies, as does the [[Wikispooks:Templates|template standardisation policy]]. In addition there are a couple of parser functions to provide access to the semantic properties.
 +
 +
===Semantic Forms===
 +
{{FA|Wikispooks:Semantic Forms}}
 +
A ''form'' is just what it sounds like - a set of boxes and checkboxes to be filled in. The 'semantic' aspect is that each of these fields is tied to particular parameters in a template. Wikispooks has a few semantic forms for the [[SMW object]]s, but as of 2023 they were not widely used (if at all), with editors preferring to edit the Wikisource directly.
 +
 +
===Best Practice===
 +
{{FA|Wikispooks:SMW Best Practice}}
 +
Policy and practices in this area are currently fluid as Wikispooks editors are still learning how to get the best out of the software, and simultaneously developing a framework for its use on the site. Some best practices are however emerging, such as the use of templates for all semantic markup.
  
 
===Integrating with Mediawiki===
 
===Integrating with Mediawiki===
Mediawiki's main organisational tools for arranging pages are the ''namespace'' and the ''category''. The latter structure is more or less deprecated on Wikispooks, since SMW has proved that it is able to provide a superior user experience with not much more work than categories. There is a possibility of greatly expanding the use of namespaces to reflect the structure of objects defined (i.e. having separate namespaces for {{t|Person:}}, {{t|Event:}}, {{t|Book:}}, {{t|Nation:}} etc. Input is welcome about this on this talk page.
+
Mediawiki's main organisational tools for arranging pages are the ''namespace'' and the ''category''. Namespaces are used here (for example, to clearly separate [[documents]]). Categories are not widely used here, since SMW is easier to maintain and provides a far superior user experience. Although used for [[templates]] and [[properties]], ''manually assigned<ref>Machine generated categories are available for use by [[templates]], reading the SMW metadata.</ref> categories are deprecated for ordinary pages'' -- editors are encouraged to remove them, since they distract from the more efficient SMW navigation.
 +
 
 +
==Known Issues==
 +
{{FA|Wikispooks:SMW Known Issues}}
 +
Semantic Mediawiki is undergoing active development and as such, not without problems. If important, these will likely be resolved in time by the software's developers. This page is for reporting and discussion of any such issues.
  
{{WikiSpooks Footer/Semantic Mediawiki}}
+
==See Also==
[[Category:Project]]
+
* [https://semantic-mediawiki.org/ Semantic Mediawiki software homepage]
 +
* [http://en.wikipedia.org/wiki/Semantic_Web Wikipedia on the Semantic Web]
 +
{{Wikispooks Footer/Semantic Mediawiki}}
 +
[[Category:Semantic Mediawiki| ]]

Latest revision as of 16:48, 2 May 2023

SMW.png

Semantic Mediawiki (SMW) extends the basic Mediawiki software by providing semantic definition and querying capabilities. This offers two main benefits to the site - (i) a richer set of ways to organise and use the information, (ii) the possibility to define site feeds to export the data in a predictable format, for others to build upon.

What is semantic data?

The word "semantic" means "about meaning". It is used here to refer to data that is machine-readable (i.e. stripped of nuance and subtlety and expressed in a very predictable and therefore easily processable format), rather than human-readable format you are now reading. Specifically, the semantic data here is just a set of triples, e.g. (Subject, verb, object):

  • The subjects are pages, each of which should correspond to a distinct entity (most commonly a person, but there are other semantic objects)
  • The verbs are called properties, and functions similarly to how verbs work in human languages, i.e. it describes how the subject and object are related
  • The objects may be pages, or may also be units of measurement

Examples

Simple sentences, e.g. "Óscar Romero was assassinated" may equate to a single triple:

(Óscar Romero, Property:Victim of, Assassination)

The subjects are pagenames, the verbs are properties, the objects are either pagenames or measurements:

(John Magufuli, Property:Died on, March 2021)

Most English sentences take multiple triples to express. e.g. "On 22 November 1963 the US deep state carried out the MLK assassination, a structural deep event that they blamed on a patsy, Lee Harvey Oswald.":

(MLK/Assassination, Property:End, 22 November 1963)
(MLK/Assassination, Property:Start, 22 November 1963)
(MLK/Assassination, Property:Constitutes, Structural deep event)
(MLK/Assassination, Property:Has perpetrator, US/Deep state)
(MLK/Assassination, Property:ON has perpetrator, Lee Harvey Oswald)
(Lee Harvey Oswald, Property:Constitutes, Patsy)

Purposes

Our main purpose of using semantic data is so that the software can read it and build pages dynamically, saving labour such as manually updating lists etc. A side benefit of using a standard semantic data format is that it allows 3rd parties to collect and process the information we have here. Since it is intended for computers to process, it is not very human readable, but should you wish to see the data, click on the small blue triangular icon with "RDF" underneath it, which is in the top tight corner of the infobox(here).

Using the SMW Extension

SMW download page

Thankfully, using the SMW extension (like using Mediawiki) does not require understanding how it works. Behind the scenes, SMW is doing a lot of work organising and cross-referencing pages, but all you really need to know as an editor is the magic word {{SMWDocs}}, which should be placed just above the "references" section. This calls Template:SMWDocs, which searches the site and automatically prepares a set of tables of any relevant documents and pages.

Understanding SMW

Semantic Mediawiki may seem to present quite a steep learning curve for non-computer scientists, as the idea of 'semantic data' may not be intuitive. Robin has volunteered to try to answer any and all SMW queries and to give to beginners help where needed. If you want to get to grips with the syntax, there is a lot of help online about this, and a useful guide to the syntax - which also gives an idea of the range of SMW - is the quick reference guide, available here. Note that you don't actually need to understand any syntax to get started - if you can fill in a form, then you can fill in semantic data!

Use on Wikispooks

Since November 2013, Wikispooks has made use of SMW and associated extensions (Semantic Bundle). The approach is to:

  1. Define a core set of semantic objects for structuring the data, with their own sets of properties and interrelationships
  2. Creating a set of semantic templates to present these objects and their interrelationships
  3. Creating a set of semantic forms to present these objects and their interrelationships
  4. Processing the existing content to fit it into these structures
  5. Allowing for seamless creation of these structures on new pages by non-SMW aware users (i.e. through semantic forms)

Semantic Objects

Full article: Wikispooks:Semantic Objects

Wikispooks has been using a core set of semantic objects for about 4 years with only very minor changes, so they can be considered stable. By structuring the Wikispooks data, they facilitate interoperation with other projects, as well as coming with a set of forms, templates and properties to interrelate them.

Semantic Properties

Full article: Wikispooks:Semantic Properties

A property is the basic type of semantic data. Wikispooks currently has 260 properties in use, each of which is documented using Template:Property.

Semantic Templates

Full article: Wikispooks:Semantic Templates

If you can code ordinary Templates, then you should find it no trouble to code Semantic Templates. All the structure and syntax from ordinary Mediawiki applies, as does the template standardisation policy. In addition there are a couple of parser functions to provide access to the semantic properties.

Semantic Forms

Full article: Wikispooks:Semantic Forms

A form is just what it sounds like - a set of boxes and checkboxes to be filled in. The 'semantic' aspect is that each of these fields is tied to particular parameters in a template. Wikispooks has a few semantic forms for the SMW objects, but as of 2023 they were not widely used (if at all), with editors preferring to edit the Wikisource directly.

Best Practice

Full article: Wikispooks:SMW Best Practice

Policy and practices in this area are currently fluid as Wikispooks editors are still learning how to get the best out of the software, and simultaneously developing a framework for its use on the site. Some best practices are however emerging, such as the use of templates for all semantic markup.

Integrating with Mediawiki

Mediawiki's main organisational tools for arranging pages are the namespace and the category. Namespaces are used here (for example, to clearly separate documents). Categories are not widely used here, since SMW is easier to maintain and provides a far superior user experience. Although used for templates and properties, manually assigned[1] categories are deprecated for ordinary pages -- editors are encouraged to remove them, since they distract from the more efficient SMW navigation.

Known Issues

Full article: Wikispooks:SMW Known Issues

Semantic Mediawiki is undergoing active development and as such, not without problems. If important, these will likely be resolved in time by the software's developers. This page is for reporting and discussion of any such issues.

See Also

Wikispooks logo.png Policy.png Wikispooks to do.png Tools2.png SMW.png
Semantic
Mediawiki
Help.png









  1. Machine generated categories are available for use by templates, reading the SMW metadata.