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

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.

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

This page outputs extended Semantic MediaWiki information to be collected by WikiApiary. Please do not make any modifications to this page inside the  with id . Feel free to change any other area of the page. For more information see WikiApiary Collecting Semantic Usage. This page requires Semantic MediaWiki 1.8 or greater.

 { "timestamp": "", "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-10plus": }, "smwformats": { "broadtable": , "csv": , "category": , "count": , "dsv": , "debug": , "embedded": , "feed": , "json": , "list": , "ol": , "rdf": , "table": , "template": , "ul": } }

&#95;&#95;NOINDEX&#95;&#95;

&#95;&#95;NOCACHE&#95;&#95;

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.