Module: Phenoscape::Terms

Defined in:
lib/phenoscaperb/Terms.rb

Class Method Summary collapse

Class Method Details

.all_ancestors(iri:, verbose: nil, options: nil) ⇒ Hash

Return all ancestor superclasses of a given term

Examples:

require 'phenoscaperb'

tm = Phenoscape::Terms
tm.all_ancestors(iri: "http://purl.obolibrary.org/obo/UBERON_0011618")

Parameters:

  • verbose (Boolean) (defaults to: nil)

    Print request headers to stdout. Default: false

  • options (Hash) (defaults to: nil)

    Hash of options for configuring the request, passed on to Faraday.new

    • timeout [Fixnum] open/read timeout Integer in seconds

    • open_timeout [Fixnum] read timeout Integer in seconds

    • proxy [Hash] hash of proxy options

      • uri [String] Proxy Server URI

      • user [String] Proxy server username

      • password [String] Proxy server password

    • params_encoder [Hash] not sure what this is

    • bind [Hash] A hash with host and port values

    • boundary [String] of the boundary value

    • oauth [Hash] A hash with OAuth details

  • iri (String)

    one or more taxon IRIs

Returns:



150
151
152
153
154
155
# File 'lib/phenoscaperb/Terms.rb', line 150

def self.all_ancestors(iri:, verbose: nil, options: nil)

  arguments = { iri: iri }.tostrings
  opts = arguments.delete_if { |k, v| v.nil? }
  Request.new("term/all_ancestors", opts, verbose, options, nil).perform
end

.all_descendants(iri:, verbose: nil, options: nil) ⇒ Hash

Return all descendant subclasses of a given term

Examples:

require 'phenoscaperb'

tm = Phenoscape::Terms
tm.all_descendants(iri: "http://purl.obolibrary.org/obo/UBERON_0011618")

Parameters:

  • verbose (Boolean) (defaults to: nil)

    Print request headers to stdout. Default: false

  • options (Hash) (defaults to: nil)

    Hash of options for configuring the request, passed on to Faraday.new

    • timeout [Fixnum] open/read timeout Integer in seconds

    • open_timeout [Fixnum] read timeout Integer in seconds

    • proxy [Hash] hash of proxy options

      • uri [String] Proxy Server URI

      • user [String] Proxy server username

      • password [String] Proxy server password

    • params_encoder [Hash] not sure what this is

    • bind [Hash] A hash with host and port values

    • boundary [String] of the boundary value

    • oauth [Hash] A hash with OAuth details

  • iri (String)

    one or more taxon IRIs

Returns:



169
170
171
172
173
174
# File 'lib/phenoscaperb/Terms.rb', line 169

def self.all_descendants(iri:, verbose: nil, options: nil)

  arguments = { iri: iri }.tostrings
  opts = arguments.delete_if { |k, v| v.nil? }
  Request.new("term/all_descendants", opts, verbose, options, nil).perform
end

.classification(iri:, verbose: nil, options: nil) ⇒ Hash

Return direct superclasses, direct subclasses, and equivalent classes of a given term

Examples:

require 'phenoscaperb'

tm = Phenoscape::Terms
tm.classification(iri: "http://purl.obolibrary.org/obo/UBERON_0011618")

Parameters:

  • verbose (Boolean) (defaults to: nil)

    Print request headers to stdout. Default: false

  • options (Hash) (defaults to: nil)

    Hash of options for configuring the request, passed on to Faraday.new

    • timeout [Fixnum] open/read timeout Integer in seconds

    • open_timeout [Fixnum] read timeout Integer in seconds

    • proxy [Hash] hash of proxy options

      • uri [String] Proxy Server URI

      • user [String] Proxy server username

      • password [String] Proxy server password

    • params_encoder [Hash] not sure what this is

    • bind [Hash] A hash with host and port values

    • boundary [String] of the boundary value

    • oauth [Hash] A hash with OAuth details

  • iri (String)

    one or more taxon IRIs

Returns:



131
132
133
134
135
136
# File 'lib/phenoscaperb/Terms.rb', line 131

def self.classification(iri:, verbose: nil, options: nil)

  arguments = { iri: iri }.tostrings
  opts = arguments.delete_if { |k, v| v.nil? }
  Request.new("term/classification", opts, verbose, options, nil).perform
end

.label(iri:, verbose: nil, options: nil) ⇒ Hash

