Bots#
This page summarizes the code structure for this directory and its immediate subdirectories. It focuses on the public / vocables / modules / bots area within the public module. Use the table of contents below to navigate deeper.
Overview#
The Bots directory contains a set of interactive, step-by-step assistants used across SousLeSensVocables tools to guide users through multi-step operations such as:
Creating ontology resources
Building OWL restrictions
Creating mappings
Exploring and composing graphs
Configuring user-oriented actions (e.g., sharing user data, finding similar nodes)
Bots are typically implemented as declarative workflows executed by a shared UI engine. A bot usually defines:
A
workflowobject (with branching via_OR/_DEFAULT)A
functionsmap keyed by workflow step namesOptional
functionTitlesfor user-facing promptsA
start(...)entry point that initializes the engine and begins the workflow
Most bots instantiate BotEngineClass, but some legacy bots rely on a shared global _botEngine and/or reuse function sets from other bots (for example SparqlQuery_bot.functions).
The underlying engine provides reusable UI primitives (list selection, value prompting, history navigation), allowing bots to focus on domain logic such as:
SPARQL operations
Lineage graph actions
Ontology model access
Mapping configuration persistence
User data sharing flows
Interactive SPARQL querying with multiple output modes (graph/table/CSV)
Modules#
Engine (core workflow runner)#
BotEngineClass (
_botEngineClass.js) — Core UI workflow runner: loads the bot UI template, executes workflow steps, supports branching (_OR), and maintains navigation history (previous/reset).
Resource creation & OWL modeling#
CreateResource_bot (
createResource_bot.js) — Generic resource creation (Class, Individual, DatatypeProperty) with optional post-actions (edit or draw in lineage whiteboard).CreateAxiomResource_bot (
createAxiomResource_bot.js) — Focused creation for axiom resources: createsowl:Class(optionalsubClassOf) and sub-properties, returning a normalizedparams.newObject.CreateRestriction_bot (
createRestriction_bot.js) — Creates OWL restrictions: writes cardinality restrictions as blank nodes and delegates value restriction creation to a lineage edge dialog.
Source onboarding#
CreateSLSVsource_bot (
createSLSVsource_bot.js) — “OntoCreator” bot to create a new source, optionally upload a graph (file/URL), add ontology metadata (creator/description), and redirect to tools (Lineage/MappingModeler).
KGcreator mapping assistance#
KGcreator_bot (
KGcreator_bot.js) — Mapping assistant in KGcreator context: helps define mapping triple models (URI typing,rdf:type, predicates, non-object properties, joins) and persists mapping config.
KGQuery assistants#
KGquery_annotations_bot (
KGquery_annotations_bot.js) — Assistant to configure SPARQL query selection (select variables) and filters by reusingSparqlQuery_bot.functions, then returnsfilterandfilterLabelvia the validator callback.KGquery_filter_bot (
KGquery_filter_bot.js) — Interactive filter builder: selects a (non-object) property, operator, and value (including date range), then builds a SPARQLFILTER(...)clause with optional logical chaining.KGquery_composite_graph_bot (
KGquery_composite_graph_bot.js) — “HyperGraphMaker” bot: imports KGquery graphs from a source and its imports, downloads/regenerates graphs, colors imported graphs, merges them, and optionally joins graphs by selecting a common class.SparqlQuery_bot (
sparqlQuery_bot.js) — Interactive SPARQL query assistant for querying graphs and displaying results as a new graph, adding to the current graph, exporting as table/CSV, or editing/executing raw SPARQL (including saved queries and “last query” recall).
MappingModeler helpers (technical mappings / lookups / extra predicates)#
MappingModeler_bot (
mappingModeler_bot.js) — Mapping Modeler assistant to apply technical mapping actions such as adding predicates (including non-object properties), addingrdf:type, addingrdfs:subClassOf, adding transformations, and creating datatype properties viaCreateResource_bot.Lookups_bot (
mappingModeler_lookups_bot.js) — Wizard to create and save “lookup” configurations: selects datasource/table/columns/target mapping, writes lookup into config, then saves the visjs mapping graph.
User data & sharing#
ShareUserData_bot (
shareUserData_bot.js) — Assistant to share a UserData item with profiles and/or users, list current sharing, and remove shared profiles/users; persists updates by patching and saving UserData metadata.
UI widgets used by bots#
ManchesterSyntaxWidget (
manchesterSyntaxWidget.js) — Token-based input widget that suggests ontology classes/properties (from source + imports + basic vocabularies) and builds a Manchester-like expression from validated tokens.
Features#
Reusable workflow engine with consistent UI primitives (list selection, prompts, previous/reset navigation, branching via
_OR).Ontology-aware selection helpers across a source and its imports (vocabularies/classes/properties/non-object properties).
SPARQL-backed persistence and model manipulation via SPARQL proxies and lineage services (creating resources, restrictions, metadata, predicate graphs).
Graph/Lineage integration: draw created resources, compute and highlight paths, explore node relations/restrictions, and visualize traversals.
Similarity search workflows: exact/fuzzy matching on nodes, optional filtering of results, and multiple display/export options.
Sharing workflows for user data: share with profiles/users, list and revoke sharing, and persist metadata updates.
KGQuery support: interactive filter construction, “hypergraph” composition, and a general-purpose SPARQL query bot with multiple output modes (graph/table/CSV) including query editing and saved query reuse.
MappingModeler support: guided technical mapping operations (predicates,
rdf:type, subclass, transforms, lookups) and datatype property creation via shared CreateResource bot.
Usage#
Choose the appropriate bot module and call its
start(...)entry point (signatures vary: some bots instantiateBotEngineClasslocally, some reuse a shared/global engine).Define or reuse a workflow object to represent the step chain and branching logic (
_OR,_DEFAULT).Implement workflow steps inside the bot’s
functionsmap and provide user-facing titles viafunctionTitlesfor consistent prompts.Use shared utilities (
CommonBotFunctions) to load ontology models and list selectable items consistently; use specialized workflow helpers (e.g.,NonObjectPropertyFilterWorklow) to generate consistent filter fragments.Persist results via SPARQL/Lineage/MappingModeler/UserData services (triples insertion, metadata updates, mapping graph saving), and depending on the bot, outputs are returned via a validator/callback, stored in
params(e.g.,params.newObject), and/or produced as UI side-effects (dialogs, graph rendering, or saved configurations).
Files in this directory#
_botEngineClass.js_commonBotFunctions.js_nonObjectPropertyFilterWorklow.jscreateAxiomResource_bot.jscreateResource_bot.jscreateRestriction_bot.jscreateSLSVsource_bot.jsgraphPaths_bot.jsKGcreator_bot.jsKGquery_annotations_bot.jsKGquery_composite_graph_bot.jsKGquery_filter_bot.jsmanchesterSyntaxWidget.jsmappingModeler_bot.jsmappingModeler_lookups_bot.jsnodeRelations_bot.jsshareUserData_bot.jssimilars_bot.jssparqlQuery_bot.js