Skip to content

Commit

Permalink
Issue #36 DOMConv Deprecation_FinalCleanup - DOMProtAttr
Browse files Browse the repository at this point in the history
IMTool/LDDTool Conversion from MOF to DOM model; Final cleanup; Focus on DOMProtAttr and similar methods.

		1) 	DOMProtAttr.java 51   AttrDefn - Done.
				deprecate - AttrDefn lddUserAttribute

		2) DOMPermValDefn.java 62 AttrDefn, PermValueDefn - Done.
				deprecate createDOMPermValSingletons
				deprecate createDOMPermValSingletonsDOM

		3) GenSchematronRules.java  -> GenDOMRules - Validated change.
			  deprecate GenSchematronRules.java
			  update GetDOMModel - remove GenSchematronRules
			  deprecate GetModels - references GenSchematronRules

		4) DOMUseCase - Done.
		    InfoModel -> DOMInfoModel

		5) DOMDataType - Done.
	     Deprecate	- createDOMDataTypeSingletons
  • Loading branch information
jshughes committed Sep 7, 2019
1 parent 14a4b46 commit f7bb732
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 97 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,40 +167,6 @@ public void setPattern(ArrayList<String> pattern) {
this.pattern = pattern;
}

public void createDOMDataTypeSingletons (DataTypeDefn lDataTypeDefn) {
// rdfIdentifier = "TBD";
// identifier = "TBD";
versionId = "TBD";
// sequenceId= "TBD";

title = lDataTypeDefn.title;
// definition = lUnitDefn.description;

// registrationStatus = lUnitDefn.registrationStatus;
// isDeprecated = lUnitDefn.isDeprecated;

regAuthId = DMDocument.masterNameSpaceIdNCLC;
steward = DMDocument.masterNameSpaceIdNCLC;
nameSpaceId = DMDocument.masterNameSpaceIdNCLC;
nameSpaceIdNC = DMDocument.masterNameSpaceIdNCLC;

type = lDataTypeDefn.type;
character_constraint = lDataTypeDefn.character_constraint;
formation_rule = lDataTypeDefn.formation_rule;
maximum_characters = lDataTypeDefn.maximum_characters;
maximum_value = lDataTypeDefn.maximum_value;
minimum_characters = lDataTypeDefn.minimum_characters;
minimum_value = lDataTypeDefn.minimum_value;
xml_schema_base_type = lDataTypeDefn.xml_schema_base_type;
character_encoding = lDataTypeDefn.character_encoding;

for (Iterator <String> i = lDataTypeDefn.pattern.iterator(); i.hasNext();) {
String lPattern = (String) i.next();
this.pattern.add(lPattern);
}
return;
}

// new - not currently being used - needs testing
public void setDataTypeAttrs (DOMClass lClass) {
this.setIdentifier (DMDocument.masterNameSpaceIdNCLC, lClass.title);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,64 +58,4 @@ public DOMPermValDefn (String lId, String lValue, String lValueMeaning) {
value_begin_date = "TBD_value_begin_date";
value_end_date = "TBD_value_end_date";
}

public void createDOMPermValSingletons (PermValueDefn lPermValue, AttrDefn lOldAttr) {
sequenceId = InfoModel.getNextUId();
// rdfIdentifier = lOldAttr.rdfIdentifier;
String lValueId = lPermValue.value;
if (isPattern) lValueId = "Pattern"; // pattern characters (e.g., back slashes) are invalid for OWL RDF identifiers.
int lValueLength = lValueId.length();
if (lValueLength > 20) lValueId = lValueId.substring(0, 20);
rdfIdentifier = DMDocument.rdfPrefix + lOldAttr.parentClassTitle + "." + lOldAttr.title + "." + lValueId + "." + sequenceId;
int lHashCodeI = lPermValue.value.hashCode();
String lHashCodeS = Integer.toString(lHashCodeI);
identifier = lOldAttr.identifier + "." + lValueId + "." + lHashCodeS;
versionId = lOldAttr.versionId;
sequenceId = lOldAttr.uid;

// title = lOldAttr.title;
// definition = lOldAttr.description;

registrationStatus = lPermValue.registrationStatus;
// isDeprecated = lOldProp.isDeprecated;

regAuthId = lOldAttr.regAuthId;
steward = lOldAttr.steward;
nameSpaceId = lOldAttr.attrNameSpaceId;
nameSpaceIdNC = lOldAttr.attrNameSpaceIdNC;

searchKey = lPermValue.searchKey;
value = lPermValue.value;
value_meaning = lPermValue.value_meaning;
value_begin_date = lPermValue.value_begin_date;
value_end_date = lPermValue.value_end_date;
return;
}

public void createDOMPermValSingletonsDOM (String lValue, String lValueMeaning, DOMAttr lAttr) {
sequenceId = InfoModel.getNextUId();
String lValueId = lValue;
if (lAttr.title.compareTo("pattern") == 0) {
isPattern = true;
lValueId = "Pattern"; // pattern characters (e.g., back slashes) are invalid for OWL RDF identifiers.
}
int lValueLength = lValueId.length();
if (lValueLength > 20) lValueId = lValueId.substring(0, 20);
rdfIdentifier = DMDocument.rdfPrefix + lAttr.parentClassTitle + "." + lAttr.title + "." + lValueId + "." + sequenceId;
int lHashCodeI = lValue.hashCode();
String lHashCodeS = Integer.toString(lHashCodeI);
identifier = lAttr.identifier + "." + lValueId + "." + lHashCodeS;
versionId = lAttr.versionId;
title = identifier;
registrationStatus = "TBD_registrationStatus";
regAuthId = lAttr.regAuthId;
steward = lAttr.steward;
nameSpaceId = lAttr.nameSpaceId;
nameSpaceIdNC = lAttr.nameSpaceIdNC;
value = lValue;
value_meaning = lValueMeaning;
value_begin_date = "TBD_value_begin_date";
value_end_date = "TBD_value_end_date";
return;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public class DOMProtAttr extends ISOClassOAIS11179 {
String dataConcept; // for CD
String classWord; // for nomenclature rules
String lddLocalIdentifier; // LDD local identifier
AttrDefn lddUserAttribute; // the USER attribute used to initialize the LDD attribute

String xmlBaseDataType; // the XML base data type
String protValType; // value type from protege model
Expand Down Expand Up @@ -102,7 +101,6 @@ public DOMProtAttr () {
dataConcept = "TBD_dataConcept";
classWord = "TBD_classWord";
lddLocalIdentifier = "TBD_lddLocalIdentifier";
lddUserAttribute = null;

xmlBaseDataType = "TBD_XML_Base_Data_Type";
protValType = "TBD_Protege_Value_type";
Expand Down Expand Up @@ -197,6 +195,7 @@ public ArrayList <DOMPropComp> convertToDOMPropCompArr () {
lDomPropCompArr.add(lDomPropComp);
} else {
System.out.println(">>error - Could not find the class referenced in an association - identifier:" + this.identifier + " Class:" + lClassTitle);
System.out.println(">>error - Could not find the class referenced in an association - identifier:" + this.identifier + " lClassMemberIdentifier:" + lClassMemberIdentifier);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@ public DOMUseCase (String id) {
}

public void setRDFIdentifier () {
rdfIdentifier = DMDocument.rdfPrefix + "." + identifier + "." + InfoModel.getNextUId();
rdfIdentifier = DMDocument.rdfPrefix + "." + identifier + "." + DOMInfoModel.getNextUId();
}
}

0 comments on commit f7bb732

Please sign in to comment.