Argument argument;
MultiEntityNode multiEntityNode;
RDFIndividual individualOne;
RDFIndividual individualTwo;
OWLObjectProperty objectProperty;
OWLNamedClass domainResidentNodePr = this.getOwlModel().getOWLNamedClass(DOMAIN_RESIDENT);
Collection instances = domainResidentNodePr.getInstances(true);
MFrag mFragOfNode = null;
for (Iterator it = instances.iterator(); it.hasNext();) {
individualOne = (RDFIndividual) it.next();
domainResidentNode = getMapDomainResidentNode().get(individualOne
.getBrowserText());
if (domainResidentNode == null) {
throw new IOMebnException(
getResource().getString("DomainResidentNotExistsInMTheory"),
individualOne.getBrowserText());
}
Debug.println("Domain Resident loaded: "
+ individualOne.getBrowserText());
domainResidentNode.setDescription(getDescription(individualOne));
/* -> isResidentNodeIn */
objectProperty = (OWLObjectProperty) getOwlModel()
.getOWLObjectProperty("isResidentNodeIn");
instances = individualOne.getPropertyValues(objectProperty);
Iterator itAux = instances.iterator();
individualTwo = (RDFIndividual) itAux.next();
domainMFrag = getMapDomainMFrag().get(individualTwo.getBrowserText());
if (domainMFrag.containsDomainResidentNode(domainResidentNode) == false) {
throw new IOMebnException(
getResource().getString("DomainResidentNotExistsInDomainMFrag"));
}
mFragOfNode = domainMFrag;
Debug.println("-> " + individualOne.getBrowserText() + ": "
+ objectProperty.getBrowserText() + " = "
+ individualTwo.getBrowserText());
/* -> hasArgument */
objectProperty = (OWLObjectProperty) getOwlModel()
.getOWLObjectProperty("hasArgument");
instances = individualOne.getPropertyValues(objectProperty);
for (Iterator itIn = instances.iterator(); itIn.hasNext();) {
individualTwo = (RDFIndividual) itIn.next();
argument = new Argument(individualTwo.getBrowserText(),
domainResidentNode);
domainResidentNode.addArgument(argument);
getMapArgument().put(individualTwo.getBrowserText(), argument);
Debug.println("-> " + individualOne.getBrowserText() + ": "
+ objectProperty.getBrowserText() + " = "
+ individualTwo.getBrowserText());
}
/* -> hasParent */
objectProperty = (OWLObjectProperty) getOwlModel()
.getOWLObjectProperty("hasParent");
instances = individualOne.getPropertyValues(objectProperty);
for (Iterator itIn = instances.iterator(); itIn.hasNext();) {
individualTwo = (RDFIndividual) itIn.next();
if (getMapDomainResidentNode().containsKey(individualTwo
.getBrowserText())) {
ResidentNode aux = getMapDomainResidentNode().get(individualTwo
.getBrowserText());
Edge auxEdge = new Edge(aux, domainResidentNode);
try {
mFragOfNode.addEdge(auxEdge);
} catch (Exception e) {
Debug.println("Erro: arco invalido!!!");
}
} else {
if (getMapGenerativeInputNode().containsKey(individualTwo
.getBrowserText())) {
InputNode aux = getMapGenerativeInputNode()
.get(individualTwo.getBrowserText());
Edge auxEdge = new Edge(aux, domainResidentNode);
try {
mFragOfNode.addEdge(auxEdge);
} catch (Exception e) {
Debug.println("Erro: arco invalido!!!");
}
} else {
throw new IOMebnException(
getResource().getString("NodeNotFound"),
individualTwo.getBrowserText());
}
}
Debug.println("-> " + individualOne.getBrowserText() + ": "
+ objectProperty.getBrowserText() + " = "
+ individualTwo.getBrowserText());
}
/* -> hasInputInstance */
objectProperty = (OWLObjectProperty) getOwlModel()
.getOWLObjectProperty("hasInputInstance");
instances = individualOne.getPropertyValues(objectProperty);
for (Iterator itIn = instances.iterator(); itIn.hasNext();) {
individualTwo = (RDFIndividual) itIn.next();
generativeInputNode = getMapGenerativeInputNode().get(individualTwo
.getBrowserText());
try {
generativeInputNode.setInputInstanceOf(domainResidentNode);
} catch (Exception e) {
e.printStackTrace();
}
Debug.println("-> " + individualOne.getBrowserText() + ": "
+ objectProperty.getBrowserText() + " = "
+ individualTwo.getBrowserText());
}
/* -> isInnerTermOf */
objectProperty = (OWLObjectProperty) getOwlModel()
.getOWLObjectProperty("isInnerTermOf");
instances = individualOne.getPropertyValues(objectProperty);
itAux = instances.iterator();
for (Iterator itIn = instances.iterator(); itIn.hasNext();) {
individualTwo = (RDFIndividual) itIn.next();
multiEntityNode = getMapMultiEntityNode().get(individualTwo
.getBrowserText());
domainResidentNode.addInnerTermFromList(multiEntityNode);
multiEntityNode.addInnerTermOfList(domainResidentNode);
Debug.println("-> " + individualOne.getBrowserText() + ": "
+ objectProperty.getBrowserText() + " = "
+ individualTwo.getBrowserText());
}
/* -> hasPossibleValues */
{
CategoricalStateEntity state = null;
objectProperty = (OWLObjectProperty) getOwlModel()
.getOWLObjectProperty("hasPossibleValues");
instances = individualOne.getPropertyValues(objectProperty);
itAux = instances.iterator();
for (Object instance : instances) {
individualTwo = (RDFIndividual) instance;
String stateName = individualTwo.getBrowserText();
/* case 1: booleans states */
if (stateName.equals("true")) {
StateLink link = domainResidentNode
.addPossibleValueLink(getMebn()
.getBooleanStatesEntityContainer()
.getTrueStateEntity());
List<String> globallyObjects = getMapBooleanStateGloballyObjects()
.get("true");
if (globallyObjects.contains(domainResidentNode
.getName())) {
link.setGloballyExclusive(true);
} else {
link.setGloballyExclusive(false);
}
domainResidentNode
.setTypeOfStates(IResidentNode.BOOLEAN_RV_STATES);
} else {
if (stateName.equals("false")) {
StateLink link = domainResidentNode
.addPossibleValueLink(getMebn()
.getBooleanStatesEntityContainer()
.getFalseStateEntity());
List<String> globallyObjects = getMapBooleanStateGloballyObjects()
.get("false");
if (globallyObjects.contains(domainResidentNode
.getName())) {
link.setGloballyExclusive(true);
} else {
link.setGloballyExclusive(false);
}
domainResidentNode
.setTypeOfStates(IResidentNode.BOOLEAN_RV_STATES);
} else {
if (stateName.equals("absurd")) {
StateLink link = domainResidentNode
.addPossibleValueLink(getMebn()
.getBooleanStatesEntityContainer()
.getAbsurdStateEntity());
List<String> globallyObjects = getMapBooleanStateGloballyObjects()
.get("absurd");
if (globallyObjects.contains(domainResidentNode
.getName())) {
link.setGloballyExclusive(true);
} else {
link.setGloballyExclusive(false);
}
domainResidentNode
.setTypeOfStates(IResidentNode.BOOLEAN_RV_STATES);
} else {
if (getMapTypes().get(stateName) != null) {
/* case 2:object entities */
StateLink link = domainResidentNode
.addPossibleValueLink(getMapTypes()
.get(stateName));
domainResidentNode
.setTypeOfStates(IResidentNode.OBJECT_ENTITY);
} else {
/* case 3: categorical states */
try {
state = getMebn()
.getCategoricalStatesEntityContainer()
.getCategoricalState(
individualTwo
.getBrowserText());
StateLink link = domainResidentNode
.addPossibleValueLink(state);
List<String> globallyObjects = getMapCategoricalStateGloballyObjects()
.get(state.getName());
if (globallyObjects
.contains(domainResidentNode
.getName())) {
link.setGloballyExclusive(true);
} else {
link.setGloballyExclusive(false);
}
domainResidentNode
.setTypeOfStates(IResidentNode.CATEGORY_RV_STATES);
} catch (CategoricalStateDoesNotExistException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}
}
} /* for */
}
/* hasProbDist */
OWLObjectProperty hasProbDist = (OWLObjectProperty) getOwlModel()
.getOWLObjectProperty("hasProbDist");
OWLDatatypeProperty hasDeclaration = getOwlModel()
.getOWLDatatypeProperty("hasDeclaration");
String cpt = null;
for (Iterator iter = individualOne.getPropertyValues(hasProbDist)