Skip to main content
Version: 1.0.0

Project metadata

A model is more than its classes and relations — to be findable and reusable it needs to say who made it, why, under which license, and what it is about. ontouml-js covers this with the metadata fields of the OntoUML/UFO Catalog Metadata Vocabulary (OCMV), the same fields used to catalog models in the OntoUML/UFO Catalog.

Theory: FAIR models

These fields exist so a model can be published as a FAIR resource — Findable, Accessible, Interoperable, Reusable. Most map directly onto Dublin Core and DCAT terms (publisher, license, themes, landing pages), which is why they reference resources on the semantic web rather than plain strings.

Resources: named references​

Metadata fields that point at things — a publisher, a license, a theme — are Resource objects: a URI plus a (multilingual) name.

import { class Resource
A reference to a resource on the semantic web, identified by its URI and described by its name, as defined by the OntoUML JSON Schema. Resources are used in the metadata fields of projects and named elements, e.g., to identify creators, publishers, licenses, and themes.
Resource
} from 'ontouml-js';
const const publisher: Resourcepublisher = new new Resource(uri?: string, name?: string, language?: string): Resource
A reference to a resource on the semantic web, identified by its URI and described by its name, as defined by the OntoUML JSON Schema. Resources are used in the metadata fields of projects and named elements, e.g., to identify creators, publishers, licenses, and themes.
Resource
(
'https://www.utwente.nl', 'University of Twente' ); var console: Consoleconsole.Console.log(...data: any[]): void
The **`console.log()`** static method outputs a message to the console. [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/log_static)
log
(const publisher: Resourcepublisher.Resource.uri?: string
The URI identifying the resource.
uri
); // https://www.utwente.nl
var console: Consoleconsole.Console.log(...data: any[]): void
The **`console.log()`** static method outputs a message to the console. [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/log_static)
log
(const publisher: Resourcepublisher.Resource.name: LanguageString
The human-readable name of the resource, possibly in multiple languages.
name
.LanguageString.get(language?: string): string | null
Returns the text value for the given language. If no language is provided, returns the value of the first language in languagePreference for which a value exists. If no such value exists, returns the first value it finds. If no values are defined, returns `null`.
@paramlanguage - language tag of the desired value (e.g., `"en"`).@throwsan error if `language` is provided but invalid or has no value.
get
()); // University of Twente

Fields that hold text — keywords, bibliographic citations — are LanguageStrings, so they can be written in several languages at once.

Setting metadata at creation time​

Project.builder() (or new ProjectBuilder()) exposes one fluent method per field. Singular methods can be chained repeatedly to add several values:

