@@ -62,8 +62,8 @@ func PutSchema(registry sources.Registry, graphUpdater *knowledge.GraphUpdater,
62
62
}, sem )
63
63
}
64
64
65
- // PutAsset upsert an asset into the graph of the data source
66
- func PutAsset (registry sources.Registry , graphUpdater * knowledge.GraphUpdater , sem * semaphore.Weighted ) http.HandlerFunc {
65
+ // PutAssets upsert several assets into the graph of the data source
66
+ func PutAssets (registry sources.Registry , graphUpdater * knowledge.GraphUpdater , sem * semaphore.Weighted ) http.HandlerFunc {
67
67
return handleUpdate (registry , func (source string , body io.Reader ) error {
68
68
requestBody := client.PutGraphAssetRequestBody {}
69
69
if err := json .NewDecoder (body ).Decode (& requestBody ); err != nil {
@@ -73,14 +73,14 @@ func PutAsset(registry sources.Registry, graphUpdater *knowledge.GraphUpdater, s
73
73
// TODO(c.michaud): verify compatibility of the schema with graph updates
74
74
err := graphUpdater .InsertAssets (source , requestBody .Assets )
75
75
if err != nil {
76
- return fmt .Errorf ("Unable to insert asset : %v" , err )
76
+ return fmt .Errorf ("Unable to insert assets : %v" , err )
77
77
}
78
78
return nil
79
79
}, sem )
80
80
}
81
81
82
- // PutRelation upsert a relation into the graph of the data source
83
- func PutRelation (registry sources.Registry , graphUpdater * knowledge.GraphUpdater , sem * semaphore.Weighted ) http.HandlerFunc {
82
+ // PutRelations upsert multiple relations into the graph of the data source
83
+ func PutRelations (registry sources.Registry , graphUpdater * knowledge.GraphUpdater , sem * semaphore.Weighted ) http.HandlerFunc {
84
84
return handleUpdate (registry , func (source string , body io.Reader ) error {
85
85
requestBody := client.PutGraphRelationRequestBody {}
86
86
if err := json .NewDecoder (body ).Decode (& requestBody ); err != nil {
@@ -96,8 +96,8 @@ func PutRelation(registry sources.Registry, graphUpdater *knowledge.GraphUpdater
96
96
}, sem )
97
97
}
98
98
99
- // DeleteAsset delete an asset from the graph of the data source
100
- func DeleteAsset (registry sources.Registry , graphUpdater * knowledge.GraphUpdater , sem * semaphore.Weighted ) http.HandlerFunc {
99
+ // DeleteAssets delete multiple assets from the graph of the data source
100
+ func DeleteAssets (registry sources.Registry , graphUpdater * knowledge.GraphUpdater , sem * semaphore.Weighted ) http.HandlerFunc {
101
101
return handleUpdate (registry , func (source string , body io.Reader ) error {
102
102
requestBody := client.DeleteGraphAssetRequestBody {}
103
103
if err := json .NewDecoder (body ).Decode (& requestBody ); err != nil {
@@ -107,14 +107,14 @@ func DeleteAsset(registry sources.Registry, graphUpdater *knowledge.GraphUpdater
107
107
// TODO(c.michaud): verify compatibility of the schema with graph updates
108
108
err := graphUpdater .RemoveAssets (source , requestBody .Assets )
109
109
if err != nil {
110
- return fmt .Errorf ("Unable to remove asset : %v" , err )
110
+ return fmt .Errorf ("Unable to remove assets : %v" , err )
111
111
}
112
112
return nil
113
113
}, sem )
114
114
}
115
115
116
- // DeleteRelation upsert a relation into the graph of the data source
117
- func DeleteRelation (registry sources.Registry , graphUpdater * knowledge.GraphUpdater , sem * semaphore.Weighted ) http.HandlerFunc {
116
+ // DeleteRelations remove multiple relations from the graph of the data source
117
+ func DeleteRelations (registry sources.Registry , graphUpdater * knowledge.GraphUpdater , sem * semaphore.Weighted ) http.HandlerFunc {
118
118
return handleUpdate (registry , func (source string , body io.Reader ) error {
119
119
requestBody := client.DeleteGraphRelationRequestBody {}
120
120
if err := json .NewDecoder (body ).Decode (& requestBody ); err != nil {
0 commit comments