From f42954a45bea9f3e40090447804f33f12c080640 Mon Sep 17 00:00:00 2001 From: OszkarSemerath Date: Sat, 24 Mar 2018 21:44:49 -0400 Subject: upgraded attribute support for the graph solver --- .../InstanceModel2PartialInterpretation.xtend | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretation2logic/src') 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 { if(attribute.isMany) { val listOfTargets = source.eGet(attribute) as List for(target : listOfTargets) { - translateLink(interpretation,sourceElement,translateValue(target,ecore2LogicTrace,partialInterpretationTrace)) + val value = translateValue(target,ecore2LogicTrace,partialInterpretationTrace) + if(value != null) { + translateLink(interpretation,sourceElement,value) + } } } else { val target = source.eGet(attribute) if(target !== null) { - translateLink(interpretation,sourceElement,translateValue(target,ecore2LogicTrace,partialInterpretationTrace)) + val value = translateValue(target,ecore2LogicTrace,partialInterpretationTrace) + if(value != null) { + translateLink(interpretation,sourceElement,value) + } } } } @@ -131,6 +137,6 @@ class InstanceModel2PartialInterpretation { } dispatch protected def translateValue(Object value, Ecore2Logic_Trace ecore2LogicTrace, Problem2PartialInterpretationTrace partialInterpretationTrace) { - throw new UnsupportedOperationException('''Mapping of «value.class.simpleName» in partial models is currently not supported!''') + //throw new UnsupportedOperationException('''Mapping of «value.class.simpleName» in partial models is currently not supported!''') } } \ No newline at end of file -- cgit v1.2.3-54-g00ecf