Commit 37cfa2bc authored by Kyriakos Kritikos's avatar Kyriakos Kritikos

Uploading initial content for importer

parents
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry including="**/*.java" kind="src" output="target/classes" path="src">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
/target/
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>importer</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>
This diff is collapsed.
<?xml version="1.0" encoding="ASCII"?>
<camel:CamelModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camel="http://www.paasage.eu/camel" xmlns:organisation="http://www.paasage.eu/camel/organisation" xmlns:provider="http://www.paasage.eu/camel/provider" xmlns:type="http://www.paasage.eu/camel/type" xmlns:unit="http://www.paasage.eu/camel/unit" xsi:schemaLocation="http://www.paasage.eu/camel camel.ecore http://www.paasage.eu/camel/organisation camel.ecore#//organisation http://www.paasage.eu/camel/provider camel.ecore#//provider http://www.paasage.eu/camel/type camel.ecore#//type http://www.paasage.eu/camel/unit camel.ecore#//unit" name="Flexiant Camel Model">
<locationModels name="Flexiant Location">
<countries name="Scotland"/>
</locationModels>
<organisationModels name="Flexiant Organisation Model">
<provider name="Flexiant" www="www.flexiant.com" postalAddress="Flexiant Limited, Geddes House, Kirkton North, Livingston, EH54 6GU, UK" email="contact@flexiant.com" public="true" PaaS="true" IaaS="true" providerModel="//@providerModels.0"/>
<dataCentres name="Flexiant Data Centre" codeName="flexiant" location="//@locationModels.0/@countries.0" cloudProvider="//@organisationModels.0/@provider"/>
</organisationModels>
<providerModels name="Flexiant Provider Model">
<constraints xsi:type="provider:Implies" name="LOWEST_VM_Constraint_Mapping" from="//@providerModels.0/@rootFeature" to="//@providerModels.0/@rootFeature">
<attributeConstraints from="//@providerModels.0/@rootFeature/@attributes.0" to="//@providerModels.0/@rootFeature/@attributes.1">
<fromValue xsi:type="type:StringValue" value="LOWEST"/>
<toValue xsi:type="type:IntValue" value="512"/>
</attributeConstraints>
<attributeConstraints from="//@providerModels.0/@rootFeature/@attributes.0" to="//@providerModels.0/@rootFeature/@attributes.3">
<fromValue xsi:type="type:StringValue" value="LOWEST"/>
<toValue xsi:type="type:IntValue" value="1"/>
</attributeConstraints>
</constraints>
<constraints xsi:type="provider:Implies" name="LOWER_VM_Constraint_Mapping" from="//@providerModels.0/@rootFeature" to="//@providerModels.0/@rootFeature">
<attributeConstraints from="//@providerModels.0/@rootFeature/@attributes.0" to="//@providerModels.0/@rootFeature/@attributes.1">
<fromValue xsi:type="type:StringValue" value="LOWER"/>
<toValue xsi:type="type:IntValue" value="1024"/>
</attributeConstraints>
<attributeConstraints from="//@providerModels.0/@rootFeature/@attributes.0" to="//@providerModels.0/@rootFeature/@attributes.3">
<fromValue xsi:type="type:StringValue" value="LOWER"/>
<toValue xsi:type="type:IntValue" value="1"/>
</attributeConstraints>
</constraints>
<constraints xsi:type="provider:Implies" name="LOW_VM_Constraint_Mapping" from="//@providerModels.0/@rootFeature" to="//@providerModels.0/@rootFeature">
<attributeConstraints from="//@providerModels.0/@rootFeature/@attributes.0" to="//@providerModels.0/@rootFeature/@attributes.1">
<fromValue xsi:type="type:StringValue" value="LOW"/>
<toValue xsi:type="type:IntValue" value="2048"/>
</attributeConstraints>
<attributeConstraints from="//@providerModels.0/@rootFeature/@attributes.0" to="//@providerModels.0/@rootFeature/@attributes.3">
<fromValue xsi:type="type:StringValue" value="LOW"/>
<toValue xsi:type="type:IntValue" value="1"/>
</attributeConstraints>
</constraints>
<constraints xsi:type="provider:Implies" name="MEDIUM_VM_Constraint_Mapping" from="//@providerModels.0/@rootFeature" to="//@providerModels.0/@rootFeature">
<attributeConstraints from="//@providerModels.0/@rootFeature/@attributes.0" to="//@providerModels.0/@rootFeature/@attributes.1">
<fromValue xsi:type="type:StringValue" value="MEDIUM"/>
<toValue xsi:type="type:IntValue" value="2048"/>
</attributeConstraints>
<attributeConstraints from="//@providerModels.0/@rootFeature/@attributes.0" to="//@providerModels.0/@rootFeature/@attributes.3">
<fromValue xsi:type="type:StringValue" value="MEDIUM"/>
<toValue xsi:type="type:IntValue" value="2"/>
</attributeConstraints>
</constraints>
<constraints xsi:type="provider:Implies" name="HIGH_VM_Constraint_Mapping" from="//@providerModels.0/@rootFeature" to="//@providerModels.0/@rootFeature">
<attributeConstraints from="//@providerModels.0/@rootFeature/@attributes.0" to="//@providerModels.0/@rootFeature/@attributes.1">
<fromValue xsi:type="type:StringValue" value="HIGH"/>
<toValue xsi:type="type:IntValue" value="4096"/>
</attributeConstraints>
<attributeConstraints from="//@providerModels.0/@rootFeature/@attributes.0" to="//@providerModels.0/@rootFeature/@attributes.3">
<fromValue xsi:type="type:StringValue" value="HIGH"/>
<toValue xsi:type="type:IntValue" value="2"/>
</attributeConstraints>
</constraints>
<constraints xsi:type="provider:Implies" name="HIGHER_VM_Constraint_Mapping" from="//@providerModels.0/@rootFeature" to="//@providerModels.0/@rootFeature">
<attributeConstraints from="//@providerModels.0/@rootFeature/@attributes.0" to="//@providerModels.0/@rootFeature/@attributes.1">
<fromValue xsi:type="type:StringValue" value="HIGHER"/>
<toValue xsi:type="type:IntValue" value="4096"/>
</attributeConstraints>
<attributeConstraints from="//@providerModels.0/@rootFeature/@attributes.0" to="//@providerModels.0/@rootFeature/@attributes.3">
<fromValue xsi:type="type:StringValue" value="HIGHER"/>
<toValue xsi:type="type:IntValue" value="3"/>
</attributeConstraints>
</constraints>
<constraints xsi:type="provider:Implies" name="HIGHEST_VM_Constraint_Mapping" from="//@providerModels.0/@rootFeature" to="//@providerModels.0/@rootFeature">
<attributeConstraints from="//@providerModels.0/@rootFeature/@attributes.0" to="//@providerModels.0/@rootFeature/@attributes.1">
<fromValue xsi:type="type:StringValue" value="HIGHEST"/>
<toValue xsi:type="type:IntValue" value="4096"/>
</attributeConstraints>
<attributeConstraints from="//@providerModels.0/@rootFeature/@attributes.0" to="//@providerModels.0/@rootFeature/@attributes.3">
<fromValue xsi:type="type:StringValue" value="HIGHEST"/>
<toValue xsi:type="type:IntValue" value="4"/>
</attributeConstraints>
</constraints>
<rootFeature name="VM">
<attributes name="vmType">
<valueType xsi:type="type:Enumeration">
<values name="LOWEST"/>
<values value="1" name="LOWER"/>
<values value="2" name="LOW"/>
<values value="3" name="MEDIUM"/>
<values value="4" name="HIGH"/>
<values value="5" name="HIGHER"/>
<values value="6" name="HIGHEST"/>
</valueType>
</attributes>
<attributes name="vmMemory">
<valueType xsi:type="type:Range">
<lowerLimit included="true">
<value xsi:type="type:IntValue" value="512"/>
</lowerLimit>
<upperLimit included="true">
<value xsi:type="type:IntValue" value="4096"/>
</upperLimit>
</valueType>
</attributes>
<attributes name="vmStorage">
<valueType xsi:type="type:Range">
<lowerLimit included="true">
<value xsi:type="type:IntValue" value="1"/>
</lowerLimit>
<upperLimit included="true">
<value xsi:type="type:IntValue" value="1000"/>
</upperLimit>
</valueType>
</attributes>
<attributes name="vmCores">
<valueType xsi:type="type:Range">
<lowerLimit included="true">
<value xsi:type="type:IntValue" value="1"/>
</lowerLimit>
<upperLimit included="true">
<value xsi:type="type:IntValue" value="4"/>
</upperLimit>
</valueType>
</attributes>
<attributes name="vmOS">
<valueType xsi:type="type:Enumeration" name="VM_OS_ENUMERATION">
<values name="CentOS 6.2"/>
<values value="1" name="Ubuntu 12.04"/>
<values value="2" name="Ubuntu 14.04"/>
<values value="3" name="Windows 2008 R2"/>
</valueType>
</attributes>
<featureCardinality cardinalityMin="1" cardinalityMax="8" value="1"/>
</rootFeature>
</providerModels>
<units xsi:type="unit:MonetaryUnit" name="euros" unit="EUROS"/>
</camel:CamelModel>
This diff is collapsed.
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>eu.paasage.mddb.model</groupId>
<version>0.0.1-SNAPSHOT</version>
<artifactId>importer</artifactId>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source/>
<target/>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>eu.paasage.mddb.model.importer.ModelImporter</mainClass>
<arguments>
</arguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4</version>
<configuration>
<archive>
<manifest>
<mainClass>eu.paasage.mddb.model.importer.ModelImporter</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>eu.paasage</groupId>
<artifactId>camel</artifactId>
<version>2.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>eu.paasage.mddb.cdo</groupId>
<artifactId>client</artifactId>
<version>2.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.jena</groupId>
<artifactId>jena-core</artifactId>
<version>2.13.0</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
package eu.paasage.mddb.model.importer;
import java.io.File;
import java.net.URL;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
import org.eclipse.emf.cdo.eresource.CDOResource;
import org.eclipse.emf.cdo.eresource.CDOResourceFolder;
import org.eclipse.emf.cdo.transaction.CDOTransaction;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.util.EcoreUtil;
import eu.paasage.camel.Application;
import eu.paasage.camel.CamelFactory;
import eu.paasage.camel.CamelModel;
import eu.paasage.camel.CamelPackage;
import eu.paasage.camel.deployment.Component;
import eu.paasage.camel.deployment.DeploymentModel;
import eu.paasage.camel.deployment.VMRequirementSet;
import eu.paasage.camel.location.LocationModel;
import eu.paasage.camel.metric.ConditionContext;
import eu.paasage.camel.metric.MetricContext;
import eu.paasage.camel.metric.MetricModel;
import eu.paasage.camel.organisation.CloudProvider;
import eu.paasage.camel.organisation.Entity;
import eu.paasage.camel.organisation.Organisation;
import eu.paasage.camel.organisation.OrganisationModel;
import eu.paasage.camel.organisation.OrganisationPackage;
import eu.paasage.camel.organisation.User;
import eu.paasage.camel.provider.ProviderModel;
import eu.paasage.camel.requirement.LocationRequirement;
import eu.paasage.camel.requirement.OSOrImageRequirement;
import eu.paasage.camel.requirement.OptimisationRequirement;
import eu.paasage.camel.requirement.QuantitativeHardwareRequirement;
import eu.paasage.camel.requirement.Requirement;
import eu.paasage.camel.requirement.RequirementFactory;
import eu.paasage.camel.requirement.RequirementModel;
import eu.paasage.camel.requirement.ScaleRequirement;
import eu.paasage.camel.requirement.ServiceLevelObjective;
import eu.paasage.camel.scalability.ScalabilityModel;
import eu.paasage.mddb.cdo.client.CDOClient;
import eu.paasage.mddb.model.importer.location.LocationGenerator;
public class ModelImporter {
private boolean inCdo = false;
private CDOClient cl = null;
public ModelImporter(){
}
public ModelImporter(boolean inCdo){
this.inCdo = inCdo;
cl = new CDOClient();
}
public boolean importLocationModels(String path, String outputPath){
LocationGenerator lg = new LocationGenerator(path);
LocationModel lm = lg.getLocationModel();
if (lm != null){
boolean stored = false;
if (inCdo){
boolean created = createCDOFolderStructure(outputPath,null);
if (created) stored = cl.storeModel(lm, outputPath + "/" + outputPath, true);
}
else{
stored = cl.exportModel(lm, outputPath);
}
return stored;
}
return false;
}
private boolean createCDOFolderStructure(String path,String subPath){
try{
CDOTransaction trans = cl.openTransaction();
trans.getOrCreateResourceFolder(path);
if (subPath != null && !subPath.isEmpty()) trans.getOrCreateResourceFolder(path + "/" + subPath);
trans.commit();
trans.close();
return true;
}
catch(Exception e){
System.out.println("Something went wrong while creating Root Folder for Providers in CDO Repository");
e.printStackTrace();
}
return false;
}
public boolean importProviderModels(String dirPath){
if (inCdo){
File f = new File(dirPath);
if (f.exists() && f.isDirectory()){
boolean created = createCDOFolderStructure("/orgs","providers");
if (created){
File[] files = f.listFiles();
for (File file: files){
EObject model = cl.loadModel(file.getAbsolutePath());
if (model instanceof CamelModel){
CamelModel cm = (CamelModel)model;
EList<OrganisationModel> oms = cm.getOrganisationModels();
if (oms != null && !oms.isEmpty()){
OrganisationModel om = oms.get(0);
CloudProvider cp = om.getProvider();
if (cp != null){
String name = cp.getName();
boolean created2 = createCDOFolderStructure("/orgs/providers",name);
cl.storeModel(model,"/orgs/providers/" + name + "/" + name,true);
}
}
}
}
}
}
}
return false;
}
private boolean processUseCaseModel(EObject model){
if (model instanceof CamelModel){
CamelModel cm = (CamelModel)model;
OrganisationModel om = cm.getOrganisationModels().get(0);
String orgName = null;
String providerName = null;
Organisation org = om.getOrganisation();
boolean stored = false;
String orgPath = null;
EcoreUtil.Copier copier = new EcoreUtil.Copier();
User user = (User)copier.copy(om.getUsers().get(0));
Application app = (Application)copier.copy(cm.getApplications().get(0));
if (org != null){
orgName = org.getName();
boolean created = createCDOFolderStructure("/orgs",orgName);
if (created){
for (User u: om.getUsers()) u.getRequirementModels().clear();
stored = cl.storeModel(om, "/orgs/" + orgName + "/" + orgName, true);
}
orgPath = "/orgs/" + orgName;
}
else{
CloudProvider cp = om.getProvider();
providerName = cp.getName();
boolean created = createCDOFolderStructure("/orgs/providers",providerName);
if (created){
for (User u: om.getUsers()) u.getRequirementModels().clear();
ProviderModel pm = cp.getProviderModel();
if (pm != null){
CamelModel newModel = CamelFactory.eINSTANCE.createCamelModel();
newModel.setName("Provider " + providerName + " Camel Model");
newModel.getOrganisationModels().add(om);
newModel.getProviderModels().add(pm);
stored = cl.storeModel(newModel, "/orgs/providers/" + providerName + "/" + providerName, true);
}
else{
stored = cl.storeModel(om, "/orgs/providers/" + providerName + "/" + providerName, true);
}
}
orgPath = "/orgs/providers/" + providerName;
}
if (stored){
String userEmail = user.getEmail();
createCDOFolderStructure(orgPath,userEmail);
cm.getOrganisationModels().clear();
cm.getProviderModels().clear();
Entity ent = app.getOwner();
if (ent instanceof User){
User u = (User)ent;
if (u.getEmail().equals(user.getEmail())){
app.setOwner(null);
}
}
String userPath = orgPath + "/" + userEmail;
stored = cl.storeModel(cm, userPath + "/" + userEmail, false);
if (stored){
try{
CDOTransaction trans = cl.openTransaction();
OrganisationModel om2 = (OrganisationModel)trans.getOrCreateResource(orgPath + "/" + orgName).getContents().get(0);
CamelModel cm2 = (CamelModel)trans.getOrCreateResource(userPath + "/" + userEmail).getContents().get(0);
User u = trans.createQuery("hql", "select u from User u where u.email='" + user.getEmail() + "'").getResult(User.class).get(0);
u.getRequirementModels().addAll(cm2.getRequirementModels());
for (Application a: cm2.getApplications()) a.setOwner(u);
trans.commit();
trans.close();
}
catch(Exception e){
e.printStackTrace();
}
cl.exportModel(orgPath + "/" + orgName, OrganisationModel.class, "output/OrgModel.xmi");
cl.exportModel(userPath + "/" + userEmail, CamelModel.class, "output/UserModel.xmi");
}
}
}
return false;
}
public boolean importUseCaseModels(){
URL url = cl.getClass().getResource("/Scalarm.xmi");
EObject model = cl.loadModel(url);
boolean processed = processUseCaseModel(model);
return processed;
}
public void finish(){
cl.closeSession();
}
public static void main(String[] args){
ModelImporter mi = new ModelImporter(true);
//mi.importLocationModels("input/geopolitical.owl", "output/locations.xmi");
mi.importLocationModels("input/geopolitical.owl", "locations");
mi.importProviderModels("input/providers");
mi.importUseCaseModels();
mi.finish();
System.exit(0);
}
}
package eu.paasage.mddb.model.importer.location;
import java.io.FileInputStream;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
import org.eclipse.emf.common.util.EList;
import com.hp.hpl.jena.ontology.Individual;
import com.hp.hpl.jena.ontology.OntModel;
import com.hp.hpl.jena.ontology.OntModelSpec;
import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.rdf.model.Property;
import com.hp.hpl.jena.rdf.model.Resource;
import com.hp.hpl.jena.rdf.model.Statement;
import com.hp.hpl.jena.rdf.model.StmtIterator;
import com.hp.hpl.jena.util.iterator.ExtendedIterator;
import eu.paasage.camel.location.GeographicalRegion;
import eu.paasage.camel.location.Country;
import eu.paasage.camel.location.LocationFactory;
import eu.paasage.camel.location.LocationModel;
public class LocationGenerator {
private String path;
private LocationModel lm = null;
public LocationGenerator(String path){
this.path = path;
loadLocationModel();
}
public LocationModel getLocationModel(){
return lm;
}
private void loadLocationModel(){
OntModel base = ModelFactory.createOntologyModel( OntModelSpec.OWL_MEM );
try{
Model model = base.read(new FileInputStream(path), null);
if (model != null){
String NS = "http://aims.fao.org/aos/geopolitical.owl#";
Resource region = base.getResource(NS + "geographical_region");
Resource selfGoverning = base.getResource(NS + "self_governing");
Hashtable<String,GeographicalRegion> uriToGeographicalRegion = new Hashtable<String,GeographicalRegion>();
Hashtable<String,List<Country>> regionToCountry = new Hashtable<String,List<Country>>();
//Hashtable<String,GeographicalRegion> nameToGeographicalRegion = new Hashtable<String,GeographicalRegion>();
ExtendedIterator<Individual> regionIt = base.listIndividuals(region);
Property name = base.getProperty(NS + "nameOfficialEN");
Property officialFrName = base.getProperty(NS + "nameOfficialFR");
Property officialItName = base.getProperty(NS + "nameOfficialIT");
Property officialEsName = base.getProperty(NS + "nameOfficialES");
Property nameShort = base.getProperty(NS + "nameShortEN");
Property nameShortFr = base.getProperty(NS + "nameShortFR");
Property nameShortIt = base.getProperty(NS + "nameShortIT");
Property nameShortEs = base.getProperty(NS + "nameShortES");
Property inGroup = base.getProperty(NS + "isInGroup");
Property code = base.getProperty(NS + "codeISO2");
if (regionIt.hasNext()){
lm = LocationFactory.eINSTANCE.createLocationModel();
lm.setName("Locations");
System.out.println("Got regions: " + regionIt);
List<Individual> regions = regionIt.toList();
for (Individual ind: regions){
//GeographicalRegion creation plus official name handling
Statement st = ind.getProperty(name);
GeographicalRegion cn = LocationFactory.eINSTANCE.createGeographicalRegion();
String officialName = st.getString();
/*if (officialName.equals("Americas")) officialName = "America";
else if (officialName.equals("south-eastern Asia")) officialName = "south-Eastern Asia";*/
cn.setName(officialName);
EList<String> alternativeNames = cn.getAlternativeNames();
st = ind.getProperty(officialFrName);
alternativeNames.add(st.getString());
st = ind.getProperty(officialItName);
alternativeNames.add(st.getString());
st = ind.getProperty(officialEsName);
alternativeNames.add(st.getString());
// Short name handling
st = ind.getProperty(nameShort);
alternativeNames.add(st.getString());
st = ind.getProperty(nameShortFr);
alternativeNames.add(st.getString());
st = ind.getProperty(nameShortIt);
alternativeNames.add(st.getString());
st = ind.getProperty(nameShortEs);
alternativeNames.add(st.getString());
//Updating of location model and hash tables
lm.getRegions().add(cn);
uriToGeographicalRegion.put(ind.getURI(), cn);
}
ExtendedIterator<Individual> countryIt = base.listIndividuals(selfGoverning);
List<Individual> countries = countryIt.toList();
for (Individual ind: countries){
//Country creation plus official name handling
Statement st = ind.getProperty(name);
if (st == null) continue;
Country cn = LocationFactory.eINSTANCE.createCountry();
String officialName = st.getString();