import { class Project
An OntoUML project: the top-level container of an ontology and the entry point of this library. A project holds every element of a model — classes, relations, generalizations, packages, properties, notes — as well as the diagrams and views that depict them, and provides typed access to these elements by id or by kind. New elements are created through the fluent builders exposed by the project (e.g., classBuilder , binaryRelationBuilder ), which register the created elements in the project. A project is also described by the metadata fields of the OntoUML/UFO Catalog Metadata Vocabulary, such as publisher, license, keywords, themes, and designed-for tasks.
@example```typescript const project = new Project(); const person = project.classBuilder().kind().name('Person').build(); const student = project.classBuilder().role().name('Student').build(); project .generalizationBuilder() .general(person) .specific(student) .build(); ```
Project
} from 'ontouml-js';
const const project: Projectproject = class Project
An OntoUML project: the top-level container of an ontology and the entry point of this library. A project holds every element of a model — classes, relations, generalizations, packages, properties, notes — as well as the diagrams and views that depict them, and provides typed access to these elements by id or by kind. New elements are created through the fluent builders exposed by the project (e.g., classBuilder , binaryRelationBuilder ), which register the created elements in the project. A project is also described by the metadata fields of the OntoUML/UFO Catalog Metadata Vocabulary, such as publisher, license, keywords, themes, and designed-for tasks.
@example```typescript const project = new Project(); const person = project.classBuilder().kind().name('Person').build(); const student = project.classBuilder().role().name('Student').build(); project .generalizationBuilder() .general(person) .specific(student) .build(); ```
Project
.Project.builder(): ProjectBuilder
Creates a builder for a new Project .
builder
()
.NamedElementBuilder<ProjectBuilder>.name(value: string, language?: string): ProjectBuilder
Adds a name to the element in the given language.
@paramvalue - the name text.@paramlanguage - language tag of `value`; defaults to LanguageString.defaultLanguage.@returnsthis builder, for method chaining.
name
('Library Ontology')
.ProjectBuilder.acronym(value: string): ProjectBuilder
Adds an acronym by which the project is known (e.g., `"UFO-S"`).
@returnsthis builder, for method chaining.
acronym
('LibO')
.ProjectBuilder.keyword(value: string, language?: string): ProjectBuilder
Adds a keyword describing the content of the project.
@paramvalue - the keyword text.@paramlanguage - language tag of `value`; defaults to LanguageString.defaultLanguage.@returnsthis builder, for method chaining.
keyword
('libraries')
.ProjectBuilder.keyword(value: string, language?: string): ProjectBuilder
Adds a keyword describing the content of the project.
@paramvalue - the keyword text.@paramlanguage - language tag of `value`; defaults to LanguageString.defaultLanguage.@returnsthis builder, for method chaining.
keyword
('bibliotecas', 'pt')
.ProjectBuilder.language(value: string): ProjectBuilder
Adds a language in which the project's elements are written, identified by a language tag (e.g., `"en"`, `"pt"`).
@returnsthis builder, for method chaining.
language
('en')
.ProjectBuilder.language(value: string): ProjectBuilder
Adds a language in which the project's elements are written, identified by a language tag (e.g., `"en"`, `"pt"`).
@returnsthis builder, for method chaining.
language
('pt')
.ProjectBuilder.publisher(uri?: string, name?: string, language?: string): ProjectBuilder
Sets the agent responsible for making the project available, such as a research group or a company.
@paramuri - URI identifying the publisher.@paramname - human-readable label of the publisher.@paramlanguage - language tag of `name` (e.g., `"en"`).@returnsthis builder, for method chaining.@throwsan error if both `uri` and `name` are absent.
publisher
('https://www.utwente.nl', 'University of Twente')
.ProjectBuilder.license(uri?: string, name?: string, language?: string): ProjectBuilder
Sets the license under which the project is distributed.
@paramuri - URI identifying the license (e.g., `"https://creativecommons.org/licenses/by/4.0/"`).@paramname - human-readable label of the license (e.g., `"CC BY 4.0"`).@paramlanguage - language tag of `name` (e.g., `"en"`).@returnsthis builder, for method chaining.@throwsan error if both `uri` and `name` are absent.
license
('https://creativecommons.org/licenses/by/4.0/', 'CC BY 4.0')
.ProjectBuilder.landingPage(uri: string): ProjectBuilder
Adds the URL of a web page where the project is made available.
@returnsthis builder, for method chaining.
landingPage
('https://example.org/library-ontology')
.ProjectBuilder.source(uri: string): ProjectBuilder
Adds the URI of a resource from which the project is derived, such as another ontology or a standard.
@returnsthis builder, for method chaining.
source
('https://doi.org/10.3233/AO-150150')
.ProjectBuilder.bibliographicCitation(value: string, language?: string): ProjectBuilder
Adds a bibliographic citation to a publication that documents the project.
@paramvalue - the citation text.@paramlanguage - language tag of `value`; defaults to LanguageString.defaultLanguage.@returnsthis builder, for method chaining.
bibliographicCitation
(
'Doe, J. (2026). The Library Ontology. Applied Ontology.' ) .ProjectBuilder.theme(uri?: string, name?: string, language?: string): ProjectBuilder
Adds a central theme of the project, i.e., a subject domain it covers (e.g., healthcare, finance).
@paramuri - URI identifying the theme.@paramname - human-readable label of the theme.@paramlanguage - language tag of `name` (e.g., `"en"`).@returnsthis builder, for method chaining.@throwsan error if both `uri` and `name` are absent.
theme
('https://id.loc.gov/authorities/classification/Z', 'Class Z')
.ProjectBuilder.build(): Project
Builds an instance of Project with the parameters passed to the builder. When no methods are evoked, the created project has the following defaults: - `id: "randomly-generated-id",` - `created: new Date()`
@throwsan error if the builder has already been used.
build
();
var console: Consoleconsole.Console.log(...data: any[]): void
The **`console.log()`** static method outputs a message to the console. [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/log_static)
log
(const project: Projectproject.Project.keywords: LanguageString[]
The keywords describing the content of this project. Sets the keywords of this project, replacing any existing ones.
@throwsan error if the array is null, undefined, or contains a null or undefined member.
keywords
.Array<LanguageString>.length: number
Gets or sets the length of the array. This is a number one higher than the highest index in the array.
length
); // 2
var console: Consoleconsole.Console.log(...data: any[]): void
The **`console.log()`** static method outputs a message to the console. [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/log_static)
log
(const project: Projectproject.Project.license?: Resource
The license under which the project is distributed.
license
?.Resource.name: LanguageString
The human-readable name of the resource, possibly in multiple languages.
name
.LanguageString.get(language?: string): string | null
Returns the text value for the given language. If no language is provided, returns the value of the first language in languagePreference for which a value exists. If no such value exists, returns the first value it finds. If no values are defined, returns `null`.
@paramlanguage - language tag of the desired value (e.g., `"en"`).@throwsan error if `language` is provided but invalid or has no value.
get
()); // CC BY 4.0

