Tripledoc

Tripledoc

  • Docs
  • API reference
  • Cheatsheet

›Interfaces

Introduction

  • Globals

Interfaces

  • LocalTripleDocumentForContainer
  • LocalTripleDocumentWithRef
  • TripleDocument
  • TripleSubject

TripleSubject

Globals › TripleSubject

Represents a single Subject in a TripleDocument.

Used to read and modify properties of a single Subject in a TripleDocument, using the get*, set*, add* and remove* methods for the relevant data types. Note that those changes will not be persisted until you call TripleDocument.save.

Hierarchy

  • TripleSubject

Index

Properties

  • addDateTime
  • addDecimal
  • addInteger
  • addLiteral
  • addLocaleString
  • addRef
  • addString
  • asRef
  • getAllDateTimes
  • getAllDecimals
  • getAllIntegers
  • getAllLiterals
  • getAllLocaleStrings
  • getAllRefs
  • getAllStrings
  • getDateTime
  • getDecimal
  • getDocument
  • getInteger
  • getLiteral
  • getLocaleString
  • getRef
  • getString
  • getType
  • removeAll
  • removeDateTime
  • removeDecimal
  • removeInteger
  • removeLiteral
  • removeLocaleString
  • removeRef
  • removeString
  • setDateTime
  • setDecimal
  • setInteger
  • setLiteral
  • setLocaleString
  • setRef
  • setString

Properties

addDateTime

• addDateTime: function

Set a property of this Subject to a Literal DateTime value.

Note that this value is not saved to the user's Pod until you save the containing Document.

Type declaration:

▸ (predicate: Reference, object: Date): void

Parameters:

NameTypeDescription
predicateReferenceThe property you want to add another value of.
objectDateThe Literal DateTime value you want to add.

addDecimal

• addDecimal: function

Set a property of this Subject to a Literal decimal value.

Note that this value is not saved to the user's Pod until you save the containing Document.

Type declaration:

▸ (predicate: Reference, object: number): void

Parameters:

NameTypeDescription
predicateReferenceThe property you want to add another value of.
objectnumberThe Literal decimal value you want to add.

addInteger

• addInteger: function

Set a property of this Subject to a Literal integer value.

Note that this value is not saved to the user's Pod until you save the containing Document.

Type declaration:

▸ (predicate: Reference, object: number): void

Parameters:

NameTypeDescription
predicateReferenceThe property you want to add another value of.
objectnumberThe Literal integer value you want to add.

addLiteral

• addLiteral: function

Set a property of this Subject to a Literal value (i.e. not a URL).

Note that this value is not saved to the user's Pod until you save the containing Document.

deprecated This method has been superseded by the type-specific methods addString, addInteger, addDecimal and addDateTime.

Type declaration:

▸ (predicate: Reference, object: LiteralTypes): void

Parameters:

NameTypeDescription
predicateReferenceThe property you want to add another value of.
objectLiteralTypesThe Literal value you want to add, the type of which is one of LiteralTypes.

addLocaleString

• addLocaleString: function

Set a property of this Subject to a Literal localised string value.

Note that this value is not saved to the user's Pod until you save the containing Document.

Type declaration:

▸ (predicate: Reference, object: string, locale: string): void

Parameters:

NameTypeDescription
predicateReferenceThe property you want to add another value of.
objectstringThe Literal string value you want to add.
localestringThe locale the given string is in.

addRef

• addRef: function

Set a property of this Subject to a Reference.

Note that this value is not saved to the user's Pod until you save the containing Document.

Type declaration:

▸ (predicate: Reference, object: Reference): void

Parameters:

NameTypeDescription
predicateReferenceThe property you want to add another value of.
objectReferenceThe IRI you want to add a reference to.

addString

• addString: function

Set a property of this Subject to a Literal string value.

Note that this value is not saved to the user's Pod until you save the containing Document.

Type declaration:

▸ (predicate: Reference, object: string): void

Parameters:

NameTypeDescription
predicateReferenceThe property you want to add another value of.
objectstringThe Literal string value you want to add.

asRef

• asRef: function

