User:Silverfish/SMW Guide: Difference between revisions

From LoadingReadyWiki
Jump to navigationJump to search
Silverfish (talk | contribs)
No edit summary
Silverfish (talk | contribs)
No edit summary
Line 1: Line 1:
This is a basic Guide to Semantic Mediawiki. The basic idea behind Semantic Mediawiki is that wikipages have properties, that are given values that describe themselves. For example, an Episode page on this wiki could have a Location property, and the value is simply the location that episode was filmed at. Properties have types, that describe the type data they contain. Location would probably be Page, as the location would have a page.
This is a basic Guide to Semantic Mediawiki. The basic idea behind Semantic Mediawiki is that wikipages have properties, that are given values that describe themselves. For example, an Episode page on this wiki could have a Location property, and the value is simply the location that episode was filmed at. Properties have types, that describe the type data they contain. Location would probably be Page, as the location would have a page.


===Air Date Example===
===Release Date Example===


I have set up an example, that I think will be useful. AirDate is a property that gives the date when an episode aired. [[User:Silverfish/Test Feed Dump Page]] is a test page that I have setup with the AirDate property set to May 25, 2011. Notice that the date looks normal in the article, but if you click browse properties, you can see the property AirDate, with the air date of 25 May 2011. This was done using a template, which is the recommended way of including properties. In the article, you can see the template <nowiki>{{AirDate|May 25, 2011}}</nowiki>, AirDate is the template name, and the date is the only parameter.  
I have set up an example, that I think will be useful. ReleaseDate is a property that gives the date when an episode was released. [[User:Silverfish/Test Feed Dump Page]] is a test page that I have setup with the ReleaseDate property set to May 25, 2011. Notice that the date looks normal in the article, but if you click browse properties, you can see the property ReleaseDate, with the air date of 25 May 2011. This was done using a template, which is the recommended way of including properties. In the article, you can see the template <nowiki>{{ReleaseDate|May 25, 2011}}</nowiki>, ReleaseDate is the template name, and the date is the only parameter.  


