diff options
Diffstat (limited to 'Application/hu.bme.mit.inf.dslreasoner.application/src/hu')
-rw-r--r-- | Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/QueryLoader.xtend | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/QueryLoader.xtend b/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/QueryLoader.xtend index 5a73845d..277a1d5f 100644 --- a/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/QueryLoader.xtend +++ b/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/QueryLoader.xtend | |||
@@ -51,7 +51,8 @@ class QueryLoader { | |||
51 | .map[lookup(pattern2Specification)] | 51 | .map[lookup(pattern2Specification)] |
52 | .toSet | 52 | .toSet |
53 | val derivedFeatures = calculateDerivedFeatures(patterns.referredEcoreModels,patterns.map[it.lookup(pattern2Specification)]) | 53 | val derivedFeatures = calculateDerivedFeatures(patterns.referredEcoreModels,patterns.map[it.lookup(pattern2Specification)]) |
54 | 54 | // patternsToTranslate.forEach[println(it.fullyQualifiedName)] | |
55 | // if (true) throw new Exception | ||
55 | return new ViatraQuerySetDescriptor( | 56 | return new ViatraQuerySetDescriptor( |
56 | patternsToTranslate, | 57 | patternsToTranslate, |
57 | validationPatterns, | 58 | validationPatterns, |
@@ -130,6 +131,7 @@ class QueryLoader { | |||
130 | val features = packages.map[EClassifiers].flatten.filter(EClass).map[it.EStructuralFeatures].flatten | 131 | val features = packages.map[EClassifiers].flatten.filter(EClass).map[it.EStructuralFeatures].flatten |
131 | val res = new HashMap | 132 | val res = new HashMap |
132 | for(feature : features) { | 133 | for(feature : features) { |
134 | /* | ||
133 | val QBFAnnotation = feature.EAnnotations.filter[it.source.equals("org.eclipse.viatra.query.querybasedfeature")].head | 135 | val QBFAnnotation = feature.EAnnotations.filter[it.source.equals("org.eclipse.viatra.query.querybasedfeature")].head |
134 | if(QBFAnnotation !== null) { | 136 | if(QBFAnnotation !== null) { |
135 | val targetFQN = QBFAnnotation.details.get("patternFQN") | 137 | val targetFQN = QBFAnnotation.details.get("patternFQN") |
@@ -141,7 +143,24 @@ class QueryLoader { | |||
141 | res.put(referredPattern, feature) | 143 | res.put(referredPattern, feature) |
142 | } | 144 | } |
143 | } | 145 | } |
146 | */ | ||
147 | if (feature.derived){ | ||
148 | //TODO we can check if feature is not from the ECORE MM | ||
149 | //TODO we can check that the found pattern has a "@QueryBasedFeature" annotation | ||
150 | val referredPattern = patterns.filter[ | ||
151 | val fqnSplit = it.fullyQualifiedName.split("\\.") | ||
152 | val patName = fqnSplit.get(fqnSplit.length - 1) | ||
153 | patName.equals(feature.name) | ||
154 | ].head | ||
155 | if(referredPattern!== null) { | ||
156 | res.put(referredPattern, feature) | ||
157 | } | ||
158 | } | ||
144 | } | 159 | } |
160 | // if (!res.empty) { | ||
161 | // println("Derived Features") | ||
162 | // res.entrySet.forEach[println(it)] | ||
163 | // } | ||
145 | return res | 164 | return res |
146 | } | 165 | } |
147 | } | 166 | } |