De Wiki REDDES
Tabla de contenidos
DeCS services allow the remote retrieval, referred to as http, of its concepts through three search types: the search by hierarchical code, the search by words and the search by boolean operators.
The hierarchical search allows searching DeCS terms by their hierarchical codes. The hierarchical code goes through the "tree_id" parameter.
When the "tree_id" parameter is empty, as in the url:
the service produces first level of DeCS hierarchical categories.
But, when "B01.050.150.900.649.801.400.112.199.120.510.550" is chosen:
the retrieved concept is the term "Macaca mulatta".
It is possible to determine the language of the search results by adding the "lang" parameter in the url, with either the value "pt" for Portuguese (&lang=pt), "es" for Spanish (&lang=es) or "en" for English (&lang=en). When not specified, the default language is Portuguese (&lang=pt).
The last search example showing the result in Spanish would present the following url:
Search by words
This type of search permits, through the "words" parameter, searching word by word, which are internally connected with an AND operator.
In the url below:
the expression " Macaca mulatta" is internally converted to "Macaca AND mulatta".
The search by words is performed in the DeCS index containing the main heading, synonyms and historical terms, all of them indexed word by word.
Just like in the hierarchical search, the "lang" parameter may be used to specify the language in which the result will be displayed, Portuguese being the default when the parameter is not specified.
Search by boolean operators
This type of search allows the use of a boolean expression through "bool" search parameter, where the terms are connected by the boolean operators AND, OR and AND NOT, as in the example below:
It is possible to specify what index will be used for the search, by placing its code (see “Search Index Prefixes" below) as a prefix to the search expression:
<index/prefix code> <search expression>
Examples with operators and indexes
The following search:
searches the terms "Macaca" or "mulatta" in the index created by the entire field with only authorized terms.
If, instead of 101, it had been used the prefix 407 (word by word, authorized term, synonyms and historical notes), the terms "Macaca mulatta", "Macaca nemestrina" and "Macaca radiata" would also have been retrieved.
If the index code to be searched is not specified, the default index will be the word by word, authorized term, synonyms and historical terms (prefix 407).
If the search expression contains no boolean operators, then it will be considered as the entire field.
Thus, the url
retrieves nothing because the term "Macaca mulatta" is considered a whole field and will be searched as an index term that has been indexed word by word.
The following url:
retrieves "Macaca mulatta" because that term appears in the indexed index with the whole field.
Prefixes of search index
101 - whole field, authorized term
102 - whole field, synonyms
104 - whole field, historical terms
103 - whole field, authorized term and synonyms
105 - whole field, authorized term and historical terms
106 - whole field, synonyms and historical terms
107 - whole field, authorized term, synonyms and historical terms
401 - word by word, authorized term
402 - word by word, synonyms
404 - word by word, historical terms
403 - word by word, authorized term and synonyms
405 - word by word, authorized term and historical terms
406 - word by word, synonyms and historical terms
407 - word by word, authorized term, synonyms and historical terms
Note: a prefix of search index applies to the search term that follows it.
Description of the search result in XML
The result of a query of DeCS services is an XML file. For better understanding of the meaning of the tags that constitute such file, there is a commented example of the search result for "107 Macaca mulatta".
DeCS Services graphical interface client
Definition: graphical application running on desktop that facilitates the use and understanding of DeCS services parameters.
Requires: Java virtual machine version 1.5 or higher
How to run: On 32 bits machines - double click the jar file. On 64 bits machine - type: java -jar DeCSClient.jar
Calling DeCS Services from a programming language
It is possible to call DeCS services from a programming language without using SOAP protocol. Possible functions that directly call DeCS services are shown below, as examples, for PHP, Python and Java languages.