Skip to content

Instantly share code, notes, and snippets.

View samuell's full-sized avatar
💻
Hacking away

Samuel Lampa samuell

💻
Hacking away
View GitHub Profile
?- use_module(library(semweb/sparql_client)).
true.
?- sparql_query('CONSTRUCT { ?s ?p ?o } WHERE { ?s ?p ?o }',
Row,
[ host('localhost'),
path('/w/index.php/Special:SPARQLEndpoint'),
port(8080),
search( [equivuri_q=1, equivuri_o=1] ) ]).
?- use_module(library(semweb/sparql_client)).
true.
?- sparql_query('CONSTRUCT { ?s ?p ?o } WHERE { ?s ?p ?o } LIMIT 1',
Row,
[ host('localhost'),
path('/w/index.php/Special:SPARQLEndpoint'),
port(8080) ]).
ERROR: Domain error: `sparql_result_document' expected, found `'application/xml'' (<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
PHP Warning: mysqli_connect(): (HY000/1045): Access denied for user ''@'localhost' (using password: NO) in /vagrant/w/vendor/semsol/arc2/store/ARC2_Store.php on line 51
PHP Stack trace:
PHP 1. {main}() /vagrant/w/maintenance/importDump.php:0
PHP 2. require_once() /vagrant/w/maintenance/importDump.php:327
PHP 3. BackupReader->execute() /vagrant/w/maintenance/doMaintenance.php:111
PHP 4. BackupReader->importFromFile() /vagrant/w/maintenance/importDump.php:106
PHP 5. BackupReader->importFromHandle() /vagrant/w/maintenance/importDump.php:269
PHP 6. WikiImporter->doImport() /vagrant/w/maintenance/importDump.php:322
PHP 7. WikiImporter->handlePage() /vagrant/w/includes/import/WikiImporter.php:577
PHP 8. WikiImporter->handleRevision() /vagrant/w/includes/import/WikiImporter.php:769
1 2 3 4 5 6 7 8 9 0 1 2 31234567890
package main
import (
"flag"
"strconv"
sp "github.com/scipipe/scipipe"
spcomp "github.com/scipipe/scipipe/components"
)
@samuell
samuell / caw_scipipe_yamlexperiment.yml
Last active June 14, 2018 15:11
This yaml-code would be fed into a tool that generates something like this Go code: https://gist.github.com/samuell/e89ccc2544c8d4def5eeef9d2f7e46bc
# --------------------------------------------------------------------------------------------
# Quick syntax intro
# --------------------------------------------------------------------------------------------
# Process definitions:
# Processes can be defined as "file:" or "shell:" type.
# - The "shell:" type takes a command pattern with the following special syntax:
# - {i:portname} defines an in-port (for feeding inputs from upstream processes)
# - {o:portname} defines an out-port (where outputs will be sent to connected downstream processes)
# - {p:portname} defines a parameter port, where parameters can be fed as a stream of strings
# Connections:
#!/usr/bin/env python
from sys import stdin, stdout
import csv
rdr = csv.reader(stdin, delimiter='\t')
wrt = csv.writer(stdout, delimiter='\t')
vals = []
rows = []
for row in rdr:
@samuell
samuell / rdfio_demo2_wikidata_query.sparql
Last active May 2, 2017 12:00
SPARQL query to obtain the data for Demonstrator II in the RDFIO paper. The link directly to the data is available in a comment below.
CONSTRUCT {
?wikidata <http://pharmb.io/onto/haspKa> ?pKa ;
<http://pharmb.io/onto/hasDOI> ?doi ;
rdfs:label ?compound . ?wikidata rdf:type <http://pharmb.io/onto/Compound> .
<http://pharmb.io/onto/Compound> rdfs:label "Compound" .
} WHERE {
?wikidata p:P1117 ?foo ;
rdfs:label ?compound ;
p:P31 ?type .
?foo a wikibase:BestRank ;
package main
import (
"flag"
"fmt"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/pkg/api/v1"
"k8s.io/client-go/tools/clientcmd"
)
package main
import (
"flag"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/tools/clientcmd"
)
var (
kubeconfig = flag.String("kubeconfig", "/home/samuel/.kube/config", "absolute path to the kubeconfig file")