Module: Muml_PrimitiveType

Defined in:
lib/ontomde-uml2-kb/protege.rb

Constant Summary collapse

PROTEGE_STRING_DATATYPE =

Protege 2000 predefined type string

"string"
PROTEGE_BOOLEAN_DATATYPE =

Protege 2000 predefined type boolean

"boolean"
PROTEGE_INTEGER_DATATYPE =

Protege 2000 predefined type integer

"integer"
UML_TO_PROTEGE_DATATYPE_MAPPING =

UML to Protege 2000 datatypes mappings.

{
  "MimeType" => PROTEGE_STRING_DATATYPE,
  "Password" => PROTEGE_STRING_DATATYPE,
  "URL" => PROTEGE_STRING_DATATYPE,
  "LargeText" => PROTEGE_STRING_DATATYPE,
  "TimeStamp" => PROTEGE_STRING_DATATYPE,
  "Calendar" => PROTEGE_STRING_DATATYPE,
  "Boolean"=>PROTEGE_BOOLEAN_DATATYPE,
  "boolean"=>PROTEGE_BOOLEAN_DATATYPE,
  "Integer"=>PROTEGE_INTEGER_DATATYPE,
  "String"=>PROTEGE_STRING_DATATYPE,
  "stringstring "=>PROTEGE_STRING_DATATYPE,
  "integerinteger " => PROTEGE_INTEGER_DATATYPE,
  "datedate " => PROTEGE_STRING_DATATYPE,
  "string" => PROTEGE_STRING_DATATYPE,
  "integer" => PROTEGE_INTEGER_DATATYPE,
  "decimal" => PROTEGE_INTEGER_DATATYPE,
  "short" => PROTEGE_INTEGER_DATATYPE
}
KB_NO_PROT_MAPPING_MSG_DISPLAYED =

returns protege primitive type for this datatype

Set.new

Instance Method Summary collapse

Instance Method Details

#prot_primitive_typeObject



157
158
159
160
161
162
163
164
165
# File 'lib/ontomde-uml2-kb/protege.rb', line 157

def prot_primitive_type
  r=UML_TO_PROTEGE_DATATYPE_MAPPING[uml_name.to_s]
  return r if r
  if !KB_NO_PROT_MAPPING_MSG_DISPLAYED.include?(uml_name.to_s)
    KB_NO_PROT_MAPPING_MSG_DISPLAYED << uml_name.to_s
    log.warn { "No protege mapping for primitive type \"#{uml_name}\" (uri=#{rdf_uri})" }
  end
  return PROTEGE_STRING_DATATYPE
end

#prot_uriObject

protege uri for a primitive type



121
122
123
# File 'lib/ontomde-uml2-kb/protege.rb', line 121

def prot_uri
  return	"#{NS_RDF_2000}rdf-schema#Literal"
end