Skip to content

Instantly share code, notes, and snippets.

@wstrinz
wstrinz / Gemfile
Last active December 16, 2015 19:30 — forked from mathias/Gemfile
source "https://rubygems.org"
gem 'rspec'
@wstrinz
wstrinz / config.yml
Created May 28, 2013 22:17
sample cogibara config
---
name: cucumber
speak: false
hard_parse: true
soft_parse: true
modules:
- module_name: chat
keywords: [talk,chat]
#Bot_ID: 24007
#
@wstrinz
wstrinz / parse_bot.rb
Last active December 18, 2015 01:09
Twitter bot that parses tweets into their components.
require 'rubygems'
require 'chatterbot/dsl'
require 'imgur'
require 'treat'
require 'yaml'
require 'pastebin'
include Treat::Core::DSL
verbose
update_config
@wstrinz
wstrinz / dumpvar.rb
Created June 8, 2013 06:03
first code for RQTL to RDF tool
require 'qtl2rdf'
def print_usage
puts "Usage: java -jar QTL2RDF.jar variable [directory]"
end
var = ARGV[0]
dir = ARGV[1] || '.'
unless var
@prefix : <http://www.rqtl.org/ns/#> .
@prefix qb: <http://purl.org/linked-data/cube#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix prop: <http://www.rqtl.org/dc/properties/> .
@prefix cs: <http://www.rqtl.org/dc/cs/> .
:dsd-mr a qb:DataStructureDefinition;
qb:component cs:refRow ,
cs:chr ,
require 'rserve'
@R = Rserve::Connection.new()
def dump_dataframe(var)
h = {}
h[var] = {"attr" => {}, "rows"=>{}}
x = @R.eval(var)
x.attr.payload.keys.map{ |a|
@prefix : <http://www.rqtl.org/ns/#> .
@prefix qb: <http://purl.org/linked-data/cube#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix prop: <http://www.rqtl.org/dc/properties/> .
@prefix cs: <http://www.rqtl.org/dc/cs/> .
:dsd-mr a qb:DataStructureDefinition;
qb:component cs:refRow ,
cs:Athlete ,
@wstrinz
wstrinz / missing.ttl
Last active December 19, 2015 03:19
Example files to test FILTER NOT EXISTS in RDF.rb
@prefix : <http://example.com/#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
:hr a :thing;
rdfs:label "Has Range"@en;
rdfs:range :somerange.
:nr a :thing;
rdfs:label "No Range"@en.
@prefix : <http://www.rqtl.org/ns/#> .
@prefix qb: <http://purl.org/linked-data/cube#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix prop: <http://www.rqtl.org/dc/properties/> .
@prefix cs: <http://www.rqtl.org/dc/cs/> .
@prefix code: <http://www.rqtl.org/dc/code/> .
@prefix class: <http://www.rqtl.org/dc/class/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
################# MARKER/LOD/GENE FOR A GIVEN PROBE ###############################
PREFIX f2gns: <http://www.rqtl.org/ns/dataset/f2g#>
PREFIX phenons: <http://www.rqtl.org/ns/dataset/islet_mlratio#>
PREFIX scanns: <http://www.rqtl.org/ns/dataset/scan_islet#>
PREFIX annons: <http://www.rqtl.org/ns/#>
PREFIX qb: <http://purl.org/linked-data/cube#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX prop: <http://www.rqtl.org/dc/properties/>
PREFIX cs: <http://www.rqtl.org/dc/cs/>