Actions

WikiApiary

Collect Semantic MediaWiki usage setup

From WikiApiary

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 #ask queries in it. The page outputs JSON formatted data which is pulled via the MediaWiki API using the parse 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. Note that you have to use the localised version of the wikitext according to you wiki instance's default language for the languages provided below. All other languages use the "en" version. (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 [http://wikiapiary.com/ WikiApiary].
Please do not make any modifications to this page inside the <code>div</code> with id
<code>wikiapiary-semantic-usage-data</code>. Feel free to change any other area of the page. For more information see
[http://wikiapiary.com/wiki/WikiApiary:Collect_Semantic_MediaWiki_usage_setup WikiApiary Collecting Semantic Usage].
This page requires [http://semantic-mediawiki.org/wiki/Semantic_MediaWiki Semantic MediaWiki] 1.8 or greater.

<div id="wikiapiary-semantic-usage-data" style="font-family: monospace; background: lightgray; padding: 5px;">
{
"timestamp": "{{CURRENTTIMESTAMP}}",
"smwqueries": { 
"count": {{#ask:[[Query size::+]]|format=count}},
"pages": {{#ask:[[Has query::+]]|format=count}},
"concepts": {{#ask:[[:Concept:+]]|format=count}},
"pageslarge": {{#ask:[[Has query.Query size::>10]]|format=count}}
},
"smwquerysizes": {
"size-1": {{#ask:[[Query size::1]]|format=count}},
"size-2": {{#ask:[[Query size::2]]|format=count}},
"size-3": {{#ask:[[Query size::3]]|format=count}},
"size-4": {{#ask:[[Query size::4]]|format=count}},
"size-5": {{#ask:[[Query size::5]]|format=count}},
"size-6": {{#ask:[[Query size::6]]|format=count}},
"size-7": {{#ask:[[Query size::7]]|format=count}},
"size-8": {{#ask:[[Query size::8]]|format=count}},
"size-9": {{#ask:[[Query size::9]]|format=count}},
"size-10plus": {{#ask:[[Query size::>10]]|format=count}}
},
"smwformats": {
"broadtable": {{#ask:[[Query format::broadtable]]|format=count}},
"csv": {{#ask:[[Query format::csv]]|format=count}},
"category": {{#ask:[[Query format::category]]|format=count}},
"count": {{#ask:[[Query format::count]]|format=count}},
"dsv": {{#ask:[[Query format::dsv]]|format=count}},
"debug": {{#ask:[[Query format::debug]]|format=count}},
"embedded": {{#ask:[[Query format::embedded]]|format=count}},
"feed": {{#ask:[[Query format::feed]]|format=count}},
"json": {{#ask:[[Query format::json]]|format=count}},
"list": {{#ask:[[Query format::list]]|format=count}},
"ol": {{#ask:[[Query format::ol]]|format=count}},
"rdf": {{#ask:[[Query format::rdf]]|format=count}},
"table": {{#ask:[[Query format::table]]|format=count}},
"template": {{#ask:[[Query format::template]]|format=count}},
"ul": {{#ask:[[Query format::ul]]|format=count}}
}
}
</div>

<!-- Invoke NOINDEX to keep search engines away from this page -->
__NOINDEX__

<!-- If you have the NoCache Magic Word extension it is useful on this page -->
__NOCACHE__
http://wikiapiary.com/wiki/WikiApiary:Collect_Semantic_MediaWiki_usage_setup

<div id="wikiapiary-semantic-usage-data" style="font-family: monospace; background: lightgray; padding: 5px;">
{
"timestamp": "{{CURRENTTIMESTAMP}}",
"smwqueries": { 
"count": {{#ask:[[Mida de consulta::+]]|format=count}},
"pages": {{#ask:[[Té consulta::+]]|format=count}},
"concepts": {{#ask:[[:Concept:+]]|format=count}},
"pageslarge": {{#ask:[[Té consulta.Mida de consulta::>10]]|format=count}}
},
"smwquerysizes": {
"size-1": {{#ask:[[Mida de consulta::1]]|format=count}},
"size-2": {{#ask:[[Mida de consulta::2]]|format=count}},
"size-3": {{#ask:[[Mida de consulta::3]]|format=count}},
"size-4": {{#ask:[[Mida de consulta::4]]|format=count}},
"size-5": {{#ask:[[Mida de consulta::5]]|format=count}},
"size-6": {{#ask:[[Mida de consulta::6]]|format=count}},
"size-7": {{#ask:[[Mida de consulta::7]]|format=count}},
"size-8": {{#ask:[[Mida de consulta::8]]|format=count}},
"size-9": {{#ask:[[Mida de consulta::9]]|format=count}},
"size-10plus": {{#ask:[[Mida de consulta::>10]]|format=count}}
},
"smwformats": {
"broadtable": {{#ask:[[Format de consulta::broadtable]]|format=count}},
"csv": {{#ask:[[Format de consulta::csv]]|format=count}},
"category": {{#ask:[[Format de consulta::category]]|format=count}},
"count": {{#ask:[[Format de consulta::count]]|format=count}},
"dsv": {{#ask:[[Format de consulta::dsv]]|format=count}},
"debug": {{#ask:[[Format de consulta::debug]]|format=count}},
"embedded": {{#ask:[[Format de consulta::embedded]]|format=count}},
"feed": {{#ask:[[Format de consulta::feed]]|format=count}},
"json": {{#ask:[[Format de consulta::json]]|format=count}},
"list": {{#ask:[[Format de consulta::list]]|format=count}},
"ol": {{#ask:[[Format de consulta::ol]]|format=count}},
"rdf": {{#ask:[[Format de consulta::rdf]]|format=count}},
"table": {{#ask:[[Format de consulta::table]]|format=count}},
"template": {{#ask:[[Format de consulta::template]]|format=count}},
"ul": {{#ask:[[Format de consulta::ul]]|format=count}}
}
}
</div>
__NOINDEX__
__NOCACHE__
Siehe hierzu [http://wikiapiary.com/wiki/WikiApiary:Collect_Semantic_MediaWiki_usage_setup Datensammlung zur semantischen Nutzung des Wikis] (en)

<div id="wikiapiary-semantic-usage-data" style="font-family: monospace; background: lightgray; padding: 5px;">
{
"timestamp": "{{CURRENTTIMESTAMP}}",
"smwqueries": { 
"count": {{#ask:[[Abfragegröße::+]]|format=count}},
"pages": {{#ask:[[Hat Abfrage::+]]|format=count}},
"concepts": {{#ask:[[:Concept:+]]|format=count}},
"pageslarge": {{#ask:[[Hat Abfrage.Abfragegröße::>10]]|format=count}}
},
"smwquerysizes": {
"size-1": {{#ask:[[Abfragegröße::1]]|format=count}},
"size-2": {{#ask:[[Abfragegröße::2]]|format=count}},
"size-3": {{#ask:[[Abfragegröße::3]]|format=count}},
"size-4": {{#ask:[[Abfragegröße::4]]|format=count}},
"size-5": {{#ask:[[Abfragegröße::5]]|format=count}},
"size-6": {{#ask:[[Abfragegröße::6]]|format=count}},
"size-7": {{#ask:[[Abfragegröße::7]]|format=count}},
"size-8": {{#ask:[[Abfragegröße::8]]|format=count}},
"size-9": {{#ask:[[Abfragegröße::9]]|format=count}},
"size-10plus": {{#ask:[[Abfragegröße::>10]]|format=count}}
},
"smwformats": {
"broadtable": {{#ask:[[Abfrageformat::broadtable]]|format=count}},
"csv": {{#ask:[[Abfrageformat::csv]]|format=count}},
"category": {{#ask:[[Abfrageformat::category]]|format=count}},
"count": {{#ask:[[Abfrageformat::count]]|format=count}},
"dsv": {{#ask:[[Abfrageformat::dsv]]|format=count}},
"debug": {{#ask:[[Abfrageformat::debug]]|format=count}},
"embedded": {{#ask:[[Abfrageformat::embedded]]|format=count}},
"feed": {{#ask:[[Abfrageformat::feed]]|format=count}},
"json": {{#ask:[[Abfrageformat::json]]|format=count}},
"list": {{#ask:[[Abfrageformat::list]]|format=count}},
"ol": {{#ask:[[Abfrageformat::ol]]|format=count}},
"rdf": {{#ask:[[Abfrageformat::rdf]]|format=count}},
"table": {{#ask:[[Abfrageformat::table]]|format=count}},
"template": {{#ask:[[Abfrageformat::template]]|format=count}},
"ul": {{#ask:[[Abfrageformat::ul]]|format=count}}
}
}
</div>
__NOINDEX__
__NOCACHE__
Αυτή η σελίδα εμφανίζει εκτεταμένες πληροφορίες για το Σημασιολογικό MediaWiki με σκοπό να συλλεχθούν από το [http://wikiapiary.com/ WikiApiary].
Παρακαλούμε να μην κάνετε καμία τροποποίηση σε αυτή τη σελίδα σε ό,τι περικλείεται μεταξύ των ετικετών <code>div</code> με id
<code>wikiapiary-semantic-usage-data</code>. Μπορείτε ελεύθερα να αλλάξετε οποιαδήποτε άλλη περιοχή της σελίδας. Για περισσότερες πληροφορίες βλ.
[http://wikiapiary.com/wiki/WikiApiary:Collect_Semantic_MediaWiki_usage_setup WikiApiary Collecting Semantic Usage].
Αυτή η σελίδα απαιτεί το [http://semantic-mediawiki.org/wiki/Semantic_MediaWiki Σημασιολογικό MediaWiki] 1.8 ή μεταγενέστερο.

<div id="wikiapiary-semantic-usage-data" style="font-family: monospace; background: lightgray; padding: 5px;">
{
"timestamp": "{{CURRENTTIMESTAMP}}",
"smwqueries": { 
"count": {{#ask:[[Query size::+]]|format=count}},
"pages": {{#ask:[[Has query::+]]|format=count}},
"concepts": {{#ask:[[:Concept:+]]|format=count}},
"pageslarge": {{#ask:[[Has query.Query size::>10]]|format=count}}
},
"smwquerysizes": {
"size-1": {{#ask:[[Query size::1]]|format=count}},
"size-2": {{#ask:[[Query size::2]]|format=count}},
"size-3": {{#ask:[[Query size::3]]|format=count}},
"size-4": {{#ask:[[Query size::4]]|format=count}},
"size-5": {{#ask:[[Query size::5]]|format=count}},
"size-6": {{#ask:[[Query size::6]]|format=count}},
"size-7": {{#ask:[[Query size::7]]|format=count}},
"size-8": {{#ask:[[Query size::8]]|format=count}},
"size-9": {{#ask:[[Query size::9]]|format=count}},
"size-10plus": {{#ask:[[Query size::>10]]|format=count}}
},
"smwformats": {
"broadtable": {{#ask:[[Query format::broadtable]]|format=count}},
"csv": {{#ask:[[Query format::csv]]|format=count}},
"category": {{#ask:[[Query format::category]]|format=count}},
"count": {{#ask:[[Query format::count]]|format=count}},
"dsv": {{#ask:[[Query format::dsv]]|format=count}},
"debug": {{#ask:[[Query format::debug]]|format=count}},
"embedded": {{#ask:[[Query format::embedded]]|format=count}},
"feed": {{#ask:[[Query format::feed]]|format=count}},
"json": {{#ask:[[Query format::json]]|format=count}},
"list": {{#ask:[[Query format::list]]|format=count}},
"ol": {{#ask:[[Query format::ol]]|format=count}},
"rdf": {{#ask:[[Query format::rdf]]|format=count}},
"table": {{#ask:[[Query format::table]]|format=count}},
"template": {{#ask:[[Query format::template]]|format=count}},
"ul": {{#ask:[[Query format::ul]]|format=count}}
}
}
</div>

<!-- Γίνεται επίκληση της μαγικής λέξης NOINDEX για να κρατήσει τις μηχανές αναζήτησης μακριά από αυτήν τη σελίδα -->
__NOINDEX__

<!-- Αν έχετε την επέκταση με τη μαγική λέξη NoCache θα φανεί χρήσιμη σε αυτή τη σελίδα -->
__NOCACHE__
http://wikiapiary.com/wiki/WikiApiary:Collect_Semantic_MediaWiki_usage_setup

<div id="wikiapiary-semantic-usage-data" style="font-family: monospace; background: lightgray; padding: 5px;">
{
"timestamp": "{{CURRENTTIMESTAMP}}",
"smwqueries": { 
"count": {{#ask:[[Tamaño de consulta::+]]|format=count}},
"pages": {{#ask:[[Tiene consulta::+]]|format=count}},
"concepts": {{#ask:[[:Concept:+]]|format=count}},
"pageslarge": {{#ask:[[Tiene consulta.Tamaño de consulta::>10]]|format=count}}
},
"smwquerysizes": {
"size-1": {{#ask:[[Tamaño de consulta::1]]|format=count}},
"size-2": {{#ask:[[Tamaño de consulta::2]]|format=count}},
"size-3": {{#ask:[[Tamaño de consulta::3]]|format=count}},
"size-4": {{#ask:[[Tamaño de consulta::4]]|format=count}},
"size-5": {{#ask:[[Tamaño de consulta::5]]|format=count}},
"size-6": {{#ask:[[Tamaño de consulta::6]]|format=count}},
"size-7": {{#ask:[[Tamaño de consulta::7]]|format=count}},
"size-8": {{#ask:[[Tamaño de consulta::8]]|format=count}},
"size-9": {{#ask:[[Tamaño de consulta::9]]|format=count}},
"size-10plus": {{#ask:[[Tamaño de consulta::>10]]|format=count}}
},
"smwformats": {
"broadtable": {{#ask:[[Formato de consulta::broadtable]]|format=count}},
"csv": {{#ask:[[Formato de consulta::csv]]|format=count}},
"category": {{#ask:[[Formato de consulta::category]]|format=count}},
"count": {{#ask:[[Formato de consulta::count]]|format=count}},
"dsv": {{#ask:[[Formato de consulta::dsv]]|format=count}},
"debug": {{#ask:[[Formato de consulta::debug]]|format=count}},
"embedded": {{#ask:[[Formato de consulta::embedded]]|format=count}},
"feed": {{#ask:[[Formato de consulta::feed]]|format=count}},
"json": {{#ask:[[Formato de consulta::json]]|format=count}},
"list": {{#ask:[[Formato de consulta::list]]|format=count}},
"ol": {{#ask:[[Formato de consulta::ol]]|format=count}},
"rdf": {{#ask:[[Formato de consulta::rdf]]|format=count}},
"table": {{#ask:[[Formato de consulta::table]]|format=count}},
"template": {{#ask:[[Formato de consulta::template]]|format=count}},
"ul": {{#ask:[[Formato de consulta::ul]]|format=count}}
}
}
</div>
__NOINDEX__
__NOCACHE__
http://wikiapiary.com/wiki/WikiApiary:Collect_Semantic_MediaWiki_usage_setup

<div id="wikiapiary-semantic-usage-data" style="font-family: monospace; background: lightgray; padding: 5px;">
{
"timestamp": "{{CURRENTTIMESTAMP}}",
"smwqueries": { 
"count": {{#ask:[[Taille de la requête::+]]|format=count}},
"pages": {{#ask:[[Possède une requête::+]]|format=count}},
"concepts": {{#ask:[[:Concept:+]]|format=count}},
"pageslarge": {{#ask:[[Possède une requête.Taille de la requête::>10]]|format=count}}
},
"smwquerysizes": {
"size-1": {{#ask:[[Taille de la requête::1]]|format=count}},
"size-2": {{#ask:[[Taille de la requête::2]]|format=count}},
"size-3": {{#ask:[[Taille de la requête::3]]|format=count}},
"size-4": {{#ask:[[Taille de la requête::4]]|format=count}},
"size-5": {{#ask:[[Taille de la requête::5]]|format=count}},
"size-6": {{#ask:[[Taille de la requête::6]]|format=count}},
"size-7": {{#ask:[[Taille de la requête::7]]|format=count}},
"size-8": {{#ask:[[Taille de la requête::8]]|format=count}},
"size-9": {{#ask:[[Taille de la requête::9]]|format=count}},
"size-10plus": {{#ask:[[Taille de la requête::>10]]|format=count}}
},
"smwformats": {
"broadtable": {{#ask:[[Format de requête::broadtable]]|format=count}},
"csv": {{#ask:[[Format de requête::csv]]|format=count}},
"category": {{#ask:[[Format de requête::category]]|format=count}},
"count": {{#ask:[[Format de requête::count]]|format=count}},
"dsv": {{#ask:[[Format de requête::dsv]]|format=count}},
"debug": {{#ask:[[Format de requête::debug]]|format=count}},
"embedded": {{#ask:[[Format de requête::embedded]]|format=count}},
"feed": {{#ask:[[Format de requête::feed]]|format=count}},
"json": {{#ask:[[Format de requête::json]]|format=count}},
"list": {{#ask:[[Format de requête::list]]|format=count}},
"ol": {{#ask:[[Format de requête::ol]]|format=count}},
"rdf": {{#ask:[[Format de requête::rdf]]|format=count}},
"table": {{#ask:[[Format de requête::table]]|format=count}},
"template": {{#ask:[[Format de requête::template]]|format=count}},
"ul": {{#ask:[[Format de requête::ul]]|format=count}}
}
}
</div>
__NOINDEX__
__NOCACHE__
http://wikiapiary.com/wiki/WikiApiary:Collect_Semantic_MediaWiki_usage_setup

<div id="wikiapiary-semantic-usage-data" style="font-family: monospace; background: lightgray; padding: 5px;">
{
"timestamp": "{{CURRENTTIMESTAMP}}",
"smwqueries": { 
"count": {{#ask:[[Bevragingsgrootte::+]]|format=count}},
"pages": {{#ask:[[Heeft bevraging::+]]|format=count}},
"concepts": {{#ask:[[:Concept:+]]|format=count}},
"pageslarge": {{#ask:[[Heeft bevraging.Bevragingsgrootte::>10]]|format=count}}
},
"smwquerysizes": {
"size-1": {{#ask:[[Bevragingsgrootte::1]]|format=count}},
"size-2": {{#ask:[[Bevragingsgrootte::2]]|format=count}},
"size-3": {{#ask:[[Bevragingsgrootte::3]]|format=count}},
"size-4": {{#ask:[[Bevragingsgrootte::4]]|format=count}},
"size-5": {{#ask:[[Bevragingsgrootte::5]]|format=count}},
"size-6": {{#ask:[[Bevragingsgrootte::6]]|format=count}},
"size-7": {{#ask:[[Bevragingsgrootte::7]]|format=count}},
"size-8": {{#ask:[[Bevragingsgrootte::8]]|format=count}},
"size-9": {{#ask:[[Bevragingsgrootte::9]]|format=count}},
"size-10plus": {{#ask:[[Bevragingsgrootte::>10]]|format=count}}
},
"smwformats": {
"broadtable": {{#ask:[[Bevragingsopmaak::broadtable]]|format=count}},
"csv": {{#ask:[[Bevragingsopmaak::csv]]|format=count}},
"category": {{#ask:[[Bevragingsopmaak::category]]|format=count}},
"count": {{#ask:[[Bevragingsopmaak::count]]|format=count}},
"dsv": {{#ask:[[Bevragingsopmaak::dsv]]|format=count}},
"debug": {{#ask:[[Bevragingsopmaak::debug]]|format=count}},
"embedded": {{#ask:[[Bevragingsopmaak::embedded]]|format=count}},
"feed": {{#ask:[[Bevragingsopmaak::feed]]|format=count}},
"json": {{#ask:[[Bevragingsopmaak::json]]|format=count}},
"list": {{#ask:[[Bevragingsopmaak::list]]|format=count}},
"ol": {{#ask:[[Bevragingsopmaak::ol]]|format=count}},
"rdf": {{#ask:[[Bevragingsopmaak::rdf]]|format=count}},
"table": {{#ask:[[Bevragingsopmaak::table]]|format=count}},
"template": {{#ask:[[Bevragingsopmaak::template]]|format=count}},
"ul": {{#ask:[[Bevragingsopmaak::ul]]|format=count}}
}
}
</div>
__NOINDEX__
__NOCACHE__

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.