API module "smwinfo"

From semantic-mediawiki.org
Jump to: navigation, search
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.0.

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.0).
  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.
NoteNote: The parameters may be concatenated using the pipe "|" character. See the usage example below.

Example

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

run example

Output

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
        }
    }
}

Note

If used in conjunction with the External Data extension do not forget to replace all pipe characters | in API URL with {{!}} templates (≤ MW 1.23) or magic word (≥ MW 1.24) inside the {{#get_web_data:...}} parser function.

References

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