Skip to content

Instantly share code, notes, and snippets.

View abargnesi's full-sized avatar

Tony Bargnesi abargnesi

View GitHub Profile
@abargnesi
abargnesi / describe_query.sql
Last active October 26, 2015 01:38
Slow subject-only basic-graph-pattern (i.e. DESCRIBE) using librdf.sqlite (https://github.com/mro/librdf.sqlite)
SELECT
-- all *_id (hashes):
id
,s_uri_id
,s_blank_id
,p_uri_id
,o_uri_id
,o_blank_id
,o_lit_id
,o_datatype_id
@abargnesi
abargnesi / config.toml
Last active October 7, 2015 17:28
Greenline Test
[[rail]]
name = "broadcast"
pattern = "pub/sub"
ingress = 5000
egress = 6000
[[rail]]
name = "conversation"
pattern = "req/rep"
ingress = 7000

Description

This endpoint provides a decomposition of BEL Statement into its constituents (i.e. subject, relationship, object, term, fx, arguments, parameter, ns, value). The short form BEL Statement is also returned under the property statement_short_form.

Request

URL: http://next.belframework.org/api/expressions/{BEL}/components

BEL URI path: Can either be a BEL Term or Statement.

@abargnesi
abargnesi / evidence-collection.json
Last active September 28, 2015 13:46
Example of evidence-collection response.
{
"evidence-collection": [
{
"evidence": {
"bel_statement": "kin(p(HGNC:AKT1)) directlyIncreases p(HGNC:FOXO3,pmod(P,T,32))",
"citation": {
"type": "PubMed",
"name": "Biochem J 2001 Mar 15 354(Pt 3) 605-12",
"id": "11237865",
"date": "",
@abargnesi
abargnesi / date_machine.rb
Last active September 12, 2015 13:00
Assign called for each reference in gen.
#!/usr/bin/env ruby
require 'wongi-engine'
require 'uuid'
engine = Wongi::Engine.create
uuid = UUID.generate.to_sym
engine << [ uuid, :value, nil ]
engine << [ uuid, :type, "Date" ]
@abargnesi
abargnesi / issue_40_testcase.rb
Last active September 11, 2015 18:16
Example for issue 40
#!/usr/bin/env ruby
require 'wongi-engine'
engine = Wongi::Engine.create
engine.rule 'event_program' do
for_all {
fact :Event, 'program_name', 'Level 1 Coaching Certification v2'
}
@abargnesi
abargnesi / xml_to_json_machine.rb
Last active September 11, 2015 17:35
Datum conversion, XML to JSON, using wongi-engine rule system
#!/usr/bin/env ruby
require 'wongi-engine'
require 'uuid'
engine = Wongi::Engine.create
uuid = UUID.generate.to_sym
engine << [ uuid, :semantic_type, :person ]
engine << [ uuid, :media_type, :'application/xml' ]
engine << [ uuid, :value, '<person id="1"><name>Anthony Bargnesi</name></person>' ]
@abargnesi
abargnesi / json-graph-schema-factored.json
Last active August 29, 2015 14:26
Structuring sub-schema documents in JSON Schema, trying to minimize duplication of parent schema in child.
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "http://localhost:8000/json-graph-schema-factored.json",
"oneOf": [
{
"$ref": "#/definitions/single-graph-container"
},
{
"$ref": "#/definitions/multiple-graph-container"
}
@abargnesi
abargnesi / travis.log
Last active August 29, 2015 14:26
Travis build initialization failure (jruby-head (9.0.0.0) on Mac OS X)
Downloaded log from: https://travis-ci.org/OpenBEL/bel.rb/jobs/74595905
Using worker: worker-jupiter-brain: (ac630102-d927-4174-a51e-1b30d8702a29:)
travis_fold:start:system_info
Build system information
Build language: ruby
travis_fold:end:system_info
@abargnesi
abargnesi / custom_definitions.rb
Last active August 29, 2015 14:26
Custom resources when parsing BEL Script
require 'bel'
# Load RDF extension; Loaded by default
BEL::Extension.load_extension 'rdf/rdf'
# Define your resources including the URI.
resource_overrides = {
:MESHDISEASE => NamespaceDefinition.new(
:MESHDISEASE,
'http://resource.belframework.org/belframework/20150611/namespace/mesh-diseases.belns',