No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
This API client was generated by the swagger-codegen project. By using the OpenAPI/Swagger spec from a remote server, you can easily generate an API client.
- API version: 1.0.0-rc+2
- Package version: 1.0.0
- Build package: io.swagger.codegen.languages.RClientCodegen
To install the opensilexClientToolsR package, the easiest is to install it directly from Github. Open an R session and run the following commands:
library(remotes)
install_github("OpenSILEX/opensilexClientToolsR", ref="1.0.0-rc+2")
You'll need the devtools
package in order to build the API.
Install the devtools
package with the following command.
if(!require(devtools)) { install.packages("devtools") }
Make sure you set the working directory to where the API code is located. Then execute
library(devtools)
install(".")
library(opensilexClientToolsR)
# Le chargement a nécessité le package : opensilexWSClientR
# Make sure to change the url to point to your instance (and don't forget to add "/rest" at the end)
# The identifier and password should be the ones of an existing account on that instance
opensilexClientToolsR::connectToOpenSILEX(identifier="guest@opensilex.org",password="guest", url = "https://localhost/rest")
# 2019-10-04 10:05:40 INFO::Query executed and data recovered - WS2
annoService <- AnnotationsApi$new()
# create Annotations
newAnnotation <- AnnotationCreationDTO$new(
description="Your annotation body",
targets=list("test:set/scientific-objects/so-test-gabriel"),
motivation="http://www.w3.org/ns/oa#assessing"
)
new_annot <- annoService$create_annotation(body = newAnnotation)
# 2021-10-19 09:38:52 INFO::Query executed and data recovered
new_annot
# <Response>
# Public:
# clone: function (deep = FALSE)
# data: http://www.phenome-fppn.fr/set/annotations#613fbb37-9aff ...
# initialize: function (metadata, data, response, success)
# metadata: list
# response: response
# success: TRUE
# search Annotations
annot <- annoService$search_annotations()
# 2021-10-19 09:39:09 INFO::Query executed and data recovered
annot
# <Response>
# Public:
# clone: function (deep = FALSE)
# data: list
# initialize: function (metadata, data, response, success)
# metadata: list
# response: response
# success: TRUE