Controlled vocabularies​

Four fields take values from OCMV's controlled vocabularies, exported as enums: OntologyDevelopmentContext (where the model was developed), OntologyPurpose (why), OntologyType (its generality), and OntologyRepresentationStyle (OntoUML- vs. UFO-style). Pass an enum value and the builder resolves the official English label for you:

import {
  class Project
An OntoUML project: the top-level container of an ontology and the entry point of this library. A project holds every element of a model — classes, relations, generalizations, packages, properties, notes — as well as the diagrams and views that depict them, and provides typed access to these elements by id or by kind. New elements are created through the fluent builders exposed by the project (e.g., classBuilder , binaryRelationBuilder ), which register the created elements in the project. A project is also described by the metadata fields of the OntoUML/UFO Catalog Metadata Vocabulary, such as publisher, license, keywords, themes, and designed-for tasks.
@example```typescript const project = new Project(); const person = project.classBuilder().kind().name('Person').build(); const student = project.classBuilder().role().name('Student').build(); project .generalizationBuilder() .general(person) .specific(student) .build(); ```
Project
,
enum OntologyDevelopmentContext
The contexts in which an ontology can be developed, i.e., the types of initiatives that motivated its creation.
OntologyDevelopmentContext
,
enum OntologyPurpose
The goals that motivate the development of an ontology.
OntologyPurpose
,
enum OntologyType
The types of ontologies according to their generality, as proposed in Roussey et al. (2011), "An introduction to ontologies and ontology engineering."
OntologyType
,
enum OntologyRepresentationStyle
The modeling styles an ontology can adopt, based on the languages used to express its elements.
OntologyRepresentationStyle
} from 'ontouml-js'; const const project: Projectproject = class Project
An OntoUML project: the top-level container of an ontology and the entry point of this library. A project holds every element of a model — classes, relations, generalizations, packages, properties, notes — as well as the diagrams and views that depict them, and provides typed access to these elements by id or by kind. New elements are created through the fluent builders exposed by the project (e.g., classBuilder , binaryRelationBuilder ), which register the created elements in the project. A project is also described by the metadata fields of the OntoUML/UFO Catalog Metadata Vocabulary, such as publisher, license, keywords, themes, and designed-for tasks.
@example```typescript const project = new Project(); const person = project.classBuilder().kind().name('Person').build(); const student = project.classBuilder().role().name('Student').build(); project .generalizationBuilder() .general(person) .specific(student) .build(); ```
Project
.Project.builder(): ProjectBuilder
Creates a builder for a new Project .
builder
()
.NamedElementBuilder<ProjectBuilder>.name(value: string, language?: string): ProjectBuilder
Adds a name to the element in the given language.
@paramvalue - the name text.@paramlanguage - language tag of `value`; defaults to LanguageString.defaultLanguage.@returnsthis builder, for method chaining.
name
('Library Ontology')
.ProjectBuilder.context(uri?: string, name?: string, language?: string): ProjectBuilder
Adds a context in which the project was developed, preferably one of the values of OntologyDevelopmentContext .
@example```typescript builder.context(OntologyDevelopmentContext.RESEARCH); ```@paramuri - URI identifying the context.@paramname - human-readable label of the context; when omitted and `uri` is a value of OntologyDevelopmentContext, the official label of the context is used.@paramlanguage - language tag of `name` (e.g., `"en"`).@returnsthis builder, for method chaining.@throwsan error if both `uri` and `name` are absent.
context
(enum OntologyDevelopmentContext
The contexts in which an ontology can be developed, i.e., the types of initiatives that motivated its creation.
OntologyDevelopmentContext
.function (enum member) OntologyDevelopmentContext.RESEARCH = "https://w3id.org/ontouml-models/vocabulary#Research"
Determines that the artifact was developed as part of a research project. This usually implies that the artifact was featured in a scientific publication.
RESEARCH
)
.ProjectBuilder.designedForTask(uri?: string, name?: string, language?: string): ProjectBuilder
Adds a goal that motivated the development of the project, preferably one of the values of OntologyPurpose .
@example```typescript builder.designedForTask(OntologyPurpose.CONCEPTUAL_CLARIFICATION); ```@paramuri - URI identifying the task.@paramname - human-readable label of the task; when omitted and `uri` is a value of OntologyPurpose, the official label of the purpose is used.@paramlanguage - language tag of `name` (e.g., `"en"`).@returnsthis builder, for method chaining.@throwsan error if both `uri` and `name` are absent.
designedForTask
(enum OntologyPurpose
The goals that motivate the development of an ontology.
OntologyPurpose
.function (enum member) OntologyPurpose.CONCEPTUAL_CLARIFICATION = "https://w3id.org/ontouml-models/vocabulary#ConceptualClarification"
Determines that the artifact was created as the result of an ontological analysis of a concept, language, or domain of interest that sought to conceptually clarify and untangle complex notions and relations.
CONCEPTUAL_CLARIFICATION
)
.ProjectBuilder.ontologyType(uri?: string, name?: string, language?: string): ProjectBuilder
Adds a type classifying the project's ontology according to its generality, preferably one of the values of OntologyType .
@example```typescript builder.ontologyType(OntologyType.DOMAIN); ```@paramuri - URI identifying the ontology type.@paramname - human-readable label of the ontology type; when omitted and `uri` is a value of OntologyType, the official label of the type is used.@paramlanguage - language tag of `name` (e.g., `"en"`).@returnsthis builder, for method chaining.@throwsan error if both `uri` and `name` are absent.
ontologyType
(enum OntologyType
The types of ontologies according to their generality, as proposed in Roussey et al. (2011), "An introduction to ontologies and ontology engineering."
OntologyType
.function (enum member) OntologyType.DOMAIN = "https://w3id.org/ontouml-models/vocabulary#Domain"
Identifies an ontology that describes how a community conceptualizes a phenomenon of interest. In general, a domain ontology formally characterizes a much narrower domain than a core ontology does.
DOMAIN
)
.ProjectBuilder.representationStyle(uri?: string, name?: string, language?: string): ProjectBuilder
Sets the modeling style adopted in the project, preferably one of the values of OntologyRepresentationStyle .
@example```typescript builder.representationStyle(OntologyRepresentationStyle.ONTOUML); ```@paramuri - URI identifying the representation style.@paramname - human-readable label of the representation style; when omitted and `uri` is a value of OntologyRepresentationStyle, the official label of the style is used.@paramlanguage - language tag of `name` (e.g., `"en"`).@returnsthis builder, for method chaining.@throwsan error if both `uri` and `name` are absent.
representationStyle
(enum OntologyRepresentationStyle
The modeling styles an ontology can adopt, based on the languages used to express its elements.
OntologyRepresentationStyle
.function (enum member) OntologyRepresentationStyle.ONTOUML = "https://w3id.org/ontouml-models/vocabulary#OntoumlStyle"
Characterizes a model that contains at least one class, relation, or property using a valid OntoUML stereotype.
ONTOUML
)
.ProjectBuilder.build(): Project
Builds an instance of Project with the parameters passed to the builder. When no methods are evoked, the created project has the following defaults: - `id: "randomly-generated-id",` - `created: new Date()`
@throwsan error if the builder has already been used.
build
();
var console: Consoleconsole.Console.log(...data: any[]): void
The **`console.log()`** static method outputs a message to the console. [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/log_static)
log
(const project: Projectproject.Project.contexts: Resource[]
The contexts in which this project was developed, preferably values of OntologyDevelopmentContext . Sets the contexts in which this project was developed, replacing any existing ones. Values should preferably be taken from OntologyDevelopmentContext .
@throwsan error if the array is null, undefined, or contains a null or undefined member.
contexts
[0].Resource.name: LanguageString
The human-readable name of the resource, possibly in multiple languages.
name
.LanguageString.get(language?: string): string | null
Returns the text value for the given language. If no language is provided, returns the value of the first language in languagePreference for which a value exists. If no such value exists, returns the first value it finds. If no values are defined, returns `null`.
@paramlanguage - language tag of the desired value (e.g., `"en"`).@throwsan error if `language` is provided but invalid or has no value.
get
()); // Research Context

