]> gerrit.simantics Code Review - simantics/district.git/blob
4adb19d3ad36d874f4ae381e1dd046bd0dadb8e8
[simantics/district.git] /
1 package org.simantics.district.network.ontology;
2
3 import org.simantics.db.RequestProcessor;
4 import org.simantics.db.Resource;
5 import org.simantics.db.ReadGraph;
6 import org.simantics.db.request.Read;
7 import org.simantics.db.Session;
8 import org.simantics.db.exception.DatabaseException;
9 import org.simantics.db.service.QueryControl;
10
11 public class DistrictNetworkResource {
12     
13     public final Resource ActionContext;
14     public final Resource ActionContext_newDiagramContribution;
15     public final Resource Actions;
16     public final Resource Actions_NewDNDiagram;
17     public final Resource AddLayerToDNDiagramTemplate;
18     public final Resource BrowseContext;
19     public final Resource Composite;
20     public final Resource Connection;
21     public final Resource Diagram;
22     public final Resource Diagram_MappedDiagram;
23     public final Resource EPSG_4326;
24     public final Resource Edge;
25     public final Resource EdgeDefaultMapping;
26     public final Resource EdgeDefaultMapping_Inverse;
27     public final Resource EdgeMappingParameterType;
28     public final Resource Edge_HasDiameter;
29     public final Resource Edge_HasDiameter_Inverse;
30     public final Resource Edge_HasLength;
31     public final Resource Edge_HasLength_Inverse;
32     public final Resource Edge_HasNominalMassFlow;
33     public final Resource Edge_HasNominalMassFlow_Inverse;
34     public final Resource Edge_HasOuterDiameter;
35     public final Resource Edge_HasOuterDiameter_Inverse;
36     public final Resource Functions;
37     public final Resource Functions_compositeInstantiator;
38     public final Resource Functions_convertToValue;
39     public final Resource Functions_defaultEdgeMappingModifier;
40     public final Resource Functions_defaultVertexMappingModifier;
41     public final Resource Functions_enumerationValues;
42     public final Resource Functions_mappingModifier;
43     public final Resource HasEndVertex;
44     public final Resource HasEndVertex_Inverse;
45     public final Resource HasInLayerTag;
46     public final Resource HasInLayerTag_Inverse;
47     public final Resource HasMapping;
48     public final Resource HasMapping_Inverse;
49     public final Resource HasSRID;
50     public final Resource HasSRID_Inverse;
51     public final Resource HasSRTEXT;
52     public final Resource HasSRTEXT_Inverse;
53     public final Resource HasSpatialRefSystem;
54     public final Resource HasSpatialRefSystem_Inverse;
55     public final Resource HasStartVertex;
56     public final Resource HasStartVertex_Inverse;
57     public final Resource Images;
58     public final Resource Images_MapImage;
59     public final Resource InLayer;
60     public final Resource Layer;
61     public final Resource MappedComponent;
62     public final Resource Mapping;
63     public final Resource MappingParameterType;
64     public final Resource Mapping_Base;
65     public final Resource Mapping_ComponentType;
66     public final Resource Mapping_ComponentType_Inverse;
67     public final Resource Mapping_EdgeMapping;
68     public final Resource Mapping_EdgeMapping_DiameterAttribute;
69     public final Resource Mapping_EdgeMapping_DiameterAttribute_Inverse;
70     public final Resource Mapping_EdgeMapping_LengthAttribute;
71     public final Resource Mapping_EdgeMapping_LengthAttribute_Inverse;
72     public final Resource Mapping_EdgeMapping_NominalMassFlowAttribute;
73     public final Resource Mapping_EdgeMapping_NominalMassFlowAttribute_Inverse;
74     public final Resource Mapping_EdgeMapping_OuterDiameterAttribute;
75     public final Resource Mapping_EdgeMapping_OuterDiameterAttribute_Inverse;
76     public final Resource Mapping_InputTerminal;
77     public final Resource Mapping_InputTerminal_Inverse;
78     public final Resource Mapping_OutputTerminal;
79     public final Resource Mapping_OutputTerminal_Inverse;
80     public final Resource Mapping_Terminal;
81     public final Resource Mapping_TerminalPair;
82     public final Resource Mapping_Terminals;
83     public final Resource Mapping_Terminals_Inverse;
84     public final Resource Mapping_VertexMapping;
85     public final Resource Mapping_VertexMapping_ElevationAttribute;
86     public final Resource Mapping_VertexMapping_ElevationAttribute_Inverse;
87     public final Resource Mapping_VertexMapping_PressureAttribute;
88     public final Resource Mapping_VertexMapping_PressureAttribute_Inverse;
89     public final Resource Mapping_VertexMapping_TemperatureAttribute;
90     public final Resource Mapping_VertexMapping_TemperatureAttribute_Inverse;
91     public final Resource SpatialRefSystem;
92     public final Resource Vertex;
93     public final Resource VertexDefaultMapping;
94     public final Resource VertexDefaultMapping_Inverse;
95     public final Resource VertexMappingParameterType;
96     public final Resource Vertex_HasElevation;
97     public final Resource Vertex_HasElevation_Inverse;
98     public final Resource Vertex_HasPressure;
99     public final Resource Vertex_HasPressure_Inverse;
100     public final Resource Vertex_HasTemperature;
101     public final Resource Vertex_HasTemperature_Inverse;
102         
103     public static class URIs {
104         public static final String ActionContext = "http://www.simantics.org/DistrictNetwork-1.0/ActionContext";
105         public static final String ActionContext_newDiagramContribution = "http://www.simantics.org/DistrictNetwork-1.0/ActionContext/newDiagramContribution";
106         public static final String Actions = "http://www.simantics.org/DistrictNetwork-1.0/Actions";
107         public static final String Actions_NewDNDiagram = "http://www.simantics.org/DistrictNetwork-1.0/Actions/NewDNDiagram";
108         public static final String AddLayerToDNDiagramTemplate = "http://www.simantics.org/DistrictNetwork-1.0/AddLayerToDNDiagramTemplate";
109         public static final String BrowseContext = "http://www.simantics.org/DistrictNetwork-1.0/BrowseContext";
110         public static final String Composite = "http://www.simantics.org/DistrictNetwork-1.0/Composite";
111         public static final String Connection = "http://www.simantics.org/DistrictNetwork-1.0/Connection";
112         public static final String Diagram = "http://www.simantics.org/DistrictNetwork-1.0/Diagram";
113         public static final String Diagram_MappedDiagram = "http://www.simantics.org/DistrictNetwork-1.0/Diagram/MappedDiagram";
114         public static final String EPSG_4326 = "http://www.simantics.org/DistrictNetwork-1.0/EPSG_4326";
115         public static final String Edge = "http://www.simantics.org/DistrictNetwork-1.0/Edge";
116         public static final String EdgeDefaultMapping = "http://www.simantics.org/DistrictNetwork-1.0/EdgeDefaultMapping";
117         public static final String EdgeDefaultMapping_Inverse = "http://www.simantics.org/DistrictNetwork-1.0/EdgeDefaultMapping/Inverse";
118         public static final String EdgeMappingParameterType = "http://www.simantics.org/DistrictNetwork-1.0/EdgeMappingParameterType";
119         public static final String Edge_HasDiameter = "http://www.simantics.org/DistrictNetwork-1.0/Edge/HasDiameter";
120         public static final String Edge_HasDiameter_Inverse = "http://www.simantics.org/DistrictNetwork-1.0/Edge/HasDiameter/Inverse";
121         public static final String Edge_HasLength = "http://www.simantics.org/DistrictNetwork-1.0/Edge/HasLength";
122         public static final String Edge_HasLength_Inverse = "http://www.simantics.org/DistrictNetwork-1.0/Edge/HasLength/Inverse";
123         public static final String Edge_HasNominalMassFlow = "http://www.simantics.org/DistrictNetwork-1.0/Edge/HasNominalMassFlow";
124         public static final String Edge_HasNominalMassFlow_Inverse = "http://www.simantics.org/DistrictNetwork-1.0/Edge/HasNominalMassFlow/Inverse";
125         public static final String Edge_HasOuterDiameter = "http://www.simantics.org/DistrictNetwork-1.0/Edge/HasOuterDiameter";
126         public static final String Edge_HasOuterDiameter_Inverse = "http://www.simantics.org/DistrictNetwork-1.0/Edge/HasOuterDiameter/Inverse";
127         public static final String Functions = "http://www.simantics.org/DistrictNetwork-1.0/Functions";
128         public static final String Functions_compositeInstantiator = "http://www.simantics.org/DistrictNetwork-1.0/Functions/compositeInstantiator";
129         public static final String Functions_convertToValue = "http://www.simantics.org/DistrictNetwork-1.0/Functions/convertToValue";
130         public static final String Functions_defaultEdgeMappingModifier = "http://www.simantics.org/DistrictNetwork-1.0/Functions/defaultEdgeMappingModifier";
131         public static final String Functions_defaultVertexMappingModifier = "http://www.simantics.org/DistrictNetwork-1.0/Functions/defaultVertexMappingModifier";
132         public static final String Functions_enumerationValues = "http://www.simantics.org/DistrictNetwork-1.0/Functions/enumerationValues";
133         public static final String Functions_mappingModifier = "http://www.simantics.org/DistrictNetwork-1.0/Functions/mappingModifier";
134         public static final String HasEndVertex = "http://www.simantics.org/DistrictNetwork-1.0/HasEndVertex";
135         public static final String HasEndVertex_Inverse = "http://www.simantics.org/DistrictNetwork-1.0/HasEndVertex_Inverse";
136         public static final String HasInLayerTag = "http://www.simantics.org/DistrictNetwork-1.0/HasInLayerTag";
137         public static final String HasInLayerTag_Inverse = "http://www.simantics.org/DistrictNetwork-1.0/HasInLayerTag/Inverse";
138         public static final String HasMapping = "http://www.simantics.org/DistrictNetwork-1.0/HasMapping";
139         public static final String HasMapping_Inverse = "http://www.simantics.org/DistrictNetwork-1.0/HasMapping/Inverse";
140         public static final String HasSRID = "http://www.simantics.org/DistrictNetwork-1.0/HasSRID";
141         public static final String HasSRID_Inverse = "http://www.simantics.org/DistrictNetwork-1.0/HasSRID/Inverse";
142         public static final String HasSRTEXT = "http://www.simantics.org/DistrictNetwork-1.0/HasSRTEXT";
143         public static final String HasSRTEXT_Inverse = "http://www.simantics.org/DistrictNetwork-1.0/HasSRTEXT/Inverse";
144         public static final String HasSpatialRefSystem = "http://www.simantics.org/DistrictNetwork-1.0/HasSpatialRefSystem";
145         public static final String HasSpatialRefSystem_Inverse = "http://www.simantics.org/DistrictNetwork-1.0/HasSpatialRefSystem/Inverse";
146         public static final String HasStartVertex = "http://www.simantics.org/DistrictNetwork-1.0/HasStartVertex";
147         public static final String HasStartVertex_Inverse = "http://www.simantics.org/DistrictNetwork-1.0/HasStartVertex_Inverse";
148         public static final String Images = "http://www.simantics.org/DistrictNetwork-1.0/Images";
149         public static final String Images_MapImage = "http://www.simantics.org/DistrictNetwork-1.0/Images/MapImage";
150         public static final String InLayer = "http://www.simantics.org/DistrictNetwork-1.0/InLayer";
151         public static final String Layer = "http://www.simantics.org/DistrictNetwork-1.0/Layer";
152         public static final String MappedComponent = "http://www.simantics.org/DistrictNetwork-1.0/MappedComponent";
153         public static final String Mapping = "http://www.simantics.org/DistrictNetwork-1.0/Mapping";
154         public static final String MappingParameterType = "http://www.simantics.org/DistrictNetwork-1.0/MappingParameterType";
155         public static final String Mapping_Base = "http://www.simantics.org/DistrictNetwork-1.0/Mapping/Base";
156         public static final String Mapping_ComponentType = "http://www.simantics.org/DistrictNetwork-1.0/Mapping/ComponentType";
157         public static final String Mapping_ComponentType_Inverse = "http://www.simantics.org/DistrictNetwork-1.0/Mapping/ComponentType/Inverse";
158         public static final String Mapping_EdgeMapping = "http://www.simantics.org/DistrictNetwork-1.0/Mapping/EdgeMapping";
159         public static final String Mapping_EdgeMapping_DiameterAttribute = "http://www.simantics.org/DistrictNetwork-1.0/Mapping/EdgeMapping/DiameterAttribute";
160         public static final String Mapping_EdgeMapping_DiameterAttribute_Inverse = "http://www.simantics.org/DistrictNetwork-1.0/Mapping/EdgeMapping/DiameterAttribute/Inverse";
161         public static final String Mapping_EdgeMapping_LengthAttribute = "http://www.simantics.org/DistrictNetwork-1.0/Mapping/EdgeMapping/LengthAttribute";
162         public static final String Mapping_EdgeMapping_LengthAttribute_Inverse = "http://www.simantics.org/DistrictNetwork-1.0/Mapping/EdgeMapping/LengthAttribute/Inverse";
163         public static final String Mapping_EdgeMapping_NominalMassFlowAttribute = "http://www.simantics.org/DistrictNetwork-1.0/Mapping/EdgeMapping/NominalMassFlowAttribute";
164         public static final String Mapping_EdgeMapping_NominalMassFlowAttribute_Inverse = "http://www.simantics.org/DistrictNetwork-1.0/Mapping/EdgeMapping/NominalMassFlowAttribute/Inverse";
165         public static final String Mapping_EdgeMapping_OuterDiameterAttribute = "http://www.simantics.org/DistrictNetwork-1.0/Mapping/EdgeMapping/OuterDiameterAttribute";
166         public static final String Mapping_EdgeMapping_OuterDiameterAttribute_Inverse = "http://www.simantics.org/DistrictNetwork-1.0/Mapping/EdgeMapping/OuterDiameterAttribute/Inverse";
167         public static final String Mapping_InputTerminal = "http://www.simantics.org/DistrictNetwork-1.0/Mapping/InputTerminal";
168         public static final String Mapping_InputTerminal_Inverse = "http://www.simantics.org/DistrictNetwork-1.0/Mapping/InputTerminal/Inverse";
169         public static final String Mapping_OutputTerminal = "http://www.simantics.org/DistrictNetwork-1.0/Mapping/OutputTerminal";
170         public static final String Mapping_OutputTerminal_Inverse = "http://www.simantics.org/DistrictNetwork-1.0/Mapping/OutputTerminal/Inverse";
171         public static final String Mapping_Terminal = "http://www.simantics.org/DistrictNetwork-1.0/Mapping/Terminal";
172         public static final String Mapping_TerminalPair = "http://www.simantics.org/DistrictNetwork-1.0/Mapping/TerminalPair";
173         public static final String Mapping_Terminals = "http://www.simantics.org/DistrictNetwork-1.0/Mapping/Terminals";
174         public static final String Mapping_Terminals_Inverse = "http://www.simantics.org/DistrictNetwork-1.0/Mapping/Terminals/Inverse";
175         public static final String Mapping_VertexMapping = "http://www.simantics.org/DistrictNetwork-1.0/Mapping/VertexMapping";
176         public static final String Mapping_VertexMapping_ElevationAttribute = "http://www.simantics.org/DistrictNetwork-1.0/Mapping/VertexMapping/ElevationAttribute";
177         public static final String Mapping_VertexMapping_ElevationAttribute_Inverse = "http://www.simantics.org/DistrictNetwork-1.0/Mapping/VertexMapping/ElevationAttribute/Inverse";
178         public static final String Mapping_VertexMapping_PressureAttribute = "http://www.simantics.org/DistrictNetwork-1.0/Mapping/VertexMapping/PressureAttribute";
179         public static final String Mapping_VertexMapping_PressureAttribute_Inverse = "http://www.simantics.org/DistrictNetwork-1.0/Mapping/VertexMapping/PressureAttribute/Inverse";
180         public static final String Mapping_VertexMapping_TemperatureAttribute = "http://www.simantics.org/DistrictNetwork-1.0/Mapping/VertexMapping/TemperatureAttribute";
181         public static final String Mapping_VertexMapping_TemperatureAttribute_Inverse = "http://www.simantics.org/DistrictNetwork-1.0/Mapping/VertexMapping/TemperatureAttribute/Inverse";
182         public static final String SpatialRefSystem = "http://www.simantics.org/DistrictNetwork-1.0/SpatialRefSystem";
183         public static final String Vertex = "http://www.simantics.org/DistrictNetwork-1.0/Vertex";
184         public static final String VertexDefaultMapping = "http://www.simantics.org/DistrictNetwork-1.0/VertexDefaultMapping";
185         public static final String VertexDefaultMapping_Inverse = "http://www.simantics.org/DistrictNetwork-1.0/VertexDefaultMapping/Inverse";
186         public static final String VertexMappingParameterType = "http://www.simantics.org/DistrictNetwork-1.0/VertexMappingParameterType";
187         public static final String Vertex_HasElevation = "http://www.simantics.org/DistrictNetwork-1.0/Vertex/HasElevation";
188         public static final String Vertex_HasElevation_Inverse = "http://www.simantics.org/DistrictNetwork-1.0/Vertex/HasElevation/Inverse";
189         public static final String Vertex_HasPressure = "http://www.simantics.org/DistrictNetwork-1.0/Vertex/HasPressure";
190         public static final String Vertex_HasPressure_Inverse = "http://www.simantics.org/DistrictNetwork-1.0/Vertex/HasPressure/Inverse";
191         public static final String Vertex_HasTemperature = "http://www.simantics.org/DistrictNetwork-1.0/Vertex/HasTemperature";
192         public static final String Vertex_HasTemperature_Inverse = "http://www.simantics.org/DistrictNetwork-1.0/Vertex/HasTemperature/Inverse";
193     }
194     
195     public static Resource getResourceOrNull(ReadGraph graph, String uri) {
196         try {
197             return graph.getResource(uri);
198         } catch(DatabaseException e) {
199             System.err.println(e.getMessage());
200             return null;
201         }
202     }
203     
204     public DistrictNetworkResource(ReadGraph graph) {
205         ActionContext = getResourceOrNull(graph, URIs.ActionContext);
206         ActionContext_newDiagramContribution = getResourceOrNull(graph, URIs.ActionContext_newDiagramContribution);
207         Actions = getResourceOrNull(graph, URIs.Actions);
208         Actions_NewDNDiagram = getResourceOrNull(graph, URIs.Actions_NewDNDiagram);
209         AddLayerToDNDiagramTemplate = getResourceOrNull(graph, URIs.AddLayerToDNDiagramTemplate);
210         BrowseContext = getResourceOrNull(graph, URIs.BrowseContext);
211         Composite = getResourceOrNull(graph, URIs.Composite);
212         Connection = getResourceOrNull(graph, URIs.Connection);
213         Diagram = getResourceOrNull(graph, URIs.Diagram);
214         Diagram_MappedDiagram = getResourceOrNull(graph, URIs.Diagram_MappedDiagram);
215         EPSG_4326 = getResourceOrNull(graph, URIs.EPSG_4326);
216         Edge = getResourceOrNull(graph, URIs.Edge);
217         EdgeDefaultMapping = getResourceOrNull(graph, URIs.EdgeDefaultMapping);
218         EdgeDefaultMapping_Inverse = getResourceOrNull(graph, URIs.EdgeDefaultMapping_Inverse);
219         EdgeMappingParameterType = getResourceOrNull(graph, URIs.EdgeMappingParameterType);
220         Edge_HasDiameter = getResourceOrNull(graph, URIs.Edge_HasDiameter);
221         Edge_HasDiameter_Inverse = getResourceOrNull(graph, URIs.Edge_HasDiameter_Inverse);
222         Edge_HasLength = getResourceOrNull(graph, URIs.Edge_HasLength);
223         Edge_HasLength_Inverse = getResourceOrNull(graph, URIs.Edge_HasLength_Inverse);
224         Edge_HasNominalMassFlow = getResourceOrNull(graph, URIs.Edge_HasNominalMassFlow);
225         Edge_HasNominalMassFlow_Inverse = getResourceOrNull(graph, URIs.Edge_HasNominalMassFlow_Inverse);
226         Edge_HasOuterDiameter = getResourceOrNull(graph, URIs.Edge_HasOuterDiameter);
227         Edge_HasOuterDiameter_Inverse = getResourceOrNull(graph, URIs.Edge_HasOuterDiameter_Inverse);
228         Functions = getResourceOrNull(graph, URIs.Functions);
229         Functions_compositeInstantiator = getResourceOrNull(graph, URIs.Functions_compositeInstantiator);
230         Functions_convertToValue = getResourceOrNull(graph, URIs.Functions_convertToValue);
231         Functions_defaultEdgeMappingModifier = getResourceOrNull(graph, URIs.Functions_defaultEdgeMappingModifier);
232         Functions_defaultVertexMappingModifier = getResourceOrNull(graph, URIs.Functions_defaultVertexMappingModifier);
233         Functions_enumerationValues = getResourceOrNull(graph, URIs.Functions_enumerationValues);
234         Functions_mappingModifier = getResourceOrNull(graph, URIs.Functions_mappingModifier);
235         HasEndVertex = getResourceOrNull(graph, URIs.HasEndVertex);
236         HasEndVertex_Inverse = getResourceOrNull(graph, URIs.HasEndVertex_Inverse);
237         HasInLayerTag = getResourceOrNull(graph, URIs.HasInLayerTag);
238         HasInLayerTag_Inverse = getResourceOrNull(graph, URIs.HasInLayerTag_Inverse);
239         HasMapping = getResourceOrNull(graph, URIs.HasMapping);
240         HasMapping_Inverse = getResourceOrNull(graph, URIs.HasMapping_Inverse);
241         HasSRID = getResourceOrNull(graph, URIs.HasSRID);
242         HasSRID_Inverse = getResourceOrNull(graph, URIs.HasSRID_Inverse);
243         HasSRTEXT = getResourceOrNull(graph, URIs.HasSRTEXT);
244         HasSRTEXT_Inverse = getResourceOrNull(graph, URIs.HasSRTEXT_Inverse);
245         HasSpatialRefSystem = getResourceOrNull(graph, URIs.HasSpatialRefSystem);
246         HasSpatialRefSystem_Inverse = getResourceOrNull(graph, URIs.HasSpatialRefSystem_Inverse);
247         HasStartVertex = getResourceOrNull(graph, URIs.HasStartVertex);
248         HasStartVertex_Inverse = getResourceOrNull(graph, URIs.HasStartVertex_Inverse);
249         Images = getResourceOrNull(graph, URIs.Images);
250         Images_MapImage = getResourceOrNull(graph, URIs.Images_MapImage);
251         InLayer = getResourceOrNull(graph, URIs.InLayer);
252         Layer = getResourceOrNull(graph, URIs.Layer);
253         MappedComponent = getResourceOrNull(graph, URIs.MappedComponent);
254         Mapping = getResourceOrNull(graph, URIs.Mapping);
255         MappingParameterType = getResourceOrNull(graph, URIs.MappingParameterType);
256         Mapping_Base = getResourceOrNull(graph, URIs.Mapping_Base);
257         Mapping_ComponentType = getResourceOrNull(graph, URIs.Mapping_ComponentType);
258         Mapping_ComponentType_Inverse = getResourceOrNull(graph, URIs.Mapping_ComponentType_Inverse);
259         Mapping_EdgeMapping = getResourceOrNull(graph, URIs.Mapping_EdgeMapping);
260         Mapping_EdgeMapping_DiameterAttribute = getResourceOrNull(graph, URIs.Mapping_EdgeMapping_DiameterAttribute);
261         Mapping_EdgeMapping_DiameterAttribute_Inverse = getResourceOrNull(graph, URIs.Mapping_EdgeMapping_DiameterAttribute_Inverse);
262         Mapping_EdgeMapping_LengthAttribute = getResourceOrNull(graph, URIs.Mapping_EdgeMapping_LengthAttribute);
263         Mapping_EdgeMapping_LengthAttribute_Inverse = getResourceOrNull(graph, URIs.Mapping_EdgeMapping_LengthAttribute_Inverse);
264         Mapping_EdgeMapping_NominalMassFlowAttribute = getResourceOrNull(graph, URIs.Mapping_EdgeMapping_NominalMassFlowAttribute);
265         Mapping_EdgeMapping_NominalMassFlowAttribute_Inverse = getResourceOrNull(graph, URIs.Mapping_EdgeMapping_NominalMassFlowAttribute_Inverse);
266         Mapping_EdgeMapping_OuterDiameterAttribute = getResourceOrNull(graph, URIs.Mapping_EdgeMapping_OuterDiameterAttribute);
267         Mapping_EdgeMapping_OuterDiameterAttribute_Inverse = getResourceOrNull(graph, URIs.Mapping_EdgeMapping_OuterDiameterAttribute_Inverse);
268         Mapping_InputTerminal = getResourceOrNull(graph, URIs.Mapping_InputTerminal);
269         Mapping_InputTerminal_Inverse = getResourceOrNull(graph, URIs.Mapping_InputTerminal_Inverse);
270         Mapping_OutputTerminal = getResourceOrNull(graph, URIs.Mapping_OutputTerminal);
271         Mapping_OutputTerminal_Inverse = getResourceOrNull(graph, URIs.Mapping_OutputTerminal_Inverse);
272         Mapping_Terminal = getResourceOrNull(graph, URIs.Mapping_Terminal);
273         Mapping_TerminalPair = getResourceOrNull(graph, URIs.Mapping_TerminalPair);
274         Mapping_Terminals = getResourceOrNull(graph, URIs.Mapping_Terminals);
275         Mapping_Terminals_Inverse = getResourceOrNull(graph, URIs.Mapping_Terminals_Inverse);
276         Mapping_VertexMapping = getResourceOrNull(graph, URIs.Mapping_VertexMapping);
277         Mapping_VertexMapping_ElevationAttribute = getResourceOrNull(graph, URIs.Mapping_VertexMapping_ElevationAttribute);
278         Mapping_VertexMapping_ElevationAttribute_Inverse = getResourceOrNull(graph, URIs.Mapping_VertexMapping_ElevationAttribute_Inverse);
279         Mapping_VertexMapping_PressureAttribute = getResourceOrNull(graph, URIs.Mapping_VertexMapping_PressureAttribute);
280         Mapping_VertexMapping_PressureAttribute_Inverse = getResourceOrNull(graph, URIs.Mapping_VertexMapping_PressureAttribute_Inverse);
281         Mapping_VertexMapping_TemperatureAttribute = getResourceOrNull(graph, URIs.Mapping_VertexMapping_TemperatureAttribute);
282         Mapping_VertexMapping_TemperatureAttribute_Inverse = getResourceOrNull(graph, URIs.Mapping_VertexMapping_TemperatureAttribute_Inverse);
283         SpatialRefSystem = getResourceOrNull(graph, URIs.SpatialRefSystem);
284         Vertex = getResourceOrNull(graph, URIs.Vertex);
285         VertexDefaultMapping = getResourceOrNull(graph, URIs.VertexDefaultMapping);
286         VertexDefaultMapping_Inverse = getResourceOrNull(graph, URIs.VertexDefaultMapping_Inverse);
287         VertexMappingParameterType = getResourceOrNull(graph, URIs.VertexMappingParameterType);
288         Vertex_HasElevation = getResourceOrNull(graph, URIs.Vertex_HasElevation);
289         Vertex_HasElevation_Inverse = getResourceOrNull(graph, URIs.Vertex_HasElevation_Inverse);
290         Vertex_HasPressure = getResourceOrNull(graph, URIs.Vertex_HasPressure);
291         Vertex_HasPressure_Inverse = getResourceOrNull(graph, URIs.Vertex_HasPressure_Inverse);
292         Vertex_HasTemperature = getResourceOrNull(graph, URIs.Vertex_HasTemperature);
293         Vertex_HasTemperature_Inverse = getResourceOrNull(graph, URIs.Vertex_HasTemperature_Inverse);
294     }
295     
296     public static DistrictNetworkResource getInstance(ReadGraph graph) {
297         Session session = graph.getSession();
298         DistrictNetworkResource ret = session.peekService(DistrictNetworkResource.class);
299         if(ret == null) {
300             QueryControl qc = graph.getService(QueryControl.class);
301             ret = new DistrictNetworkResource(qc.getIndependentGraph(graph));
302             session.registerService(DistrictNetworkResource.class, ret);
303         }
304         return ret;
305     }
306     
307     public static DistrictNetworkResource getInstance(RequestProcessor session) throws DatabaseException {
308         DistrictNetworkResource ret = session.peekService(DistrictNetworkResource.class);
309         if(ret == null) {
310             ret = session.syncRequest(new Read<DistrictNetworkResource>() {
311                 public DistrictNetworkResource perform(ReadGraph graph) throws DatabaseException {
312                     QueryControl qc = graph.getService(QueryControl.class);
313                     return new DistrictNetworkResource(qc.getIndependentGraph(graph));
314                 }
315             });
316             session.registerService(DistrictNetworkResource.class, ret);
317         }
318         return ret;
319     }
320     
321 }
322