Ruby API¶
Generated by parsing
Ruby's connector source,
so this page cannot list a method that does not exist. Package:
dfc-linkml-connector.
Exports: core + models, required from lib/dfc_linkml_connector.rb.
Surface¶
Every public method on the connector, as declared in the source.
| Method | Operation |
|---|---|
default_context_url() |
— |
instance() |
— |
load_bundled_taxonomies() |
Load the bundled taxonomies |
context_url() |
The @context URL in use |
context() |
The resolved @context |
bundled_context() |
The bundled context, or null |
load_facets() |
Replace the Facet vocabulary |
load_measures() |
Replace the Measure vocabulary |
load_product_types() |
Replace the ProductType vocabulary |
load_vocabulary() |
Replace an arbitrary vocabulary |
load_facets_from_url() |
Fetch the Facet vocabulary |
load_measures_from_url() |
Fetch the Measure vocabulary |
load_product_types_from_url() |
Fetch the ProductType vocabulary |
export() |
Export objects to JSON-LD |
validate() |
— |
import() |
Import JSON-LD into objects |
facet() |
— |
measure() |
— |
product_type() |
— |
scope() |
— |
vocabulary_term() |
— |
Read-only method accessors: ontology_version(), taxonomy_version(), vocab_loader().
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:
There are no factories. Construct the model directly:
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¶
- Model reference — every class and property
- SDK contract — the cross-language guarantees
- Migration guide — from the original connectors
- Concepts — why the behaviour is like this