triplestore_access {avidaR} | R Documentation |
Class to manage triplestore access options
new()
Create and initialize the object.
triplestore_access$new()
Object of class triplestore_access.
get_access_options()
Get access options
triplestore_access$get_access_options()
list containing URL of the API server, user credentials, repository name, authentication status, and SPARQL protocol version
set_access_options()
Set authentication access options for graphdb triplestore
triplestore_access$set_access_options( url = NULL, user = NULL, password = NULL, repository = NULL, timeout = 100 )
url
String containing the URL of the triplestore server
user
String containing the username if authentication is needed
password
String containing the password if authentication is needed
repository
String containing the ID of the repository to which you want to connect to
timeout
Connection timeout limit in seconds used for queries
submit_query()
Submit a SPARQL query to the triplestore to obtain data
triplestore_access$submit_query(query)
query
String containing the SPARQL query to retrieve data
ontology()
Show ontology information
triplestore_access$ontology()
List containing title, description and versionIRI of the ontology
clone()
The objects of this class are cloneable with this method.
triplestore_access$clone(deep = FALSE)
deep
Whether to make a deep clone.
# Create object triplestore
triplestore <- triplestore_access$new()
# Set options to access a specific triple-store implemented in GraphDB
triplestore$set_access_options(
url = "https://graphdb.fortunalab.org",
user = "public_avida",
password = "public_avida",
repository = "avidaDB_test"
)
# Show current access options
triplestore$get_access_options()
# Querying data with SPARQL
triplestore$submit_query('PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
select ?tandem_id where {
?digital_tandem_repeat rdfs:label "digital tandem repeat"@en .
?tandem_id a ?digital_tandem_repeat .
} limit 10')
# Show ontology info
triplestore$ontology()