diff options
Diffstat (limited to 'Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretation2logic/src')
1 files changed, 9 insertions, 3 deletions
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretation2logic/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretation2logic/InstanceModel2PartialInterpretation.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretation2logic/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretation2logic/InstanceModel2PartialInterpretation.xtend index d9c1b8f6..761e77b1 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretation2logic/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretation2logic/InstanceModel2PartialInterpretation.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretation2logic/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretation2logic/InstanceModel2PartialInterpretation.xtend | |||
@@ -104,12 +104,18 @@ class InstanceModel2PartialInterpretation { | |||
104 | if(attribute.isMany) { | 104 | if(attribute.isMany) { |
105 | val listOfTargets = source.eGet(attribute) as List<? extends EObject> | 105 | val listOfTargets = source.eGet(attribute) as List<? extends EObject> |
106 | for(target : listOfTargets) { | 106 | for(target : listOfTargets) { |
107 | translateLink(interpretation,sourceElement,translateValue(target,ecore2LogicTrace,partialInterpretationTrace)) | 107 | val value = translateValue(target,ecore2LogicTrace,partialInterpretationTrace) |
108 | if(value != null) { | ||
109 | translateLink(interpretation,sourceElement,value) | ||
110 | } | ||
108 | } | 111 | } |
109 | } else { | 112 | } else { |
110 | val target = source.eGet(attribute) | 113 | val target = source.eGet(attribute) |
111 | if(target !== null) { | 114 | if(target !== null) { |
112 | translateLink(interpretation,sourceElement,translateValue(target,ecore2LogicTrace,partialInterpretationTrace)) | 115 | val value = translateValue(target,ecore2LogicTrace,partialInterpretationTrace) |
116 | if(value != null) { | ||
117 | translateLink(interpretation,sourceElement,value) | ||
118 | } | ||
113 | } | 119 | } |
114 | } | 120 | } |
115 | } | 121 | } |
@@ -131,6 +137,6 @@ class InstanceModel2PartialInterpretation { | |||
131 | } | 137 | } |
132 | 138 | ||
133 | dispatch protected def translateValue(Object value, Ecore2Logic_Trace ecore2LogicTrace, Problem2PartialInterpretationTrace partialInterpretationTrace) { | 139 | dispatch protected def translateValue(Object value, Ecore2Logic_Trace ecore2LogicTrace, Problem2PartialInterpretationTrace partialInterpretationTrace) { |
134 | throw new UnsupportedOperationException('''Mapping of «value.class.simpleName» in partial models is currently not supported!''') | 140 | //throw new UnsupportedOperationException('''Mapping of «value.class.simpleName» in partial models is currently not supported!''') |
135 | } | 141 | } |
136 | } \ No newline at end of file | 142 | } \ No newline at end of file |