@@ -116,15 +116,15 @@ void testFiltering(Direction orientation, boolean isUndirected) {
116116 var label2 = RelationshipType .of ("Bar" );
117117
118118 var relationshipSchema = RelationshipSchema .empty ()
119- .addProperty (label1 , orientation , "bar" , ValueType .DOUBLE )
120- .addProperty (label1 , orientation , "baz" , ValueType .DOUBLE )
121- .addProperty (label2 , orientation , "baz" , ValueType .DOUBLE );
119+ .addProperty (label1 , orientation , "bar" , ValueType .DOUBLE , PropertyState . PERSISTENT )
120+ .addProperty (label1 , orientation , "baz" , ValueType .DOUBLE , PropertyState . PERSISTENT )
121+ .addProperty (label2 , orientation , "baz" , ValueType .DOUBLE , PropertyState . PERSISTENT );
122122
123123 assertThat (relationshipSchema .filter (Set .of (label1 , label2 ))).isEqualTo (relationshipSchema );
124124
125125 var expected = RelationshipSchema .empty ()
126- .addProperty (label1 , orientation , "bar" , ValueType .DOUBLE )
127- .addProperty (label1 , orientation , "baz" , ValueType .DOUBLE );
126+ .addProperty (label1 , orientation , "bar" , ValueType .DOUBLE , PropertyState . PERSISTENT )
127+ .addProperty (label1 , orientation , "baz" , ValueType .DOUBLE , PropertyState . PERSISTENT );
128128
129129 assertThat (relationshipSchema .filter (Set .of (label1 ))).isEqualTo (expected );
130130 assertThat (relationshipSchema .isUndirected ()).isEqualTo (isUndirected );
@@ -136,9 +136,9 @@ void testFilteringMixed() {
136136 var undirectedType = RelationshipType .of ("U" );
137137
138138 var directed = RelationshipSchema .empty ()
139- .addProperty (directedType , Direction .DIRECTED , "bar" , ValueType .DOUBLE );
139+ .addProperty (directedType , Direction .DIRECTED , "bar" , ValueType .DOUBLE , PropertyState . PERSISTENT );
140140 var undirected = RelationshipSchema .empty ()
141- .addProperty (undirectedType , Direction .UNDIRECTED , "flob" , ValueType .DOUBLE );
141+ .addProperty (undirectedType , Direction .UNDIRECTED , "flob" , ValueType .DOUBLE , PropertyState . PERSISTENT );
142142 var mixed = directed .union (undirected );
143143
144144 assertThat (mixed .isUndirected ()).isFalse ();
@@ -165,14 +165,14 @@ void testUnion(Direction direction1, Direction direction2, Boolean isUndirectedE
165165 var type2 = RelationshipType .of ("Bar" );
166166
167167 var relationshipSchema1 = RelationshipSchema .empty ()
168- .addProperty (type1 , direction1 , "bar" , ValueType .DOUBLE );
168+ .addProperty (type1 , direction1 , "bar" , ValueType .DOUBLE , PropertyState . PERSISTENT );
169169
170170 var relationshipSchema2 = RelationshipSchema .empty ()
171- .addProperty (type2 , direction2 , "bar" , ValueType .DOUBLE );
171+ .addProperty (type2 , direction2 , "bar" , ValueType .DOUBLE , PropertyState . PERSISTENT );
172172
173173 var expected = RelationshipSchema .empty ()
174- .addProperty (type1 , direction1 , "bar" , ValueType .DOUBLE )
175- .addProperty (type2 , direction2 , "bar" , ValueType .DOUBLE );
174+ .addProperty (type1 , direction1 , "bar" , ValueType .DOUBLE , PropertyState . PERSISTENT )
175+ .addProperty (type2 , direction2 , "bar" , ValueType .DOUBLE , PropertyState . PERSISTENT );
176176
177177 var actual = relationshipSchema1 .union (relationshipSchema2 );
178178 assertThat (actual ).isEqualTo (expected );
@@ -199,13 +199,25 @@ void unionOnSameTypesFailsOnDirectionMismatch() {
199199
200200 @ Test
201201 void unionOnSameTypeSamePropertyDifferentValueTypeFails () {
202- var schema1 = RelationshipSchema .empty ()
203- .addProperty (RelationshipType .of ("X" ), Direction .DIRECTED , "x" , ValueType .DOUBLE )
204- .addProperty (RelationshipType .of ("Y" ), Direction .UNDIRECTED , "unlikelypartofmessage" , ValueType .DOUBLE );
202+ var schema1 = RelationshipSchema
203+ .empty ()
204+ .addProperty (RelationshipType .of ("X" ), Direction .DIRECTED , "x" , ValueType .DOUBLE , PropertyState .PERSISTENT )
205+ .addProperty (RelationshipType .of ("Y" ),
206+ Direction .UNDIRECTED ,
207+ "unlikelypartofmessage" ,
208+ ValueType .DOUBLE ,
209+ PropertyState .PERSISTENT
210+ );
205211
206- var schema2 = RelationshipSchema .empty ()
207- .addProperty (RelationshipType .of ("X" ), Direction .DIRECTED , "x" , ValueType .LONG )
208- .addProperty (RelationshipType .of ("Y" ), Direction .UNDIRECTED , "unlikelypartofmessage" , ValueType .DOUBLE );
212+ var schema2 = RelationshipSchema
213+ .empty ()
214+ .addProperty (RelationshipType .of ("X" ), Direction .DIRECTED , "x" , ValueType .LONG , PropertyState .PERSISTENT )
215+ .addProperty (RelationshipType .of ("Y" ),
216+ Direction .UNDIRECTED ,
217+ "unlikelypartofmessage" ,
218+ ValueType .DOUBLE ,
219+ PropertyState .PERSISTENT
220+ );
209221
210222 assertThatThrownBy (() -> schema1 .union (schema2 ))
211223 .hasMessageContaining ("Combining schema entries with value type" )
@@ -217,14 +229,28 @@ void unionOnSameTypeSamePropertyDifferentValueTypeFails() {
217229
218230 static Stream <Arguments > schemaAndHasProperties () {
219231 return Stream .of (
220- Arguments .of (RelationshipSchema .empty ().addRelationshipType (RelationshipType .of ("A" ), Direction .DIRECTED ), false ),
221- Arguments .of (RelationshipSchema .empty ().addRelationshipType (RelationshipType .of ("A" ), Direction .UNDIRECTED ), false ),
232+ Arguments .of (RelationshipSchema .empty ().addRelationshipType (RelationshipType .of ("A" ), Direction .DIRECTED ),
233+ false
234+ ),
235+ Arguments .of (RelationshipSchema .empty ().addRelationshipType (RelationshipType .of ("A" ), Direction .UNDIRECTED ),
236+ false
237+ ),
222238 Arguments .of (RelationshipSchema
223239 .empty ()
224- .addProperty (RelationshipType .of ("A" ), Direction .DIRECTED , "foo" , ValueType .LONG ), true ),
240+ .addProperty (RelationshipType .of ("A" ),
241+ Direction .DIRECTED ,
242+ "foo" ,
243+ ValueType .LONG ,
244+ PropertyState .PERSISTENT
245+ ), true ),
225246 Arguments .of (RelationshipSchema
226247 .empty ()
227- .addProperty (RelationshipType .of ("A" ), Direction .UNDIRECTED , "foo" , ValueType .LONG ), true )
248+ .addProperty (RelationshipType .of ("A" ),
249+ Direction .UNDIRECTED ,
250+ "foo" ,
251+ ValueType .LONG ,
252+ PropertyState .PERSISTENT
253+ ), true )
228254 );
229255 }
230256
@@ -250,9 +276,23 @@ void testBuildRelTypes() {
250276
251277 @ Test
252278 void testBuildProperties () {
253- var schema = RelationshipSchema .empty ()
254- .addProperty (RelationshipType .of ("X" ), Direction .UNDIRECTED , "x" , ValueType .DOUBLE )
255- .addProperty (RelationshipType .of ("Y" ), Direction .DIRECTED , "y" , ValueType .DOUBLE , Aggregation .MIN )
279+ RelationshipSchema relationshipSchema = RelationshipSchema .empty ()
280+ .addProperty (RelationshipType .of ("X" ), Direction .UNDIRECTED , "x" , ValueType .DOUBLE ,
281+ PropertyState .PERSISTENT
282+ );
283+ relationshipSchema
284+ .getOrCreateRelationshipType (RelationshipType .of ("Y" ), Direction .DIRECTED )
285+ .addProperty (
286+ "y" ,
287+ RelationshipPropertySchema .of (
288+ "y" ,
289+ ValueType .DOUBLE ,
290+ DefaultValue .forDouble (),
291+ PropertyState .PERSISTENT ,
292+ Aggregation .MIN
293+ )
294+ );
295+ var schema = relationshipSchema
256296 .addProperty (
257297 RelationshipType .of ("Z" ),
258298 Direction .UNDIRECTED ,
@@ -277,10 +317,14 @@ void testBuildProperties() {
277317 void shouldCreateDeepCopiesWhenFiltering () {
278318 var relType = RelationshipType .of ("A" );
279319 var relationshipSchema = RelationshipSchema .empty ();
280- relationshipSchema .getOrCreateRelationshipType (relType , Direction .DIRECTED ).addProperty ("prop" , ValueType .LONG );
320+ relationshipSchema .getOrCreateRelationshipType (relType , Direction .DIRECTED ).addProperty ("prop" , ValueType .LONG ,
321+ PropertyState .PERSISTENT
322+ );
281323 var filteredSchema = relationshipSchema .filter (Set .of (relType ));
282324 filteredSchema
283- .getOrCreateRelationshipType (relType , Direction .DIRECTED ).addProperty ("shouldNotExistInOriginalSchema" , ValueType .LONG );
325+ .getOrCreateRelationshipType (relType , Direction .DIRECTED ).addProperty ("shouldNotExistInOriginalSchema" , ValueType .LONG ,
326+ PropertyState .PERSISTENT
327+ );
284328
285329 assertThat (relationshipSchema .get (relType ).properties ())
286330 .doesNotContainKey ("shouldNotExistInOriginalSchema" )
0 commit comments