Each of these methods also accepts a plain (uri, name, language) triple when you need a value outside the vocabulary.

Editing metadata on an existing project​

Every field is also a property of Project, with add*/remove* methods for the plural ones:

import { class Project
An OntoUML project: the top-level container of an ontology and the entry point of this library. A project holds every element of a model — classes, relations, generalizations, packages, properties, notes — as well as the diagrams and views that depict them, and provides typed access to these elements by id or by kind. New elements are created through the fluent builders exposed by the project (e.g., classBuilder , binaryRelationBuilder ), which register the created elements in the project. A project is also described by the metadata fields of the OntoUML/UFO Catalog Metadata Vocabulary, such as publisher, license, keywords, themes, and designed-for tasks.
@example```typescript const project = new Project(); const person = project.classBuilder().kind().name('Person').build(); const student = project.classBuilder().role().name('Student').build(); project .generalizationBuilder() .general(person) .specific(student) .build(); ```
Project
, class Resource
A reference to a resource on the semantic web, identified by its URI and described by its name, as defined by the OntoUML JSON Schema. Resources are used in the metadata fields of projects and named elements, e.g., to identify creators, publishers, licenses, and themes.
Resource
, class LanguageString
A text value expressed in one or more languages. Each value is indexed by an IETF BCP 47 language tag (e.g., `"en"`, `"pt"`), allowing elements to be named and described multilingually. For example, a class may be named `"Person"` in English and `"Pessoa"` in Portuguese. The static fields defaultLanguage and languagePreference control, respectively, the language assumed when adding a value without a tag and the order in which languages are tried when retrieving a value without specifying one.
LanguageString
} from 'ontouml-js';
const const project: Projectproject = new new Project(): Project
An OntoUML project: the top-level container of an ontology and the entry point of this library. A project holds every element of a model — classes, relations, generalizations, packages, properties, notes — as well as the diagrams and views that depict them, and provides typed access to these elements by id or by kind. New elements are created through the fluent builders exposed by the project (e.g., classBuilder , binaryRelationBuilder ), which register the created elements in the project. A project is also described by the metadata fields of the OntoUML/UFO Catalog Metadata Vocabulary, such as publisher, license, keywords, themes, and designed-for tasks.
@example```typescript const project = new Project(); const person = project.classBuilder().kind().name('Person').build(); const student = project.classBuilder().role().name('Student').build(); project .generalizationBuilder() .general(person) .specific(student) .build(); ```
Project
();
const project: Projectproject.Project.publisher?: Resource
The agent responsible for making the project available, such as a research group or a company.
publisher
= new new Resource(uri?: string, name?: string, language?: string): Resource
A reference to a resource on the semantic web, identified by its URI and described by its name, as defined by the OntoUML JSON Schema. Resources are used in the metadata fields of projects and named elements, e.g., to identify creators, publishers, licenses, and themes.
Resource
('https://www.utwente.nl', 'UT');
const project: Projectproject.Project.namespace?: string
The namespace URI under which the project's elements are identified.
namespace
= 'https://example.org/libo#';
const project: Projectproject.Project.addKeyword(value: LanguageString): void
Adds a keyword describing the content of this project.
@throwsan error if the value is null or undefined.
addKeyword
(new new LanguageString(value?: string, language?: string): LanguageString
A text value expressed in one or more languages. Each value is indexed by an IETF BCP 47 language tag (e.g., `"en"`, `"pt"`), allowing elements to be named and described multilingually. For example, a class may be named `"Person"` in English and `"Pessoa"` in Portuguese. The static fields defaultLanguage and languagePreference control, respectively, the language assumed when adding a value without a tag and the order in which languages are tried when retrieving a value without specifying one.
LanguageString
('libraries'));
const project: Projectproject.Project.addLanguage(value: string): void
Adds a language in which this project's elements are written, identified by a language tag (e.g., `"en"`, `"pt"`).
@throwsan error if the value is null or undefined.
addLanguage
('en');
const project: Projectproject.Project.addAcronym(value: string): void
Adds an acronym by which this project is known (e.g., `"UFO-S"`).
@throwsan error if the value is null or undefined.
addAcronym
('LibO');
var console: Consoleconsole.Console.log(...data: any[]): void
The **`console.log()`** static method outputs a message to the console. [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/log_static)
log
(const project: Projectproject.Project.acronyms: string[]
The acronyms by which this project is known (e.g., `"UFO-S"`). Sets the acronyms of this project, replacing any existing ones.
@throwsan error if the array is null, undefined, or contains a null or undefined member.
acronyms
); // [ "LibO" ]

