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

Function getWebId

lib/common/user-utils.mjs:12–20  ·  view source on GitHub ↗
(accountDirectory, accountUrl, suffixMeta, fetchData)

Source from the content-addressed store, hash-verified

10}
11
12export async function getWebId (accountDirectory, accountUrl, suffixMeta, fetchData) {
13 const metaFilePath = `${accountDirectory}/${suffixMeta}`
14 const metaFileUri = `${accountUrl}${suffixMeta}`
15 const metaData = await fetchData(metaFilePath)
16 const metaGraph = $rdf.graph()
17 $rdf.parse(metaData, metaGraph, metaFileUri, 'text/turtle')
18 const webIdNode = metaGraph.any(undefined, SOLID('account'), $rdf.sym(accountUrl))
19 return webIdNode.value
20}
21
22export function isValidUsername (username) {
23 return /^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(username)

Callers 1

updateIndex.mjsFile · 0.90

Calls 1

graphMethod · 0.80

Tested by

no test coverage detected