Get the IRI of the Reference representing this specific Subject.

returns The IRI of this specific Subject.

Type declaration:

▸ (): Reference


getAllDateTimes

• getAllDateTimes: function

returns All literal DateTime values satisfying predicate.

Type declaration:

▸ (predicate: Reference): Date[]

Parameters:

NameTypeDescription
predicateReferenceWhich property of this Subject you want the values of.

getAllDecimals

• getAllDecimals: function

returns All literal decimal values satisfying predicate.

Type declaration:

▸ (predicate: Reference): number[]

Parameters:

NameTypeDescription
predicateReferenceWhich property of this Subject you want the values of.

getAllIntegers

• getAllIntegers: function

returns All literal integer values satisfying predicate.

Type declaration:

▸ (predicate: Reference): number[]

Parameters:

NameTypeDescription
predicateReferenceWhich property of this Subject you want the values of.

getAllLiterals

• getAllLiterals: function

returns All literal values satisfying predicate.

deprecated This method has been superseded by the type-specific methods getAllStrings, getAllIntegers, getAllDecimals and [[getAllDates]].

Type declaration:

▸ (predicate: Reference): LiteralTypes[]

Parameters:

NameTypeDescription
predicateReferenceWhich property of this Subject you want the values of.

getAllLocaleStrings

• getAllLocaleStrings: function

returns All literal string values satisfying predicate in the given locale, or all locale strings if no locale was specified.

Type declaration:

▸ (predicate: Reference, locale?: undefined | string): GetAllLocaleStringsReturnType‹undefined | string›

Parameters:

NameTypeDescription
predicateReferenceWhich property of this Subject you want the values of.
locale?undefined | stringWhich locale the values should be in, e.g. 'nl-NL', or undefined to get all locale strings.

getAllRefs

• getAllRefs: function

returns All references satisfying predicate.

Type declaration:

▸ (predicate: Reference): Array‹Reference›

Parameters:

NameTypeDescription
predicateReferenceWhich property of this Subject you want the values of.

getAllStrings

• getAllStrings: function

returns All literal string values satisfying predicate.

Type declaration:

▸ (predicate: Reference): string[]

Parameters:

NameTypeDescription
predicateReferenceWhich property of this Subject you want the values of.

getDateTime

• getDateTime: function

Find a literal date+time value for predicate on this Subject.

This retrieves one date+time literal, or null if none is found. If you want to find all date+time literals for a predicate, see getAllDateTimes.

returns The first literal Date value satisfying predicate, if any, and null otherwise.

Type declaration:

▸ (predicate: Reference): Date | null

Parameters:

NameTypeDescription
predicateReferenceWhich property of this Subject you want the value of.

getDecimal

• getDecimal: function

Find a literal decimal value for predicate on this Subject.

This retrieves one decimal literal, or null if none is found. If you want to find all decimal literals for a predicate, see getAllDecimals.

returns The first literal decimal value satisfying predicate, if any, and null otherwise.

Type declaration:

▸ (predicate: Reference): number | null

Parameters:

NameTypeDescription
predicateReferenceWhich property of this Subject you want the value of.

getDocument

• getDocument: function

returns The TripleDocument that contains this Subject.

Type declaration:

▸ (): BareTripleDocument


getInteger

• getInteger: function

Find a literal integer value for predicate on this Subject.

This retrieves one integer literal, or null if none is found. If you want to find all integer literals for a predicate, see getAllIntegers.

returns The first literal integer value satisfying predicate, if any, and null otherwise.

Type declaration:

▸ (predicate: Reference): number | null

Parameters:

NameTypeDescription
predicateReferenceWhich property of this Subject you want the value of.

getLiteral

• getLiteral: function

returns The first literal value satisfying predicate, if any, and null otherwise.

deprecated This method has been superseded by the type-specific methods getString, getInteger, getDecimal and getDateTime.

Type declaration:

▸ (predicate: Reference): LiteralTypes | null

Parameters:

NameTypeDescription
predicateReferenceWhich property of this Subject you want the value of.

getLocaleString

• getLocaleString: function

