File size: 2,090 Bytes
b110593
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
//                           _       _
// __      _____  __ ___   ___  __ _| |_ ___
// \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
//  \ V  V /  __/ (_| |\ V /| | (_| | ||  __/
//   \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
//
//  Copyright © 2016 - 2024 Weaviate B.V. All rights reserved.
//
//  CONTACT: [email protected]
//

package test

// func Test_NetworkFetch(t *testing.T) {
// 	result := AssertGraphQL(t, helper.RootAuth, `
//     {
// 			Network {
// 				Fetch {
// 					Things(where: {
// 						class: {
// 							name: "bestclass"
// 							certainty: 0.8
// 							keywords: [{value: "foo", weight: 0.9}]
// 						},
// 						properties: {
// 							name: "bestproperty"
// 							certainty: 0.8
// 							keywords: [{value: "bar", weight: 0.9}]
// 							operator: Equal
// 							valueString: "some-value"
// 						},
// 					}) {
// 						beacon certainty
// 					}
// 				}
// 			}
// 		}`,
// 	)

// 	results := result.Get("Network", "Fetch", "Things").Result
// 	expected := []interface{}{
// 		map[string]interface{}{
// 			"beacon":    "weaviate://RemoteWeaviateForAcceptanceTest/things/c2b94c9a-fea2-4f9a-ae40-6d63534633f7",
// 			"certainty": json.Number("0.5"),
// 		},
// 		map[string]interface{}{
// 			"beacon":    "weaviate://RemoteWeaviateForAcceptanceTest/things/32fc9b12-00b8-46b2-962d-63c1f352e090",
// 			"certainty": json.Number("0.7"),
// 		},
// 	}
// 	assert.Equal(t, expected, results)
// }

// func Test_NetworkFetchFuzzy(t *testing.T) {
// 	result := AssertGraphQL(t, helper.RootAuth, `
//     {
// 			Network {
// 				Fetch {
// 					Fuzzy(value:"something", certainty: 0.5) {
// 						beacon certainty
// 					}
// 				}
// 			}
// 		}`,
// 	)

// 	results := result.Get("Network", "Fetch", "Fuzzy").Result
// 	expected := []interface{}{
// 		map[string]interface{}{
// 			"beacon":    "weaviate://RemoteWeaviateForAcceptanceTest/things/61c21951-3460-4189-86ad-884a17b70c16",
// 			"certainty": json.Number("0.5"),
// 		},
// 	}
// 	assert.Equal(t, expected, results)
// }