namespace deserves a note: when set, namespace + element.id should form a resolvable URI for every element — this is how a serialized model becomes a set of FAIR digital objects.

Metadata on every element​

Authorship isn't limited to the project. Every named element — classes, relations, packages, even diagrams — carries creators and contributors (both Resource lists), plus alternativeNames and editorialNotes:

import { class Project
An OntoUML project: the top-level container of an ontology and the entry point of this library. A project holds every element of a model — classes, relations, generalizations, packages, properties, notes — as well as the diagrams and views that depict them, and provides typed access to these elements by id or by kind. New elements are created through the fluent builders exposed by the project (e.g., classBuilder , binaryRelationBuilder ), which register the created elements in the project. A project is also described by the metadata fields of the OntoUML/UFO Catalog Metadata Vocabulary, such as publisher, license, keywords, themes, and designed-for tasks.
@example```typescript const project = new Project(); const person = project.classBuilder().kind().name('Person').build(); const student = project.classBuilder().role().name('Student').build(); project .generalizationBuilder() .general(person) .specific(student) .build(); ```
Project
, class Resource
A reference to a resource on the semantic web, identified by its URI and described by its name, as defined by the OntoUML JSON Schema. Resources are used in the metadata fields of projects and named elements, e.g., to identify creators, publishers, licenses, and themes.
Resource
} from 'ontouml-js';
const const project: Projectproject = new new Project(): Project
An OntoUML project: the top-level container of an ontology and the entry point of this library. A project holds every element of a model — classes, relations, generalizations, packages, properties, notes — as well as the diagrams and views that depict them, and provides typed access to these elements by id or by kind. New elements are created through the fluent builders exposed by the project (e.g., classBuilder , binaryRelationBuilder ), which register the created elements in the project. A project is also described by the metadata fields of the OntoUML/UFO Catalog Metadata Vocabulary, such as publisher, license, keywords, themes, and designed-for tasks.
@example```typescript const project = new Project(); const person = project.classBuilder().kind().name('Person').build(); const student = project.classBuilder().role().name('Student').build(); project .generalizationBuilder() .general(person) .specific(student) .build(); ```
Project
();
const const model: Packagemodel = const project: Projectproject.Project.packageBuilder(): PackageBuilder
Creates a builder for a new Package in this project.
packageBuilder
().PackageBuilder.root(): PackageBuilder
Sets the package as the root package of its project, i.e., the package that contains the entire model.
@returnsthis builder, for method chaining.
root
().PackageBuilder.build(): Package
Builds an instance of Package with the parameters passed to the builder. When no methods are evoked, the created package has the following defaults: - `id: "randomly-generated-id",` - `created: new Date(),` - `contents: []`
@throwsan error if the builder has already been used.
build
();
const const person: Classperson = const model: Packagemodel.Package.classBuilder(): ClassBuilder
Creates a builder for a Class contained in this package.
classBuilder
().ClassBuilder.kind(): ClassBuilder
Sets the stereotype of the class to «kind», which decorates rigid classes that provide an identity principle to their instances, which are functional complexes (e.g., `Person`, `Car`). Also applies the following defaults: - `restrictedTo = [ "functional-complex" ]` - `order = 1`
@returnsthis builder, for method chaining.
kind
().NamedElementBuilder<ClassBuilder>.name(value: string, language?: string): ClassBuilder
Adds a name to the element in the given language.
@paramvalue - the name text.@paramlanguage - language tag of `value`; defaults to LanguageString.defaultLanguage.@returnsthis builder, for method chaining.
name
('Person').ClassBuilder.build(): Class
Builds an instance of Class with the parameters passed to the builder. **WARNING:** the ordering in which methods are evoked may affect the resulting object. When no methods are evoked, the created class has the following defaults: - `id: "randomly-generated-id",` - `created: new Date(),` - `isAbstract: false,` - `isDerived: false,` - `order: 1,` - `isPowertype: false,`
@throwsan error if the builder has already been used.
build
();
const person: Classperson.NamedElement.addCreator(value: Resource): void
Adds an agent responsible for creating this element, such as a person or an organization.
@throwsan error if the value is null or undefined.
addCreator
(
new new Resource(uri?: string, name?: string, language?: string): Resource
A reference to a resource on the semantic web, identified by its URI and described by its name, as defined by the OntoUML JSON Schema. Resources are used in the metadata fields of projects and named elements, e.g., to identify creators, publishers, licenses, and themes.
Resource
('https://orcid.org/0000-0000-0000-0000', 'Jane Doe')
); var console: Consoleconsole.Console.log(...data: any[]): void
The **`console.log()`** static method outputs a message to the console. [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/log_static)
log
(const person: Classperson.NamedElement.creators: Resource[]
The agents responsible for creating this element. Sets the creators of this element, replacing any existing ones.
@throwsan error if the array is null, undefined, or contains a null or undefined member.
creators
[0].Resource.name: LanguageString
The human-readable name of the resource, possibly in multiple languages.
name
.LanguageString.get(language?: string): string | null
Returns the text value for the given language. If no language is provided, returns the value of the first language in languagePreference for which a value exists. If no such value exists, returns the first value it finds. If no values are defined, returns `null`.
@paramlanguage - language tag of the desired value (e.g., `"en"`).@throwsan error if `language` is provided but invalid or has no value.
get
()); // Jane Doe

Now you try it​

Give the starter project a license, two keywords in different languages, and a research context — then check what the serialization looks like.

Loading playground…

Key takeaways​

  • Reference-valued fields (publisher, license, themes, …) are Resource objects — a URI plus a multilingual name; text-valued fields (keywords, citations) are **LanguageString**s.
  • Set everything fluently with Project.builder(), or field by field on an existing project.
  • context, designedForTask, ontologyType, and representationStyle accept OCMV enum values and auto-fill their official labels.
  • Every named element also carries creators, contributors, alternativeNames, and editorialNotes.

That completes the model layer. Next, give your model a visual form in Creating diagrams →.