<?php 
include 'slides/mdb/scripts/mdb_tests.cfg';
$service MDB_SERVER.API_URI;
$fp fopen($service,'r');
$out '';
while(
$r fread($fp,4096))
    
$out .= $r;
fclose($fp);
echo 
$out;
?>
Output of the "Introspection" script
Function:
sql
Parameters:
  • query: urlencoded SQL query
  • [format]: csv (default), wddx, serialized, table

Description:
General function to query a database server. Accepts a valid SQL query ("SELECT", "SHOW", or "DESCRIBE" statements only), and an optioanl result format. Valid formats are "csv" (default), "wddx", "serialized" (PHP serialization), "table" (HTML table). Example of use: /services/api.php?func=sql&query=select+source_id+from+protein+limit+10&format=wddx

Function:
metallopdb
Parameters:
  • metal: atomic symbol for the metal
  • [mode]: one of: first (default), last, random, new
  • [count]: how many PDB entries to retrieve (default = 5)
  • [format]: csv (default), wddx, rss, serialized

Description:
Specialized function to retrieve a list of PDB structures containing a particular metal ion, as indexed in the MDB. The retrieval mode can be one of "first" (default) to get the first "n" PDB ids (sorted alphabetically), "last" to get the last "n" ids, "random" to get "n" random entries, and "new" to ge the newest "n" entries released/indexed. The number of entries to retrieve is set using "count". The list can be formated as "csv" (default), "wddx", "rss", or "serialized" (PHP serialization). Example of use: /services/api.php?func=metallopdb&metal=zn&mode=random&count=5 &format=rss