#* ## ???? Add standard header ## ## UML/SysML to OWL schema generator ## ## ## ## ## ???? generate one schema file per package, to properly support viewpoints ## $file.silentCreate(template, outputFileName, importObject) ## *# #set ($namespace = "http://projects.baesystems.com/META/ontology/2011/8/") #set ($package = $importer) #set ($attrHash = $map.createHashMap()) ## XML shortcuts ]> ##???? compute import dependencies? ## ## http://projects.baesystems.com/META/ontology/2011/8/$package.name #foreach ($class in $package.ownedType) #if ($class.elementType == "block") $class.name #set($baseClassifier = $class.baseClassifier) #set($size = $baseClassifier.size()) #if($baseClassifier.size() > 0) #foreach($super in $sorter.humanSort($baseClassifier)) #set ($superPack = "") #if ($super.owner != $package) #set ($superPack = $namespace + $super.owner.name + "#") #end #end #else ## default supertype ## #end## has supertypes #foreach ($attr in $class.attribute) #if($attr.association) #set($association = $attribute.association) #foreach($member in $attr.association.memberEnd) ## #end ## ## generate default role names - myClassName ## #set($roleName = $attr.name) #if ($attr.name == "") #set($roleName = "my" + ${attr.type.name}) #end ## ## 0..1 0..* 1 1..* #if($attr.multiplicity == "0..1") 0 ##???? 1 #elseif ($attr.multiplicity == "0..*" || $attr.multiplicity == "") 0 #elseif ($attr.multiplicity == "1") 1 #elseif ($attr.multiplicity == "1..*") 1 #end #end## if attr association #end## foreach class attributes ## ## add hasFeature for each attribute ## #foreach ($attr in $class.attribute) #if(!$attr.association && ($attr.elementType == "property" || $attr.elementType == "attribute" || $attr.elementType == "valueproperty")) ## add to hash set #set ($tmp = $attrHash.put($attr.name, $attr)) #end #end## foreach class attributes #* ## factor out ports - only want descriptive properties in the schema #foreach ($attr in $class.attribute) #if(!$attr.association && ($attr.elementType == "property" || $attr.elementType == "attribute" || $attr.elementType == "valueproperty")) #end #end##attributes *# #foreach ($attr in $class.attribute) #if($attr.association) #set($association = $attribute.association) #foreach($member in $attr.association.memberEnd) ## #end ## ## generate default role names - myClassName ## #set($roleName = $attr.name) #if ($attr.name == "") #set($roleName = "my" + ${attr.type.name}) #end #end #end## end Block #end## endif type is block #end## end foreach type in package #set ($kindHash2 = $map.createHashMap()) #set ($kindHash = $array.createArray()) #foreach ($attr in $attrHash) #if (! ($attr.type && $attr.type.quantityKind) ) #set ($kind = "UNKNOWN") #set ($kind = $attr.type.quantityKind) #else #set ($kind = $attr.type.quantityKind) #end #if(!$kindHash.contains($kind)) #set ($tmp = $kindHash.add($kind)) #end #gen_kind($attr.type, $attr.type.quantityKind, $attr.type.unit) #if(!$kindHash2.containsKey( $gen_kind_out)) #set ($tmp = $kindHash2.put( $gen_kind_out, $gen_kind_out)) #end #gen_kind($attr.type, $attr.type.quantityKind, $attr.type.unit) #end #foreach ($k in $kindHash2) #foreach ($attr in $attrHash)## attHash may need to change to array #gen_kind($attr.type, $attr.type.quantityKind, $attr.type.unit) #if ($k == $gen_kind_out) #set ($t = $attr.type) #end #end## attrs #end## kinds ########################################################### ## gen_kind ## #* SysML QK units existing types from meta.owl, for backward compatibility (in #else #set ($otype = "http://www.w3.org/2001/XMLSchema#string") #end #end $otype#end ##