Find a literal string value in a given locale for predicate on this Subject.

This retrieves one string literal, or null if none (in the given locale) is found. If you want to find all string literals in a locale for a predicate, see getAllLocaleStrings.

returns The first literal string value satisfying predicate in the given locale, if any, and null otherwise.

Type declaration:

▸ (predicate: Reference, locale: string): string | null

Parameters:

NameTypeDescription
predicateReferenceWhich property of this Subject you want the value of.
localestringWhich locale the string should be in, e.g. 'nl-NL'.

getRef

• getRef: function

Find a reference attached to this Subject with predicate.

This retrieves one reference, or null if none is found. If you want to find all references for a predicate, see getAllRefs.

returns The first referenced IRI satisfying predicate, if any, and null otherwise.

Type declaration:

▸ (predicate: Reference): Reference | null

Parameters:

NameTypeDescription
predicateReferenceWhich property of this Subject you want the value of.

getString

• getString: function

Find a literal string value for predicate on this Subject.

This retrieves one string literal, or null if none is found. If you want to find all string literals for a predicate, see getAllStrings.

returns The first literal string value satisfying predicate, if any, and null otherwise.

Type declaration:

▸ (predicate: Reference): string | null

Parameters:

NameTypeDescription
predicateReferenceWhich property of this Subject you want the value of.

getType

• getType: function

returns The type of this Subject, if known.

Type declaration:

▸ (): Reference | null


removeAll

• removeAll: function

Remove all values for a property of this Subject.

Note that these values are not removed from the user's Pod until you save the containing Document.

Type declaration:

▸ (predicate: Reference): void

Parameters:

NameTypeDescription
predicateReferenceThe property you want to remove the values of.

removeDateTime

• removeDateTime: function

Remove a Literal DateTime value for a property of this Subject.

Note that this value is not removed from the user's Pod until you save the containing Document.

Type declaration:

▸ (predicate: Reference, object: Date): void

Parameters:

NameTypeDescription
predicateReferenceThe property you want to remove a value of.
objectDateThe Literal DateTime value you want to remove.

removeDecimal

• removeDecimal: function

Remove a Literal decimal value for a property of this Subject.

Note that this value is not removed from the user's Pod until you save the containing Document.

Type declaration:

▸ (predicate: Reference, object: number): void

Parameters:

NameTypeDescription
predicateReferenceThe property you want to remove a value of.
objectnumberThe Literal decimal value you want to remove.

removeInteger

• removeInteger: function

Remove a Literal integer value for a property of this Subject.

Note that this value is not removed from the user's Pod until you save the containing Document.

Type declaration:

▸ (predicate: Reference, object: number): void

Parameters:

NameTypeDescription
predicateReferenceThe property you want to remove a value of.
objectnumberThe Literal integer value you want to remove.

removeLiteral

• removeLiteral: function

Remove a Literal value for a property of this Subject.

Note that this value is not removed from the user's Pod until you save the containing Document.

deprecated This method has been superseded by the type-specific methods removeString, removeInteger, removeDecimal and removeDateTime.

Type declaration:

▸ (predicate: Reference, object: LiteralTypes): void

Parameters:

NameTypeDescription
predicateReferenceThe property you want to remove a value of.
objectLiteralTypesThe Literal value you want to remove, the type of which is one of LiteralTypes.

removeLocaleString

• removeLocaleString: function

Remove a Literal localised string value for a property of this Subject.

Note that this value is not removed from the user's Pod until you save the containing Document.

Type declaration:

▸ (predicate: Reference, object: string, locale: string): void

Parameters:

NameTypeDescription
predicateReferenceThe property you want to remove a value of.
objectstringThe Literal string value you want to remove.
localestringThe locale of the string to remove.

removeRef

• removeRef: function

Remove a Reference value for a property of this Subject.

Note that this pointer is not removed from the user's Pod until you save the containing Document.

Type declaration:

▸ (predicate: Reference, object: Reference): void

Parameters:

NameTypeDescription
predicateReferenceThe property you want to remove a reference for.
objectReferenceThe reference you want to remove.

removeString

• removeString: function

