Tripledoc

Tripledoc

  • Docs
  • API reference
  • Cheatsheet

›Interfaces

Introduction

  • Globals

Interfaces

  • LocalTripleDocumentForContainer
  • LocalTripleDocumentWithRef
  • TripleDocument
  • TripleSubject

LocalTripleDocumentForContainer

Globals › LocalTripleDocumentForContainer

An initialised Document that has not been stored in a Pod yet, and has no known location.

You will obtain a LocalTripleDocumentForContainer when calling createDocumentInContainer. It differs from a regular TripleDocument in that methods like TripleDocument.asRef are not available, because the Reference for this Document is not known yet. When you save this Document to the Pod, you will get a fully initialised TripleDocument as a return value.

Hierarchy

  • BareTripleDocument

    • LocalTripleDocumentForContainer

    • LocalTripleDocumentWithRef

Index

Properties

  • addSubject
  • save

Properties

addSubject

• addSubject: function

Inherited from void

Add a Subject — note that it is not written to the Pod until you call save.

returns A TripleSubject instance that can be used to define its properties.

Type declaration:

▸ (options?: NewSubjectOptions): TripleSubject

Parameters:

NameTypeDescription
options?NewSubjectOptionsBy default, Tripledoc will automatically generate an identifier with which this Subject can be identified within the Document, and which is likely to be unique. The options parameter has a number of optional properties. The first, identifier, takes a string. If set, Tripledoc will not automatically generate an identifier. Instead, the value of this parameter will be used as the Subject's identifier. The second optional parameter, identifierPrefix, is also a string. If set, it will be prepended before this Subject's identifier, whether that's autogenerated or not.

save

• save: function

Persist Subjects in this Document to the Pod.

returns The updated Document with persisted Subjects.

Type declaration:

▸ (subjects?: TripleSubject[]): Promise‹TripleDocument›

Parameters:

NameTypeDescription
subjects?TripleSubject[]Optional array of specific Subjects within this Document that should be written to the Pod, i.e. excluding Subjects not in this array.
← GlobalsLocalTripleDocumentWithRef →
  • Hierarchy
  • Index
    • Properties
  • Properties
    • addSubject
    • save
Tripledoc
Docs
Writing a Solid AppAPI ReferenceCheatsheet
More
Source codeRelease notes
Copyright © 2021 Inrupt