MCPcopy Create free account
hub / github.com/Pometry/Raphtory / add_edges

Method add_edges

raphtory-graphql/src/python/client/remote_graph.rs:148–213  ·  view source on GitHub ↗
(&self, updates: Vec<PyEdgeAddition>)

Source from the content-addressed store, hash-verified

146 /// None:
147 #[pyo3(signature = (updates))]
148 pub fn add_edges(&self, updates: Vec<PyEdgeAddition>) -> Result<(), ClientError> {
149 let template = r#"
150 {
151 updateGraph(path: "{{ path }}") {
152 addEdges(
153 edges: [
154 {% for edge in edges %}
155 {
156 src: "{{ edge.src }}"
157 dst: "{{ edge.dst }}"
158 {% if edge.layer%}, layer: "{{ edge.layer }}"{% endif %}
159 {% if edge.updates%},
160 updates: [
161 {% for tprop in edge.updates %}
162 {
163 time: {{ tprop.time[0] }},
164 {% if tprop.properties%}
165 properties: [
166 {% for prop in tprop.properties%}
167 {
168 key: "{{ prop.key }}",
169 value:{{prop.value | safe}}
170 }
171 {% if not loop.last %},{% endif %}
172 {% endfor %}
173 ]
174 {% endif %}
175 }
176 {% if not loop.last %},{% endif %}
177 {% endfor %}
178 ]
179 {% endif %}
180 {% if edge.metadata%},
181 metadata: [
182 {% for cprop in edge.metadata %}
183 {
184 key: "{{ cprop.key }}",
185 value:{{ cprop.value }}
186 }
187 {% if not loop.last %},{% endif %}
188 {% endfor %}
189 ]
190 {% endif %}
191 }
192 {% if not loop.last %},{% endif %}
193 {% endfor %}
194 ]
195 )
196 }
197 }
198 "#;
199
200 let query_context = context! {
201 path => self.graph.path.clone(),
202 edges => updates,
203 };
204
205 let query = build_query(template, query_context)?;

Callers

nothing calls this directly

Calls 3

build_queryFunction · 0.85
execute_async_taskFunction · 0.85
queryMethod · 0.45

Tested by

no test coverage detected