Remove a Literal string value for a property of this Subject.

Note that this value is not removed from the user's Pod until you save the containing Document.

Type declaration:

▸ (predicate: Reference, object: string): void

Parameters:

NameTypeDescription
predicateReferenceThe property you want to remove a value of.
objectstringThe Literal string value you want to remove.

setDateTime

• setDateTime: function

Set a property of this Subject to a DateTime Literal value, clearing all existing values.

Note that this change is not saved to the user's Pod until you save the containing Document.

Type declaration:

▸ (predicate: Reference, object: Date): void

Parameters:

NameTypeDescription
predicateReferenceThe property you want to set the value of.
objectDateThe DateTime Literal value you want to set.

setDecimal

• setDecimal: function

Set a property of this Subject to a decimal Literal value, clearing all existing values.

Note that this change is not saved to the user's Pod until you save the containing Document.

Type declaration:

▸ (predicate: Reference, object: number): void

Parameters:

NameTypeDescription
predicateReferenceThe property you want to set the value of.
objectnumberThe decimal Literal value you want to set.

setInteger

• setInteger: function

Set a property of this Subject to an integer Literal value, clearing all existing values.

Note that this change is not saved to the user's Pod until you save the containing Document.

Type declaration:

▸ (predicate: Reference, object: number): void

Parameters:

NameTypeDescription
predicateReferenceThe property you want to set the value of.
objectnumberThe integer Literal value you want to set.

setLiteral

• setLiteral: function

Set a property of this Subject to a Literal value, clearing all existing values.

Note that this change is not saved to the user's Pod until you save the containing Document.

deprecated This method has been superseded by the type-specific methods setString, setInteger, setDecimal and setDateTime.

Type declaration:

▸ (predicate: Reference, object: LiteralTypes): void

Parameters:

NameTypeDescription
predicateReferenceThe property you want to set the value of.
objectLiteralTypesThe Literal value you want to set, the type of which is one of LiteralTypes.

setLocaleString

• setLocaleString: function

Set a property of this Subject to a localised string Literal value, clearing all existing values.

Note that this change is not saved to the user's Pod until you save the containing Document.

Type declaration:

▸ (predicate: Reference, object: string, locale: string): void

Parameters:

NameTypeDescription
predicateReferenceThe property you want to set the value of.
objectstringThe string Literal value you want to set.
localestringThe locale of the given string.

setRef

• setRef: function

Set a property of this Subject to a Reference, clearing all existing values.

Note that this change is not saved to the user's Pod until you save the containing Document.

Type declaration:

▸ (predicate: Reference, object: Reference): void

Parameters:

NameTypeDescription
predicateReferenceThe property you want to set the value of.
objectReferenceThe reference you want to add.

setString

• setString: function

Set a property of this Subject to a string Literal value, clearing all existing values.

Note that this change is not saved to the user's Pod until you save the containing Document.

Type declaration:

▸ (predicate: Reference, object: string): void

Parameters:

NameTypeDescription
predicateReferenceThe property you want to set the value of.
objectstringThe string Literal value you want to set.
← TripleDocument
  • Hierarchy
  • Index
    • Properties
  • Properties
    • addDateTime
    • addDecimal
    • addInteger
    • addLiteral
    • addLocaleString
    • addRef
    • addString
    • asRef
    • getAllDateTimes
    • getAllDecimals
    • getAllIntegers
    • getAllLiterals
    • getAllLocaleStrings
    • getAllRefs
    • getAllStrings
    • getDateTime
    • getDecimal
    • getDocument
    • getInteger
    • getLiteral
    • getLocaleString
    • getRef
    • getString
    • getType
    • removeAll
    • removeDateTime
    • removeDecimal
    • removeInteger
    • removeLiteral
    • removeLocaleString
    • removeRef
    • removeString
    • setDateTime
    • setDecimal
    • setInteger
    • setLiteral
    • setLocaleString
    • setRef
    • setString
Tripledoc
Docs
Writing a Solid AppAPI ReferenceCheatsheet
More
Source codeRelease notes
Copyright © 2021 Inrupt