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
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
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.
Find the package and manual on CRAN. You can simply install the version hosted there issuing the command below:
all.packages("rtematres")
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")
After installation load the package:
ary(rtematres)
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.
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")
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")