How to use the solid-ui.ns.rdf function in solid-ui

To help you get started, we’ve selected a few solid-ui examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github solid / solid-panes / src / pad / padPane.ts View on Github external
console.log(
                  'FAILED to craete results file at: ' +
                    padDoc.uri +
                    ' : ' +
                    message
                )
              }
            })
          } else {
            // Other error, not 404 -- do not try to overwite the file
            complainIfBad(ok, 'FAILED to read results file: ' + body)
          }
        } else {
          // Happy read
          clearElement(naviMain)
          if (store.holds(subject, ns.rdf('type'), ns.wf('TemplateInstance'))) {
            showBootstrap(subject, naviMain, 'pad')
          }
          showResults(true)
          naviMiddle3.appendChild(newInstanceButton())
        }
      })
    }
github solid / solid-panes / src / pad / padPane.source.ts View on Github external
console.log(
                  'FAILED to craete results file at: ' +
                    padDoc.uri +
                    ' : ' +
                    message
                )
              }
            })
          } else {
            // Other error, not 404 -- do not try to overwite the file
            complainIfBad(ok, 'FAILED to read results file: ' + body)
          }
        } else {
          // Happy read
          clearElement(naviMain)
          if (store.holds(subject, ns.rdf('type'), ns.wf('TemplateInstance'))) {
            showBootstrap(subject, naviMain, 'pad')
          }
          showResults(true)
          naviMiddle3.appendChild(newInstanceButton())
        }
      })
    }
github solid / solid-panes / src / pad / padPane.source.ts View on Github external
agenda.push(function createNewPadDataFile () {
        store.add(newInstance, ns.rdf('type'), PAD('Notepad'), newPadDoc)

        // TODO @@ Remove casting of add
        ;(store.add as any)(
          newInstance,
          ns.dc('created'),
          new Date(),
          newPadDoc
        )
        if (me) {
          store.add(newInstance, ns.dc('author'), me, newPadDoc)
        }
        store.add(newInstance, PAD('next'), newInstance, newPadDoc) // linked list empty

        // Keep a paper trail   @@ Revisit when we have non-public ones @@ Privacy
        store.add(newInstance, ns.space('inspiration'), thisInstance, padDoc)
        store.add(newInstance, ns.space('inspiration'), thisInstance, newPadDoc)
github solid / solid-panes / src / pad / padPane.ts View on Github external
agenda.push(function createNewPadDataFile () {
        store.add(newInstance, ns.rdf('type'), PAD('Notepad'), newPadDoc)

        // TODO @@ Remove casting of add
        ;(store.add as any)(
          newInstance,
          ns.dc('created'),
          new Date(),
          newPadDoc
        )
        if (me) {
          store.add(newInstance, ns.dc('author'), me, newPadDoc)
        }
        store.add(newInstance, PAD('next'), newInstance, newPadDoc) // linked list empty

        // Keep a paper trail   @@ Revisit when we have non-public ones @@ Privacy
        store.add(newInstance, ns.space('inspiration'), thisInstance, padDoc)
        store.add(newInstance, ns.space('inspiration'), thisInstance, newPadDoc)
github solid / solid-panes / src / pad / padPane.source.ts View on Github external
allWrite: boolean
    ) {
      var g = graph()
      var auth = Namespace('http://www.w3.org/ns/auth/acl#')
      var a = g.sym(aclURI + '#a1')
      var acl = g.sym(aclURI)
      var doc = g.sym(docURI)
      g.add(a, ns.rdf('type'), auth('Authorization'), acl)
      g.add(a, auth('accessTo'), doc, acl)
      g.add(a, auth('agent'), me, acl)
      g.add(a, auth('mode'), auth('Read'), acl)
      g.add(a, auth('mode'), auth('Write'), acl)
      g.add(a, auth('mode'), auth('Control'), acl)

      a = g.sym(aclURI + '#a2')
      g.add(a, ns.rdf('type'), auth('Authorization'), acl)
      g.add(a, auth('accessTo'), doc, acl)
      g.add(a, auth('agentClass'), ns.foaf('Agent'), acl)
      g.add(a, auth('mode'), auth('Read'), acl)
      if (allWrite) {
        g.add(a, auth('mode'), auth('Write'), acl)
      }
      // TODO: Figure out why `serialize` isn't on the type definition according to TypeScript:
      return serialize(acl, g, aclURI, 'text/turtle')
    }
github solid / solid-panes / src / pad / padPane.ts View on Github external
mintNew: function (context, newPaneOptions: any) {
    const store = context.session.store
    const updater = store.updater as UpdateManager
    if (newPaneOptions.me && !newPaneOptions.me.uri) {
      throw new Error('notepad mintNew:  Invalid userid')
    }

    var newInstance = (newPaneOptions.newInstance =
      newPaneOptions.newInstance ||
      store.sym(newPaneOptions.newBase + 'index.ttl#this'))
    // var newInstance = kb.sym(newBase + 'pad.ttl#thisPad');
    var newPadDoc = newInstance.doc()

    store.add(newInstance, ns.rdf('type'), ns.pad('Notepad'), newPadDoc)
    // @@ TODO Remove casting
    ;(store.add as any)(newInstance, ns.dc('title'), 'Shared Notes', newPadDoc)
    ;(store.add as any)(newInstance, ns.dc('created'), new Date(), newPadDoc)
    if (newPaneOptions.me) {
      store.add(newInstance, ns.dc('author'), newPaneOptions.me, newPadDoc)
    }
    // kb.add(newInstance, ns.pad('next'), newInstance, newPadDoc);
    // linked list empty @@
    var chunk = store.sym(newInstance.uri + '_line0')
    store.add(newInstance, ns.pad('next'), chunk, newPadDoc) // Linked list has one entry
    store.add(chunk, ns.pad('next'), newInstance, newPadDoc)
    store.add(chunk, ns.dc('author'), newPaneOptions.me, newPadDoc)
    // @@ TODO Remove casting
    ;(store.add as any)(chunk, ns.sioc('content'), '', newPadDoc)

    return new Promise(function (resolve, reject) {