@@ -25,40 +25,8 @@ func NewGraphUpdater(graphDB GraphDB, schemaPersistor schema.Persistor) *GraphUp
25
25
return & GraphUpdater {graphDB , schemaPersistor }
26
26
}
27
27
28
- // Augment the graph of the user with "observed" relation from the source to the each asset
29
- func (sl * GraphUpdater ) appendObservedRelations (source string , updates * GraphUpdatesBulk ) {
30
- assetsToAdd := []Asset {Asset {Type : "source" , Key : source }}
31
- observedRelationsToRemove := []Relation {}
32
- observedRelationsToAdd := []Relation {}
33
-
34
- for _ , a := range updates .GetAssetUpserts () {
35
- observedRelationsToAdd = append (observedRelationsToAdd , Relation {
36
- Type : "observed" ,
37
- From : AssetKey (assetsToAdd [0 ]),
38
- To : AssetKey (a ),
39
- })
40
- }
41
-
42
- for _ , a := range updates .GetAssetRemovals () {
43
- observedRelationsToRemove = append (observedRelationsToRemove , Relation {
44
- Type : "observed" ,
45
- From : AssetKey (assetsToAdd [0 ]),
46
- To : AssetKey (a ),
47
- })
48
- }
49
-
50
- updates .UpsertAssets (assetsToAdd ... )
51
- updates .UpsertRelations (observedRelationsToAdd ... )
52
- updates .RemoveRelations (observedRelationsToRemove ... )
53
- }
54
-
55
28
// UpdateSchema update the schema for the source with the one provided in the request
56
29
func (sl * GraphUpdater ) UpdateSchema (source string , sg schema.SchemaGraph ) error {
57
- for _ , a := range sg .Assets () {
58
- sg .AddRelation (schema .AssetType ("source" ), "observed" , a )
59
- }
60
- sg .AddAsset ("source" )
61
-
62
30
previousSchema , err := sl .schemaPersistor .LoadSchema (context .Background (), source )
63
31
if err != nil {
64
32
fmt .Printf ("[ERROR] Unable to read schema from DB: %v.\n " , err )
0 commit comments