You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Testing that NewNodeFromStrings is not the point of this package. Taking the example from the unit tests.
106
+
n, _:=node.NewNodeFromStrings("/some/type", "id_1")
107
+
// Testing NewImmutable is not the point of this package.
108
+
immutFoo, _:=predicate.NewImmutable("foo")
109
+
nO, _:=node.NewNodeFromStrings("/some/other/type", "id_2")
110
+
o:=triple.NewNodeObject(nO)
111
+
table:= []struct {
112
+
gc*GraphClause
113
+
wantstring
114
+
}{
115
+
{&GraphClause{}, `{ opt=false @[][] }`},
116
+
{
117
+
&GraphClause{
118
+
Optional: true,
119
+
S: n,
120
+
SBinding: "?nBinding",
121
+
SAlias: "?nAlias",
122
+
STypeAlias: "?nTypeAlias",
123
+
SIDAlias: "?nIDAlias",
124
+
P: immutFoo,
125
+
PID: "?predID",
126
+
PBinding: "?predBinding",
127
+
PAlias: "?predAlias",
128
+
PIDAlias: "?predIDAlias",
129
+
PAnchorBinding: "?predAnchorBinding",
130
+
PAnchorAlias: "?predAnchorAlias",
131
+
PLowerBound: &timeObj1,
132
+
PUpperBound: &timeObj2,
133
+
PLowerBoundAlias: "?earlyYesterday",
134
+
PUpperBoundAlias: "?someTimeInTheFuture",
135
+
PTemporal: true,
136
+
O: o,
137
+
OBinding: "?objBinding",
138
+
OAlias: "?objAlias",
139
+
OID: "?objID",
140
+
OTypeAlias: "?objTypeAlias",
141
+
OIDAlias: "?objCuteID",
142
+
OAnchorBinding: "?Popeyes",
143
+
OAnchorAlias: "?Olive",
144
+
OLowerBound: &timeObj3,
145
+
OUpperBound: &timeObj4,
146
+
OLowerBoundAlias: "?SometimeSoon",
147
+
OUpperBoundAlias: "?seemsSoFarAway",
148
+
OTemporal: true,
149
+
},
150
+
`{ opt=true /some/type<id_1> AS ?nAlias TYPE ?nTypeAlias ID ?nIDAlias "foo"@[] ?predBinding "?predID" AS ?predAlias ID ?predIDAlias AT ?predAnchorAlias /some/other/type<id_2> AS ?objAlias TYPE ?objTypeAlias ID ?objCuteID AT ?Olive AS ?objAlias ID ?objCuteID }`,
151
+
},
152
+
{
153
+
&GraphClause{
154
+
Optional: true,
155
+
S: nil,
156
+
SBinding: "?nBinding",
157
+
SAlias: "?nAlias",
158
+
STypeAlias: "?nTypeAlias",
159
+
SIDAlias: "?nIDAlias",
160
+
P: nil,
161
+
PID: "?predID",
162
+
PBinding: "?predBinding",
163
+
PAlias: "?predAlias",
164
+
PIDAlias: "?predIDAlias",
165
+
PAnchorBinding: "?predAnchorBinding",
166
+
PAnchorAlias: "?predAnchorAlias",
167
+
PLowerBound: &timeObj1,
168
+
PUpperBound: &timeObj2,
169
+
PLowerBoundAlias: "?earlyYesterday",
170
+
PUpperBoundAlias: "?someTimeInTheFuture",
171
+
PTemporal: false,
172
+
O: nil,
173
+
OAnchorBinding: "?Popeyes",
174
+
OLowerBound: &timeObj3,
175
+
OUpperBound: &timeObj4,
176
+
OLowerBoundAlias: "?SometimeSoon",
177
+
OUpperBoundAlias: "?seemsSoFarAway",
178
+
OTemporal: false,
179
+
},
180
+
`{ opt=true ?nBinding AS ?nAlias TYPE ?nTypeAlias ID ?nIDAlias ?predBinding "?predID"@[] AS ?predAlias ID ?predIDAlias AT ?predAnchorAlias[] }`,
181
+
},
182
+
{
183
+
&GraphClause{
184
+
Optional: true,
185
+
S: nil,
186
+
SBinding: "?nBinding",
187
+
SAlias: "?nAlias",
188
+
STypeAlias: "?nTypeAlias",
189
+
SIDAlias: "?nIDAlias",
190
+
P: nil,
191
+
PID: "?predID",
192
+
PBinding: "?predBinding",
193
+
PAlias: "?predAlias",
194
+
PIDAlias: "?predIDAlias",
195
+
PAnchorBinding: "?predAnchorBinding",
196
+
PAnchorAlias: "?predAnchorAlias",
197
+
PLowerBound: &timeObj1,
198
+
PUpperBound: &timeObj2,
199
+
PLowerBoundAlias: "?earlyYesterday",
200
+
PUpperBoundAlias: "?someTimeInTheFuture",
201
+
PTemporal: true,
202
+
O: nil,
203
+
OBinding: "?objBinding",
204
+
OAlias: "?objAlias",
205
+
OID: "?objID",
206
+
OTypeAlias: "?objTypeAlias",
207
+
OIDAlias: "?objCuteID",
208
+
OAnchorAlias: "?Olive",
209
+
OLowerBound: &timeObj3,
210
+
OUpperBound: &timeObj4,
211
+
OLowerBoundAlias: "?SometimeSoon",
212
+
OUpperBoundAlias: "?seemsSoFarAway",
213
+
OTemporal: true,
214
+
},
215
+
`{ opt=true ?nBinding AS ?nAlias TYPE ?nTypeAlias ID ?nIDAlias ?predBinding "?predID"@[?predAnchorBinding at ?predAnchorAlias] AS ?predAlias ID ?predIDAlias AT ?predAnchorAlias ?objBinding "?objID"[2019-11-30T22:10:50.000000003Z,2019-12-02T17:00:10.000000015Z] AS ?objAlias TYPE ?objTypeAlias ID ?objCuteID AT ?Olive AS ?objAlias ID ?objCuteID }`,
0 commit comments