API module "smwinfo"

From semantic-mediawiki.org
smwinfo
Allows to access statistical data and information about the usage of Semantic MediaWiki
Keywords
API · API module · ask query · action smwinfo · smwinfo
Further Information
Provided by: Semantic MediaWiki
Added: 1.6.0
Removed: still available
Table of Contents

The "smwinfo" API module allows access statistical data information via action "smwinfo" (?action=smwinfo) about the usage of Semantic MediaWiki using the MediaWiki API. It was introduced with Semantic MediaWiki 1.6.0Released on 30 July 2011 and compatible with MW 1.15.x - 1.18.x..

The module supports ten parameters:

  1. "proppagecount" Allows to retrieve the total number of properties registered with a page.
  2. "declaredpropcount" Allows to retrieve the total number of declared properties (properties with a datatype assigned).
  3. "usedpropcount": Allows to retrieve the total number of used properties (properties with at least one property value assignment).
  4. "propcount": Allows to retrieve the total number of property values (property value assignments).
  5. "errorcount": Allows to retrieve the total number of improperly added values1 (available since Semantic MediaWiki 2.2.0Released on 9 May 2015 and compatible with MW 1.19.0 - 1.24.x.).
  6. "querycount": Allows to retrieve the total number of queries.
  7. "querysize": Allows to retrieve the total size of all queries.
  8. "formatcount": Allows to retrieve the query formats used together with their total usage count. See also the output example below.
  9. "subobjectcount": Allows to retrieve the total number of subobjects.
  10. "conceptcount": Allows to retrieve the total number of concepts.
The parameters may be concatenated using the pipe "|" character. See the usage example below.

Example[edit]

../api.php?action=smwinfo&format=json&info=proppagecount|propcount|errorcount|querycount|usedpropcount|declaredpropcount|conceptcount|querysize|subobjectcount|formatcount

run example

Output[edit]

The parameter "formatcount" will output an array of used formats together with its count information available.

{
    "info": {
        "formatcount": {
            "datatables": 44,
            "list": 27,
            "jqplotchart": 15,
            "eventcalendar": 15,
            "gallery": 15,
            "jqplotseries": 13,
            "count": 2,
            "sum": 2,
            "rdf": 1
        }
    }
}
If used in conjunction with the "External Data" extension do not forget to replace all pipe characters | in API URL with the {{!}} magic word inside the {{#get_web_data:...}} parser function.

References

  1. ^  Semantic MediaWiki: GitHub issue gh:smw:893