Skip to content

TypeScript API

Generated by parsing TypeScript's connector source, so this page cannot list a method that does not exist. Package: @siol-data/linkml-connector.

Exports: 93 symbols from src/index.ts.

Surface

Every public method on the connector, as declared in the source.

Method Operation
loadBundledTaxonomies() Load the bundled taxonomies
getContext() The resolved @context
loadBundledContext() The bundled context, or null
loadFacets() Replace the Facet vocabulary
loadMeasures() Replace the Measure vocabulary
loadProductTypes() Replace the ProductType vocabulary
loadVocabulary() Replace an arbitrary vocabulary
loadFacetsFromUrl() Fetch the Facet vocabulary
loadMeasuresFromUrl() Fetch the Measure vocabulary
loadProductTypesFromUrl() Fetch the ProductType vocabulary
export() Export objects to JSON-LD
import() Import JSON-LD into objects
validate() —

Read-only property accessors: c.contextUrl, c.facet, c.measure, c.product_type, c.scope, c.vocabulary_term.

Plus 89 createX factories, one per DFC class, listed in the model reference.

The same operation, three names

Every row below is one capability, present in all three connectors unless marked otherwise. The names differ; the behaviour does not.

Operation TypeScript Ruby PHP
Export objects to JSON-LD export(...objects) export export
Import JSON-LD into objects import(data) import import
The @context URL in use contextUrl context_url getContextUrl()
The resolved @context getContext() context getContext()
The bundled context, or null loadBundledContext() bundled_context loadBundledContext()
Load the bundled taxonomies loadBundledTaxonomies() load_bundled_taxonomies loadBundledTaxonomies()
Replace the Facet vocabulary loadFacets(data) load_facets loadFacets(data)
Replace the Measure vocabulary loadMeasures(data) load_measures loadMeasures(data)
Replace the ProductType vocabulary loadProductTypes(data) load_product_types loadProductTypes(data)
Replace an arbitrary vocabulary loadVocabulary(name, data) load_vocabulary loadVocabulary(name, data)
Fetch the Facet vocabulary loadFacetsFromUrl() load_facets_from_url — not present —
Fetch the Measure vocabulary loadMeasuresFromUrl() load_measures_from_url — not present —
Fetch the ProductType vocabulary loadProductTypesFromUrl() load_product_types_from_url — not present —

Constructing objects

The three connectors do not agree on this, and it is the single most common source of confusion when moving code between them.

Every class has a factory on the connector, taking either form:

c.createOrganization("https://example.org/org/1", { name: "Acme" });
c.createOrganization({ semanticId: "https://example.org/org/1", name: "Acme" });

There are no factories. Construct the model directly:

DfcLinkmlConnector::Models::Organization.new(
  "https://example.org/org/1", name: "Acme"
)

Factories, positional identity first:

$c->createOrganization("https://example.org/org/1", ['name' => 'Acme']);

All three take the identity as the first argument. TypeScript additionally accepts a single object whose semanticId key carries it, which is a migration aid for code written against the original connectors.

There are 89 classes. The generated model reference lists them all, and every one has a factory except in Ruby.

See also