1 package org.simantics.district.network.techtype.requests;
3 import org.simantics.db.ReadGraph;
4 import org.simantics.db.Resource;
5 import org.simantics.db.common.request.ResourceRead;
6 import org.simantics.db.exception.DatabaseException;
7 import org.simantics.district.network.ontology.DistrictNetworkResource;
8 import org.simantics.layer0.Layer0;
10 public class PossibleTechTypeKeyName extends ResourceRead<String> {
11 public PossibleTechTypeKeyName(Resource componentType) {
16 public String perform(ReadGraph graph) throws DatabaseException {
17 Layer0 L0 = Layer0.getInstance(graph);
18 DistrictNetworkResource DN = DistrictNetworkResource.getInstance(graph);
20 for (Resource r : graph.getObjects(resource, L0.DomainOf)) {
21 Resource accessor = graph.getPossibleObject(r, L0.valueAccessor);
22 if (accessor.equals(DN.TechType_Functions_techTypeCodeValueAccessor)) {
23 return graph.getRelatedValue2(r, L0.HasName);