Search
From ToxBank API Wiki
(Difference between revisions)
m (→Alerts) |
m |
||
Line 1: | Line 1: | ||
− | = Search = | + | = Query = |
+ | |||
+ | == Search == | ||
{{REST Operations | {{REST Operations | ||
Line 13: | Line 15: | ||
}} | }} | ||
− | = Search Protocols = | + | == Search Protocols == |
{{REST Operations | {{REST Operations | ||
Line 27: | Line 29: | ||
}} | }} | ||
− | = Search Studies = | + | == Search Studies == |
{{REST Operations | {{REST Operations | ||
Line 41: | Line 43: | ||
}} | }} | ||
− | = Search Data= | + | == Search Data== |
{{REST Operations | {{REST Operations | ||
Line 55: | Line 57: | ||
}} | }} | ||
− | = Create a predefined query = | + | == Create a predefined query == |
{{REST Operations | {{REST Operations |
Revision as of 07:36, 16 September 2011
Contents |
Query
Search
Description | Search in the default space |
---|---|
Resource | [[]] |
Method | GET |
URI | /query |
Parameters | TBD, search parameters, page parameters |
Header Parameters | subjectid:SECURITY-TOKEN |
Media Type (input) | application/x-www-form-urlencoded, RDF, JSON |
Results | URIs of the results, or in other supported format |
Media Type (output) | text/uri-list, RDF, JSON |
Status code | 200,400,401,402,403 |
Search Protocols
Description | Search protocols |
---|---|
Resource | [[]] |
Method | GET |
URI | /query/protocols |
Parameters | TBD, search parameters, page parameters |
Header Parameters | subjectid:SECURITY-TOKEN |
Media Type (input) | application/x-www-form-urlencoded, RDF, JSON |
Results | URIs of the protocols found, or in other supported format |
Media Type (output) | text/uri-list, RDF, JSON |
Status code | 200,400,401,402,403 |
Search Studies
Description | Search studies |
---|---|
Resource | [[]] |
Method | GET |
URI | /query/study |
Parameters | TBD, search parameters, page parameters |
Header Parameters | subjectid:SECURITY-TOKEN |
Media Type (input) | application/x-www-form-urlencoded, RDF, JSON |
Results | URIs of the studies found, or in other supported format |
Media Type (output) | text/uri-list, RDF, JSON |
Status code | 200,400,401,402,403 |
Search Data
Description | Search data |
---|---|
Resource | [[]] |
Method | GET |
URI | /query/data |
Parameters | TBD, search parameters, page parameters |
Header Parameters | subjectid:SECURITY-TOKEN |
Media Type (input) | application/x-www-form-urlencoded, RDF, JSON |
Results | URIs of the datasets found, or in other supported format |
Media Type (output) | text/uri-list, RDF, JSON |
Status code | 200,400,401,402,403 |
Create a predefined query
Description | Create a predefined query |
---|---|
Resource | [[]] |
Method | POST |
URI | /query |
Parameters | TBD |
Header Parameters | subjectid:SECURITY-TOKEN |
Media Type (input) | application/x-www-form-urlencoded, RDF, JSON |
Results | URI of the new query, e.g. /query/Q999 |
Media Type (output) | text/uri-list |
Status code | 200,400,401,402,403 |
Alerts
An alert is defined by query URI and a frequency.
N3 representation of an alert
<http://toxbank.net/services/alerts/Alert_33> a tb:Alert ; dc:title "My first alert"; tb:hasQuery <http://toxbank.net/services/query/Q456>; tb:frequency tb:Daily; tb:userToBeNotified <http://toxbank.net/services/user/U8247634857324857>.
Retrieve alerts
Description | Retrieve alerts |
---|---|
Resource | [[]] |
Method | GET |
URI | /user/{obfuscatedid}/alerts |
Parameters | TBD, search paratemers to filter alerts |
Header Parameters | subjectid:SECURITY-TOKEN |
Media Type (input) | |
Results | content in supported formats |
Media Type (output) | text/uri-list, RDF, JSON |
Status code | 200,202,400,401,402,403 |
cURL example
$curl -X GET http://toxbank.net/services/alerts -H "Accept:text/n3" .... <http://toxbank.net/services/alerts/Alert_33> a tb:Alert ; dc:title "My first alert"; tb:hasQuery <http://toxbank.net/services/query/Q456>; tb:frequency tb:Daily; tb:userToBeNotified <http://toxbank.net/services/user/U8247634857324857>. <http://toxbank.net/services/alerts/Alert_34> a tb:Alert ; dc:title "My second alert"; tb:hasQuery <http://toxbank.net/services/query/Q789>; tb:frequency tb:Weekly; tb:userToBeNotified <http://toxbank.net/services/user/U8247634857324857>.
Create an alert
Description | Creates an alert |
---|---|
Resource | [[]] |
Method | POST |
URI | /user/{obfuscatedid}/alerts |
Parameters | query uri, frequency (predefined list),name |
Header Parameters | subjectid:SECURITY-TOKEN |
Media Type (input) | application/x-www-form-urlencoded, RDF, JSON |
Results | Task URI, when complete - URI of the new alert , e.g. /user/U8247634857324857/alerts/Alert_5678 |
Media Type (output) | text/uri-list |
Status code | 200,202,400,401,402,403 |
cURL example
$curl -X POST http://toxbank.net/services/alerts -d "query=http://toxbank.net/services/query/Q789" -d "frequency=Weekly" >HTTP/1.1 200 OK >http://toxbank.net/services/alerts/Alert_34
Retrieve an Alert
Description | Retrieve an alert |
---|---|
Resource | [[]] |
Method | GET |
URI | /user/{obfuscatedid}/alerts/{id} |
Parameters | |
Header Parameters | subjectid:SECURITY-TOKEN |
Media Type (input) | |
Results | content in supported formats |
Media Type (output) | text/uri-list, RDF, JSON |
Status code | 200,202,400,401,402,403 |
Update an Alert
Description | Update an alert |
---|---|
Resource | [[]] |
Method | PUT |
URI | /user/{obfuscatedid}/alerts/{id} |
Parameters | |
Header Parameters | subjectid:SECURITY-TOKEN |
Media Type (input) | application/x-www-form-urlencoded, RDF, JSON |
Results | Task uri, including error reports |
Media Type (output) | text/uri-list |
Status code | 200,202,400,401,402,403 |
Delete an Alert
Description | Deletes an alert |
---|---|
Resource | [[]] |
Method | DELETE |
URI | /user/{obfuscatedid}/alerts/{id} |
Parameters | nons |
Header Parameters | subjectid:SECURITY-TOKEN |
Media Type (input) | none |
Results | |
Media Type (output) | text/uri-list |
Status code | 200,202,400,401,402,403 |
Facts about SearchRDF feed
Acts on | |
Has output media type | text/uri-list, RDF, JSON + and text/uri-list + |
Has status code | 200,400,401,402,403 + and 200,202,400,401,402,403 + |