import NIEMglobals; modeltype UML uses 'http://www.omg.org/spec/UML/20110701'; modeltype XSD uses 'http://www.eclipse.org/xsd/2002/XSD'; modeltype CAT uses 'http://reference.niem.gov/niem/resource/mpd/catalog/1.0/'; transformation NIEMplatformBinding; main() {} /////////////////////////abstract platform bindings abstract helper UML::Element::isEditable():Boolean;// true if the context Element can be modified (i.e., not a library or shared resource) abstract query UML::Element::IsStereotypeApplied(stereotype:UML::Stereotype):Boolean;// true if the stereotype has been applied to the context Element abstract helper UML::Element::removeElement();// remove the context Element from the model abstract helper UML::Element::ApplyStereotype(stereotype:UML::Stereotype):Stdlib::Element;// apply the stereotype to the context Element abstract helper UML::MultiplicityElement::setLower(lower:Integer);// set the lower value of a MultiplicityElement abstract helper UML::MultiplicityElement::setUpper(upper:Integer);// set the upper value of a MultiplicityElement abstract query UML::Element::GetStereotypeApplication(stereotype:UML::Stereotype):Stdlib::Element;// get the instance of the stereotype applied to the context Element // get nearest containing <> Package, part of Issue 18251: NIEM-UML Issue: Constraint schema query UML::Element::getNearestNIEMSchemaPackage():UML::Package{ var schemaPackage:UML::Package=self.getNearestPackage(); if(schemaPackage.isStereotypeApplied(NIEMSchemaStereotype)) then {return schemaPackage;} endif; if(schemaPackage.name=XMLPrimitiveTypesPackageName)then{return schemaPackage;}endif; if(schemaPackage.name=UMLPrimitiveTypesPackageName)then{return schemaPackage;}endif; var nestingPackage:UML::Package=schemaPackage.nestingPackage; if(nestingPackage.oclIsUndefined())then{return null;}endif; return nestingPackage.getNearestNIEMSchemaPackage(); } /* Stereotype instance tag value setters. Context is an applied stereotype instance. Argument is value of tag to be set. In the case of Enumerations, argument is the String value of the EnumerationLiteral name These are abstract to reflect variations of Stereotype instance implementations, which typically are either * A UML InstanceSpecification * A dynamic CMOF meta-model implementation */ abstract helper Stdlib::Element::setInformationModelDefaultPurpose(defaultPurpose:String);// set <> defaultPurpose abstract helper Stdlib::Element::setSchemaAppinfoConformantIndicator(isConformant:Boolean);// set <> isConformant abstract helper Stdlib::Element::setSchemaVersion(version:String);// set <> version abstract helper Stdlib::Element::setSchemaNamespace(namespace:String);// set <> targetNamespace abstract helper Stdlib::Element::setFileTypeExternalURI(externalURI:String);// set <> externalURI abstract helper Stdlib::Element::setFileTypeNatureCode(fullnatureURI:String);// set <> natureCode (argument is full URI, not the abbreviated code in the Enumeration) abstract helper Stdlib::Element::setFileTypePurposeCode(fullpurposeURI:String);// set <> purposeCode (argument is full URI, not the abbreviated code in the Enumeration) abstract helper Stdlib::Element::setFileTypeDescriptionText(descriptionText:String);// set <> descriptionText abstract helper Stdlib::Element::setFileSetTypeNatureURI(natureURI:String);// set <> natureCode (argument is full URI, not the abbreviated code in the Enumeration) abstract helper Stdlib::Element::setFileSetTypePurposeURI(purposeURI:String);// set <> purposeCode (argument is full URI, not the abbreviated code in the Enumeration) abstract helper Stdlib::Element::setNIEMPropertyKind(kind:String);// set <> kind abstract helper Stdlib::Element::setNIEMPropertyNillable(nillable:Boolean);// set <> nillable abstract helper Stdlib::Element::setNIEMSimpleTypeFractionDigits(value:Integer);// set <> fractionDigits abstract helper Stdlib::Element::setNIEMSimpleTypeLength(value:Integer);// set <> length abstract helper Stdlib::Element::setNIEMSimpleTypeMaxLength(value:Integer);// set <> maxLength abstract helper Stdlib::Element::setNIEMSimpleTypeMinLength(value:Integer);// set <> minLength abstract helper Stdlib::Element::setNIEMSimpleTypeMaxExclusive(value:String);// set <> maxExclusive abstract helper Stdlib::Element::setNIEMSimpleTypeMaxInclusive(value:String);// set <> maxInclusive abstract helper Stdlib::Element::setNIEMSimpleTypeMinExclusive(value:String);// set <> minExclusive abstract helper Stdlib::Element::setNIEMSimpleTypeMinInclusive(value:String);// set <> minInclusive abstract helper Stdlib::Element::setNIEMSimpleTypeTotalDigits(value:Integer);// set <> totalDigits abstract helper Stdlib::Element::setNIEMSimpleTypeWhiteSpace(value:String);// set <> whiteSpace abstract helper Stdlib::Element::setNIEMSimpleTypePattern(value:Sequence(String));// set <> pattern abstract helper Stdlib::Element::setNIEMAnyPropertyProcessContents(processContents:String);// set <> processContents abstract helper Stdlib::Element::setNIEMAnyPropertyValueNamespace(valueNamespace:String);// set <> valueNamespace abstract helper OclAny::isCatalogFolderType():Boolean;// abstract helper CAT::CatalogType::addCatalogFileSet(folder:CAT::FileSetType); abstract helper CAT::CatalogType::addCatalogFolder(folderIn:CAT::FolderType); abstract helper CAT::CatalogType::addCatalogFile(fileIn:CAT::FileType); abstract helper CAT::FileSetType::addFileSetFiles(value:String); // retrieve the string value of the natureCode tag from a <> abstract query Stdlib::Element::getFileTypeNatureCode():String;// additional query to support issues including Issue 18179: NIEM-UML Issue – Changelog // retrieve the string value of the natureCode tag from a <> abstract query Stdlib::Element::getFileSetTypeNatureCode():String;// additional query to support issues including Issue 18179: NIEM-UML Issue – Changelog abstract query Stdlib::Element::getFileTypePurposeURI():String; abstract helper Stdlib::Element::getFileTypeNatureURI():String; abstract helper Stdlib::Element::splitSchemas(referenceTarget:Stdlib::Element); /* Stereotype instance tag value getters. Context is an applied stereotype instance. The value of tag on the Stereotype instance is returned. In the case of Enumerations, return value is the String value of the EnumerationLiteral name These are abstract to reflect variations of Stereotype instance implementations, which typically are either * A UML InstanceSpecification * A dynamic CMOF meta-model implementation */ abstract query Stdlib::Element::getInformationModelDefaultPurpose():String;// get <> defaultPurpose query UML::Package::getSchemaTargetNamespace():String=self.GetStereotypeApplication(NIEMSchemaStereotype).oclAsType(Stdlib::Element).getSchemaTargetNamespace(); abstract helper Stdlib::Element::getSchemaTargetNamespace():String;// get <> targetNamespace abstract query Stdlib::Element::getPimSchemaConformantIndicator():Boolean;// get <> isConformant abstract query Stdlib::Element::getPimSchemaVersion():String;// get <> version abstract query Stdlib::Element::getSchemaDefaultPrefix():String;// Issue 17572: NIEM-UML FTF Issue: Namespace prefix (niem-uml-ftf): abstract query Stdlib::Element::getNIEMSimpleTypeFractionDigits():Integer;// get <> fractionDigits abstract query Stdlib::Element::getNIEMSimpleTypeLength():Integer;// get <> length abstract query Stdlib::Element::getNIEMSimpleTypeMaxLength():Integer;// get <> maxLength abstract query Stdlib::Element::getNIEMSimpleTypeMinLength():Integer;// get <> minLength abstract query Stdlib::Element::getNIEMSimpleTypeTotalDigits():Integer;// get <> totalDigits abstract query Stdlib::Element::getNIEMSimpleTypePattern():Sequence(String);// get <> pattern // return value of tag relativePathName within <>; as part of Issue 18361: PSM Representation for XSD Complex Type abstract query Stdlib::Element::getFileTypeRelativePathName():String; abstract query Stdlib::Element::getNIEMSimpleTypeMaxExclusive():String;// get <> maxExclusive abstract query Stdlib::Element::getNIEMSimpleTypeMaxInclusive():String;// get <> maxInclusive abstract query Stdlib::Element::getNIEMSimpleTypeMinExclusive():String;// get <> minExclusive abstract query Stdlib::Element::getNIEMSimpleTypeMinInclusive():String;// get <> minInclusive abstract query Stdlib::Element::getXSDRepresentationRestrictionWhiteSpace():String;// get <> whiteSpace abstract query Stdlib::Element::getNIEMPropertyKind():String;// get <> kind abstract query Stdlib::Element::getAnyPropertyNamespace():String;// get <> valueNamespace abstract query Stdlib::Element::getAnyPropertyProcessContents():String;// get <> processContents abstract query Stdlib::Element::getNIEMElementNillable():Boolean;// get <> nillable abstract query Stdlib::Element::getXSDPropertyFixed():String;// get <> nillable abstract query Stdlib::Element::getMpdDescriptionText():String;// get <> descriptionText abstract query Stdlib::Element::getMpdBaseURI():String;// get <> mpdBaseURI abstract query Stdlib::Element::getMpdVersionID():String;// get <> mpdVersionID abstract helper Stdlib::Element::getMpdSecurityMarkingText():String;// get <> SecurityMarkingText abstract helper Stdlib::Element::getMpdStatusText():String;// get <> StatusText abstract helper Stdlib::Element::getMpdKeywordText():Sequence(String);// get <> KeywordText abstract helper Stdlib::Element::getMpdPOC():Sequence(Stdlib::Element);// get <> POC abstract helper Stdlib::Element::getMpdDomainText():Sequence(String);// get <> DomainText abstract helper Stdlib::Element::getMpdPurposeText():Sequence(String);// get <> PurposeText abstract helper Stdlib::Element::getMpdExchangePatternText():Sequence(String);// get <> ExchangePatternText abstract helper Stdlib::Element::getMpdExchangePartnerName():Sequence(String);// get <> ExchangePartnerName abstract helper Stdlib::Element::getMpdASName():String;// get <> ASName abstract helper Stdlib::Element::getMpdASAddressText():String;// get <> ASAddressText abstract helper Stdlib::Element::getMpdASWebSiteURL():String;// get <> ASWebSiteURL abstract helper Stdlib::Element::getMpdCreationDate():String;// get <> CreationDate abstract helper Stdlib::Element::getMpdPackageCode():String;// get <> mpdClassCode abstract helper Stdlib::Element::getPOCName():String;// get POCType POCName abstract helper Stdlib::Element::getPOCEmail():Sequence(String);// get POCType POCEmail abstract helper Stdlib::Element::getPOCTelephone():Sequence(String);// get POCType POCTelephone abstract query Stdlib::Element::getFileSetTypePurposeCode():String;// get <> purposeCode (as full URI, not the abbreviated code in the Enumeration) abstract helper Stdlib::Element::getFileSetExternalURI():String;// get <> externalURI abstract helper Stdlib::Element::getFileSetDescriptionText():String;// get <> descriptionText abstract query Stdlib::Element::getFileTypePurposeCode():String;// get <> purposeCode (as full URI, not the abbreviated code in the Enumeration) // if <> applied, return the <> name, otherwise umlName, added as part of Issue 18361: PSM Representation for XSD Complex Type with Simple Content abstract query UML::Element::getBaseNiemName(umlName:String ):String; // if <> applied, return the <> name, otherwise the UML name, added as part of Issue 18361: PSM Representation for XSD Complex Type with Simple Content query UML::NamedElement::getBaseNiemName():String=self.getBaseNiemName(self.name); abstract helper Stdlib::Element::getFileTypeExternalURI():String;// get <> externalURI abstract query Stdlib::Element::getFileDescriptionText():String;// get <> descriptionText abstract helper Stdlib::Element::getRelationshipDescriptionText():String;// get <> descriptionText abstract helper Stdlib::Element::getRelationshipCode():String;// get <> relationshipCode /* apply the stereotype to the target, copy the values of the stereotype instance context to the new stereotype instance, return the new stereotype instance */ abstract helper Stdlib::Element::deepcloneStereotypeApplication(stereotype:UML::Stereotype,inout target:UML::Element):Stdlib::Element; /* apply the <> stereotype to the target, copy the values of the <> stereotype instance context to the new <> stereotype instance */ abstract helper Stdlib::Element::cloneInformationModelToNamespace(inout target:Stdlib::Element); /* For the context CMOF extent, For the URI of the extent, return the last segment of the URI after truncating the file extension. */ abstract helper Stdlib::Element::contextURI():String; /* Return a representation for the CMOF extent of the XSDSchema context */ abstract helper XSD::XSDSchema::extent():Stdlib::Element; /* Sets the QName prefix used to reference the schema for schema namespace. */ abstract helper XSD::XSDSchema::setSchemaForSchema(prefix:String,namespace:String); /* Sets the QName prefix used to reference the given namespace. */ abstract helper XSD::XSDSchema::setQNamePrefixToNamespace(prefix:String,namespace:String); /* Return the location of the XSDSchema, relative to the root directory of the target ModelPackageDescription */ abstract query XSD::XSDSchema::relativeMdpLocation():String; /* Resolve and load the schema referenced by the XSDImport context. */ abstract helper XSD::XSDImport::importSchema(); /* Returns the value of the 'Application Information' attribute list for the XSDAnnotation context. The list contents are of type org.w3c.dom.Element. This represents the application information infoset property, i.e., a list of appinfo elements. */ abstract query XSD::XSDAnnotation::getXSDAnnotationApplicationInformation():OrderedSet(OclAny); /* In the context of an XSDAnnotation, creates and returns a new documentation org.w3c.dom.element using the containing schema's document as the factory. */ abstract helper XSD::XSDAnnotation::createUserInformation(sourceURI:String):OclAny; /* In the context of an org.w3c.dom.Element, return all child org.w3c.dom.Elements */ abstract query OclAny::getElementElements():OrderedSet(OclAny); /* In the context of an org.w3c.dom.Element, return the text content. */ abstract query OclAny::getXSDElementValue():String; /* In the context of an org.w3c.dom.Element, return the name. */ abstract query OclAny::getElementName():String; /* In the context of an org.w3c.dom.Element, return the namespace. */ abstract query OclAny::getElementNamespace():String; /* In the context of an org.w3c.dom.Element, set the textContent to provided value. */ abstract helper OclAny::setTextContent(value:String); /* in the context of an org.w3c.dom.Element, commit any changes to Element or its components (if necessary) */ abstract helper OclAny::commitInformation(); /* in the context of an XSDAnnotation, create or update an applicationInformation element, for the given name within the NIEM appinfo2 namespace, setting its textual content to the provided value */ abstract helper XSD::XSDAnnotation::setAppinfo2Element(value:String,owningSchema:XSD::XSDSchema,name:String); /* in the context of an XSDAnnotation, create or update an applicationInformation element, for the given name within the NIEM appinfo namespace, setting its textual content to the provided value */ abstract helper XSD::XSDAnnotation::setAppinfoElementValue(value:String,name:String); /* in the context of an XSDAnnotation, create or update an applicationInformation element, for the given elementName within the NIEM appinfo namespace, set the appinfo:name attribute to the provided name and set the appinfo:namespace to the provided namespace in the case of elementName='AppliesTo', always add an element; in all other cases, replace content of any existing element matching elementName (or add new element if no match) */ abstract helper XSD::XSDAnnotation::setAppinfoElement(elementName:String,name:String,namespace:String); /* in the context of an org.w3c.dom.Element return the value of the appinfo:name attribute */ abstract query OclAny::getAppInfoName():String; /* in the context of an org.w3c.dom.Element return the value of the appinfo:namespace attribute */ abstract query OclAny::getAppInfoNamespace():String; /* in the context of an org.w3c.dom.Element, return whether or not there is an appinfo:namespace attribute */ abstract query OclAny::hasAppinfoNamespaceAttribute(name:String):Boolean; /* in the context of an org.w3c.dom.Element, return whether or not there is an appinfo:name attribute */ abstract query OclAny::hasAppinfoNameAttribute(name:String):Boolean; /* in the context of an XSDAnnotation, map the textual content of UserInformation to the body of a new Comment and append the new Comment to the ownedComments of the owner */ abstract helper XSD::XSDAnnotation::mapXSDAnnotation(owner:UML::Element); abstract helper Stdlib::Element::getSchemaAtRelativeURI(relativeURI:String):Stdlib::Element; abstract helper Stdlib::Element::setFileSetTypeDescriptionText(descriptionTextIn:String); abstract helper Stdlib::Element::setFileSetTypeExternalURI(externalURIIn:String); abstract helper Stdlib::Element::setMpdVersionID(mpdVersionID:String); abstract helper Stdlib::Element::setMpdBaseURI(mpdBaseURI:String); abstract helper Stdlib::Element::setMpdDescriptionText(descriptionText:String); abstract helper Stdlib::Element::setMpdSecurityMarkingText(SecurityMarkingText:String); abstract helper Stdlib::Element::setMpdCreationDate(CreationDate:String); abstract helper Stdlib::Element::setMpdStatusText(StatusText:String); abstract helper Stdlib::Element::setMpdKeywordText(KeywordText:Sequence(String)); abstract helper Stdlib::Element::setMpdDomainText(DomainText:Sequence(String)); abstract helper Stdlib::Element::setMpdPurposeText(PurposeText:Sequence(String)); abstract helper Stdlib::Element::setMpdExchangePatternText(ExchangePatternText:Sequence(String)); abstract helper Stdlib::Element::setMpdExchangePartnerName(ExchangePartnerName:Sequence(String)); abstract helper Stdlib::Element::setMpdASName(ASName:String); abstract helper Stdlib::Element::setMpdASAddressText(ASAddressText:String); abstract helper Stdlib::Element::setMpdASWebSiteURL(ASWebSiteURL:String); abstract helper Stdlib::Element::setPOCPOCName(POCName:String); abstract helper Stdlib::Element::setPOCPOCEmail(POCEmail:Sequence(String)); abstract helper Stdlib::Element::setPOCPOCTelephone(POCTelephone:Sequence(String)); abstract helper Stdlib::Element::setMpdPackageCode(packageCode:String); abstract helper Stdlib::Element::getMpdPOCList():Stdlib::Element; abstract helper Stdlib::Element::createPOCInstance():Stdlib::Element; ////////////////////////////common helpers and queries /* Retrieves the nearest package that owns (either directly or indirectly) this element, or the element itself (if it is a package). */ query UML::Element::getNearestPackage():UML::Package= if(self.oclIsKindOf(UML::Package)) then self.oclAsType(UML::Package) else self.owner.getNearestPackage() endif; /* Applies the current definition of the specified profile to this package and automatically applies required stereotypes in the profile to elements within this package's namespace hieararchy. If a different definition is already applied, automatically migrates any associated stereotype values on a "best effort" basis (matching classifiers and structural features by name). */ helper UML::Package::applyProfile(profile : UML::Profile){ var profileApplication: UML::ProfileApplication=new UML::ProfileApplication(); profileApplication.applyingPackage:=self; profileApplication.appliedProfile:=profile; log('applyProfile '+profile.qualifiedName+' to '+self.qualifiedName); return; } /* The query allParents() gives all of the direct and indirect ancestors of a generalized Classifier. result = self.parents()->union(self.parents()->collect(p | p.allParents()) */ query UML::Classifier::allParents():OrderedSet(UML::Classifier)= self.general->select(g|(g<>self) and (g<>null)and not(g.oclIsUndefined())) ->union(self.general->select(g|(g<>self) and (g<>null)and not(g.oclIsUndefined())).allParents())->asOrderedSet(); /* Determines whether the specified profile is applied to this package. */ query UML::Package::isProfileApplied(profile:UML::Profile):Boolean= self.profileApplication->exists(a|a.appliedProfile=profile); /* In the context of a NIEM_PIM_Profile, initialize the global variables for its stereotypes. */ helper UML::Profile::initLogicalProfileStereotypes(){ logicalProfile:=self; NIEMRoleOfStereotype:=logicalProfile.getOwnedStereotype('RoleOf'); NIEMReferenceNameStereotype:=logicalProfile.getOwnedStereotype('ReferenceName'); NIEMRoleStereotype:=logicalProfile.getOwnedStereotype('RolePlayedBy'); NIEMAugmentsStereotype:=logicalProfile.getOwnedStereotype('Augments'); NIEMInformationModelStereotype:=logicalProfile.getOwnedStereotype('InformationModel'); return; } /* In the context of a Model_Package_Description_Profile, initialize the global variables for its stereotypes. */ helper UML::Profile::initProvisioningProfileStereotypes(){ provisioningProfile:=self; prompdStereotype:=provisioningProfile.getOwnedStereotype(provisioningMpdStereotypeName); NIEMModelPackageDescriptionRelationshipStereotype:=provisioningProfile.getOwnedStereotype('ModelPackageDescriptionRelationship'); NIEMModelPackageDescriptionFileStereotype:=provisioningProfile.getOwnedStereotype('ModelPackageDescriptionFile'); NIEMModelPackageDescriptionFileSetStereotype:=provisioningProfile.getOwnedStereotype('ModelPackageDescriptionFileSet'); packageCodeLiteralEnumeration:=provisioningProfile.packagedElement ->select(e|e.oclIsKindOf(UML::Enumeration)and (e.name='ModelPackageDescriptionClassCode')).oclAsType(UML::Enumeration) ->asSequence()->first(); defaultPackageCodeLiteral:=packageCodeLiteralEnumeration.getOwnedLiteral(defaultPackageCodeName); return; } /* In the context of a NIEM_Common_Profile, initialize the global variables for its stereotypes. */ helper UML::Profile::initStructureProfileStereotypes(){ structureProfile:=self; NIEMAdapterStereotype:=structureProfile.getOwnedStereotype('AdapterType'); appliesToStereotype:=structureProfile.getOwnedStereotype('Application'); NIEMAssociationStereotype:=structureProfile.getOwnedStereotype('AssociationType'); NIEMAugmentationApplicationStereotype:=structureProfile.getOwnedStereotype('AugmentationApplication'); NIEMAugmentationStereotype:=structureProfile.getOwnedStereotype('AugmentationType'); NIEMChoiceStereotype:=structureProfile.getOwnedStereotype('Choice'); NIEMDescriptionStereotype:=structureProfile.getOwnedStereotype('Documentation'); NIEMListTypeStereotype:=structureProfile.getOwnedStereotype('List'); NIEMMetadataApplicationStereotype:=structureProfile.getOwnedStereotype('MetadataApplication'); NIEMMetadataStereotype:=structureProfile.getOwnedStereotype('MetadataType'); NIEMSchemaStereotype:=structureProfile.getOwnedStereotype(provisioningNdrSchemaStereotypeName); NIEMTypeStereotype:=structureProfile.getOwnedStereotype('NIEMType'); NIEMObjectTypeStereotype:=structureProfile.getOwnedStereotype('ObjectType'); NIEMPropertyHolderStereotype:=structureProfile.getOwnedStereotype(propertyHolderStereotypeName); NIEMReferencesStereotype:=structureProfile.getOwnedStereotype('References'); NIEMUnionTypeStereotype:=structureProfile.getOwnedStereotype('Union'); NIEMUnionOfStereotype:=structureProfile.getOwnedStereotype('UnionOf'); NIEMRestrictionStereotype:=structureProfile.getOwnedStereotype('Restriction'); NIEMSimpleTypeStereotype:=structureProfile.getOwnedStereotype('ValueRestriction'); return; } /* In the context of a NIEM_PSM_Profile, initialize the global variables for its stereotypes. */ helper UML::Profile::initNiemXsdProfileStereotypes(){ niemXsdProfile:=self; NIEMPropertyStereotype:=niemXsdProfile.getOwnedStereotype('XSDProperty'); NIEMAnyPropertyStereotype:=niemXsdProfile.getOwnedStereotype('XSDAnyProperty'); NIEMRepresentationRestrictionStereotype:=niemXsdProfile.getOwnedStereotype('XSDRepresentationRestriction'); NIEMSimpleContentStereotype:=niemXsdProfile.getOwnedStereotype('XSDSimpleContent'); NIEMSequenceIdStereotype:=niemXsdProfile.getOwnedStereotype('SequenceID'); NIEMDeclarationStereotype:=niemXsdProfile.getOwnedStereotype('XSDDeclaration'); return; } /* Retrieves the first Stereotype with the specified 'Name' from the 'Owned Stereotype' reference list. */ query UML::Profile::getOwnedStereotype(stereotypeName:String):UML::Stereotype{ var stereotype:UML::Stereotype=self.ownedStereotype->select(s|s.name=stereotypeName)->asSequence()->first(); if(stereotype.oclIsUndefined())then{ log('ERROR: stereotype '+stereotypeName+' not found in profile '+self.name); }else{}endif; return stereotype; } /* Retrieves the first EnumerationLiteral with the specified 'Name' from the 'Owned Literal' containment reference list. */ query UML::Enumeration::getOwnedLiteral(schemaKind:String):UML::EnumerationLiteral= self.ownedLiteral->select(l|l.name=schemaKind)->asSequence()->first(); /* In the context of a top-level Model, find and initialize globals for all NIEM Profiles plus the XML Type Library */ helper UML::Model::initializeProfileGlobals(){ var pimRoot:UML::Model=self; var allSourceProfiles:Set(UML::Profile)=pimRoot.allSubobjectsOfType(UML::Profile).oclAsType(UML::Profile)->asSet(); allSourceProfiles ->select(p|p.name=provisioningProfileName)->asSequence()->first().initProvisioningProfileStereotypes();//getProvisioningProfile(); allSourceProfiles->select(p|p.name=logicalProfileName) ->asSequence()->first().initLogicalProfileStereotypes(); allSourceProfiles->select(p|p.name=structureProfileName) ->asSequence()->first().initStructureProfileStereotypes(); allSourceProfiles->select(p|p.name=niemXsdProfileName) ->asSequence()->first().initNiemXsdProfileStereotypes(); umlXmlLibrary:=pimRoot.allSubobjectsOfType(UML::Model).oclAsType(UML::Model) ->select(m|m.name=XMLPrimitiveTypesPackageName)->asSequence()->first(); return; } /* In the context of a name String, true if the name conforms with the NIEM RoleOf Element name rule */ query String::isRoleOfName():Boolean=self.startsWith('RoleOf') and (self<>'RoleOf'); /* In the context of a name String, return a converted name conforming to NCName (non-colonized name) */ query String::toNCName():String=self.replace('/','_').replace(' ','') .replace('<','_').replace('>','_').replace('(','_').replace(')','_').replace(',','_').replace('=',''); // true if given Classifier context is in a niem-conformant model part of Issue 18251: NIEM-UML Issue: Constraint schema helper UML::Classifier::isNIEMConformant():Boolean{ var schemaContainer:UML::Package=self.getNearestNIEMSchemaPackage(); if(not(schemaContainer.oclIsUndefined()))then{ var pimStereotypeInstance:Stdlib::Element=schemaContainer.GetStereotypeApplication(NIEMSchemaStereotype).oclAsType(Stdlib::Element); if(not(pimStereotypeInstance.oclIsUndefined()))then{ var appinfoConformantIndicator:Boolean=pimStereotypeInstance.getPimSchemaConformantIndicator(); if(appinfoConformantIndicator.oclIsUndefined())then{appinfoConformantIndicator:=true;}endif; return appinfoConformantIndicator; }endif; }endif; return false; } // perform platform-specific provisioning of changelog, where self context is a package representing a changelog abstract helper UML::Package::changelog(inout psmPackage:UML::Package);// hook to platform-specific implementation per Issue 18179: NIEM-UML Issue – Changelog // part of Issue 18251: NIEM-UML Issue: Constraint schema // find any explicitly specified constraint models for given <> (the client of a <> for which given model is supplier) abstract query UML::Package::getPimConstraintModels():Set(UML::Package); // returns Dependencies for which the context NamedElement is the supplier, as part of Issue 18361: PSM Representation for XSD Complex Type abstract query UML::NamedElement::getSupplierDependency():Set(UML::Dependency); /////////////tjd added // tjd added isPimComplexTypeSimpleContentRestriction // test if this is a restriction on a niem proxy (complexType), per Issue 18361: PSM Representation for XSD Complex Type with Simple Content query UML::Classifier::isProxyRestriction():Boolean=false; query UML::DataType::isProxyRestriction():Boolean=self.getRestrictions()->exists(r|not(r._mapping.oclIsUndefined())); // for given Classifier context, return <>s , part of Issue 18361: PSM Representation for XSD Complex Type with Simple Content query UML::Classifier::getRestrictions():Set(UML::Realization)= self.clientDependency ->select(d|d.isStereotypeApplied(NIEMRestrictionStereotype)).oclAsType(UML::Realization) ->asSet(); query UML::Property::referencesTopLevelProperty():UML::Property= self.clientDependency->select(d|d.IsStereotypeApplied(NIEMReferencesStereotype)) .supplier->select(s|s.oclIsKindOf(UML::Property)) .oclAsType(UML::Property)->asSequence()->first();