]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.graph/src/org/simantics/graph/query/Paths.java
Option for exporting tg and pgraph with sharedlibrary
[simantics/platform.git] / bundles / org.simantics.graph / src / org / simantics / graph / query / Paths.java
1 package org.simantics.graph.query;
2
3
4
5 public class Paths {
6     public static PathRoot  Root = new PathRoot("");
7         public static Path SimanticsDomain = Root.child("www.simantics.org");
8         
9         public Path Layer0;
10         
11         public Path InstanceOf;
12         public Path Inherits;
13         public Path SupertypeOf;
14         public Path SubrelationOf;
15         public Path SuperrelationOf;
16         public Path InverseOf;
17         public Path HasDatatype;
18         public Path Asserts;
19         public Path Assertion;
20         public Path HasPredicate;
21         public Path HasObject;
22         public Path Equals;
23         public Path ConsistsOf;
24         public Path PartOf;
25         public Path HasNext;
26         public Path HasPrevious;        
27         public Path Template;
28         public Path HasTemplate;
29         public Path HasTemplateParameters;
30         public Path HasCardinality;     
31         public Path PropertyDefinition;
32         public Path HasPropertyDefinition;
33         public Path ConcernsRelation;
34         public Path HasDomain;
35         public Path HasRange;
36         public Path Tag;
37         public Path Entity;
38         public Path IsWeaklyRelatedTo;
39         public Path IsRelatedTo;
40         
41         public Path HasResourceClass;
42         public Path Deprecated;
43         
44         public Path Library;
45         
46         // Literal types
47         public Path Literal;
48         public Path Boolean;
49         public Path Byte;
50         public Path Integer;
51         public Path Long;
52         public Path Float;
53         public Path Double;
54         public Path String;     
55         public Path Variant;
56         
57         public Path BooleanArray;
58         public Path ByteArray;
59         public Path IntegerArray;
60         public Path LongArray;
61         public Path FloatArray;
62         public Path DoubleArray;
63         public Path StringArray;
64         
65         public Path Graph;
66         public Path Datatype;
67         public Path IntegerRange;
68         
69         public Path List;
70         public Path List_Entry;
71         public Path List_Next;
72         public Path List_Previous;
73         public Path List_Element;
74         
75         public Paths(String layer0Version) {
76             Layer0 = SimanticsDomain.child("Layer0-" + layer0Version);
77             
78             InstanceOf = Layer0.child("InstanceOf");
79             Inherits = Layer0.child("Inherits");
80             SupertypeOf = Layer0.child("SupertypeOf");
81             SubrelationOf = Layer0.child("SubrelationOf");
82             SuperrelationOf = Layer0.child("SuperrelationOf");
83             InverseOf = Layer0.child("InverseOf");
84             HasDatatype = Layer0.child("HasDataType");
85             Asserts = Layer0.child("Asserts");
86             Assertion = Layer0.child("Assertion");
87             HasPredicate = Layer0.child("HasPredicate");
88             HasObject = Layer0.child("HasObject");
89             Equals = Layer0.child("Equals");
90             ConsistsOf = Layer0.child("ConsistsOf");
91             PartOf = Layer0.child("PartOf");
92             HasNext = Layer0.child("HasNext");
93             HasPrevious = Layer0.child("HasPrevious");  
94             Template = Layer0.child("Template");
95             HasTemplate = Layer0.child("HasTemplate");
96             HasTemplateParameters = Layer0.child("HasTemplateParameters");
97             HasCardinality = Layer0.child("HasCardinality");    
98             PropertyDefinition = Layer0.child("PropertyDefinition");
99             HasPropertyDefinition = Layer0.child("HasPropertyDefinition");
100             ConcernsRelation = Layer0.child("ConcernsRelation");
101             HasDomain = Layer0.child("HasDomain");
102             HasRange = Layer0.child("HasRange");
103             Tag = Layer0.child("Tag");
104             Entity = Layer0.child("Entity");
105             IsWeaklyRelatedTo = Layer0.child("IsWeaklyRelatedTo");
106             IsRelatedTo = Layer0.child("IsRelatedTo");
107             
108             HasResourceClass = Layer0.child("HasResourceClass");
109             Deprecated = Layer0.child("Deprecated");
110             
111             Library = Layer0.child("Library");
112             
113             // Literal types
114             Literal = Layer0.child("Literal");
115             Boolean = Layer0.child("Boolean");
116             Byte = Layer0.child("Byte");
117             Integer = Layer0.child("Integer");
118             Long = Layer0.child("Long");
119             Float = Layer0.child("Float");
120             Double = Layer0.child("Double");
121             String = Layer0.child("String");    
122             Variant = Layer0.child("Variant");
123             
124             BooleanArray = Layer0.child("BooleanArray");
125             ByteArray = Layer0.child("ByteArray");
126             IntegerArray = Layer0.child("IntegerArray");
127             LongArray = Layer0.child("LongArray");
128             FloatArray = Layer0.child("FloatArray");
129             DoubleArray = Layer0.child("DoubleArray");
130             StringArray = Layer0.child("StringArray");
131             
132             Graph = Layer0.child("Graph");
133             Datatype = Layer0.child("DataType");
134             IntegerRange = Layer0.child("IntegerRange");
135             
136             List = Layer0.child("List");
137             List_Entry = List.child("Entry");
138             List_Next = List.child("Next");
139             List_Previous = List.child("Previous");
140             List_Element = List.child("Element");           
141         }
142         
143         public Path getPath(String url) {
144                 String[] parts = url.split("/{1,2}");
145                 if ( parts.length == 0 ) return null;
146                 Path path = parts[0].equals("http:") ? Root : new PathRoot(parts[0]);
147                 for (int i=1; i<parts.length; i++) {
148                         path = path.child( parts[i] );
149                 }
150                 return path;
151         }
152
153 }