Skip to content

Latest commit

 

History

History
16 lines (12 loc) · 1.25 KB

README.md

File metadata and controls

16 lines (12 loc) · 1.25 KB

catgraph-jsonp

This is a JSONP interface to Catgraph. It is used by the DeepCat Gadget.

Usage

Do a JSONP request to http://tools.wmflabs.org/catgraph-jsonp/GRAPHNAME/COMMAND?userparam=PARAM&callback=YOURFUNCTION where COMMAND is the graphcore command to execute on GRAPHNAME. YOURFUNCTION is your JSONP callback. It will be called with a dict with the following fields:

  • 'status' is the graphserv response
  • 'statusMessage' contains the rest of the graphserv status message if present
  • 'result' contains any graphcore result rows converted to arrays
  • 'userparam' reflects the corresponding cgi parameter (optional).

Example: Get the root categories (categories without a parent category) of frwiki. http://tools.wmflabs.org/catgraph-jsonp/frwiki_ns14/list-roots?callback=dostuff

http://tools.wmflabs.org/catgraph-jsonp is configured to return at most 500 result rows, larger results are truncated.

Issue tracker

Please file bugs and feature requests on [Phabricator] (https://phabricator.wikimedia.org/maniphest/task/create/?projects=tcb-team,catgraph&title=%5BCatGraph-jsonp%5D).