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
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
Method submit_query()
Submit a SPARQL query to the triplestore to obtain data
Usage
triplestore_access$submit_query(query)
Arguments
query
String 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
deep
Whether 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()