From 60e98e246f1431384717f7c72c8e74d96bb47f68 Mon Sep 17 00:00:00 2001 From: Arno Date: Thu, 27 Jun 2024 14:55:41 +0200 Subject: [PATCH 1/3] Add ValueMap.clear(). --- .../tests/ValueMapTest.java | 14 +++++++++ .../model/qualitypatternmodel.aird | 14 ++++++++- .../model/qualitypatternmodel.ecore | 1 + .../model/qualitypatternmodel.genmodel | 1 + .../TextrepresentationPackage.java | 29 ++++++++++++++++++- .../textrepresentation/ValueMap.java | 8 +++++ .../impl/ParameterFragmentImpl.java | 1 + .../impl/TextrepresentationPackageImpl.java | 13 +++++++++ .../textrepresentation/impl/ValueMapImpl.java | 14 +++++++++ 9 files changed, 93 insertions(+), 2 deletions(-) diff --git a/qualitypatternmodel.tests/src/qualitypatternmodel/textrepresentation/tests/ValueMapTest.java b/qualitypatternmodel.tests/src/qualitypatternmodel/textrepresentation/tests/ValueMapTest.java index 5c751787..c5338ebd 100644 --- a/qualitypatternmodel.tests/src/qualitypatternmodel/textrepresentation/tests/ValueMapTest.java +++ b/qualitypatternmodel.tests/src/qualitypatternmodel/textrepresentation/tests/ValueMapTest.java @@ -22,6 +22,7 @@ *
  • {@link qualitypatternmodel.textrepresentation.ValueMap#getKey(java.lang.String) Get Key}
  • *
  • {@link qualitypatternmodel.textrepresentation.ValueMap#addAll(java.util.Map) Add All}
  • *
  • {@link qualitypatternmodel.textrepresentation.ValueMap#generateVariantJSONObject() Generate Variant JSON Object}
  • + *
  • {@link qualitypatternmodel.textrepresentation.ValueMap#clear() Clear}
  • * *

    * @generated @@ -175,4 +176,17 @@ public void testGenerateVariantJSONObject() { fail(); } + /** + * Tests the '{@link qualitypatternmodel.textrepresentation.ValueMap#clear() Clear}' operation. + * + * + * @see qualitypatternmodel.textrepresentation.ValueMap#clear() + * @generated + */ + public void testClear() { + // TODO: implement this operation test method + // Ensure that you remove @generated or mark it @generated NOT + fail(); + } + } //ValueMapTest diff --git a/qualitypatternmodel/model/qualitypatternmodel.aird b/qualitypatternmodel/model/qualitypatternmodel.aird index cd977f5a..1be3be04 100644 --- a/qualitypatternmodel/model/qualitypatternmodel.aird +++ b/qualitypatternmodel/model/qualitypatternmodel.aird @@ -4,7 +4,7 @@ qualitypatternmodel.ecore - + @@ -2782,6 +2782,10 @@ + + + + @@ -14034,6 +14038,14 @@ + + + + + + + + diff --git a/qualitypatternmodel/model/qualitypatternmodel.ecore b/qualitypatternmodel/model/qualitypatternmodel.ecore index 19133881..fb673403 100644 --- a/qualitypatternmodel/model/qualitypatternmodel.ecore +++ b/qualitypatternmodel/model/qualitypatternmodel.ecore @@ -1289,6 +1289,7 @@ + + diff --git a/qualitypatternmodel/src/qualitypatternmodel/textrepresentation/TextrepresentationPackage.java b/qualitypatternmodel/src/qualitypatternmodel/textrepresentation/TextrepresentationPackage.java index d77e246d..1ad01e30 100644 --- a/qualitypatternmodel/src/qualitypatternmodel/textrepresentation/TextrepresentationPackage.java +++ b/qualitypatternmodel/src/qualitypatternmodel/textrepresentation/TextrepresentationPackage.java @@ -840,6 +840,15 @@ public interface TextrepresentationPackage extends EPackage { */ int VALUE_MAP___GENERATE_VARIANT_JSON_OBJECT = 5; + /** + * The operation id for the 'Clear' operation. + * + * + * @generated + * @ordered + */ + int VALUE_MAP___CLEAR = 6; + /** * The number of operations of the 'Value Map' class. * @@ -847,7 +856,7 @@ public interface TextrepresentationPackage extends EPackage { * @generated * @ordered */ - int VALUE_MAP_OPERATION_COUNT = 6; + int VALUE_MAP_OPERATION_COUNT = 7; /** * The meta object id for the 'Object Wrapper' data type. @@ -1461,6 +1470,16 @@ public interface TextrepresentationPackage extends EPackage { */ EOperation getValueMap__GenerateVariantJSONObject(); + /** + * Returns the meta object for the '{@link qualitypatternmodel.textrepresentation.ValueMap#clear() Clear}' operation. + * + * + * @return the meta object for the 'Clear' operation. + * @see qualitypatternmodel.textrepresentation.ValueMap#clear() + * @generated + */ + EOperation getValueMap__Clear(); + /** * Returns the meta object for data type '{@link java.lang.Object Object Wrapper}'. * @@ -1979,6 +1998,14 @@ interface Literals { */ EOperation VALUE_MAP___GENERATE_VARIANT_JSON_OBJECT = eINSTANCE.getValueMap__GenerateVariantJSONObject(); + /** + * The meta object literal for the 'Clear' operation. + * + * + * @generated + */ + EOperation VALUE_MAP___CLEAR = eINSTANCE.getValueMap__Clear(); + /** * The meta object literal for the 'Object Wrapper' data type. * diff --git a/qualitypatternmodel/src/qualitypatternmodel/textrepresentation/ValueMap.java b/qualitypatternmodel/src/qualitypatternmodel/textrepresentation/ValueMap.java index 9e05342c..086d8d9f 100644 --- a/qualitypatternmodel/src/qualitypatternmodel/textrepresentation/ValueMap.java +++ b/qualitypatternmodel/src/qualitypatternmodel/textrepresentation/ValueMap.java @@ -100,4 +100,12 @@ public interface ValueMap extends EObject { */ JSONObject generateVariantJSONObject(); + /** + * + * + * @model + * @generated + */ + void clear(); + } // ValueMap diff --git a/qualitypatternmodel/src/qualitypatternmodel/textrepresentation/impl/ParameterFragmentImpl.java b/qualitypatternmodel/src/qualitypatternmodel/textrepresentation/impl/ParameterFragmentImpl.java index 35a04282..02cd2bd0 100644 --- a/qualitypatternmodel/src/qualitypatternmodel/textrepresentation/impl/ParameterFragmentImpl.java +++ b/qualitypatternmodel/src/qualitypatternmodel/textrepresentation/impl/ParameterFragmentImpl.java @@ -691,6 +691,7 @@ public void clearValue() { for(Parameter p : getParameter()) p.clear(); setUserValue(null); + getValueMap().clear(); } @Override diff --git a/qualitypatternmodel/src/qualitypatternmodel/textrepresentation/impl/TextrepresentationPackageImpl.java b/qualitypatternmodel/src/qualitypatternmodel/textrepresentation/impl/TextrepresentationPackageImpl.java index e1b95c49..85574077 100644 --- a/qualitypatternmodel/src/qualitypatternmodel/textrepresentation/impl/TextrepresentationPackageImpl.java +++ b/qualitypatternmodel/src/qualitypatternmodel/textrepresentation/impl/TextrepresentationPackageImpl.java @@ -800,6 +800,16 @@ public EOperation getValueMap__GenerateVariantJSONObject() { return valueMapEClass.getEOperations().get(5); } + /** + * + * + * @generated + */ + @Override + public EOperation getValueMap__Clear() { + return valueMapEClass.getEOperations().get(6); + } + /** * * @@ -921,6 +931,7 @@ public void createPackageContents() { createEOperation(valueMapEClass, VALUE_MAP___GET_KEY__STRING); createEOperation(valueMapEClass, VALUE_MAP___ADD_ALL__MAP); createEOperation(valueMapEClass, VALUE_MAP___GENERATE_VARIANT_JSON_OBJECT); + createEOperation(valueMapEClass, VALUE_MAP___CLEAR); // Create data types objectWrapperEDataType = createEDataType(OBJECT_WRAPPER); @@ -1087,6 +1098,8 @@ public void initializePackageContents() { initEOperation(getValueMap__GenerateVariantJSONObject(), this.getJSONObjectWrapper(), "generateVariantJSONObject", 0, 1, IS_UNIQUE, IS_ORDERED); + initEOperation(getValueMap__Clear(), null, "clear", 0, 1, IS_UNIQUE, IS_ORDERED); + // Initialize data types initEDataType(objectWrapperEDataType, Object.class, "ObjectWrapper", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); initEDataType(jsonObjectWrapperEDataType, JSONObject.class, "JSONObjectWrapper", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); diff --git a/qualitypatternmodel/src/qualitypatternmodel/textrepresentation/impl/ValueMapImpl.java b/qualitypatternmodel/src/qualitypatternmodel/textrepresentation/impl/ValueMapImpl.java index 07a2f813..8f2e25ac 100644 --- a/qualitypatternmodel/src/qualitypatternmodel/textrepresentation/impl/ValueMapImpl.java +++ b/qualitypatternmodel/src/qualitypatternmodel/textrepresentation/impl/ValueMapImpl.java @@ -200,6 +200,17 @@ public JSONObject generateVariantJSONObject() { return result; } + /** + * + * + * @generated NOT + */ + @Override + public void clear() { + getKeys().clear(); + getValues().clear(); + } + /** * * @@ -294,6 +305,9 @@ public Object eInvoke(int operationID, EList arguments) throws InvocationTarg return null; case TextrepresentationPackage.VALUE_MAP___GENERATE_VARIANT_JSON_OBJECT: return generateVariantJSONObject(); + case TextrepresentationPackage.VALUE_MAP___CLEAR: + clear(); + return null; } return super.eInvoke(operationID, arguments); } From 2cbcf737cca8b7d0ec3ec39010fa05074e5173b4 Mon Sep 17 00:00:00 2001 From: Arno Date: Thu, 27 Jun 2024 15:33:35 +0200 Subject: [PATCH 2/3] Small fix. --- .../textrepresentation/impl/ParameterFragmentImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qualitypatternmodel/src/qualitypatternmodel/textrepresentation/impl/ParameterFragmentImpl.java b/qualitypatternmodel/src/qualitypatternmodel/textrepresentation/impl/ParameterFragmentImpl.java index 02cd2bd0..a131b057 100644 --- a/qualitypatternmodel/src/qualitypatternmodel/textrepresentation/impl/ParameterFragmentImpl.java +++ b/qualitypatternmodel/src/qualitypatternmodel/textrepresentation/impl/ParameterFragmentImpl.java @@ -691,7 +691,7 @@ public void clearValue() { for(Parameter p : getParameter()) p.clear(); setUserValue(null); - getValueMap().clear(); + getAttributeMap().clear(); } @Override From 3ab223b4204f56ef49e77151f8674c71433630e9 Mon Sep 17 00:00:00 2001 From: Arno Date: Thu, 27 Jun 2024 16:47:33 +0200 Subject: [PATCH 3/3] Move constraint-specific information to extra file. --- .../GenericPatternInformation.java | 100 +++++++++ .../initialisation/GenericPatterns.java | 200 +++++++++--------- 2 files changed, 199 insertions(+), 101 deletions(-) create mode 100644 qualitypatternmodel/src/qualitypatternmodel/newservlets/initialisation/GenericPatternInformation.java diff --git a/qualitypatternmodel/src/qualitypatternmodel/newservlets/initialisation/GenericPatternInformation.java b/qualitypatternmodel/src/qualitypatternmodel/newservlets/initialisation/GenericPatternInformation.java new file mode 100644 index 00000000..26b65093 --- /dev/null +++ b/qualitypatternmodel/src/qualitypatternmodel/newservlets/initialisation/GenericPatternInformation.java @@ -0,0 +1,100 @@ +package qualitypatternmodel.newservlets.initialisation; + +public class GenericPatternInformation { + + static String CARD_NAME = "Card"; + static String CARD_ID_GENERIC = "Card_generic"; + static String CARD_SHORTDESCR = "Cardinality Constraint"; + static String CARD_DESCR = "Check, wether the occurence count of specific elements apply."; + + static String COMP_NAME = "Comp"; + static String COMP_ID_GENERIC = "Comp_generic"; + static String COMP_SHORTDESCR = "Comparison Pattern"; + static String COMP_DESCR = "Check, wether the occurence count of specific elements apply."; + + static String COMPSET_NAME = "CompSet"; + static String COMPSET_ID_GENERIC = "CompSet_generic"; + static String COMPSET_SHORTDESCR = "Comparison Pattern with Set"; + static String COMPSET_DESCR = "Check, wether the value of fields are within a list of allowed (/forbidden) terms."; + + static String FUNC_NAME = "Func"; + static String FUNC_ID_GENERIC = "Func_generic"; + static String FUNC_SHORTDESCR = "Functional Dependency Constraint"; + static String FUNC_DESCR = "Validate a dependency between two subordinate fields is valid in comparison to data records next to it."; + + static String UNIQUE_NAME = "Unique"; + static String UNIQUE_ID_GENERIC = "Unique_generic"; + static String UNIQUE_SHORTDESCR = "Uniqueness Constraint"; + static String UNIQUE_DESCR = "Check, whether a value is unique within the dataset."; + + static String MATCH_NAME = "Match"; + static String MATCH_ID_GENERIC = "Match_generic"; + static String MATCH_SHORTDESCR = "Regular Expression Check"; + static String MATCH_DESCR = "Check, whether a value matches a specific regular expression."; + + static String CONTAINS_NAME = "Contains"; + static String CONTAINS_ID_GENERIC = "Contains_generic"; + static String CONTAINS_SHORTDESCR = "Contains Check"; + static String CONTAINS_DESCR = "Check, whether a value contains a specific substring."; + + static String APPDUP2_NAME = "Appdup2"; + static String APPDUP2_ID_GENERIC = "Appdup2_generic"; + static String APPDUP2_SHORTDESCR = "Approximate Duplicate based on two attributes"; + static String APPDUP2_DESCR = "Check whether there are records that have the same value in two important attributes, suggesting that they describe the same real-world object."; + + static String APPDUP3_NAME = "Appdup3"; + static String APPDUP3_ID_GENERIC = "Appdup2_generic"; + static String APPDUP3_SHORTDESCR = "Approximate Duplicate based on three attributes"; + static String APPDUP3_DESCR = "Check whether there are records that have the same value in three important attributes, suggesting that they describe the same real-world object."; + + static String DUPVAL_NAME = "DupVal"; + static String DUPVAL_ID_GENERIC = "DupVal_generic"; + static String DUPVAL_SHORTDESCR = "Duplicate value"; + static String DUPVAL_DESCR = "Check whether a record has the same value in two distinct fields."; + + static String INVALIDLINK_NAME = "InvalidLink_generic"; + static String INVALIDLINK_ID_GENERIC = "InvalidLink_generic"; + static String INVALIDLINK_SHORTDESCR = "Invalid Link"; + static String INVALIDLINK_DESCR = "Check whether a record an invalid link in a field."; + + static String MANDATT_NAME = "MandAtt"; + static String MANDATT_ID_GENERIC = "MandAtt_generic"; + static String MANDATT_SHORTDESCR = "Mandatory Attribute"; + static String MANDATT_DESCR = "Check whether a record has a mandatory field."; + + static String STRINGLENGTH_NAME = "StringLength"; + static String STRINGLENGTH_ID_GENERIC = "StringLength_generic"; + static String STRINGLENGTH_SHORTDESCR = "String value length restriction"; + static String STRINGLENGTH_DESCR = "Check whether all field values comply to the length restriction."; + + static String COMPVAL_NAME = "CompVal"; + static String COMPVAL_ID_GENERIC = "CompVal_generic"; + static String COMPVAL_SHORTDESCR = "Compare Values"; + static String COMPVAL_DESCR = "Check whether all values of a specific field within a record does comply to a value restriction."; + + static String LOCALUNIQUE_NAME = "LocalUnique"; + static String LOCALUNIQUE_ID_GENERIC = "LocalUnique_generic"; + static String LOCALUNIQUE_SHORTDESCR = "Local Unique Attribute Constraint"; + static String LOCALUNIQUE_DESCR = "Check whether all field values are unique within a record."; + + static String COMPVALANY_NAME = "CompValAny"; + static String COMPVALANY_ID_GENERIC = "CompValAny_generic"; + static String COMPVALANY_SHORTDESCR = "Compare values within a record"; + static String COMPVALANY_DESCR = "Check whether any value of a specific field within a record does comply to a value restriction."; + + static String CARDIMPLIESMANDATT_NAME = "CardImpliesMandAtt"; + static String CARDIMPLIESMANDATT_ID_GENERIC = "CardImpliesMandAtt_generic"; + static String CARDIMPLIESMANDATT_SHORTDESCR = "Mandatory Attribute based on Cardinality Constraint"; + static String CARDIMPLIESMANDATT_DESCR = "Check whether a attribute exists, that is mandatory on specific cardinalities of a field."; + + static String CHECKFORMAT_NAME = "CheckFormat"; + static String CHECKFORMAT_ID_GENERIC = "CheckFormat_generic"; + static String CHECKFORMAT_SHORTDESCR = "Check the format of a resource"; + static String CHECKFORMAT_DESCR = "Check if the ressource under an URL is of a specific format."; + + static String COMPDATABASE_NAME = "CompDatabase"; + static String COMPDATABASE_ID_GENERIC = "CompDatabase_generic"; + static String COMPDATABASE_SHORTDESCR = "Fieldvalue in Database"; + static String COMPDATABASE_DESCR = "Check whether all values in a field are in a database."; + +} diff --git a/qualitypatternmodel/src/qualitypatternmodel/newservlets/initialisation/GenericPatterns.java b/qualitypatternmodel/src/qualitypatternmodel/newservlets/initialisation/GenericPatterns.java index bed20c15..74d10709 100644 --- a/qualitypatternmodel/src/qualitypatternmodel/newservlets/initialisation/GenericPatterns.java +++ b/qualitypatternmodel/src/qualitypatternmodel/newservlets/initialisation/GenericPatterns.java @@ -124,15 +124,14 @@ public static CompletePattern getConcrete(CompletePattern pattern, Language lan, public static CompletePattern getGenericCard() throws InvalidityException, OperatorCycleException, MissingPatternContainerException { CompletePattern pattern = PatternstructureFactory.eINSTANCE.createCompletePattern(); - pattern.setPatternId("Card_generic"); - pattern.setAbstractId("Card_generic"); - pattern.setName("Card"); - pattern.setShortDescription("Cardinality Constraint"); - pattern.setDescription("Check, wether the occurence count of specific elements apply."); + pattern.setPatternId(GenericPatternInformation.CARD_ID_GENERIC); + pattern.setAbstractId(GenericPatternInformation.CARD_ID_GENERIC); + pattern.setName(GenericPatternInformation.CARD_NAME); + pattern.setShortDescription(GenericPatternInformation.CARD_SHORTDESCR); + pattern.setDescription(GenericPatternInformation.CARD_DESCR); // Context graph of pattern: Node returnNode = pattern.getGraph().getNodes().get(0).makeComplex(); - returnNode.setName("RecordElement"); // First-order logic condition of pattern: CountCondition countCondition = PatternstructureFactory.eINSTANCE.createCountCondition(); @@ -149,7 +148,6 @@ public static CompletePattern getGenericCard() throws InvalidityException, Opera Node countReturn = returnNode.addOutgoing(countCondition.getCountPattern().getGraph()).getTarget().makePrimitive(); // countReturn = countReturn.makePrimitive(); countReturn = countReturn.makeComplex(); - countReturn.setName("PropertyToCount"); countReturn.setReturnNode(true); pattern.isValid(AbstractionLevel.GENERIC); @@ -158,11 +156,11 @@ public static CompletePattern getGenericCard() throws InvalidityException, Opera public static CompletePattern getGenericComp() throws InvalidityException, OperatorCycleException, MissingPatternContainerException { CompletePattern pattern = PatternstructureFactory.eINSTANCE.createCompletePattern(); - pattern.setPatternId("Comp_generic"); - pattern.setAbstractId("Comp_generic"); - pattern.setName("Comp"); - pattern.setShortDescription("Comparison Pattern"); - pattern.setDescription("Check, wether the occurence count of specific elements apply."); + pattern.setPatternId(GenericPatternInformation.COMP_ID_GENERIC); + pattern.setAbstractId(GenericPatternInformation.COMP_ID_GENERIC); + pattern.setName(GenericPatternInformation.COMP_NAME); + pattern.setShortDescription(GenericPatternInformation.COMP_SHORTDESCR); + pattern.setDescription(GenericPatternInformation.COMP_DESCR); Graph graph1 = pattern.getGraph(); Node returnNode = graph1.getReturnNodes().get(0).makeComplex(); @@ -186,11 +184,11 @@ public static CompletePattern getGenericComp() throws InvalidityException, Opera public static CompletePattern getGenericCompSet() throws InvalidityException, OperatorCycleException, MissingPatternContainerException { CompletePattern pattern = PatternstructureFactory.eINSTANCE.createCompletePattern(); - pattern.setPatternId("CompSet_generic"); - pattern.setAbstractId("CompSet_generic"); - pattern.setName("CompSet"); - pattern.setShortDescription("Comparison Pattern with Set"); - pattern.setDescription("Check, wether the vallue of fields are within a list of allowed (/forbidden) wo."); + pattern.setPatternId(GenericPatternInformation.COMPSET_ID_GENERIC); + pattern.setAbstractId(GenericPatternInformation.COMPSET_ID_GENERIC); + pattern.setName(GenericPatternInformation.COMPSET_NAME); + pattern.setShortDescription(GenericPatternInformation.COMPSET_SHORTDESCR); + pattern.setDescription(GenericPatternInformation.COMPSET_DESCR); Graph graph1 = pattern.getGraph(); Node returnNode = graph1.getReturnNodes().get(0).makeComplex(); @@ -215,11 +213,11 @@ public static CompletePattern getGenericCompSet() throws InvalidityException, Op public static CompletePattern getGenericFunc() throws InvalidityException, OperatorCycleException, MissingPatternContainerException { CompletePattern pattern = PatternstructureFactory.eINSTANCE.createCompletePattern(); - pattern.setPatternId("Func_generic"); - pattern.setAbstractId("Func_generic"); - pattern.setName("Func"); - pattern.setShortDescription("Functional Dependency Constraint"); - pattern.setDescription("Validate a dependency between two subordinate fields is valid in comparison to data records next to it."); + pattern.setPatternId(GenericPatternInformation.FUNC_ID_GENERIC); + pattern.setAbstractId(GenericPatternInformation.FUNC_ID_GENERIC); + pattern.setName(GenericPatternInformation.FUNC_NAME); + pattern.setShortDescription(GenericPatternInformation.FUNC_SHORTDESCR); + pattern.setDescription(GenericPatternInformation.FUNC_DESCR); QuantifiedCondition qc = PatternstructureFactory.eINSTANCE.createQuantifiedCondition(); @@ -254,11 +252,11 @@ public static CompletePattern getGenericFunc() throws InvalidityException, Opera public static CompletePattern getGenericUnique() throws InvalidityException, OperatorCycleException, MissingPatternContainerException { CompletePattern pattern = PatternstructureFactory.eINSTANCE.createCompletePattern(); - pattern.setPatternId("Unique_generic"); - pattern.setAbstractId("Unique_generic"); - pattern.setName("Unique"); - pattern.setShortDescription("Uniqueness Constraint"); - pattern.setDescription("Check, whether a value is unique within the dataset."); + pattern.setPatternId(GenericPatternInformation.UNIQUE_ID_GENERIC); + pattern.setAbstractId(GenericPatternInformation.UNIQUE_ID_GENERIC); + pattern.setName(GenericPatternInformation.UNIQUE_NAME); + pattern.setShortDescription(GenericPatternInformation.UNIQUE_SHORTDESCR); + pattern.setDescription(GenericPatternInformation.UNIQUE_DESCR); // NotCondition notCon = PatternstructureFactory.eINSTANCE.createNotCondition(); // pattern.setCondition(notCon); @@ -286,11 +284,11 @@ public static CompletePattern getGenericUnique() throws InvalidityException, Ope public static CompletePattern getGenericMatch() throws InvalidityException, OperatorCycleException, MissingPatternContainerException { CompletePattern pattern = PatternstructureFactory.eINSTANCE.createCompletePattern(); - pattern.setPatternId("Match_generic"); - pattern.setAbstractId("Match_generic"); - pattern.setName("Match"); - pattern.setShortDescription("Regular Expression Check"); - pattern.setDescription("Check, whether a value matches a specific regular expression."); + pattern.setPatternId(GenericPatternInformation.MATCH_ID_GENERIC); + pattern.setAbstractId(GenericPatternInformation.MATCH_ID_GENERIC); + pattern.setName(GenericPatternInformation.MATCH_NAME); + pattern.setShortDescription(GenericPatternInformation.MATCH_SHORTDESCR); + pattern.setDescription(GenericPatternInformation.MATCH_DESCR); pattern.getGraph().getReturnNodes().get(0).makeComplex(); @@ -310,11 +308,11 @@ public static CompletePattern getGenericMatch() throws InvalidityException, Oper public static CompletePattern getGenericContains() throws InvalidityException, OperatorCycleException, MissingPatternContainerException { CompletePattern pattern = PatternstructureFactory.eINSTANCE.createCompletePattern(); - pattern.setPatternId("Contains_generic"); - pattern.setAbstractId("Contains_generic"); - pattern.setName("Contains"); - pattern.setShortDescription("Contains Check"); - pattern.setDescription("Check, whether a value contains a specific substring."); + pattern.setPatternId(GenericPatternInformation.CONTAINS_ID_GENERIC); + pattern.setAbstractId(GenericPatternInformation.CONTAINS_ID_GENERIC); + pattern.setName(GenericPatternInformation.CONTAINS_NAME); + pattern.setShortDescription(GenericPatternInformation.CONTAINS_SHORTDESCR); + pattern.setDescription(GenericPatternInformation.CONTAINS_DESCR); // Context graph of pattern: pattern.getGraph().getReturnNodes().get(0).makeComplex(); @@ -337,11 +335,11 @@ public static CompletePattern getGenericContains() throws InvalidityException, O public static CompletePattern getGenericAppdup2() throws InvalidityException, OperatorCycleException, MissingPatternContainerException { CompletePattern pattern = PatternstructureFactory.eINSTANCE.createCompletePattern(); - pattern.setPatternId("Appdup2_generic"); - pattern.setAbstractId("Appdup2_generic"); - pattern.setName("Appdup2"); - pattern.setShortDescription("Approximate Duplicate based on two attributes"); - pattern.setDescription("Check whether there are records that have the same value in two important attributes, suggesting that they describe the same real-world object."); + pattern.setPatternId(GenericPatternInformation.APPDUP2_ID_GENERIC); + pattern.setAbstractId(GenericPatternInformation.APPDUP2_ID_GENERIC); + pattern.setName(GenericPatternInformation.APPDUP2_NAME); + pattern.setShortDescription(GenericPatternInformation.APPDUP2_SHORTDESCR); + pattern.setDescription(GenericPatternInformation.APPDUP2_DESCR); pattern.getGraph().getReturnNodes().get(0).makeComplex(); pattern.getGraph().getReturnNodes().get(0).setName("main"); @@ -373,11 +371,11 @@ public static CompletePattern getGenericAppdup2() throws InvalidityException, Op public static CompletePattern getGenericAppdup3() throws InvalidityException, OperatorCycleException, MissingPatternContainerException { CompletePattern pattern = getGenericAppdup2(); - pattern.setPatternId("Appdup3_generic"); - pattern.setAbstractId("Appdup3_generic"); - pattern.setName("Appdup3"); - pattern.setShortDescription("Approximate Duplicate based on three attributes"); - pattern.setDescription("Check whether there are records that have the same value in three important attributes, suggesting that they describe the same real-world object."); + pattern.setPatternId(GenericPatternInformation.APPDUP3_ID_GENERIC); + pattern.setAbstractId(GenericPatternInformation.APPDUP3_ID_GENERIC); + pattern.setName(GenericPatternInformation.APPDUP3_NAME); + pattern.setShortDescription(GenericPatternInformation.APPDUP3_SHORTDESCR); + pattern.setDescription(GenericPatternInformation.APPDUP3_DESCR); Graph g0 = pattern.getGraph(); QuantifiedCondition qc1 = (QuantifiedCondition) pattern.getCondition(); @@ -395,11 +393,11 @@ public static CompletePattern getGenericAppdup3() throws InvalidityException, Op public static CompletePattern getGenericDupVal() throws InvalidityException, OperatorCycleException, MissingPatternContainerException { CompletePattern pattern = PatternstructureFactory.eINSTANCE.createCompletePattern(); - pattern.setPatternId("DupVal_generic"); - pattern.setAbstractId("DupVal_generic"); - pattern.setName("DupVal"); - pattern.setShortDescription("Duplicate value"); - pattern.setDescription("Check whether a record has the same value in two distinct fields."); + pattern.setPatternId(GenericPatternInformation.DUPVAL_ID_GENERIC); + pattern.setAbstractId(GenericPatternInformation.DUPVAL_ID_GENERIC); + pattern.setName(GenericPatternInformation.DUPVAL_NAME); + pattern.setShortDescription(GenericPatternInformation.DUPVAL_SHORTDESCR); + pattern.setDescription(GenericPatternInformation.DUPVAL_DESCR); ComplexNode main = (ComplexNode) pattern.getGraph().getReturnNodes().get(0).makeComplex(); main.setName("main"); @@ -437,11 +435,11 @@ public static CompletePattern getGenericDupVal() throws InvalidityException, Ope public static CompletePattern getGenericInvalidLink() throws InvalidityException, OperatorCycleException, MissingPatternContainerException { CompletePattern pattern = PatternstructureFactory.eINSTANCE.createCompletePattern(); - pattern.setPatternId("InvalidLink_generic"); - pattern.setAbstractId("InvalidLink_generic"); - pattern.setName("InvalidLink"); - pattern.setShortDescription("Invalid Link"); - pattern.setDescription("Check whether a record an invalid link in a field."); + pattern.setPatternId(GenericPatternInformation.INVALIDLINK_ID_GENERIC); + pattern.setAbstractId(GenericPatternInformation.INVALIDLINK_ID_GENERIC); + pattern.setName(GenericPatternInformation.INVALIDLINK_NAME); + pattern.setShortDescription(GenericPatternInformation.INVALIDLINK_SHORTDESCR); + pattern.setDescription(GenericPatternInformation.INVALIDLINK_DESCR); ComplexNode main = (ComplexNode) pattern.getGraph().getReturnNodes().get(0).makeComplex(); main.setName("main"); @@ -461,11 +459,11 @@ public static CompletePattern getGenericInvalidLink() throws InvalidityException public static CompletePattern getGenericMandAtt() throws InvalidityException, OperatorCycleException, MissingPatternContainerException { CompletePattern pattern = PatternstructureFactory.eINSTANCE.createCompletePattern(); - pattern.setPatternId("MandAtt_generic"); - pattern.setAbstractId("MandAtt_generic"); - pattern.setName("MandAtt"); - pattern.setShortDescription("Mandatory Attribute"); - pattern.setDescription("Check whether a record has a mandatory field."); + pattern.setPatternId(GenericPatternInformation.MANDATT_ID_GENERIC); + pattern.setAbstractId(GenericPatternInformation.MANDATT_ID_GENERIC); + pattern.setName(GenericPatternInformation.MANDATT_NAME); + pattern.setShortDescription(GenericPatternInformation.MANDATT_SHORTDESCR); + pattern.setDescription(GenericPatternInformation.MANDATT_DESCR); ComplexNode main = (ComplexNode) pattern.getGraph().getReturnNodes().get(0).makeComplex(); main.setName("main"); @@ -482,11 +480,11 @@ public static CompletePattern getGenericMandAtt() throws InvalidityException, Op public static CompletePattern getGenericStringLength() throws InvalidityException, OperatorCycleException, MissingPatternContainerException { CompletePattern pattern = PatternstructureFactory.eINSTANCE.createCompletePattern(); - pattern.setPatternId("StringLength_generic"); - pattern.setAbstractId("StringLength_generic"); - pattern.setName("StringLength"); - pattern.setShortDescription("String value length restriction"); - pattern.setDescription("Check whether all field values comply to the length restriction."); + pattern.setPatternId(GenericPatternInformation.STRINGLENGTH_ID_GENERIC); + pattern.setAbstractId(GenericPatternInformation.STRINGLENGTH_ID_GENERIC); + pattern.setName(GenericPatternInformation.STRINGLENGTH_NAME); + pattern.setShortDescription(GenericPatternInformation.STRINGLENGTH_SHORTDESCR); + pattern.setDescription(GenericPatternInformation.STRINGLENGTH_DESCR); ComplexNode main = (ComplexNode) pattern.getGraph().getReturnNodes().get(0).makeComplex(); main.setName("main"); @@ -508,11 +506,11 @@ public static CompletePattern getGenericStringLength() throws InvalidityExceptio public static CompletePattern getGenericCompVal() throws InvalidityException, OperatorCycleException, MissingPatternContainerException { CompletePattern pattern = PatternstructureFactory.eINSTANCE.createCompletePattern(); - pattern.setPatternId("CompVal_generic"); - pattern.setAbstractId("CompVal_generic"); - pattern.setName("CompVal"); - pattern.setShortDescription(""); - pattern.setDescription("Check whether all values of a specific field within a record does comply to a value restriction."); + pattern.setPatternId(GenericPatternInformation.COMPVAL_ID_GENERIC); + pattern.setAbstractId(GenericPatternInformation.COMPVAL_ID_GENERIC); + pattern.setName(GenericPatternInformation.COMPVAL_NAME); + pattern.setShortDescription(GenericPatternInformation.COMPVAL_SHORTDESCR); + pattern.setDescription(GenericPatternInformation.COMPVAL_DESCR); ComplexNode main = (ComplexNode) pattern.getGraph().getReturnNodes().get(0).makeComplex(); main.setName("main"); @@ -531,59 +529,59 @@ public static CompletePattern getGenericCompVal() throws InvalidityException, Op // public static CompletePattern getGenericLocalUnique() throws InvalidityException, OperatorCycleException, MissingPatternContainerException { // CompletePattern pattern = PatternstructureFactory.eINSTANCE.createCompletePattern(); -// pattern.setPatternId("LocalUnique_generic"); -// pattern.setAbstractId("LocalUnique_generic"); -// pattern.setName("LocalUnique"); -// pattern.setShortDescription("Local Unique Attribute Value"); -// pattern.setDescription("Check whether all field values are unique within a record."); +// pattern.setPatternId(GenericPatternInformation.LOCALUNIQUE_ID_GENERIC); +// pattern.setAbstractId(GenericPatternInformation.LOCALUNIQUE_ID_GENERIC); +// pattern.setName(GenericPatternInformation.LOCALUNIQUE_NAME); +// pattern.setShortDescription(GenericPatternInformation.LOCALUNIQUE_SHORTDESCR); +// pattern.setDescription(GenericPatternInformation.LOCALUNIQUE_DESCR); // // TODO // pattern.isValid(AbstractionLevel.GENERIC); // return pattern; // } - +// // public static CompletePattern getGenericCompValAny() throws InvalidityException, OperatorCycleException, MissingPatternContainerException { // CompletePattern pattern = PatternstructureFactory.eINSTANCE.createCompletePattern(); -// pattern.setPatternId("CompValAny_generic"); -// pattern.setAbstractId("CompValAny_generic"); -// pattern.setName("CompValAny"); -// pattern.setShortDescription(""); -// pattern.setDescription("Check whether any value of a specific field within a record does comply to a value restriction."); +// pattern.setPatternId(GenericPatternInformation.COMPVALANY_ID_GENERIC); +// pattern.setAbstractId(GenericPatternInformation.COMPVALANY_ID_GENERIC); +// pattern.setName(GenericPatternInformation.COMPVALANY_NAME); +// pattern.setShortDescription(GenericPatternInformation.COMPVALANY_SHORTDESCR); +// pattern.setDescription(GenericPatternInformation.COMPVALANY_DESCR); // // TODO // pattern.isValid(AbstractionLevel.GENERIC); // return pattern; // } - +// // public static CompletePattern getGenericCardImpliesMandAtt() throws InvalidityException, OperatorCycleException, MissingPatternContainerException { // CompletePattern pattern = PatternstructureFactory.eINSTANCE.createCompletePattern(); -// pattern.setPatternId("CardImpliesMandAtt_generic"); -// pattern.setAbstractId("CardImpliesMandAtt_generic"); -// pattern.setName("CardImpliesMandAtt"); -// pattern.setShortDescription("Mandatory Attribute based on Cardinality Constraint"); -// pattern.setDescription("Check whether a attribute exists, that is mandatory on specific cardinalities of a field."); +// pattern.setPatternId(GenericPatternInformation.CARDIMPLIESMANDATT_ID_GENERIC); +// pattern.setAbstractId(GenericPatternInformation.CARDIMPLIESMANDATT_ID_GENERIC); +// pattern.setName(GenericPatternInformation.CARDIMPLIESMANDATT_NAME); +// pattern.setShortDescription(GenericPatternInformation.CARDIMPLIESMANDATT_SHORTDESCR); +// pattern.setDescription(GenericPatternInformation.CARDIMPLIESMANDATT_DESCR); // // TODO // pattern.isValid(AbstractionLevel.GENERIC); // return pattern; // } - +// // public static CompletePattern getGenericCheckFormat() throws InvalidityException, OperatorCycleException, MissingPatternContainerException { // CompletePattern pattern = PatternstructureFactory.eINSTANCE.createCompletePattern(); -// pattern.setPatternId("CheckFormat_generic"); -// pattern.setAbstractId("CheckFormat_generic"); -// pattern.setName("CheckFormat"); -// pattern.setShortDescription("Check the format of a resource."); -// pattern.setDescription("Check if the ressource under an URL is of a specific format."); +// pattern.setPatternId(GenericPatternInformation.CHECKFORMAT_ID_GENERIC); +// pattern.setAbstractId(GenericPatternInformation.CHECKFORMAT_ID_GENERIC); +// pattern.setName(GenericPatternInformation.CHECKFORMAT_NAME); +// pattern.setShortDescription(GenericPatternInformation.CHECKFORMAT_SHORTDESCR); +// pattern.setDescription(GenericPatternInformation.CHECKFORMAT_DESCR); // // TODO // pattern.isValid(AbstractionLevel.GENERIC); // return pattern; // } - +// // public static CompletePattern getGenericCompDatabase() throws InvalidityException, OperatorCycleException, MissingPatternContainerException { // CompletePattern pattern = PatternstructureFactory.eINSTANCE.createCompletePattern(); -// pattern.setPatternId("CompDatabase_generic"); -// pattern.setAbstractId("CompDatabase_generic"); -// pattern.setName("CompDatabase"); -// pattern.setShortDescription("Fieldvalue in Database"); -// pattern.setDescription("Check whether all values in a field are in a database."); +// pattern.setPatternId(GenericPatternInformation.COMPDATABASE_ID_GENERIC); +// pattern.setAbstractId(GenericPatternInformation.COMPDATABASE_ID_GENERIC); +// pattern.setName(GenericPatternInformation.COMPDATABASE_NAME); +// pattern.setShortDescription(GenericPatternInformation.COMPDATABASE_SHORTDESCR); +// pattern.setDescription(GenericPatternInformation.COMPDATABASE_DESCR); // // TODO // pattern.isValid(AbstractionLevel.GENERIC); // return pattern;