Difference between revisions of "RadLex API"
m (Reverted edits by Shadoe (Talk); changed back to last version by Johnpaulett) |
Johnpaulett (talk | contribs) (In the process of adding v2) |
||
Line 1: | Line 1: | ||
+ | '''Warning: This documentation is currently being updated to reflect version 2 of the servlet. Changes should be be official''' | ||
+ | |||
+ | [http://radlex.org RadLex Term Browser] | ||
+ | |||
<h1>XML API</h1> | <h1>XML API</h1> | ||
Line 208: | Line 212: | ||
</relationTypes> | </relationTypes> | ||
</code> | </code> | ||
+ | |||
+ | <h1>API Description</h1> | ||
+ | <h2>search</h2> | ||
+ | '''URI:''' [http://radlex.org/search http://radlex.org/search] <br /> | ||
+ | '''Parameters:''' ''query'' - a string of the term, ID, or phrase to search for <br /> | ||
+ | <br /> | ||
+ | Utilizes 3 types of search: <br /> | ||
+ | <ol> | ||
+ | <li>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. </li> | ||
+ | <li>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. </li> | ||
+ | <li>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]). </li> | ||
+ | </ol> |
Revision as of 04:13, 13 February 2007
Warning: This documentation is currently being updated to reflect version 2 of the servlet. Changes should be be official
1 XML API
File | get* Parameters | Currently Implemented | Details | Return Format |
---|---|---|---|---|
getTermById | radlexID | Yes | Return a single term with its ID = radlexID | <term> |
getChildren |
radlexID<br> [relationType] |
Yes | Returns all terms that have that radlexID as a parent and are related to the parent via the relationType. If no e relationtype is present, all children of that radlexID will be returned. | <children> |
getTree |
baseID<br> relationType<br> [radlexID] |
Yes | Returns all links starting with the baseID as the root term related via the relationType. If no radlexID is present only a single layer of children below the baseID term will be returned. If radlexID is present, all nodes that will create the structure from the baseID term to the radlexID term are given—this is “filled” out with all the children of the nodes. That is, if baseID = A and radlexID = a1, and A has children a, b, c, d, and a has children a1, a2, a3. The links of all of A’s children will be given, followed by all of a’s children. The baseID is also linked to its parent—the true root term for the ontology will be have an id=“ROOT”. |
<links> |
search |
query<br> [returnType] |
Yes | Performs a search based upon the query parameter. returnType can equal “reduced” or “full”. If “reduced”, only matching radlexID’s and term name’s will be returned. If “full”, the full term structure will be returned for each match | <terms> (Reduced) |
getRelationTypes | Yes | Returns a list of all the currently supported relationTypes. (See Relation Types below) | <relationTypes> |
- HTTP post is redirected to get
2 Relation Types
- preferred
- isa
- partof
- branchof
- segmentof
- tributaryof
- continuouswith
- containedin
- memberof
- synonymof
3 Error Codes
id | meaning |
---|---|
1 | Radlex ID is not valid |
2 | Radlex ID could not be found |
3 | Relationship type is not valid |
4 | Database connection error |
5 | Insufficient http get parameters. |
6 | No search results matching query |
4 XML Documents Structure
4.1 <error> Format
<program>
<error id="2">Radlex ID could not be found</error>
</program>
4.2 <term> Format
<term id="RID2">
<name>Thorax</name>
<definition>A definition</definition>
<comment>A comment</comment>
<source>Chest Committee</source>
<dateCreated></dateCreated>
<termStatus></termStatus>
<versionNumber>Chest Committee</versionNumber>
<acr id="A44445">Chest</acr>
<snomed id="SN44545">Chest</snomed>
<umls id="CUI4545848">Thorax</umls>
<parents>
<parent id="RID1" relationType="partof" preferred="1">Anatomical Terms</parent>
</parents>
<children>
<child id="RID3" relationType="partof" preferred="1">Lungs</child>
</children>
</term>
4.3 <terms> Reduced Format
<terms>
<term id="RID2">
<name>Thorax</name>
</term>
…
</terms>
4.4 <terms> Full Format
<terms>
<term id="RID2">
<name>Thorax</name>
<definition>A definition</definition>
<comment>A comment</comment>
<source>Chest Committee</source>
<acr id="A44445">Chest</acr>
<snomed id="SN44545">SNChest</snomed>
<umls id="CUI4545848">Thorax</umls>
<parents><parent id="RID1" relationType="partof" preferred="1">Anatomical Terms</parent>
</parents>
<children>
<child id="RID3" relationType="partof" preferred="1">Lungs</child>
</children>
</term>
…
</terms>
4.5 <links> Format
<links>
<link parent="RID0" id="RID1" relationType="partof" preferred="1">Anatomical Terms</link>
<link parent="RID1" id="RID5" relationType="isa" preferred="1">Legs</link>
<link parent="RID1" id="RID4" relationType="partof" preferred="1">Abdomen</link>
<link parent="RID1" id="RID2" relationType="partof" preferred="1">Thorax</link>
…
</links>
4.6 <children> Format
<children parent="RID2">
<child id="RID3" relationType="partof" preferred="1">Lungs</child>
…
</children>
4.7 <relationTypes> Format
<relationTypes>
<relationType>preferred</relationType>
<relationType>isa</relationType>
<relationType>partof</relationType>
<relationType>tributaryof</relationType>
<relationType>branchof</relationType>
<relationType>segmentof</relationType>
<relationType>continuouswith</relationType>
<relationType>containedin</relationType>
<relationType>memberof</relationType>
</relationTypes>
5 API Description
5.1 search
URI: http://radlex.org/search
Parameters: query - a string of the term, ID, or phrase to search for
Utilizes 3 types of search:
- 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).