Difference between revisions of "RadLex API"
Jump to navigation
Jump to search
Johnpaulett (talk | contribs) |
Johnpaulett (talk | contribs) (midstream of major revision for API v2) |
||
Line 1: | Line 1: | ||
− | '''Warning: This documentation is currently being updated to reflect version 2 of the servlet. | + | '''Warning: This documentation is currently being updated to reflect version 2 of the servlet.''' |
− | + | The RadLex API acts as a webservice, which allows developers to query the RadLex terminology and retrieve an XML response. | |
− | + | __TOC__ | |
+ | == Methods == | ||
+ | === search === | ||
+ | URL: [http://radlex.org/search http://radlex.org/search] | ||
− | + | Parameters: | |
− | + | * ''query'' - string to search for in the database | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | Return: | |
− | + | See notes below. <terms> structure. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | < | ||
− | + | Notes: | |
− | + | Performs a search on the database for the ''query''' term or phrase. | |
− | + | *If the query matches "^RID([0-9]+)$", a search for that radlexID is performed, which should yield 0 or 1 results. If 1 result is found, the search exits and returns that one value. | |
− | + | *If the query has fewer than 4 characters, the database is queried via several LIKE statements. The 4 character minimum is a result of MySQL's Fulltext Search default limit. The query will return all, if any, matches and exit the search. | |
− | + | *If the search has not already been exited, a MySQL Fulltext Search will be initiated on the database. This is the preferred method, as it uses MySQL's native natural language search ([http://dev.mysql.com/doc/refman/5.0/en/fulltext-search.html MySQL Documentation]). | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | === getTermByID === | |
− | + | URL: [http://radlex.org/getTermByID http://radlex.org/getTermByID ] | |
− | + | ||
− | + | Parameters: | |
− | + | * ''radlexID'' - the RadLex ID to obtain in the form "^RID([0-9]+)$" | |
− | + | ||
− | + | Return: | |
− | + | [[#<term>]] structure. | |
− | < | + | |
− | < | + | Notes: |
− | </ | + | Obtains all information pertaining to the ''radlexID'' in the terminology. |
+ | |||
+ | == Return Structures == | ||
+ | As a convention for this API, elements preceeded by a dollar sign ($) are variable content. | ||
+ | === <term> === | ||
+ | === <terms> === | ||
+ | === <children> === | ||
+ | === <relationTypes> === | ||
+ | === <error> === | ||
+ | For a more detailed discussion of [[#Errors | error messages]], see below. | ||
+ | <pre><nowiki> | ||
+ | <program> | ||
+ | <error id="$errorid">$errormessage</error> | ||
+ | </program> | ||
+ | </nowiki></pre> | ||
+ | |||
+ | == Errors == | ||
+ | |||
+ | == Examples == | ||
+ | |||
[[Category:RadLex]] | [[Category:RadLex]] |
Revision as of 22:39, 25 February 2007
Warning: This documentation is currently being updated to reflect version 2 of the servlet.
The RadLex API acts as a webservice, which allows developers to query the RadLex terminology and retrieve an XML response.
1 Methods
1.1 search
Parameters:
- query - string to search for in the database
Return: See notes below. <terms> structure.
Notes: Performs a search on the database for the query' term or phrase.
- If the query matches "^RID([0-9]+)$", a search for that radlexID is performed, which should yield 0 or 1 results. If 1 result is found, the search exits and returns that one value.
- If the query has fewer than 4 characters, the database is queried via several LIKE statements. The 4 character minimum is a result of MySQL's Fulltext Search default limit. The query will return all, if any, matches and exit the search.
- If the search has not already been exited, a MySQL Fulltext Search will be initiated on the database. This is the preferred method, as it uses MySQL's native natural language search (MySQL Documentation).
1.2 getTermByID
URL: http://radlex.org/getTermByID
Parameters:
- radlexID - the RadLex ID to obtain in the form "^RID([0-9]+)$"
Return: #<term> structure.
Notes: Obtains all information pertaining to the radlexID in the terminology.
2 Return Structures
As a convention for this API, elements preceeded by a dollar sign ($) are variable content.
2.1 <term>
2.2 <terms>
2.3 <children>
2.4 <relationTypes>
2.5 <error>
For a more detailed discussion of error messages, see below.
<program> <error id="$errorid">$errormessage</error> </program>