1 package org.simantics.db.layer0.request;
3 import java.util.ArrayList;
6 import org.simantics.databoard.Bindings;
7 import org.simantics.db.ReadGraph;
8 import org.simantics.db.Resource;
9 import org.simantics.db.common.request.ResourceRead;
10 import org.simantics.db.exception.DatabaseException;
11 import org.simantics.db.layer0.util.Layer0Utils;
12 import org.simantics.layer0.Layer0;
14 public class GlobalOntologies extends ResourceRead<List<Resource>> {
16 public GlobalOntologies(Resource root) {
21 public List<Resource> perform(ReadGraph graph) throws DatabaseException {
22 Layer0 L0 = Layer0.getInstance(graph);
23 ArrayList<Resource> result = new ArrayList<Resource>();
24 for(Resource ontology : Layer0Utils.listOntologies(graph)) {
25 Boolean global = graph.getPossibleRelatedValue(ontology, L0.Ontology_global, Bindings.BOOLEAN);
26 if(global != null && global) result.add(ontology);