MCPcopy Index your code
hub / github.com/nodeSolidServer/node-solid-server / putGraph

Method putGraph

lib/ldp.mjs:196–200  ·  view source on GitHub ↗

* Serializes and writes a graph to the given uri, and returns the original * (non-serialized) graph. * Usage: * * ``` * ldp.putGraph('https://localhost:8443/contacts/resource1.ttl', graph) * .then(graph => { * // success * }) * ``` * * @param grap

(graph, uri, contentType)

Source from the content-addressed store, hash-verified

194 * @return {Promise<Graph>}
195 */
196 async putGraph (graph, uri, contentType) {
197 const content = await serialize(graph, uri, contentType)
198 const stream = stringToStream(content)
199 return await this.put(uri, stream, contentType)
200 }
201
202 isValidRdf (body, requestUri, contentType) {
203 const resourceGraph = $rdf.graph()

Callers 2

saveProfileGraphMethod · 0.80
ldp-test.mjsFile · 0.80

Calls 3

putMethod · 0.95
serializeFunction · 0.90
stringToStreamFunction · 0.90

Tested by

no test coverage detected