Title: | The rtematres API package |
Description: | Exploit controlled vocabularies organized on tematres servers. |
Version: | 0.2 |
Author: | Claas-Thido Pfaff <claas-thido.pfaff@idiv-biodiversity.de> |
Maintainer: | Claas-Thido Pfaff <claas-thido.pfaff@idiv-biodiversity.de> |
Suggests: | ggplot2, |
Imports: | XML, RCurl, plyr, gdata |
Date: | 2013-08-13 |
License: | GPL-3 |
URL: | https://github.com/cpfaff/rtematres |
Collate: | 'rtematres.api.base.R' 'rtematres.api.convenience.R' 'rtematres.api.helpers.R' 'rtematres.options.R' 'rtematres-package.R' 'rtematres.helpers.R' 'zzz.R' |
Packaged: | 2013-08-23 06:12:21 UTC; sabsirro |
NeedsCompilation: | no |
Repository: | CRAN |
Date/Publication: | 2013-08-23 08:22:49 |
rtematres A package to exploit controlled vocabularies from tematres servers
Description
rtematres A package to exploit controlled vocabularies from tematres servers
Basic tematres server api
Description
Basic tematres server api
Usage
rtematres.api(task = "availableTasks", argument)
Arguments
task |
The api task you like to execute. Use the the "availableTasks" to get an overview about the base api. It returns a data frame with descriptions and the arguments for the tasks. |
argument |
Is the argument for the api task. You find the information about the arguments when you call the task "availableTasks". |
Value
The function returns either a dataframe for information or a list of keywords and ids
Examples
## Not run:
rtematres.api(task = "availableTasks")
rtematres.api(task = "fetchVocabularyData")
rtematres.api(task = "fetchTopTerms")
rtematres.api(task = "search", argument = "measurement")
rtematres.api(task = "letter", argument = "t")
rtematres.api(task = "fetchTerm", argument = 12)
rtematres.api(task = "fetchDown", argument = 4 )
rtematres.api(task = "fetchUp", argument = 4)
rtematres.api(task = "fetchRelated", argument = 4)
rtematres.api(task = "fetchAlt", argument = 12 )
rtematres.api(task = "fetchCode", argument = "tree")
rtematres.api(task = "fetchNotes", argument = 5 )
rtematres.api(task = "fetchDirectTerms", argument = 12)
rtematres.api(task = "fetchURI", argument = 12)
rtematres.api(task = "fetchTargetTerms", argument = 12 )
rtematres.api(task = "fetchSourceTerm", argument = 12)
rtematres.api(task = "fetchTerms", argument = '12,13' )
rtematres.api(task = "fetchRelatedTerms", argument = '12,13' )
rtematres.api(task = "fetchSimilar", argument = 12)
rtematres.api(task = "fetchLast")
rtematres.api.conversion.keyword_id(given = "Measurement")
rtematres.api.conversion.keyword_id(given = 8)
## End(Not run)
An tematres api helper that converts ids to strings and vise versa
Description
As the tematres api accepts ids of terms only on most of its tasks this is a small helper that converts them into each other. It has two function names tha you can use depending on what you are converting. But both function names do the same so they can be exchanged. (rtematres.api.conversion.[term_id/id_term])
Usage
rtematres.api.conversion.term_id(given, warn = T)
Arguments
given |
Either a term or an integer id for a term |
warn |
Give a waring when the term/id is not found. Defaults to TRUE. |
Value
Either a string or id
A tematres base api based function to retrieve definitions
Description
It retrieves the definition of a term given the case it has been described in the vocuabulary on the temates server.
Usage
rtematres.api.define(term)
Arguments
term |
It takes a term that you are searching the definition for |
Value
Either a string or id
A convenient wrapper to all tasks of the base api.
Description
As some of the task of the base api only take ids the wrapper does a conversion from a term to the id to communicate with the server. So you can use terms in all taks with this function.
Usage
rtematres.api.do(task = "availableTasks", term)
Arguments
task |
The api task you like to execute. Use the the "availableTasks" to get an overview about the base api. It returns a data frame with descriptions and the arguments for the tasks. |
term |
Is the term(s) you like to execute the task for. |
Value
The function returns either a dataframe for information or a list of keywords and ids
Examples
## Not run:
rtematres.api.do(task = "availableTasks")
rtematres.api.do(task = "fetchVocabularyData")
rtematres.api.do(task = "suggest", term = "measurement")
rtematres.api.do(task = "suggestDetails", term = "measurement")
rtematres.api.do(task = "fetchTopTerms")
rtematres.api.do(task = "search", term = "measurement")
rtematres.api.do(task = "letter", term = "t")
rtematres.api.do(task = "fetchTerm", term = "tree")
rtematres.api.do(task = "fetchTerms", term = c("Context", "tree") )
rtematres.api.do(task = "fetchDown", term = "Context")
rtematres.api.do(task = "fetchUp", term = "measurement")
rtematres.api.do(task = "fetchRelated", term = "tree")
rtematres.api.do(task = "fetchAlt", term = "tree" )
rtematres.api.do(task = "fetchCode", term = "tree")
rtematres.api.do(task = "fetchNotes", term = "Context")
rtematres.api.do(task = "fetchDirectTerms", term = "carbon")
rtematres.api.do(task = "fetchURI", term = "carbon")
rtematres.api.do(task = "fetchTargetTerms", term = "carbon")
rtematres.api.do(task = "fetchSourceTerm", term = "Context")
rtematres.api.do(task = "fetchRelatedTerms", term = c("Context", "tree"))
rtematres.api.do(task = "fetchSimilar", term = "tree")
rtematres.api.do(task = "fetchLast")
## End(Not run)
A tematres base api based function to search the server
Description
Search a Tematres thesaurus via keywords. This function is a wrapper and so it calls the appropriate funtions depending on the search task.
Usage
rtematres.api.search(term, task = "search")
Arguments
term |
The term you are looking for |
task |
Defines behavior on search. Defaults to "search" but can also be "broader" (look for upward definitions) and "narrower" (looking for downward definitions). |
Value
The function returns a vector of keywords
Set or query otions related to the rtematresdata R package.
Description
This function is used to query and set the options used by the rtematres package. For example you can set the URLs to your tematres server and the API.
Usage
rtematres.options(...)
Arguments
... |
similar to |
Examples
#Tematres URLs
rtematres.options('tematres_url')
rtematres.options(tematres_url="http://www.example.com")