+ Pair<EnvironmentSpecification, Environment> pair = graph.syncRequest(new Read<Pair<EnvironmentSpecification, Environment>>() {
+ @Override
+ public Pair<EnvironmentSpecification, Environment> perform(ReadGraph graph) throws DatabaseException {
+ Resource indexRoot = graph.syncRequest(new IndexRoot(ontology));
+ return graph.syncRequest(new EnvironmentRequest(indexRoot) {
+ @Override
+ protected void fillEnvironmentSpecification(EnvironmentSpecification environmentSpecification) {
+ /*if(!moduleName.equals("http://www.simantics.org/Layer0-1.1")) { // Prevent cyclic dependencies
+ environmentSpecification.importModule(DB_MODULE, "");
+ environmentSpecification.importModule(VARIABLE_MODULE, "");
+ }*/
+ }
+ @Override
+ protected String getRootModuleName() {
+ return SCL_TYPES_NAME;
+ }
+ });
+ }
+ });
+ for(ImportDeclaration decl : pair.first.imports)
+ importDeclarations.add(decl.hidden());
+ this.environment = pair.second;