Retrieve a label for a given term IRI.

Examples:

require 'phenoscaperb'

tm = Phenoscape::Terms
tm.label(iri: "http://purl.obolibrary.org/obo/UBERON_0011618")

Parameters:

  • verbose (Boolean) (defaults to: nil)

    Print request headers to stdout. Default: false

  • options (Hash) (defaults to: nil)

    Hash of options for configuring the request, passed on to Faraday.new

    • timeout [Fixnum] open/read timeout Integer in seconds

    • open_timeout [Fixnum] read timeout Integer in seconds

    • proxy [Hash] hash of proxy options

      • uri [String] Proxy Server URI

      • user [String] Proxy server username

      • password [String] Proxy server password

    • params_encoder [Hash] not sure what this is

    • bind [Hash] A hash with host and port values

    • boundary [String] of the boundary value

    • oauth [Hash] A hash with OAuth details

  • iri (String)

    a taxon IRI

Returns:



91
92
93
94
95
96
# File 'lib/phenoscaperb/Terms.rb', line 91

def self.label(iri:, verbose: nil, options: nil)

  arguments = { iri: iri }.tostrings
  opts = arguments.delete_if { |k, v| v.nil? }
  Request.new("term/label", opts, verbose, options, nil).perform
end

.labels(iris:, verbose: nil, options: nil) ⇒ Hash

Retrieve a label for each term IRI in a list

Examples:

require 'phenoscaperb'

tm = Phenoscape::Terms
tm.labels(iris: [
  "http://purl.obolibrary.org/obo/UBERON_0011618"
])

Parameters:

  • verbose (Boolean) (defaults to: nil)

    Print request headers to stdout. Default: false

  • options (Hash) (defaults to: nil)

    Hash of options for configuring the request, passed on to Faraday.new

    • timeout [Fixnum] open/read timeout Integer in seconds

    • open_timeout [Fixnum] read timeout Integer in seconds

    • proxy [Hash] hash of proxy options

      • uri [String] Proxy Server URI

      • user [String] Proxy server username

      • password [String] Proxy server password

    • params_encoder [Hash] not sure what this is

    • bind [Hash] A hash with host and port values

    • boundary [String] of the boundary value

    • oauth [Hash] A hash with OAuth details

  • iris (String)

    one or more taxon IRIs

Returns:



112
113
114
115
116
117
# File 'lib/phenoscaperb/Terms.rb', line 112

def self.labels(iris:, verbose: nil, options: nil)

  arguments = { iris: iris }.tostrings
  opts = arguments.delete_if { |k, v| v.nil? }
  Request.new("term/labels", opts, verbose, options, nil).perform
end

.least_common_subsumers(iris:, definedBy:, verbose: nil, options: nil) ⇒ Hash

Return all descendant subclasses of a given term

. definedBy: “??”

)

Examples:

require 'phenoscaperb'

