Module: Mrdf_Model

Defined in:
lib/ontomde-uml2-kbjava/rdfToJava.rb

Instance Method Summary collapse

Instance Method Details

#kbjava_computeCoverageObject



294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
# File 'lib/ontomde-uml2-kbjava/rdfToJava.rb', line 294

def kbjava_computeCoverage
  puts "COVERAGE REPORT"
  puts %{class|property|hit|min hit\n}
  ret=Array.new
  uml_Class_all.each { |c|

    next if c.uml_isAbstract?
    next if c.kind_of?(Cuml_Enumeration)
    next if c.uml_ownedAttribute.empty?
    puts %{#{c.uml_name}|id|#{c.kb_coverage.size}|1\n}
    c.uml_ownedAttribute.each {|a|
      max=a.uml_type_one.kind_of?(Muml_Enumeration) ? a.uml_type_one.uml_ownedLiteral.size : "1"
      puts %{#{c.uml_name}|#{a.uml_name}|#{a.kb_coverage.size}|#{max}\n}
      ret<< { "class" => c.uml_name,"property"=> a.uml_name, "hit" =>a.kb_coverage.size, "minhit" => max}
    }

  }
  puts "COVERAGE REPORT END"
  return ret
end