This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sparql' | |
module RDF | |
class Literal | |
## | |
# Returns the object SPARQL representation | |
# | |
# @param [Hash{Symbol => Object}] options ({}) | |
# options passed for the generation | |
# @return [String] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BUNNY = Bunny.new | |
BUNNY.start | |
def run | |
ch = BUNNY.create_channel | |
exchange = ch.exchange('osb.modules', :type => :topic, :durable => true) | |
ch.close | |
end | |
t = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -------------------------------------------------------- | |
# Rendering of a single view | |
# -------------------------------------------------------- | |
# users/show.rabl | |
object :@user | |
condition(->(user) { true }) do | |
node(:xx) do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'freebase-api' | |
FreebaseAPI.session = FreebaseAPI::Session.new(:env => :sandbox, :key => 'FREEBASE_KEY', :query_options => { :lang => :fr }) | |
FreebaseAPI.logger.level = Logger::UNKNOWN | |
instruments = FreebaseAPI.session.mqlread([{ | |
:type => '/music/instrument', | |
:id => nil, | |
:name => nil | |
}]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rdf' | |
result = RDF::NTriples::Reader.new('<http://dbpedia.org/resource/Fitch_Ratings2> <http://dbpedia.org/ontology/wikiPageRedirects2> <http://dbpedia.org/resource/Fitch_Group2>') | |
if result.count > 0 | |
puts result.statements.first.nil? # displays false | |
end | |
result.rewind |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def self.encode_properties(body_size, properties) | |
pieces, flags = [], 0 | |
properties.each do |key, value| | |
if value | |
i, f, result = self.send(:"encode_#{key}", value) | |
flags |= f | |
pieces[i] = result | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Transport | |
# Common transport layer for http transfers. | |
class HTTP | |
# Builder for the http transport layer requests. | |
class RequestBuilder | |
def initialize_request_path | |
uri = URI.parse @url |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Spira::Types | |
## | |
# A {Spira::Type} for integer values. Values will be associated with the | |
# `XSD.integer` type. | |
# | |
# A {Spira::Resource} property can reference this type as | |
# `Spira::Types::Integer`, `Integer`, or `XSD.integer`. | |
# | |
# @see Spira::Type |