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 8: Line 8:


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 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.
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]


===Location Example===
===Location Example===
Line 16: Line 14:


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:LocationWithFormatting]] as used on [[User:Silverfish/Test_Feed_Dump_Page_2]]. That template will currently only work for a single location.
===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: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.
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.
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 21:35, 2 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.

Air 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 {{AirDate|May 25, 2011}}, AirDate 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 [[AirDate::{{{1}}}]]. The air date is passed as a parameter, and will be processed as [[AirDate::May 25, 2011]]. 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.

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 [[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: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.

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.


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: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.

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.

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]