Options
All
  • Public
  • Public/Protected
  • All
Menu

Utility class with functions dealing with rdf triples

Hierarchy

  • Rdf

Index

Methods

Static logTripleTable

  • logTripleTable(triples: Triple[]): void
  • Log an array of triples to the console as a table with three columns: subject, predicate and object

    Parameters

    • triples: Triple[]

    Returns void

Static matchesTriple

  • matchesTriple(subject: string | null, predicate: string | null, object: string | null): function
  • Creates a triple matcher callback function for use in e.g. an Array#filter() expression

    For example:

    tripleArray.filter(Rdf.matchesTriple('someSubject', null, null));

    Parameters

    • subject: string | null

      can be null if not wanting to match by subject

    • predicate: string | null

      can be null if not wanting to match by predicate

    • object: string | null

      can be null if not wanting to match by object

    Returns function

      • (triple: Triple): boolean
      • Parameters

        • triple: Triple

        Returns boolean

Static transformObject

  • transformObject(transformMap: object, triple: Triple): Triple
  • Rename the object of a triple based on a map with original objects as keys and replacement objects as values

    For example:

    const transformedTriple = Rdf.transformObject({
      "oldObject1": "newObject1",
      "oldObject2": "newObject2",
    }, someTriple));

    Parameters

    • transformMap: object
      • [oldObject: string]: string
    • triple: Triple

    Returns Triple

Static transformPredicate

  • transformPredicate(transformMap: object, triple: Triple): Triple
  • Rename the predicate of a triple based on a map with original predicates as keys and replacement predicates as values

    For example:

    const transformedTriple = Rdf.transformPredicate({
      "oldPredicate1": "newPredicate1",
      "oldPredicate2": "newPredicate2",
    }, someTriple));

    Parameters

    • transformMap: object
      • [oldPredicate: string]: string
    • triple: Triple

    Returns Triple

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc