query titles: Advanced UsageĪny API action can be requested using #action. meta :siteinfo, siprop: "extensions" client. upload_image "filename", "path", "comment", "ignorewarnings" client. protect_page "title", "reason", "protections" # protections are optional, default is "edit=sysop|move=sysop" client. create_account "username", "password" # will not work on wikis that require CAPTCHA, like Wikipedia client. log_in "username", "password" # default Vagrant username and password are "Admin", "vagrant" client. See also this help page for further information.Require "mediawiki_api" client = MediawikiApi:: Client. If the parser strict mode is disabled (note: default is enabled) then extra colons can cause unexpected pattern matching which should be mitigated by using the #set parser function instead. The #set call is specifically helpful when trying to save a Text value that contains square brackets, such as wiki-links such brackets often don't work with conventional Semantic MediaWiki markup. This function takes in pairs of property names and values and stores them semantically but it does not print anything to the screen. Instead of using the standard double-brackets markup, you can also define semantic data using the #set parser function. Silent annotations using #set See Help:Setting values using #set for more detailed information The following help page on data classification describes some principles on how to use categories and properties to classify and distinguish content from another. The way to do this is to specify a type for the "Has population" property see the article on Property declarations for more information. We want to be able to tell Semantic MediaWiki that "Has population" is a number, not a link to a page in the wiki. For example, in alphabetical order, "1,000,000" comes before "345". Furthermore, if you wanted to create a list of all German cities ordered by population, numeric order is different from the alphabetical order that you would expect for article names. However, it creates a link to a 3,396,990 page, and having an article for every population value probably does not make sense. With Semantic MediaWiki, this is done by putting the property name and :: in front of the text and surrounding it with ] brackets, thus: In the article, identifying it as a value for the "Has population" property. To make this knowledge available to computer programs, one would like to "tag" the text For example, there is a number in the Berlin article giving its population. There is other useful information in wiki articles besides links to other articles. → Consider using annotations with #set instead. it requires a disabled strict mode setting. There are various ways of adding properties to pages:Ĭlassify a link with the property "example property."Īs of Semantic MediaWiki 2.3.0 Released on 29 October 2015 and compatible with MW 1.19.0 - 1.25.x. configuration parameter $wgCapitalLinks) and if changed arbitrarily may cause content to be rendered invalid or unavailable during query execution. In-text annotations and property declarations are case-sensitive and therefore adhere certain MediaWiki configuration settings (e.g. As with categories, a property's article can be empty, but it is strongly recommended to add a description that explains the intent of the property and its proper usage. So you can also also use MediaWiki's special page "Search" to find existing properties. Just as category articles are prefixed with Category:, all property articles are prefixed with Property: to distinguish them from other articles. You can see all the properties in use in the wiki with special page "Properties" Lists properties and displays their usage. To simplify this re-use, every property has its own article in the wiki, just as every category has an article. As in the case of categories, the name of the property is arbitrary, but users should try to re-use properties that already appear elsewhere. The additional text Is capital of is the name of the property that classifies the link to Germany. In the article, this text still is displayed as a simple hyperlink to «Germany». With Semantic MediaWiki, this is done by putting a property name and :: in front of the link inside the brackets, thus: In the article text, identifying it as a link that describes a «capital property». To make this knowledge available to computer programs, one would like to «tag» the link However, the link to «Germany» has a special meaning: it was put there since Berlin is the capital of Germany. This article contains many links to other articles, such as «Germany», «European Union», and «United States». Consider the Wikipedia article on Berlin.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |