| triplestore_access {avidaR} | R Documentation |
Class to manage triplestore access options
Description
Class to manage triplestore access options
Methods
Public methods
Method new()
Create and initialize the object.
Usage
triplestore_access$new()
Returns
Object of class triplestore_access.
Method get_access_options()
Get access options
Usage
triplestore_access$get_access_options()
Returns
list containing URL of the API server, user credentials, repository name, authentication status, and SPARQL protocol version
Method set_access_options()
Set authentication access options for graphdb triplestore
Usage
triplestore_access$set_access_options( url = NULL, user = NULL, password = NULL, repository = NULL, timeout = 100 )
Arguments
urlString containing the URL of the triplestore server
userString containing the username if authentication is needed
passwordString containing the password if authentication is needed
repositoryString containing the ID of the repository to which you want to connect to
timeoutConnection timeout limit in seconds used for queries
Method submit_query()
Submit a SPARQL query to the triplestore to obtain data
Usage
triplestore_access$submit_query(query)
Arguments
queryString containing the SPARQL query to retrieve data
Method ontology()
Show ontology information
Usage
triplestore_access$ontology()
Returns
List containing title, description and versionIRI of the ontology
Method clone()
The objects of this class are cloneable with this method.
Usage
triplestore_access$clone(deep = FALSE)
Arguments
deepWhether to make a deep clone.
Examples
# 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()