Options
All
  • Public
  • Public/Protected
  • All
Menu

In m-ld, all API interactions are done 'in context'. All identifiers of significant data entities, including Subjects, properties and types are actually IRIs, but in an API call they may appear to be simple strings.

The default context for API calls in m-ld (if not overridden in the config), uses the provided domain name to scope all identifiers, as follows:

  • Subject identities are prefixed with http://≪domain≫/ (the so-called "base" of the domain)
  • property names and types are prefixed with http://≪domain≫/# (note the extra hash; this is the so-called "vocabulary", or "vocab" of the domain)

A MeldContext allows an application to translate between simple strings and IRIs. This is typically only necessary in advanced use-cases, such as when creating constraints.

see

https://www.w3.org/TR/json-ld/#the-context

Hierarchy

  • MeldContext

Index

Methods

compactIri

  • compactIri(iri: Iri, options?: undefined | { vocab?: undefined | false | true }): string
  • Compact an IRI to its short identifier

    Parameters

    • iri: Iri

      the IRI to compact

    • Optional options: undefined | { vocab?: undefined | false | true }

      whether to compact according to the vocab (or otherwise the base)

    Returns string

expandTerm

  • expandTerm(value: string, options?: undefined | { vocab?: undefined | false | true }): Iri
  • Expand an identifier to its full IRI

    Parameters

    • value: string

      the identifier to expand

    • Optional options: undefined | { vocab?: undefined | false | true }

      whether to expand according to the vocab (or otherwise the base)

    Returns Iri

getTermDetail

  • getTermDetail(key: string, type: keyof ExpandedTermDef): string | null

Legend

  • Constructor
  • Property
  • Method
  • Property
  • Method
  • Inherited property
  • Inherited method
  • Static property
  • Static method
  • Protected method

Generated using TypeDoc. Delivered by Vercel. @m-ld/m-ld - v0.10.1-edge.4 Source code licensed MIT. Privacy policy