Search

From ToxBank API Wiki
(Difference between revisions)
Jump to: navigation, search
m (Query)
(Search)
 
(57 intermediate revisions by 4 users not shown)
Line 1: Line 1:
= Query =
+
{{REST_resource}}
 +
 
 +
= Search =
  
 
== Query language ==
 
== Query language ==
  
  Options (not mutually exclusive)
+
Suggestion:
  
  GET parameters:
+
Queries will be passed as parameters to the search URI.  Valid query parameters are as follows:
  Free text search, language could be similar to [http://www.google.co.uk/advanced_search Google advanced search]
+
  
  GET or POST parameters, defining SPARQL
+
    keyword=some_keyword
  [http://www.w3.org/TR/rdf-sparql-query/ SPARQL]
+
        Search only keywords for given keyword
 +
    metadata=free_text
 +
        Search all metadata for given free text
 +
    resourceType=protocol|data
 +
        Limit search to either protocol or data.  All resource types are searched if omitted.
 +
    timeModified=epoch-epoch
 +
        Limit search to give time period. Times must be represented as seconds since the epoch.
 +
        timeModified=0 - all times equal to and after the value.
 +
        timeModified=-11111111 - all times up to and including the value.
 +
        timeMOdified=1234-11111111 - all times inclusive of value range.
  
== Search ==
+
== Search Ad Hoc Query ==
 +
{{HasOperation |id=Search:AdHocQuery}}
  
{{REST Operations
+
== Get Indexed Investigation ==
|REST_op_description=Search in the default space
+
{{HasOperation |id=Search:GetIndexedInvestigation}}
|REST_op_method=GET
+
|REST_op_uri=/query
+
|REST_op_params=TBD, search parameters, page parameters
+
|REST_header_param=subjectid:SECURITY-TOKEN
+
|REST_op_mime_input=application/x-www-form-urlencoded, RDF,  JSON
+
|REST_op_result=URIs of the results, or in other supported format
+
|REST_op_mime_output=text/uri-list, RDF, JSON
+
|REST_op_status=200,400,401,402,403
+
}}
+
  
== Search Protocols ==
+
== Get Indexed Protocol ==
 +
{{HasOperation |id=Search:GetIndexedProtocol}}
  
[[API_Protocol|Protocols]]
+
== Index Investigation ==
{{REST Operations
+
{{HasOperation |id=Search:IndexInvestigation}}
|REST_op_description=Search protocols
+
|REST_op_method=GET
+
|REST_op_uri=/query/protocols
+
|REST_op_params=TBD, search parameters, page parameters
+
|REST_header_param=subjectid:SECURITY-TOKEN
+
|REST_op_mime_input=application/x-www-form-urlencoded, RDF,  JSON
+
|REST_op_result=URIs of the protocols found, or in other supported format
+
|REST_op_mime_output=text/uri-list, RDF, JSON
+
|REST_op_status=200,400,401,402,403
+
}}
+
  
== Search Studies ==
+
== Index Protocol ==
[[API_Study|Study]]
+
{{HasOperation |id=Search:IndexProtocol}}
{{REST Operations
+
|REST_op_description=Search studies
+
|REST_op_method=GET
+
|REST_op_uri=/query/study
+
|REST_op_params=TBD, search parameters, page parameters
+
|REST_header_param=subjectid:SECURITY-TOKEN
+
|REST_op_mime_input=application/x-www-form-urlencoded, RDF,  JSON
+
|REST_op_result=URIs of the studies found, or in other supported format
+
|REST_op_mime_output=text/uri-list, RDF, JSON
+
|REST_op_status=200,400,401,402,403
+
}}
+
  
== Search Data==
+
== Delete Indexed Investigation ==
[[API_Data|Data]] [[API_Study#Assays|Assays]]
+
{{HasOperation |id=Search:DeleteIndexedInvestigation}}
{{REST Operations
+
|REST_op_description=Search data
+
|REST_op_method=GET
+
|REST_op_uri=/query/data
+
|REST_op_params=TBD, search parameters, page parameters
+
|REST_header_param=subjectid:SECURITY-TOKEN
+
|REST_op_mime_input=application/x-www-form-urlencoded, RDF,  JSON
+
|REST_op_result=URIs of the datasets found, or in other supported format
+
|REST_op_mime_output=text/uri-list, RDF, JSON
+
|REST_op_status=200,400,401,402,403
+
}}
+
  
== Create a predefined query ==
+
== Delete Indexed Protocol ==
 +
{{HasOperation |id=Search:DeleteIndexedProtocol}}
  
{{REST Operations
+
== Administer Index Resources ==
|REST_op_description=Create a predefined query
+
{{HasOperation |id=Search:AdministerIndexResources}}
|REST_op_method=POST
+
|REST_op_uri=/query
+
|REST_op_params=TBD
+
|REST_header_param=subjectid:SECURITY-TOKEN
+
|REST_op_mime_input=application/x-www-form-urlencoded, RDF,  JSON
+
|REST_op_result=URI of the new query, e.g. /query/Q999
+
|REST_op_mime_output=text/uri-list
+
|REST_op_status=200,400,401,402,403
+
}}
+
  
 
== Keyword hierarchy ==
 
== Keyword hierarchy ==
TBD
+
 
 +
Web service access to ontologies
  
 
== Filtering the query ==
 
== Filtering the query ==

Latest revision as of 20:50, 21 January 2013

Search


Contents

Search

Query language

Suggestion:

Queries will be passed as parameters to the search URI. Valid query parameters are as follows:

   keyword=some_keyword
       Search only keywords for given keyword
   metadata=free_text
       Search all metadata for given free text
   resourceType=protocol|data
       Limit search to either protocol or data.  All resource types are searched if omitted.
   timeModified=epoch-epoch
       Limit search to give time period.  Times must be represented as seconds since the epoch.
       timeModified=0 - all times equal to and after the value.
       timeModified=-11111111 - all times up to and including the value.
       timeMOdified=1234-11111111 - all times inclusive of value range.

Search Ad Hoc Query

Description Search an ad hoc query
Resource Search
Method GET
URI /search
Parameters See query language
Header Parameters subjectid:SECURITY-TOKEN
Media Type (input)
Results URIs of the results
Media Type (output) text/uri-list
Status code 200,400,401,402,403

Links: Page, Edit with form



Get Indexed Investigation

Description Get uri of index investigation
Resource Index
Method GET
URI /search/index/investigation
Parameters resourceUri={resourceUri}
Header Parameters subjectid:SECURITY-TOKEN
Media Type (input)
Results
Media Type (output) uri of resource if it exists in index
Status code 200,400,401,402,403

Links: Page, Edit with form



Get Indexed Protocol

Description Get uri of indexed protocol
Resource Index
Method GET
URI /search/index/protocol
Parameters resourceUri={resourceUri}
Header Parameters subjectid:SECURITY-TOKEN
Media Type (input)
Results
Media Type (output) uri of resource if it exists in index
Status code 200,400,401,402,403

Links: Page, Edit with form



Index Investigation

Description Add investigation to query index
Resource Index
Method PUT
URI /search/index/investigation
Parameters resourceUri={resourceUri}
Header Parameters subjectid:SECURITY-TOKEN
Media Type (input) text/uri
Results
Media Type (output)
Status code 200,400,401,402,403

Links: Page, Edit with form



Index Protocol

Description Add protocol to query index
Resource Index
Method PUT
URI /search/index/protocol
Parameters resourceUri={resourceUri}
Header Parameters subjectid:SECURITY-TOKEN
Media Type (input) text/uri
Results
Media Type (output)
Status code 200,400,401,402,403

Links: Page, Edit with form



Delete Indexed Investigation

Description Delete an indexed investigation
Resource Index
Method DELETE
URI /search/index/investigation
Parameters resourceUri={resourceUri}
Header Parameters subjectid:SECURITY-TOKEN
Media Type (input)
Results
Media Type (output)
Status code 200,400,401,402,403

Links: Page, Edit with form



Delete Indexed Protocol

Description Delete an indexed protocol
Resource Index
Method DELETE
URI /search/index/protocol
Parameters resourceUri={resourceUri}
Header Parameters subjectid:SECURITY-TOKEN
Media Type (input)
Results
Media Type (output)
Status code 200,400,401,402,403

Links: Page, Edit with form



Administer Index Resources

Description Sync search index with actual data
Resource Index
Method POST
URI /search/index
Parameters admin=sync
Header Parameters subjectid:SECURITY-TOKEN
Media Type (input)
Results
Media Type (output)
Status code 200,400,401,402,403

Links: Page, Edit with form



Keyword hierarchy

Web service access to ontologies

Filtering the query

TBD

Alerts

An Alert is defined by Query URI ,frequency and an User to be notified.