Class: PubliSci::Writers::JSON

Inherits:
Base
  • Object
show all
Defined in:
lib/bio-publisci/writers/json.rb

Instance Method Summary collapse

Methods inherited from Base

#codes, #dataSet, #dimensions, #handle_input, #measures, #observations, #repo_to_ruby, #turtle_to_ruby

Methods included from Analyzer

#check_integrity, #dirty?, #recommend_range, #recommend_range_strings

Methods included from Parser

#add_node, #bnode_value, #encode_value, #get_ary, #get_hashes, #is_complex?, #is_uri?, #load_string, #observation_hash, #sanitize, #sanitize_hash, #strip_prefixes, #strip_uri, #to_literal, #to_resource, #turtle_indent

Methods included from Query

#execute, #execute_from_file, #property_names, #property_values, #row_names, #vocabulary

Instance Method Details

#build_json(data) ⇒ Object



4
5
6
# File 'lib/bio-publisci/writers/json.rb', line 4

def build_json(data)
  data.values.to_json
end

#from_store(file, select_dataset = nil, shorten_url = true) ⇒ Object



13
14
15
# File 'lib/bio-publisci/writers/json.rb', line 13

def from_store(file,select_dataset=nil,shorten_url=true)
  build_json(repo_to_ruby(file,select_dataset,shorten_url)[:data])
end

#from_turtle(file, select_dataset = nil, shorten_url = true) ⇒ Object



8
9
10
11
# File 'lib/bio-publisci/writers/json.rb', line 8

def from_turtle(file,select_dataset=nil,shorten_url=true)
  rb = turtle_to_ruby(file,select_dataset,shorten_url)
  build_json(rb[:data])
end