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.
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 ResourceA 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): ResourceA 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[]): voidThe **`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?: stringThe URI identifying the resource.uri); // https://www.utwente.nl
var console: Consoleconsole.Console.log(...data: any[]): voidThe **`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: LanguageStringThe human-readable name of the resource, possibly in multiple
languages.name.LanguageString.get(language?: string): string | nullReturns 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`.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 ProjectAn 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.Project } from 'ontouml-js';
const const project: Projectproject = class ProjectAn 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.Project.Project.builder(): ProjectBuilderCreates a builder for a new
Project
.builder()
.NamedElementBuilder<ProjectBuilder>.name(value: string, language?: string): ProjectBuilderAdds a name to the element in the given language.name('Library Ontology')
.ProjectBuilder.acronym(value: string): ProjectBuilderAdds an acronym by which the project is known (e.g., `"UFO-S"`).acronym('LibO')
.ProjectBuilder.keyword(value: string, language?: string): ProjectBuilderAdds a keyword describing the content of the project.keyword('libraries')
.ProjectBuilder.keyword(value: string, language?: string): ProjectBuilderAdds a keyword describing the content of the project.keyword('bibliotecas', 'pt')
.ProjectBuilder.language(value: string): ProjectBuilderAdds a language in which the project's elements are written, identified
by a language tag (e.g., `"en"`, `"pt"`).language('en')
.ProjectBuilder.language(value: string): ProjectBuilderAdds a language in which the project's elements are written, identified
by a language tag (e.g., `"en"`, `"pt"`).language('pt')
.ProjectBuilder.publisher(uri?: string, name?: string, language?: string): ProjectBuilderSets the agent responsible for making the project available, such as a
research group or a company.publisher('https://www.utwente.nl', 'University of Twente')
.ProjectBuilder.license(uri?: string, name?: string, language?: string): ProjectBuilderSets the license under which the project is distributed.license('https://creativecommons.org/licenses/by/4.0/', 'CC BY 4.0')
.ProjectBuilder.landingPage(uri: string): ProjectBuilderAdds the URL of a web page where the project is made available.landingPage('https://example.org/library-ontology')
.ProjectBuilder.source(uri: string): ProjectBuilderAdds the URI of a resource from which the project is derived, such as
another ontology or a standard.source('https://doi.org/10.3233/AO-150150')
.ProjectBuilder.bibliographicCitation(value: string, language?: string): ProjectBuilderAdds a bibliographic citation to a publication that documents the project.bibliographicCitation(
'Doe, J. (2026). The Library Ontology. Applied Ontology.'
)
.ProjectBuilder.theme(uri?: string, name?: string, language?: string): ProjectBuilderAdds a central theme of the project, i.e., a subject domain it covers
(e.g., healthcare, finance).theme('https://id.loc.gov/authorities/classification/Z', 'Class Z')
.ProjectBuilder.build(): ProjectBuilds 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()`build();
var console: Consoleconsole.Console.log(...data: any[]): voidThe **`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.keywords.Array<LanguageString>.length: numberGets 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[]): voidThe **`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?: ResourceThe license under which the project is distributed.license?.Resource.name: LanguageStringThe human-readable name of the resource, possibly in multiple
languages.name.LanguageString.get(language?: string): string | nullReturns 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`.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 ProjectAn 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.Project,
enum OntologyDevelopmentContextThe contexts in which an ontology can be developed, i.e., the types of
initiatives that motivated its creation.OntologyDevelopmentContext,
enum OntologyPurposeThe goals that motivate the development of an ontology.OntologyPurpose,
enum OntologyTypeThe types of ontologies according to their generality, as proposed in
Roussey et al. (2011), "An introduction to ontologies and ontology
engineering."OntologyType,
enum OntologyRepresentationStyleThe modeling styles an ontology can adopt, based on the languages used to
express its elements.OntologyRepresentationStyle
} from 'ontouml-js';
const const project: Projectproject = class ProjectAn 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.Project.Project.builder(): ProjectBuilderCreates a builder for a new
Project
.builder()
.NamedElementBuilder<ProjectBuilder>.name(value: string, language?: string): ProjectBuilderAdds a name to the element in the given language.name('Library Ontology')
.ProjectBuilder.context(uri?: string, name?: string, language?: string): ProjectBuilderAdds a context in which the project was developed, preferably one of the
values of
OntologyDevelopmentContext
.context(enum OntologyDevelopmentContextThe 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): ProjectBuilderAdds a goal that motivated the development of the project, preferably
one of the values of
OntologyPurpose
.designedForTask(enum OntologyPurposeThe 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): ProjectBuilderAdds a type classifying the project's ontology according to its
generality, preferably one of the values of
OntologyType
.ontologyType(enum OntologyTypeThe 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): ProjectBuilderSets the modeling style adopted in the project, preferably one of the
values of
OntologyRepresentationStyle
.representationStyle(enum OntologyRepresentationStyleThe 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(): ProjectBuilds 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()`build();
var console: Consoleconsole.Console.log(...data: any[]): voidThe **`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
.contexts[0].Resource.name: LanguageStringThe human-readable name of the resource, possibly in multiple
languages.name.LanguageString.get(language?: string): string | nullReturns 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`.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 ProjectAn 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.Project, class ResourceA 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 LanguageStringA 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(): ProjectAn 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.Project();
const project: Projectproject.Project.publisher?: ResourceThe 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): ResourceA 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?: stringThe namespace URI under which the project's elements are identified.namespace = 'https://example.org/libo#';
const project: Projectproject.Project.addKeyword(value: LanguageString): voidAdds a keyword describing the content of this project.addKeyword(new new LanguageString(value?: string, language?: string): LanguageStringA 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): voidAdds a language in which this project's elements are written, identified
by a language tag (e.g., `"en"`, `"pt"`).addLanguage('en');
const project: Projectproject.Project.addAcronym(value: string): voidAdds an acronym by which this project is known (e.g., `"UFO-S"`).addAcronym('LibO');
var console: Consoleconsole.Console.log(...data: any[]): voidThe **`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.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 ProjectAn 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.Project, class ResourceA 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(): ProjectAn 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.Project();
const const model: Packagemodel = const project: Projectproject.Project.packageBuilder(): PackageBuilderCreates a builder for a new
Package
in this project.packageBuilder().PackageBuilder.root(): PackageBuilderSets the package as the root package of its project, i.e., the package
that contains the entire model.root().PackageBuilder.build(): PackageBuilds 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: []`build();
const const person: Classperson = const model: Packagemodel.Package.classBuilder(): ClassBuilderCreates a builder for a
Class
contained in this package.classBuilder().ClassBuilder.kind(): ClassBuilderSets 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`kind().NamedElementBuilder<ClassBuilder>.name(value: string, language?: string): ClassBuilderAdds a name to the element in the given language.name('Person').ClassBuilder.build(): ClassBuilds 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,`build();
const person: Classperson.NamedElement.addCreator(value: Resource): voidAdds an agent responsible for creating this element, such as a person or
an organization.addCreator(
new new Resource(uri?: string, name?: string, language?: string): ResourceA 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[]): voidThe **`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.creators[0].Resource.name: LanguageStringThe human-readable name of the resource, possibly in multiple
languages.name.LanguageString.get(language?: string): string | nullReturns 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`.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.
Key takeaways
- Reference-valued fields (publisher, license, themes, …) are
Resourceobjects — 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, andrepresentationStyleaccept OCMV enum values and auto-fill their official labels.- Every named element also carries
creators,contributors,alternativeNames, andeditorialNotes.
That completes the model layer. Next, give your model a visual form in Creating diagrams →.