Class: YOWL::Import
- Inherits:
-
LabelledDocObject
- Object
- DocObject
- LabelledDocObject
- YOWL::Import
- Defined in:
- lib/yowl/import.rb
Instance Attribute Summary collapse
-
#importedOntology ⇒ Object
readonly
Returns the value of attribute importedOntology.
-
#importedSchema ⇒ Object
readonly
Returns the value of attribute importedSchema.
Attributes inherited from DocObject
Instance Method Summary collapse
-
#classWithURI(uri_) ⇒ Object
See YOWL::Individual::classWithURI(uri).
- #imports ⇒ Object
-
#initialize(resource_, schema_) ⇒ Import
constructor
A new instance of Import.
- #isExternal? ⇒ Boolean
- #name ⇒ Object
- #resourceNameHtml ⇒ Object
Methods inherited from LabelledDocObject
#<=>, #comment, #commentOrLabel, #definition, #editorialNotes, #hasComment?, #hasDefinition?, #hasDifferentLabel?, #hasEditorialNotes?, #label, #see_alsos, #status
Methods inherited from DocObject
#escaped_short_name, #escaped_uri, #get_literal, #hasOtherNamespace?, #hasUri?, #ns, #ontology, #repository, #short_name, #to_s, #uri
Constructor Details
#initialize(resource_, schema_) ⇒ Import
Returns a new instance of Import.
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/yowl/import.rb', line 10 def initialize(resource_, schema_) super(resource_, schema_) @importedSchema = schema_.repository.getSchemaForImport(self) @importedOntology = @importedSchema ? @importedSchema.ontology : nil if @importedSchema.nil? puts "WARNING: #{@schema.fileName}: Created Import #{uri} but did not find schema for it " end if @importedOntology.nil? puts "WARNING: #{@schema.fileName}: Created Import #{uri} but did not find ontology for it " end end |
Instance Attribute Details
#importedOntology ⇒ Object (readonly)
Returns the value of attribute importedOntology.
8 9 10 |
# File 'lib/yowl/import.rb', line 8 def importedOntology @importedOntology end |
#importedSchema ⇒ Object (readonly)
Returns the value of attribute importedSchema.
7 8 9 |
# File 'lib/yowl/import.rb', line 7 def importedSchema @importedSchema end |
Instance Method Details
#classWithURI(uri_) ⇒ Object
See YOWL::Individual::classWithURI(uri)
50 51 52 53 54 55 56 57 58 59 |
# File 'lib/yowl/import.rb', line 50 def classWithURI(uri_) if isExternal? return nil end if @importedSchema return @importedSchema.classWithURI(uri_) end puts "WARNING: Cannot check whether class #{uri_.to_s} exists in imported ontology #{uri} as this ontology is not loaded" return nil end |
#imports ⇒ Object
39 40 41 |
# File 'lib/yowl/import.rb', line 39 def imports return @importedOntology ? @importedOntology.imports : [] end |
#isExternal? ⇒ Boolean
43 44 45 |
# File 'lib/yowl/import.rb', line 43 def isExternal? return (@importedSchema.nil? and @importedOntology.nil?) end |
#name ⇒ Object
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/yowl/import.rb', line 24 def name if @importedSchema return @importedSchema.name end prefix, ns = @schema.prefixForNamespace(uri) if prefix return prefix end return short_name end |
#resourceNameHtml ⇒ Object
35 36 37 |
# File 'lib/yowl/import.rb', line 35 def resourceNameHtml return "#{@name}.html" end |