tm = Phenoscape::Terms
tm.least_common_subsumers(
   iris: "http://purl.obolibrary.org/obo/UBERON_0011618",

Parameters:

  • verbose (Boolean) (defaults to: nil)

    Print request headers to stdout. Default: false

  • options (Hash) (defaults to: nil)

    Hash of options for configuring the request, passed on to Faraday.new

    • timeout [Fixnum] open/read timeout Integer in seconds

    • open_timeout [Fixnum] read timeout Integer in seconds

    • proxy [Hash] hash of proxy options

      • uri [String] Proxy Server URI

      • user [String] Proxy server username

      • password [String] Proxy server password

    • params_encoder [Hash] not sure what this is

    • bind [Hash] A hash with host and port values

    • boundary [String] of the boundary value

    • oauth [Hash] A hash with OAuth details

  • iris (String)

    one or more taxon IRIs

  • definedBy (String)

    the ontology identifier IRI in which the search terms are defined, e.g. purl.obolibrary.org/obo/uberon.owl

Returns:



192
193
194
195
196
197
# File 'lib/phenoscaperb/Terms.rb', line 192

def self.least_common_subsumers(iris:, definedBy:, verbose: nil, options: nil)

  arguments = { iris: iris, definedBy: definedBy }.tostrings
  opts = arguments.delete_if { |k, v| v.nil? }
  Request.new("term/least_common_subsumers", opts, verbose, options, nil).perform
end

.search(text:, type: nil, property: nil, verbose: nil, options: nil) ⇒ Hash

Search for terms in the KB by text match on a property value.

Examples:

require 'phenoscaperb'

tm = Phenoscape::Terms
tm.search(text: "fin")

Parameters:

  • verbose (Boolean) (defaults to: nil)

    Print request headers to stdout. Default: false

  • options (Hash) (defaults to: nil)

    Hash of options for configuring the request, passed on to Faraday.new

    • timeout [Fixnum] open/read timeout Integer in seconds

    • open_timeout [Fixnum] read timeout Integer in seconds

    • proxy [Hash] hash of proxy options

      • uri [String] Proxy Server URI

      • user [String] Proxy server username

      • password [String] Proxy server password

    • params_encoder [Hash] not sure what this is

    • bind [Hash] A hash with host and port values

    • boundary [String] of the boundary value

    • oauth [Hash] A hash with OAuth details

  • string (String)

    the input text to search

  • type (String) (defaults to: nil)

    the type of term to search for, e.g. www.w3.org/2002/07/owl#Class

  • property (String) (defaults to: nil)

    relation between term and text

Returns:



51
52
53
54
55
56
# File 'lib/phenoscaperb/Terms.rb', line 51

def self.search(text:, type: nil, property: nil, verbose: nil, options: nil)

  arguments = { text: text, type: type, property: property }.tostrings
  opts = arguments.delete_if { |k, v| v.nil? }
  Request.new("term/search", opts, verbose, options, nil).perform
end

.search_classes(text:, definedBy:, limit: nil, verbose: nil, options: nil) ⇒ Hash

Search for classes from a particular ontology.

Examples:

require 'phenoscaperb'

tm = Phenoscape::Terms
tm.search_classes(text: "fin", definedBy: "??")

Parameters:

  • verbose (Boolean) (defaults to: nil)

    Print request headers to stdout. Default: false

  • options (Hash) (defaults to: nil)

    Hash of options for configuring the request, passed on to Faraday.new

    • timeout [Fixnum] open/read timeout Integer in seconds

    • open_timeout [Fixnum] read timeout Integer in seconds

    • proxy [Hash] hash of proxy options

      • uri [String] Proxy Server URI

      • user [String] Proxy server username

      • password [String] Proxy server password

    • params_encoder [Hash] not sure what this is

    • bind [Hash] A hash with host and port values

    • boundary [String] of the boundary value

    • oauth [Hash] A hash with OAuth details

  • text (String)

    the input text to search

  • definedBy (String)

    the ontology identifier IRI in which the search terms are defined, e.g. purl.obolibrary.org/obo/uberon.owl

  • limit (integer) (defaults to: nil)

    limit records

Returns:



72
73
74
75
76
77
# File 'lib/phenoscaperb/Terms.rb', line 72

def self.search_classes(text:, definedBy:, limit: nil, verbose: nil, options: nil)

  arguments = { text: text, definedBy: definedBy, limit: limit }.tostrings
  opts = arguments.delete_if { |k, v| v.nil? }
  Request.new("term/search_classes", opts, verbose, options, nil).perform
end

.term(iri:, verbose: nil, options: nil) ⇒ Hash

Return detail info for a given term. Currently this is the label and an optional definition.

Examples:

require 'phenoscaperb'

tm = Phenoscape::Terms
tm.term(iri: "http://purl.obolibrary.org/obo/UBERON_0011618")

Parameters:

  • verbose (Boolean) (defaults to: nil)

    Print request headers to stdout. Default: false

  • options (Hash) (defaults to: nil)

    Hash of options for configuring the request, passed on to Faraday.new

    • timeout [Fixnum] open/read timeout Integer in seconds

    • open_timeout [Fixnum] read timeout Integer in seconds

    • proxy [Hash] hash of proxy options

      • uri [String] Proxy Server URI

      • user [String] Proxy server username

      • password [String] Proxy server password

    • params_encoder [Hash] not sure what this is

    • bind [Hash] A hash with host and port values

    • boundary [String] of the boundary value

    • oauth [Hash] A hash with OAuth details

  • iri (String)

    a term IRI

Returns:



30
31
32
33
34
35
# File 'lib/phenoscaperb/Terms.rb', line 30

def self.term(iri:, verbose: nil, options: nil)

  arguments = { iri: iri }.tostrings
  opts = arguments.delete_if { |k, v| v.nil? }
  Request.new("term", opts, verbose, options, nil).perform
end