...
Code Block |
---|
|
<?xml version="1.0"?>
<methodCall>
<methodName>termwebapi2.setSourceLanguage</methodName>
<params>
<param><value><string>123456789abc</string></value></param>
<param><value><string>fra<<param><value><string>eng</string></value></param>
</params>
</methodCall> |
...
Code Block |
---|
|
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
<params>
<param><value>fra<<param><value>eng</value></param>
</params>
</methodResponse> |
Searching terms
With the method getIndexTerms
you can retrieve a list of IndexTerm objects, corresponding to the items in the termlist in the GUI. From the index terms you can then retrieve the full concept or term objects. To getIndexTerms
you can specify a search expression which filters the result. An empty search expression returns the full list.
Info |
---|
At most 1000 entries are returned by a call to getIndexTerms . To retrieve more, do subsequent calls to getIndexTerms and set the fromPos parameter in the Search condition struct. |
Example: Search for the term "fish"
...
Code Block |
---|
|
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
<params>
<param><value><array><data><value>
<struct>
<member><name>__objtype</name><value>IndexTerm</value></member>
<member><name>term</name><value>fish</value></member>
<member><name>conceptEntryID</name><value>436</value></member>
<member><name>termEntryID</name><value>437</value></member>
</struct>
</value></data></array></value></param>
</params>
</methodResponse> |
You can also use wildcards (asterisk for any string, question mark for any single character) in the search expression.
Search condition structYou can also pass a struct as argument to getIndexTerms
. The struct consists of the search expression and an integer specifying from which index in the termlist the returned result should start.
Example: Search for all terms containg "fish" but skip the five first results
Code Block |
---|
|
<?xml version="1.0"?>
<methodCall>
<methodName>termwebapi2.getIndexTerms</methodName>
<params>
<param><value><string>123456789abc</string></value></param>
<param><value><struct>
<member><name>searchExp</name><value><string>*fish*</string></value></member>
<member><name>fromPos</name><value><int>5</int></value></member>
</struct></value></param>
</params>
</methodCall> |
Translating results
It is also possible to return the index terms in a target language. By specifying a target language code after the search condition struct, the result contains all terms in the target language, from the concepts corresponding to the found index terms in the source language.
Example: Search for the term "fish" and return result in French
Code Block |
---|
|
<?xml version="1.0"?>
<methodCall>
<methodName>termwebapi2.getIndexTerms</methodName>
<params>
<param><value><string>123456789abc</string></value></param>
<param><value><struct>
<member><name>searchExp</name><value><string>fish</string></value></member>
<member><name>fromPos</name><value><int>0</int></value></member>
</struct></value></param>
<param><value><string>fra</string></value></param>
</params>
</methodCall> |
Response:
Code Block |
---|
|
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
<params>
<param><value><array><data><value>
<struct>
<member><name>__objtype</name><value>IndexTerm</value></member>
<member><name>term</name><value>poisson</value></member>
<member><name>conceptEntryID</name><value>436</value></member>
<member><name>termEntryID</name><value>440</value></member>
</struct>
</value></data></array></value></param>
</params>
</methodResponse> |