Sha256: fce504d7ede4c15444cf4efa45381ae21f661d17dcf4895ffb37f94c10875839

Contents?: true

Size: 1.6 KB

Versions: 8

Compression:

Stored size: 1.6 KB

Contents

#!/usr/bin/ruby

require 'rubygems'
require 'biointerchange'

include BioInterchange

def print_resource(resource)
  puts "    #{resource}"
  puts "        Ontology class:             #{GFF3O.is_class?(resource)}"
  puts "        Ontology object property:   #{GFF3O.is_object_property?(resource)}"
  puts "        Ontology datatype property: #{GFF3O.is_datatype_property?(resource)}"
end

# Get the URI of an ontology term by label:
puts "'seqid' property:"
print_resource(GFF3O.seqid())

# Ambiguous labels will return an array of URIs:
# "start" can refer to a sub-property of "feature_properties" or "target_properties"
puts "'start' properties:"
GFF3O.start().each { |start_synonym|
  print_resource(start_synonym)
}
# "feature_properties" can be either a datatype or object property
puts "'feature_properties' properties:"
GFF3O.feature_properties().each { |feature_properties_synonym|
  print_resource(feature_properties_synonym)
}

# Use build-in method "is_datatype_property" to resolve ambiguity:
# (Note: there is exactly one item in the result set, so the selection of the first item is acceptable.)
feature_properties = GFF3O.feature_properties().select { |uri| GFF3O.is_datatype_property?(uri) }
puts "'feature_properties' properties, which are a datatype property:"
feature_properties.each { |feature_property|
  print_resource(feature_property)
}

# Use build-in method "with_parent" to pick properties based on their context:
puts "'start' property with parent datatype property 'feature_properties':"
GFF3O.with_parent(GFF3O.start(), feature_properties[0]).each { |feature_property|
  print_resource(feature_property)
}

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
biointerchange-1.0.8 examples/vocabulary.rb
biointerchange-1.0.7 examples/vocabulary.rb
biointerchange-1.0.6 examples/vocabulary.rb
biointerchange-1.0.5 examples/vocabulary.rb
biointerchange-1.0.4 examples/vocabulary.rb
biointerchange-1.0.2 examples/vocabulary.rb
biointerchange-1.0.1 examples/vocabulary.rb
biointerchange-1.0.0 examples/vocabulary.rb