WikiApiary:Collect Semantic MediaWiki usage setup

WikiApiary collects basic Semantic MediaWiki information using the Semantic MediaWiki SMWInfo API method which provides a count of properties and other basic information. This page describes how to enable WikiApiary to collect information on how Semantic MediaWiki queries are used on the site and how widely it is deployed. Enabling Semantic usage collection adds a much deeper set of data for Semantic MediaWiki websites.

You can see examples of this data being used on WikiApiary, see the graphs for query count, pages with queries, query sizes and query formats.

Setup
There are two steps to enabling semantic usage collection from a wiki:


 * 1) Add the Project:SMWExtInfo wiki page to the wiki being collected from.
 * 2) Enable Collect semantic usage for the website on WikiApiary.

SMWExtInfo is a regular wiki page with a number of  queries in it. The page outputs YAML formatted data which is pulled via the MediaWiki API using the  method. The queries in this page depend on the data that is created by Semantic MediaWiki 1.8 and later. If you do not have Semantic MediaWiki 1.8 you must upgrade in order to use this functionality. This page also uses ParserFunctions and if you have MagicNoCache it is useful here to insure that the data is current.

After verifying you have Semantic MediaWiki 1.8 or greater, create a page in the project namespace called SMWExtInfo. Create Project:SMWExtInfo and place the following wikitext into the page. If you do have the MagicNoCache extension please make sure to remove the spaces around the underscores for the NOCACHE directive.

You can also get the wiki text from the raw output of WikiApiary's SMWExtInfo.

&lt;nowiki&gt; generated: smwqueries: ....count: ....pages: ....concepts: ....pageslarge: smwquerysizes: ....Size 1: ....Size 2: ....Size 3: ....Size 4: ....Size 5: ....Size 6: ....Size 7: ....Size 8: ....Size 9: ....Size 10+: smwformats: ....broadtable: ....csv: ....category: ....count: ....dsv: ....debug: ....embedded: ....feed: ....json: ....list: ....ol: ....rdf: ....table: ....template: ....ul: __ NOCACHE __
 * 1) This page outputs extended Semantic MediaWiki information
 * 2) to be collected by WikiApiary http://wikiapiary.com/
 * 3) Please make no modifications to this page outside of this comment block.
 * 4) http://wikiapiary.com/wiki/WikiApiary:Collect_Semantic_MediaWiki_usage_setup&lt;/nowiki&gt;

If you need to add any additional information to this page please only add comment lines in the beginning of the YAML block. You can call the MediaWiki API manually to see the output. Here is the URL for WikiApiary, replace with the path to your API endpoint.

http://wikiapiary.com/w/api.php?action=parse&page=Project:SMWExtInfo&prop=text&disablepp=1&format=json

After creating this page then enable Semantic usage and data will start being retrieved.

Questions

 * Why all the dots in the output?
 * This data is pulled using the MediaWiki API to parse the contents of the WikiPage. In order for the YAML to work as intended, some indenting is required. If spaces were used it would cause the MediaWiki parser to assume that the contents were preformatted and add a lot of HTML to the output that would cause problems. The four periods defeat that, and User:Bumble Bee takes the response and replaces "...." with "   " before asking the YAML processor to parse it.


 * I have feedback and improvements on how this function works. How do I share that with you?
 * Use the |talk page.