The template is here: [[Template:AirDate]]. If you look at the details it is <nowiki>[[AirDate::{{{1}}}]]</nowiki>. The air date is passed as a parameter, and will be processed as <nowiki>[[AirDate::May 25, 2011]]</nowiki>. That is in the syntax for Semantic Mediawiki. It says that the page it is inserted into (in this case using a template) has the property AirDate, and value May 25 2011. It is generally recommended to only use this markup inside the template, and use the template to include the property on a page. There's Also [[Template:AirDateWithFormatting]] as used on [[User:Silverfish/Test_Feed_Dump_Page_2]] that uses a similar template, but includes the heading as well.
The template is here: [[Template:ReleaseDate]]. If you look at the details it is <nowiki>'''Date:''' [[ReleaseDate::{{{1}}}]] [[ReleaseDay::{{#time: d|{{{1}}} }}|]][[ReleaseMonth::{{#time: m|{{{1}}} }}|]][[ReleaseYear::{{#time: Y|{{{1}}} }}|]]</nowiki>. The release date is passed as a parameter, and will be processed as <nowiki>'''Date:''' [[ReleaseDate::May 25, 2011]] [[ReleaseDay::{{#time: d|May 25, 2011 }}|]][[ReleaseMonth::{{#time: m|May 25, 2011 }}|]][[ReleaseYear::{{#time: Y|May 25, 2011 }}|]]</nowiki>. That is in the syntax for Semantic Mediawiki. It says <nowiki>[[ReleaseDate::May 25, 2011]]</nowki> means that the page it is inserted into (in this case using a template) has the property ReleaseDate, and value May 25 2011. It is generally recommended to only use this markup inside the template, and use the template to include the property on a page. It also adds the heading, and derives a ReleaseDay, ReleaseMonth, and ReleaseYear properties from the date.


Finally, if you click on the AirDate Property, or click here [[Property:AirDate]], you can see Date is listed. This is the type of the property, and indicates that the AirDate is a date, so the system knows how to interpret it. You can edit the page to see the only markup is <nowiki>[[Has type::Date]]</nowiki>. That indicates that the property has the Date type, and you can replace Date with another type as appropriate. See [https://semantic-mediawiki.org/wiki/Help:Property_declaration] for more details. In fact, this means the Property page has property "Has type", with value "Date", as Property pages can have properties too.
Finally, if you click on the ReleaseDate Property, or click here [[Property:ReleaseDate]], you can see Date is listed. This is the type of the property, and indicates that the ReleaseDate is a date, so the system knows how to interpret it. You can edit the page to see the only markup is <nowiki>[[Has type::Date]]</nowiki>. That indicates that the property has the Date type, and you can replace Date with another type as appropriate. See [https://semantic-mediawiki.org/wiki/Help:Property_declaration] for more details. In fact, this means the Property page has property "Has type", with value "Date", as Property pages can have properties too.


===Location Example===
===Location Example===


I have now set up Location as a property, that gives the filming location for an episode. The Property can be includes multiple times if an episode has multiple locations. It is used in [[User:Silverfish/Test Feed Dump Page]], which uses [[Template:Location]], which is essentially the same as the one for AirDate. If you look at [[Property:Location]], you can see the type is Page, as the Location will link to the article for the relevant location. Strongbadia is includes as a test, to see if it will accept Pages without articles, which it does.
I have now set up Location as a property, that gives the filming location for an episode. The Property can be includes multiple times if an episode has multiple locations. It is used in [[User:Silverfish/Test Feed Dump Page]], which uses [[Template:LocationPlain]], which includes similar semantic mediawiki markup to the one for ReleaseDate. The markup is <nowiki>[[Location::{{{1}}}]]</nowiki>.If you look at [[Property:Location]], you can see the type is Page, as the Location will link to the article for the relevant location. Strongbadia is includes as a test, to see if it will accept Pages without articles, which it does.


There's Also [[Template:LocationWithFormatting]] as used on [[User:Silverfish/Test_Feed_Dump_Page_2]]. That template will currently only work for a single location.
There's Also [[Template:Location]] as used on [[User:Silverfish/Test_Feed_Dump_Page_2]]. Both templates only work for one location currently.


===Appearance By Example===


===Appearance By Example===
I have now set up AppearanceBy as a property, to indicate that someone appeared in a video or podcast. The Property will usually be includes multiple times when there are multiple people in the episode. It is used in [[User:Silverfish/Test Feed Dump Page]], which uses [[Template:AppearanceByPlain]]. If you look at [[Property:AppearanceBy]], you can see the type is Page, as there will be a link to the person making an appearance.
 
There's Also [[Template:AppearanceBy]] as used on [[User:Silverfish/Test_Feed_Dump_Page_2]]. That template will currently work with up to 4 cast members, but it will need testing.


I have now set up AppearanceBy as a property, to indicate that someone appeared in a video or podcast. The Property will usually be includes multiple times when there are multiple people in the episode. It is used in [[User:Silverfish/Test Feed Dump Page]], which uses [[Template:AppearanceBy]]. If you look at [[Property:AppearanceBy]], you can see the type is Page, as there will be a link to the person making an appearance.
===Edited By Example===


There's Also [[Template:AppearanceByWithFormatting]] as used on [[User:Silverfish/Test_Feed_Dump_Page_2]]. That template will currently work with up to 4 cast members, but it will need testing.
EditedBy has the same setup as AppearanceBy, but the template with formatting is currently setup for only one editor.


So that's the basic idea, and I will probably be adding to this later. I recommend looking at the Introduction to Semantic MediaWiki for more information [https://semantic-mediawiki.org/wiki/Help:Introduction_to_Semantic_MediaWiki]
So that's the basic idea, and I will probably be adding to this later. I recommend looking at the Introduction to Semantic MediaWiki for more information [https://semantic-mediawiki.org/wiki/Help:Introduction_to_Semantic_MediaWiki]

Revision as of 01:52, 28 January 2015

This is a basic Guide to Semantic Mediawiki. The basic idea behind Semantic Mediawiki is that wikipages have properties, that are given values that describe themselves. For example, an Episode page on this wiki could have a Location property, and the value is simply the location that episode was filmed at. Properties have types, that describe the type data they contain. Location would probably be Page, as the location would have a page.

Release Date Example

I have set up an example, that I think will be useful. ReleaseDate is a property that gives the date when an episode was released. User:Silverfish/Test Feed Dump Page is a test page that I have setup with the ReleaseDate property set to May 25, 2011. Notice that the date looks normal in the article, but if you click browse properties, you can see the property ReleaseDate, with the air date of 25 May 2011. This was done using a template, which is the recommended way of including properties. In the article, you can see the template {{ReleaseDate|May 25, 2011}}, ReleaseDate is the template name, and the date is the only parameter.

The template is here: Template:ReleaseDate. If you look at the details it is '''Date:''' [[ReleaseDate::{{{1}}}]] [[ReleaseDay::{{#time: d|{{{1}}} }}|]][[ReleaseMonth::{{#time: m|{{{1}}} }}|]][[ReleaseYear::{{#time: Y|{{{1}}} }}|]]. The release date is passed as a parameter, and will be processed as '''Date:''' [[ReleaseDate::May 25, 2011]] [[ReleaseDay::{{#time: d|May 25, 2011 }}|]][[ReleaseMonth::{{#time: m|May 25, 2011 }}|]][[ReleaseYear::{{#time: Y|May 25, 2011 }}|]]. That is in the syntax for Semantic Mediawiki. It says [[ReleaseDate::May 25, 2011]]</nowki> means that the page it is inserted into (in this case using a template) has the property ReleaseDate, and value May 25 2011. It is generally recommended to only use this markup inside the template, and use the template to include the property on a page. It also adds the heading, and derives a ReleaseDay, ReleaseMonth, and ReleaseYear properties from the date. Finally, if you click on the ReleaseDate Property, or click here [[Property:ReleaseDate]], you can see Date is listed. This is the type of the property, and indicates that the ReleaseDate is a date, so the system knows how to interpret it. You can edit the page to see the only markup is <nowiki>[[Has type::Date]]. That indicates that the property has the Date type, and you can replace Date with another type as appropriate. See [1] for more details. In fact, this means the Property page has property "Has type", with value "Date", as Property pages can have properties too.

Location Example

I have now set up Location as a property, that gives the filming location for an episode. The Property can be includes multiple times if an episode has multiple locations. It is used in User:Silverfish/Test Feed Dump Page, which uses Template:LocationPlain, which includes similar semantic mediawiki markup to the one for ReleaseDate. The markup is [[Location::{{{1}}}]].If you look at Property:Location, you can see the type is Page, as the Location will link to the article for the relevant location. Strongbadia is includes as a test, to see if it will accept Pages without articles, which it does.

There's Also Template:Location as used on User:Silverfish/Test_Feed_Dump_Page_2. Both templates only work for one location currently.

Appearance By Example

I have now set up AppearanceBy as a property, to indicate that someone appeared in a video or podcast. The Property will usually be includes multiple times when there are multiple people in the episode. It is used in User:Silverfish/Test Feed Dump Page, which uses Template:AppearanceByPlain. If you look at Property:AppearanceBy, you can see the type is Page, as there will be a link to the person making an appearance.

There's Also Template:AppearanceBy as used on User:Silverfish/Test_Feed_Dump_Page_2. That template will currently work with up to 4 cast members, but it will need testing.

Edited By Example

EditedBy has the same setup as AppearanceBy, but the template with formatting is currently setup for only one editor.

So that's the basic idea, and I will probably be adding to this later. I recommend looking at the Introduction to Semantic MediaWiki for more information [2]