ropensci/rtematres

Name: rtematres

Owner: rOpenSci

Description: An API package to exploit vocabularies managed via a tematres thesaurus

Created: 2013-09-08 16:35:02.0

Updated: 2013-09-08 16:35:03.0

Pushed: 2013-08-23 07:09:10.0

Homepage: null

Size: 172

Language: R

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

The R package for tematres

The rtematres package is an api package to exploit formal representations of knowledge hosted on any tematres server instance. It gives you access to the base API functions and their documentation and offers convenient wrapper functions that ease the explotion of the vocabolary.

Install
From CRAN

Find the package and manual on CRAN. You can simply install the version hosted there issuing the command below:

all.packages("rtematres")
From github

The installation from Github requires the devtools package.

stall devtools:
all.packages("devtools")
stall rtematres:
ary(devtools)
all_github(username = "cpfaff", repo = "rtematres", subdir = "rtematres")
Usage
Load the package

After installation load the package:

ary(rtematres)
Options

rtematres.options()

rtematres.options("tematres_url" = "http://url.to/your/tematres/server") rtematres.options("tematres_service_url" = "http://url.to/your/tematres/server/api")

Note: tematres_url is informative only atm but you need to set the url in tematres_service_ur to the services.php of the tematres server. This is the the access to the api.

Exploit the knowledge

You can get a list of tasks their descriptions and arguments they take using the command below.

atres.api.do(task = "availableTasks")

To exploit the vocabulary you can issue one of the tasks in the list below. If the task takes multiple terms you need to concatenate the strings in R typical manner with c("term one", "term two").

atres.api.do(task = "fetchVocabularyData")
atres.api.do(task = "suggest", term = "measurement")
atres.api.do(task = "suggestDetails", term = "measurement")
atres.api.do(task = "fetchTopTerms")
atres.api.do(task = "search", term = "measurement")
atres.api.do(task = "letter", term = "t")
atres.api.do(task = "fetchTerm", term = "tree")
atres.api.do(task = "fetchTerms", term = c("Context", "tree") )
atres.api.do(task = "fetchDown", term = "Context")
atres.api.do(task = "fetchUp", term = "measurement")
atres.api.do(task = "fetchRelated", term = "tree")
atres.api.do(task = "fetchAlt", term = "tree" )
atres.api.do(task = "fetchCode", term = "tree")
atres.api.do(task = "fetchNotes", term = "Context")
atres.api.do(task = "fetchDirectTerms", term = "carbon")
atres.api.do(task = "fetchURI", term = "carbon")
atres.api.do(task = "fetchTargetTerms", term = "carbon")
atres.api.do(task = "fetchSourceTerm", term = "Context")
atres.api.do(task = "fetchRelatedTerms", term = c("Context", "tree"))
atres.api.do(task = "fetchSimilar", term = "tree")
atres.api.do(task = "fetchLast")
Helper
atres.api.conversion.id_term(given = 20 )

The option name is given as it also handles the reverse case. You can do the following to get the id for a term:

atres.api.conversion.id_term(given = "Contex")

This reverse case also has its own alias to the function. This feels semantically more native when writing and reading code.

atres.api.conversion.term_id(given = "Contex")

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.