Skip to content

Instantly share code, notes, and snippets.

View jjkoehorst's full-sized avatar

Jasper jjkoehorst

  • The Netherlands
View GitHub Profile
dir.create("queries")
dir.create("results")
SPARQL <- function(endpoint, query) {
query = gsub(pattern = "'",replacement = '"', x = query)
md5 = digest::digest(object = paste(endpoint, query))
filename = paste0("./results/",md5)
queryfile = paste0("./queries/",md5)
if (file.exists(filename)) {
results = fread(filename, sep = "\t")
@jjkoehorst
jjkoehorst / gist:500ab3c8d882fb14eb680fd309eaa773
Created July 8, 2021 14:26
Stack trace inputstream irods and vaadin
2021-07-08 14:08:38.912 INFO 12812 --- [nio-8081-exec-9] n.m.views.authentication.LoginView : Successful login for koehorst
ITEM PATH AFTER CLICK /unlock/home/koehorst/phyloseq/ALLCHECK_mAssayList__4.tsv
2021-07-08 14:08:51.932 ERROR 12812 --- [nio-8081-exec-9] c.p.i.SessionClosingIRODSFileInputStream : JargonException in read is converted to IOException for method contract
org.irods.jargon.core.exception.JargonException: error code received from iRODS:-345000
at org.irods.jargon.core.connection.IRODSErrorScanner.checkSpecificCodesAndThrowIfExceptionLocated(IRODSErrorScanner.java:276) ~[core-4.3.0.2.jar:na]
at org.irods.jargon.core.connection.IRODSErrorScanner.inspectAndThrowIfNeeded(IRODSErrorScanner.java:115) ~[core-4.3.0.2.jar:na]
at org.irods.jargon.core.connection.IRODSMidLevelProtocol.processMessageInfoLessThanZero(IRODSMidLevelProtocol.java:1399) ~[core-4.3.0.2.jar:na]
at org.irods.jargon.core.connection.IRODSMidLevelProtocol.readMessage(IRODSMidLevelProtocol.java:903) ~[core-4.3.0.2.jar:na
@jjkoehorst
jjkoehorst / SPARQL.r
Created April 12, 2023 17:03
SPARQL function for R
# Script to query the triple store
library(stringr)
library(httr)
library(jsonlite)
# SPARQL endpoint where the triple store endpoint is located
endpoint = "http://localhost:7200/repositories/wur_unlock_hivghana_drp0070"
# create a named character vector of URLs and prefixes
url_dict <- c("http://example.com/" = "ex:",