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

Function parse

lib/utils.mjs:73–87  ·  view source on GitHub ↗
(data, baseUri, contentType)

Source from the content-addressed store, hash-verified

71 * @return {Graph} The parsed graph
72 */
73export async function parse (data, baseUri, contentType) {
74 const graph = $rdf.graph()
75 return new Promise((resolve, reject) => {
76 try {
77 return $rdf.parse(data, graph, baseUri, contentType, (err, str) => {
78 if (err) {
79 return reject(err)
80 }
81 resolve(str)
82 })
83 } catch (err) {
84 return reject(err)
85 }
86 })
87}
88
89/**
90 * Returns the base filename (without directory) for a given path.

Callers 1

fetchGraphMethod · 0.90

Calls 1

graphMethod · 0.80

Tested by

no test coverage detected