JSDOCS

Contents

souslesensvocables@3.12.0 tools:jsdoc2md jsdoc2md –configure docs/jsdoc/jsdoc.json –template docs/jsdoc/jsdoc.hbs –no-cache

JSDOCS#

Modules#

Lineage_axioms

Module for managing and visualizing ontological axioms in the lineage graph. Provides functionality for:

  • Visualizing classes with their associated axioms
  • Drawing axiom relationships in the graph
  • Supporting different types of axioms
  • Testing axiom functionality
  • Managing axiom metadata and visualization
Lineage_combine

Module for combining and merging multiple ontology sources in the lineage graph. Provides functionality for:

  • Adding multiple ontology sources to the graph
  • Merging nodes from different sources
  • Managing source visibility and grouping
  • Handling node hierarchies during merges
  • Supporting different merge modes and depths
  • Preserving ontological restrictions during merges
Lineage_common

Common utility functions for the lineage system. Provides functionality for:

  • Managing clipboard operations with nodes
  • Node deletion and manipulation
  • Copy/paste operations between nodes
  • Managing ontology imports
  • Basic node operations and validations
Lineage_createRelation

Module for creating and managing relationships between ontology nodes. Provides functionality for:

  • Creating new relationships between nodes in the ontology
  • Managing relationship types and properties
  • Validating relationship constraints
  • Supporting different types of ontological relationships
  • Managing relationship metadata and restrictions
  • Integrating with the ontology model system
Lineage_createResource

Module for creating new resources (classes, named individuals) in the ontology. Provides functionality for:

  • Creating new classes and named individuals
  • Generating and managing RDF triples
  • Handling resource URIs and labels
  • Managing resource relationships and hierarchies
  • Supporting metadata and provenance information
  • Validating resource creation inputs
Lineage_createSLSVsource

Module for creating new SLSV (Sous Le Sens Vocables) sources in the system. Provides functionality for:

  • Creating and configuring new ontology sources
  • Managing source metadata and configuration
  • Handling source imports and dependencies
  • Managing user permissions and ownership
  • Supporting source validation and persistence
  • Integrating with the SLSV bot system
Lineage_decoration

Module for managing visual decorations and styling of nodes in the lineage graph. Provides functionality for:

  • Managing node colors and styles based on ontology classes
  • Handling legends and visual indicators
  • Supporting different decoration schemes (upper ontology, custom)
  • Managing predefined color schemes
  • Handling node shapes and icons
  • Supporting dynamic visual updates
Lineage_dictionary

Module for managing ontology dictionaries and term mappings. Provides functionality for:

  • Managing term mappings between different ontology sources
  • Supporting dictionary-based operations and queries
  • Handling domain and range source relationships
  • Managing dictionary filters and constraints
  • Supporting dictionary visualization and navigation
  • Handling dictionary metadata and timestamps
  • Supporting dictionary-based search and filtering
Lineage_graphTraversal

Module for managing the shortest path search between nodes in the Lineage graph.

Lineage_properties

Module for managing ontology properties and their relationships. Provides functionality for:

  • Managing object and data properties
  • Visualizing property hierarchies
  • Handling property restrictions and constraints
  • Supporting property domains and ranges
  • Managing property metadata and visualization
  • Supporting property tree operations
  • Handling property-based graph operations
Lineage_reasoner

Module for performing reasoning operations on ontologies. Provides functionality for:

  • Running inference operations on ontologies
  • Checking ontology consistency
  • Detecting unsatisfiable classes
  • Managing inference rules and predicates
  • Visualizing reasoning results
  • Supporting different reasoning operations
  • Handling reasoning errors and results
Lineage_relationFilter

Module for filtering and managing relationships between ontology nodes. Provides functionality for:

  • Creating and applying filters on node relationships
  • Managing property restrictions and constraints
  • Supporting different filter types (string, date, number)
  • Handling domain and range filters
  • Managing filter roles (subject/object)
  • Supporting complex filter conditions
  • Validating filter inputs
Lineage_relationIndividualsFilter

Module for managing filters on individuals in ontology relationships. Provides functionality for:

  • Filtering individuals based on class membership
  • Supporting date-based filtering of individuals
  • Managing advanced search criteria for individuals
  • Handling individual selection and filtering UI
  • Supporting range and domain filtering
  • Managing filter persistence and application
  • Supporting multiple filter types and combinations
  • Coordinating with relation visualization
Lineage_relations

Module for managing and visualizing relationships between nodes in the lineage graph. Provides functionality for:

  • Drawing and filtering relationships between nodes
  • Managing property trees and their visualization
  • Handling relationship queries and filters
  • Managing relationship colors and visual styles
  • Supporting different types of relationships (hierarchical, semantic, etc.)
Lineage_rules

Module for managing ontological rules and constraints. Provides functionality for:

  • Creating and managing ontology rules
  • Handling premises and conclusions
  • Supporting rule-based reasoning
  • Managing rule components and relationships
  • Supporting rule validation and execution
  • Handling rule visualization and editing
  • Managing rule-based constraints
Lineage_selection

Module for managing node selection in the lineage graph. Provides functionality for:

  • Selecting and deselecting nodes
  • Managing multiple node selections
  • Visualizing selected nodes
  • Supporting keyboard modifiers for selection
  • Handling selection events and actions
  • Managing selection trees and hierarchies
  • Supporting selection-based operations
Lineage_similars

Module for finding and visualizing similar nodes across different ontology sources. Provides functionality for:

  • Finding nodes with similar labels or properties
  • Comparing nodes across different sources
  • Visualizing similar nodes in the graph
  • Supporting exact and fuzzy matching
  • Managing source-specific similarity searches
  • Handling node selection and comparison
  • Supporting interactive similarity exploration
Lineage_sources

Module for managing ontology sources in the lineage system. Provides functionality for:

  • Loading and initializing ontology sources
  • Managing source selection and activation
  • Handling source-specific UI elements and themes
  • Supporting source imports and dependencies
  • Managing source metadata and configurations
  • Coordinating source-related operations with other modules
  • Supporting source validation and persistence
Lineage_whiteboard
KGquery

KGquery Module Module for querying and visualizing knowledge graphs. Provides functionality to build and execute queries on knowledge graphs.

KGquery

KGquery Module Module for querying and visualizing knowledge graphs. Provides functionality to build and execute queries on knowledge graphs.

KGquery_controlPanel

KGquery_controlPanel Module Handles the user interface control panel for knowledge graph queries.

KGquery_filter

KGquery_filter Module Handles filtering functionality for knowledge graph queries.

KGquery_myQueries

KGquery_myQueries Module Handles saving and loading of knowledge graph queries.

KGquery_nodeSelector

KGquery_nodeSelector Module Module for selecting and managing nodes in knowledge graph queries.

KGquery_paths

Module for managing paths in knowledge graph queries. This module provides functionality for:

  • Configuring and managing paths between nodes
  • Manipulating identifiers and variables in paths
  • Managing graphical display of paths
  • Finding shortest paths between nodes
  • Managing path ambiguities
DataSourceManager

DataSourceManager module Responsible for managing data source configurations and operations.

MappingColumnsGraph

MappingColumnsGraph module. Handles the visualization and management of mapping columns in a graph.

MappingModeler

MappingModeler module. The MappingModeler tool helps creating new mappings from sources, and visualising and editing these mappings.

MappingTransform

Module responsible for generating and managing mappings for the MappingTransform process. It interacts with the Vis.js graph to retrieve mappings and formats them as JSON for use in the application. It also provides functionality for generating SLS mappings and R2ML mappings (coming soon).

MappingsDetails : Object

MappingsDetails manages technical mappings (non structural mappings)

TripleFactory

The TripleFactory module handles the creation, filtering, and writing of RDF triples. It includes functions for generating sample triples, creating all mappings triples, and indexing the graph.

UIcontroller

UIcontroller module manages the display of panels in the mapping modeler interface, handling tab activation and panel visibility for data sources, column mappings, technical mappings, and triples.

Sparql_OWL

Sparql_OWL Module OWL controller: builds and runs the SPARQL queries for sources whose schemaType is "OWL" (and KNOWLEDGE_GRAPH). Navigates class hierarchies via rdfs:subClassOf, reads owl:Class/owl:ObjectProperty/owl:DatatypeProperty/owl:NamedIndividual, resolves OWL restrictions (owl:onProperty + owl:someValuesFrom/allValuesFrom/cardinality) and property domains/ranges. It is selected per source through Config.sources[source].controller and invoked by Sparql_generic; query fragments come from Sparql_common and execution from Sparql_proxy.

Sparql_SKOS

Sparql_SKOS Module SKOS controller: builds and runs the SPARQL queries for sources whose schemaType is "SKOS". Navigates thesauri/taxonomies via skos:broader/skos:narrower, reads labels through skos:prefLabel/skos:altLabel, and supports SKOS collections. It is selected per source through Config.sources[source].controller and invoked by Sparql_generic; query building blocks (prefixes, predicates, FROM clause, limit) come from getSourceVariables and execution from Sparql_proxy.

Sparql_common

Sparql_common Module Shared helpers for building SPARQL query fragments and parsing results, used by every controller (Sparql_OWL, Sparql_SKOS, Sparql_generic). Provides string/URI escaping, FILTER / VALUES clause builders, FROM <graph> clause assembly from a source and its imports, prefix injection, date filters and source↔graphUri lookups. It builds SPARQL text fragments; it does not execute queries (that is Sparql_proxy).

Sparql_generic

Sparql_generic Module Schema-agnostic CRUD and traversal layer over the triple store. Read operations (getTopConcepts, getNodeChildren, getNodeInfos, …) delegate to the per-source controller (Sparql_OWL or Sparql_SKOS) chosen by Config.sources[source].controller, automatically batching large id/word lists into slices. Write operations build and run INSERT / DELETE / COPY SPARQL against the source's named graph, and helpers convert triple objects to SPARQL text and post-process result bindings (labels, types, sorting).

Sparql_proxy

Sparql_proxy Module Low-level execution layer for SPARQL queries. Wraps every query in an AJAX call to the backend /sparqlProxy endpoint (which forwards it to the triple store), handling GET/POST method selection, custom headers, CONSTRUCT vs SELECT response formats and query history logging. This is the single entry point used by all higher-level modules (Sparql_OWL, Sparql_SKOS, Sparql_generic) to talk to an endpoint.

Members#

Implicit_legendOverlay

Implicit_legendOverlay Implicit Model legend overlay config (categories/labels/order + tableColors).

Mapping_legendOverlay

Mapping_legendOverlay Mapping Modeler legend overlay config (categories/labels/order only). Uses LegendOverlayWidget.attachVisjsGraph for automatic refresh on graph changes.

sparqlTests

The MIT License Copyright 2020 Claude Fauconnet / SousLesens Claude.fauconnet@gmail.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Functions#

saveVisjsModelGraph([callback])

Saves the current Vis.js graph model.

Lineage_axioms#

Module for managing and visualizing ontological axioms in the lineage graph. Provides functionality for:

  • Visualizing classes with their associated axioms

  • Drawing axiom relationships in the graph

  • Supporting different types of axioms

  • Testing axiom functionality

  • Managing axiom metadata and visualization

Lineage_axioms.drawClassesWithAxioms([source], [axiomType]) ⇒ void#

Draws classes with associated axioms in a visual graph representation. Retrieves axioms from the specified source and visualizes them using Vis.js.

Kind: static method of Lineage_axioms

Param

Type

Description

[source]

string

The name of the data source. Defaults to the active source if not provided.

[axiomType]

string

The specific type of axiom to filter by (optional).

Lineage_axioms.testAxioms() ⇒ void#

Tests axiom functionalities by initializing a sample node with axiom data. Opens a dialog displaying axioms for the test node.

Kind: static method of Lineage_axioms

Lineage_combine#

Module for combining and merging multiple ontology sources in the lineage graph. Provides functionality for:

  • Adding multiple ontology sources to the graph

  • Merging nodes from different sources

  • Managing source visibility and grouping

  • Handling node hierarchies during merges

  • Supporting different merge modes and depths

  • Preserving ontological restrictions during merges

Lineage_combine.showSourcesDialog() ⇒ void#

Displays a dialog for selecting ontology sources to add to the graph. Supports OWL and SKOS sources.

Kind: static method of Lineage_combine

Lineage_combine.init() ⇒ void#

Initializes the Lineage_combine module by resetting selected sources and hiding action-related UI elements.

Kind: static method of Lineage_combine

Lineage_combine.addSelectedSourcesToGraph() ⇒ void#

Adds selected ontology sources to the graph and updates the UI accordingly. Registers the selected sources, draws their top concepts, and updates menu actions.

Kind: static method of Lineage_combine

Lineage_combine.setGraphPopupMenus() ⇒ void#

Sets the popup menu options for the graph, including actions to hide, show, group, and ungroup sources.

Kind: static method of Lineage_combine

Lineage_combine.showMergeNodesDialog([fromNode], [toNode]) ⇒ void#

Displays a dialog for merging selected ontology nodes. Allows users to specify the target source and node, select merge options, and choose nodes for merging.

Kind: static method of Lineage_combine

Param

Type

Description

[fromNode]

Object

The node from which the merge is initiated.

[toNode]

Object

The target node for the merge.

Lineage_combine.mergeNodesUI([testObj]) ⇒ void#

Handles the UI logic for merging ontology nodes. Gathers user input such as target source, merge mode, and selected nodes before triggering the merge process.

Kind: static method of Lineage_combine

Param

Type

Description

[testObj]

Object

Optional test object for debugging.

Lineage_combine.mergeNodes(jstreeNodes, mergeMode, mergeDepth, mergeRestrictions, mergedNodesType, targetSource, [targetNode], callback) ⇒ void#

Merges multiple ontology nodes into a target source, preserving hierarchy and restrictions. This function retrieves node descendants, applies restrictions, and inserts the merged data into the target source.

Kind: static method of Lineage_combine

Param

Type

Description

jstreeNodes

Array.<Object>

The nodes selected for merging, represented as jstree objects.

mergeMode

string

The merging mode, e.g., “keepUri”.

mergeDepth

string

Defines the depth of the merge operation (“nodeOnly”, “nodeAndDirectChildren”, “nodeDescendantsOnly”).

mergeRestrictions

boolean

Whether to include ontology restrictions in the merge.

mergedNodesType

string

The RDF type of the merged nodes (e.g., “owl:NamedIndividual”, “owl:Class”).

targetSource

string

The target source where merged nodes will be inserted.

[targetNode]

string

The optional parent node under which merged nodes will be placed.

callback

function

A callback function executed after the merge process completes.

Lineage_common#

Common utility functions for the lineage system. Provides functionality for:

  • Managing clipboard operations with nodes

  • Node deletion and manipulation

  • Copy/paste operations between nodes

  • Managing ontology imports

  • Basic node operations and validations

Lineage_common.copyNodeToClipboard(nodeData) ⇒ void#

Copies a node’s data to the clipboard as a JSON string.

Kind: static method of Lineage_common

Param

Type

Description

nodeData

Object

The node data to copy.

Lineage_common.deleteNode(node, jstreeId) ⇒ void#

Deletes a specified ontology node, removing its associated triples. If the node has children, deletion is prevented.

Kind: static method of Lineage_common

Param

Type

Description

node

Object

The node to delete.

jstreeId

string

The ID of the jstree instance where the node is displayed.

Lineage_common.pasteNodeFromClipboard(parentNode) ⇒ void#

Pastes a copied node from the clipboard under a specified parent node. The function ensures that only compatible node types are pasted.

Kind: static method of Lineage_common

Param

Type

Description

parentNode

Object

The parent node under which the copied node will be pasted.

Lineage_common.onshowImportsCBXChange(cbx) ⇒ void#

Toggles the inclusion of ontology imports in SPARQL queries.

Kind: static method of Lineage_common

Param

Type

Description

cbx

HTMLInputElement

The checkbox input element controlling the setting.

Lineage_createRelation#

Module for creating and managing relationships between ontology nodes. Provides functionality for:

  • Creating new relationships between nodes in the ontology

  • Managing relationship types and properties

  • Validating relationship constraints

  • Supporting different types of ontological relationships

  • Managing relationship metadata and restrictions

  • Integrating with the ontology model system

Lineage_createResource#

Module for creating new resources (classes, named individuals) in the ontology. Provides functionality for:

  • Creating new classes and named individuals

  • Generating and managing RDF triples

  • Handling resource URIs and labels

  • Managing resource relationships and hierarchies

  • Supporting metadata and provenance information

  • Validating resource creation inputs

Lineage_createResource~getTriple(resourceUri, predicate, object) ⇒ Object#

Helper function to create a triple object with subject, predicate and object.

Kind: inner method of Lineage_createResource
Returns: Object - Triple object with subject, predicate and object properties

Param

Type

Description

resourceUri

string

The URI of the resource (subject)

predicate

string

The predicate of the triple

object

string

The object of the triple

Lineage_createSLSVsource#

Module for creating new SLSV (Sous Le Sens Vocables) sources in the system. Provides functionality for:

  • Creating and configuring new ontology sources

  • Managing source metadata and configuration

  • Handling source imports and dependencies

  • Managing user permissions and ownership

  • Supporting source validation and persistence

  • Integrating with the SLSV bot system

Lineage_decoration#

Module for managing visual decorations and styling of nodes in the lineage graph. Provides functionality for:

  • Managing node colors and styles based on ontology classes

  • Handling legends and visual indicators

  • Supporting different decoration schemes (upper ontology, custom)

  • Managing predefined color schemes

  • Handling node shapes and icons

  • Supporting dynamic visual updates

Lineage_dictionary#

Module for managing ontology dictionaries and term mappings. Provides functionality for:

  • Managing term mappings between different ontology sources

  • Supporting dictionary-based operations and queries

  • Handling domain and range source relationships

  • Managing dictionary filters and constraints

  • Supporting dictionary visualization and navigation

  • Handling dictionary metadata and timestamps

  • Supporting dictionary-based search and filtering

Lineage_dictionary.onLoaded() ⇒ void#

Callback function executed when the dictionary module is loaded. Shows the TSF dictionary dialog in the Lineage_dictionary context.

Kind: static method of Lineage_dictionary

Lineage_dictionary.showTSFdictionaryDialog(context) ⇒ void#

Displays the TSF dictionary dialog with appropriate configuration based on context.

Kind: static method of Lineage_dictionary

Param

Type

Description

context

string

The context in which to show the dictionary (“Lineage_dictionary”, “Lineage_similars”, or “Lineage_relations”).

Lineage_dictionary.onChangeFilterSelect(value) ⇒ void#

Event handler for changes in filter select elements. Updates dictionary filters based on the selected value.

Kind: static method of Lineage_dictionary

Param

Type

Description

value

string

The selected filter value.

Lineage_dictionary.getDictionarySources(dictionary, [domainSource], [rangeSource], callback) ⇒ void#

Retrieves dictionary sources with their domain and range labels.

Kind: static method of Lineage_dictionary

Param

Type

Description

dictionary

string

The dictionary source to query.

[domainSource]

string

Optional domain source filter.

[rangeSource]

string

Optional range source filter.

callback

function

Callback function with signature (error, results).

Lineage_dictionary.getDictionaryFilters() ⇒ string#

Retrieves current dictionary filters from the UI.

Kind: static method of Lineage_dictionary
Returns: string - SPARQL filter string based on current UI filter values.

Lineage_dictionary.getFilterPredicates(subjectVarname) ⇒ string#

Gets filter predicates for a given subject variable.

Kind: static method of Lineage_dictionary
Returns: string - SPARQL predicates string based on current UI filter values.

Param

Type

Description

subjectVarname

string

The name of the subject variable in the SPARQL query.

Lineage_dictionary.fillDictionaryFilters(filterClassName, source) ⇒ void#

Populates dictionary filter select elements with available values.

Kind: static method of Lineage_dictionary

Param

Type

Description

filterClassName

string

The CSS class name for filter elements.

source

string

The source to query for filter values.

Lineage_dictionary.exportDictionaryToTable(filters) ⇒ void#

Exports dictionary data to a table format based on current filters.

Kind: static method of Lineage_dictionary

Param

Type

Description

filters

Object

Filter criteria for the export.

Lineage_graphTraversal#

Module for managing the shortest path search between nodes in the Lineage graph.

Lineage_properties#

Module for managing ontology properties and their relationships. Provides functionality for:

  • Managing object and data properties

  • Visualizing property hierarchies

  • Handling property restrictions and constraints

  • Supporting property domains and ranges

  • Managing property metadata and visualization

  • Supporting property tree operations

  • Handling property-based graph operations

Lineage_properties.init() ⇒ void#

Initializes the properties module by resetting the graph initialization state.

Kind: static method of Lineage_properties

Lineage_properties.showPropInfos(_event, obj) ⇒ void#

Displays property information in the graph div.

Kind: static method of Lineage_properties

Param

Type

Description

_event

Event

The event object (unused).

obj

Object

Object containing the node information.

obj.node

Object

The node object.

obj.node.id

string

The ID of the node.

Lineage_properties.jstreeContextMenu() ⇒ Object#

Creates the context menu for the jstree nodes.

Kind: static method of Lineage_properties
Returns: Object - Object containing menu items and their actions.

Lineage_properties.onTreeNodeClick(_event, obj) ⇒ void#

Handles click events on tree nodes.

Kind: static method of Lineage_properties

Param

Type

Description

_event

Event

The click event object.

obj

Object

Object containing the clicked node information.

Lineage_properties.openNode(node) ⇒ void#

Opens a node in the property tree and loads its subproperties.

Kind: static method of Lineage_properties

Param

Type

Description

node

Object

The node to open.

node.data

Object

The node’s data.

node.data.id

string

The node’s ID.

node.data.source

string

The node’s source.

Lineage_properties.getPropertiesjsTreeData(source, ids, words, options, callback) ⇒ void#

Generates jstree data structure for object properties.

Kind: static method of Lineage_properties

Param

Type

Description

source

string

The source to query.

ids

Array.<string>

Array of property IDs to filter by.

words

Array.<string>

Array of words to search for in property labels.

options

Object

Additional options for the query.

[options.searchType]

string

Type of search to perform (filters properties on words present in predicate or subject or object label).

callback

function

Callback function with signature (error, jstreeData).

Lineage_reasoner#

Module for performing reasoning operations on ontologies. Provides functionality for:

  • Running inference operations on ontologies

  • Checking ontology consistency

  • Detecting unsatisfiable classes

  • Managing inference rules and predicates

  • Visualizing reasoning results

  • Supporting different reasoning operations

  • Handling reasoning errors and results

Lineage_reasoner.showReasonerDialog() ⇒ void#

Shows the reasoner dialog with options for different reasoning operations.

Kind: static method of Lineage_reasoner

Lineage_reasoner.runOperation(operation) ⇒ void#

Runs a selected reasoning operation (Inference, Consistency, or Unsatisfiable).

Kind: static method of Lineage_reasoner

Param

Type

Description

operation

string

The type of reasoning operation to run.

Lineage_reasoner.runConsistency() ⇒ void#

Runs a consistency check on the current ontology.

Kind: static method of Lineage_reasoner

Lineage_reasoner.runUnsatisfiable() ⇒ void#

Runs an unsatisfiability check on the current ontology.

Kind: static method of Lineage_reasoner

Lineage_reasoner.showInferencePredicates() ⇒ void#

Shows available inference predicates in a tree structure.

Kind: static method of Lineage_reasoner

Lineage_reasoner.runInference(predicates, callback) ⇒ void#

Runs inference on the selected predicates.

Kind: static method of Lineage_reasoner

Param

Type

Description

predicates

Array.<string>

Array of predicates to use for inference.

callback

function

Callback function with signature (error, result).

Lineage_reasoner.execute() ⇒ void#

Executes the selected reasoning operation and displays results.

Kind: static method of Lineage_reasoner

Lineage_reasoner.listInferenceSubjects() ⇒ void#

Lists subjects from inference results in a tree structure.

Kind: static method of Lineage_reasoner

Lineage_reasoner.displayInference() ⇒ void#

Displays inference results in either table or graph format.

Kind: static method of Lineage_reasoner

Lineage_relationFilter#

Module for filtering and managing relationships between ontology nodes. Provides functionality for:

  • Creating and applying filters on node relationships

  • Managing property restrictions and constraints

  • Supporting different filter types (string, date, number)

  • Handling domain and range filters

  • Managing filter roles (subject/object)

  • Supporting complex filter conditions

  • Validating filter inputs

Lineage_relationFilter.showAddFilterDiv(clear) ⇒ void#

Displays the user interface for adding a filter on a relation.

Kind: static method of Lineage_relationFilter

Param

Type

Description

clear

boolean

Indicates if the current property should be reset.

Lineage_relationFilter.onSelectRoleType(role) ⇒ void#

Handles the selection of a role type (subject or object) for the filter.

Kind: static method of Lineage_relationFilter

Param

Type

Description

role

string

The selected role (“subject” or “object”).

Lineage_relationFilter.onCommonUIWidgetSelectObjectValue(value) ⇒ void#

Applies specific formatting to the selected value based on its type.

Kind: static method of Lineage_relationFilter

Param

Type

Description

value

string

The selected value.

Lineage_relationFilter.addFilter() ⇒ void#

Adds a filter based on the selected property and value.

Kind: static method of Lineage_relationFilter

Lineage_relationIndividualsFilter#

Module for managing filters on individuals in ontology relationships. Provides functionality for:

  • Filtering individuals based on class membership

  • Supporting date-based filtering of individuals

  • Managing advanced search criteria for individuals

  • Handling individual selection and filtering UI

  • Supporting range and domain filtering

  • Managing filter persistence and application

  • Supporting multiple filter types and combinations

  • Coordinating with relation visualization

Lineage_relations#

Module for managing and visualizing relationships between nodes in the lineage graph. Provides functionality for:

  • Drawing and filtering relationships between nodes

  • Managing property trees and their visualization

  • Handling relationship queries and filters

  • Managing relationship colors and visual styles

  • Supporting different types of relationships (hierarchical, semantic, etc.)

Lineage_relations.showDrawRelationsDialog(caller) ⇒ void#

Shows the dialog for drawing relations between nodes in the graph.

Kind: static method of Lineage_relations

Param

Type

Description

caller

string

The caller of the function (“Graph”, “Tree”, etc.).

Lineage_relations.getPropertiesJstreeMenu() ⇒ Object#

Returns the context menu for the properties tree.

Kind: static method of Lineage_relations
Returns: Object - The context menu items.

Lineage_relations.onSelectPropertyTreeNode(event, object) ⇒ void#

Handles the selection of a node in the properties tree.

Kind: static method of Lineage_relations

Param

Type

Description

event

Event

The selection event.

object

Object

The object containing node data.

object.node

Object

The selected node.

object.node.parent

string

The parent node ID.

object.node.data

Object

Additional node data.

Lineage_relations.onFilterObjectTypeSelect(role, type) ⇒ void#

Handles the selection of object type for filtering.

Kind: static method of Lineage_relations

Param

Type

Description

role

string

The role of the object (subject or object).

type

string

The selected object type.

Lineage_relations.onshowDrawRelationsDialogValidate(action, [_type]) ⇒ void#

Validates and executes the selected action in the relations dialog.

Kind: static method of Lineage_relations

Param

Type

Description

action

string

The action to execute (“clear” or “draw”).

[_type]

string

The type of relation (unused).

Lineage_relations.outlineWhiteboardNodes(options) ⇒ void#

Outlines nodes in the whiteboard based on their properties.

Kind: static method of Lineage_relations

Param

Type

Description

options

Object

Configuration options for outlining nodes.

options.filter

string

SPARQL filter to apply when querying nodes.

options.output

string

The output format (“outline”).

options.edgesColor

string

Color to use for edges.

Lineage_relations.drawRelations(direction, type, caller, options, [graphDiv]) ⇒ void#

Draws relations between nodes in the graph.

Kind: static method of Lineage_relations

Param

Type

Default

Description

direction

string

Direction of relations (“direct”, “inverse”, or “both”).

type

string

Type of relations to draw (“restrictions”, “dictionary”, etc.).

caller

string

The caller of the function (“Graph”, “Tree”, “leftPanel”, etc.).

options

Object

Configuration options for drawing relations.

[options.skipLiterals]

boolean

true

Whether to skip literal nodes.

[options.source]

string

Source to use for relations.

[options.data]

string | Array

Data to use for relations (node IDs).

[options.output]

string

Output format (“table” or graph).

[options.returnVisjsData]

boolean

Whether to return Vis.js data.

[options.filter]

string

SPARQL filter to apply.

[options.includeSources]

string

Sources to include.

[graphDiv]

string

The div element where to draw the graph.

Lineage_relations.getInferredProperties(source, callback, result) ⇒ void#

Retrieves inferred properties from the ontology model.

Kind: static method of Lineage_relations

Param

Type

Description

source

string

The source from which to get inferred properties.

callback

function

Callback function with signature (error, result).

result

Object

The jstree data structure containing inferred properties.

result.nodes

Array

Array of nodes representing properties and their constraints.

result.nodes[].data

Object

Node data containing property information.

result.nodes[].data.id

string

Property ID.

result.nodes[].data.label

string

Property label.

result.nodes[].data.constraints

Object

Property constraints with domain and range.

Lineage_relations.onCheckNodePropertyTreeNode(event, obj) ⇒ void#

Handles the selection of a node in the properties tree.

Kind: static method of Lineage_relations

Param

Type

Description

event

Event

The selection event.

obj

Object

The object containing node data.

obj.node

Object

The selected node.

obj.node.data

Object

Node data containing property information.

obj.node.data.constraints

Object

Property constraints.

obj.node.data.label

string

Property label.

Lineage_relations.callPreviousQuery() ⇒ void#

Recalls and executes the previous query.

Kind: static method of Lineage_relations

Lineage_relations.loadUserQueries() ⇒ void#

Loads user-saved queries.

Kind: static method of Lineage_relations

Lineage_relations.onSelectSavedQuery(id) ⇒ void#

Handles the selection of a saved query.

Kind: static method of Lineage_relations

Param

Type

Description

id

string

The ID of the saved query to load.

Lineage_relations.saveCurrentQuery() ⇒ void#

Saves the current query configuration.

Kind: static method of Lineage_relations

Lineage_relations.deleteSavedQuery(id) ⇒ void#

Deletes a saved query.

Kind: static method of Lineage_relations

Param

Type

Description

id

string

The ID of the query to delete.

Lineage_relations.drawEquivalentClasses(source, data, callback) ⇒ void#

Draws equivalent classes in the graph.

Kind: static method of Lineage_relations

Param

Type

Description

source

string

The source containing the equivalent classes.

data

Array.<string>

Array of class IDs to find equivalents for.

callback

function

Callback function with signature (error, result).

Lineage_rules#

Module for managing ontological rules and constraints. Provides functionality for:

  • Creating and managing ontology rules

  • Handling premises and conclusions

  • Supporting rule-based reasoning

  • Managing rule components and relationships

  • Supporting rule validation and execution

  • Handling rule visualization and editing

  • Managing rule-based constraints

Lineage_rules.showRulesDialog() ⇒ void#

Displays the rules dialog.

Kind: static method of Lineage_rules

Lineage_rules.onSearchClassKeyDown(event) ⇒ void#

Handles the class search event on key press.

Kind: static method of Lineage_rules

Param

Type

Description

event

Event

The keyboard event.

Lineage_rules.onSearchPropertyKeyDown(event) ⇒ void#

Handles the property search event on key press.

Kind: static method of Lineage_rules

Param

Type

Description

event

Event

The keyboard event.

Lineage_rules.searchItem(term, type) ⇒ void#

Searches for items (classes or properties) in the ontology.

Kind: static method of Lineage_rules

Param

Type

Description

term

string

The search term.

type

string

The type of item to search for (“Class” or “ObjectProperty”).

Lineage_rules.getContextMenu() ⇒ Object#

Returns the context menu for the rules tree.

Kind: static method of Lineage_rules
Returns: Object - The context menu items.

Lineage_rules.selectTreeNodeFn(event, obj) ⇒ void#

Handles the selection of a node in the tree.

Kind: static method of Lineage_rules

Param

Type

Description

event

Event

The selection event.

obj

Object

Object containing the selected node data.

Lineage_rules.addPremiseOrConclusion(node, role) ⇒ void#

Adds a premise or conclusion to the rule.

Kind: static method of Lineage_rules

Param

Type

Description

node

Object

The node to add.

role

string

The role of the node (“premise” or “conclusion”).

Lineage_rules.clearPremise(div) ⇒ void#

Removes a premise from the rule.

Kind: static method of Lineage_rules

Param

Type

Description

div

string

The ID of the div to remove.

Lineage_rules.getImplicitModel() ⇒ void#

Retrieves the implicit model of the ontology.

Kind: static method of Lineage_rules

Lineage_rules.addPropertiesToTree(node) ⇒ void#

Adds properties to the tree for a given node.

Kind: static method of Lineage_rules

Param

Type

Description

node

Object

The node for which to add properties.

Lineage_rules.execRule() ⇒ void#

Exécute la règle définie avec les prémisses et conclusions sélectionnées.

Kind: static method of Lineage_rules

Lineage_selection#

Module for managing node selection in the lineage graph. Provides functionality for:

  • Selecting and deselecting nodes

  • Managing multiple node selections

  • Visualizing selected nodes

  • Supporting keyboard modifiers for selection

  • Handling selection events and actions

  • Managing selection trees and hierarchies

  • Supporting selection-based operations

Lineage_selection.self.filterBy : object#

Filter operations for selected nodes.

Kind: static namespace of Lineage_selection

Lineage_selection.self.decorate : object#

Decoration operations for selected nodes.

Kind: static namespace of Lineage_selection

Lineage_selection.self.classDecorate : object#

Class decoration operations for selected nodes.

Kind: static namespace of Lineage_selection

Lineage_selection.addNodeToSelection(node) ⇒ void#

Adds a node to the current selection and updates its visual appearance.

Kind: static method of Lineage_selection

Param

Type

Description

node

Object

The node to add to the selection.

node.data

Object

The node’s data.

node.data.id

string

The node’s unique identifier.

Lineage_selection.clearNodesSelection([ids]) ⇒ void#

Clears the selection for specified node IDs or all nodes if no IDs are provided.

Kind: static method of Lineage_selection

Param

Type

Description

[ids]

string | Array.<string>

Single ID or array of node IDs to clear from selection.

Lineage_selection.getSelectedNodesTree() ⇒ Array.<Object>#

Creates a jstree data structure from the currently selected nodes.

Kind: static method of Lineage_selection
Returns: Array.<Object> - Array of jstree node objects.

Lineage_selection.showSelectionDialog(allGraphNodes) ⇒ void#

Shows the selection dialog with a tree view of selected nodes.

Kind: static method of Lineage_selection

Param

Type

Description

allGraphNodes

boolean

If true, selects all nodes in the graph.

Lineage_selection.selectNodesOnHover(node, point, options) ⇒ void#

Handles node selection on hover with keyboard modifiers.

Kind: static method of Lineage_selection

Param

Type

Description

node

Object

The node being hovered.

point

Object

The point where the hover occurred.

options

Object

Keyboard modifier options.

options.ctrlKey

boolean

Whether the Ctrl key is pressed.

options.altKey

boolean

Whether the Alt key is pressed.

options.shiftKey

boolean

Whether the Shift key is pressed.

Lineage_selection.onSelectedNodeTreeclick(event, obj) ⇒ void#

Handles click events on nodes in the selection tree.

Kind: static method of Lineage_selection

Param

Type

Description

event

Event

The click event.

obj

Object

Object containing the clicked node data.

Lineage_selection.getSelectedNodes(onlyIds) ⇒ Array.<(string|Object)>#

Gets the currently selected nodes from the selection tree.

Kind: static method of Lineage_selection
Returns: Array.<(string|Object)> - Array of node IDs or node objects.

Param

Type

Description

onlyIds

boolean

If true, returns only node IDs instead of full node objects.

Lineage_selection.onSelectionExecuteAction(action, checkSelected) ⇒ void#

Executes an action on the selected nodes.

Kind: static method of Lineage_selection

Param

Type

Description

action

string

The action to execute (“filterBy”, “decorate”, “classDecorate”, etc.).

checkSelected

boolean

Whether to check if nodes are selected before executing.

Lineage_similars#

Module for finding and visualizing similar nodes across different ontology sources. Provides functionality for:

  • Finding nodes with similar labels or properties

  • Comparing nodes across different sources

  • Visualizing similar nodes in the graph

  • Supporting exact and fuzzy matching

  • Managing source-specific similarity searches

  • Handling node selection and comparison

  • Supporting interactive similarity exploration

Lineage_similars.showDialog(selection) ⇒ void#

Shows the dialog for finding similar nodes.

Kind: static method of Lineage_similars

Param

Type

Description

selection

boolean

Whether to use selected nodes as the source.

Lineage_similars.onChangeSelection(value) ⇒ void#

Handles changes in the selection mode.

Kind: static method of Lineage_similars

Param

Type

Description

value

string

The new selection value.

Lineage_similars.showSourcesTree() ⇒ void#

Displays the tree of available sources for finding similar nodes.

Kind: static method of Lineage_similars

Lineage_similars.onSourceSelected(evt, obj) ⇒ void#

Handles the selection of a source from the sources tree.

Kind: static method of Lineage_similars

Param

Type

Description

evt

Event

The selection event.

obj

Object

Object containing the selected node data.

Lineage_similars.onValidateSources() ⇒ void#

Callback for source selection validation.

Kind: static method of Lineage_similars

Lineage_similars.drawSimilars() ⇒ void#

Initiates the drawing of similar nodes based on the current mode.

Kind: static method of Lineage_similars

Lineage_similars.drawSourceSimilars(fromFource, source) ⇒ void#

Draws similar nodes from a specific source.

Kind: static method of Lineage_similars

Param

Type

Description

fromFource

string

The starting source

source

string

The source to search for similar nodes.

Lineage_similars.getStartingNodes() ⇒ Array.<Object> | null#

Gets the nodes to use as starting points for similarity search.

Kind: static method of Lineage_similars
Returns: Array.<Object> | null - Array of starting nodes or null if none selected.

Lineage_similars.drawWhiteBoardSimilars([selectedMode], [mode], [output]) ⇒ void#

Draws similar nodes found within the whiteboard.

Kind: static method of Lineage_similars

Param

Type

Description

[selectedMode]

string

Optional selected mode. “AllWhiteboardNodes” or “SelectedNodes”

[mode]

string

Optional mode. “exactMatch” or “fuzzyMatch”

[output]

string

Optional output format. “graph” or “table” or “save”

Lineage_sources#

Module for managing ontology sources in the lineage system. Provides functionality for:

  • Loading and initializing ontology sources

  • Managing source selection and activation

  • Handling source-specific UI elements and themes

  • Supporting source imports and dependencies

  • Managing source metadata and configurations

  • Coordinating source-related operations with other modules

  • Supporting source validation and persistence

Lineage_sources.self.menuActions : object#

Collection of menu actions for source management.

Kind: static namespace of Lineage_sources

Lineage_sources.init(showDialog) ⇒ void#

Initializes the lineage sources module, resetting the active source and UI elements. Optionally displays the source selection dialog.

Kind: static method of Lineage_sources

Param

Type

Description

showDialog

boolean

Whether to show the source selection dialog.

Lineage_sources.resetAll(showDialog) ⇒ void#

Resets all loaded sources and unregisters ontology models. Calls the initialization function afterward.

Kind: static method of Lineage_sources

Param

Type

Description

showDialog

boolean

Whether to show the source selection dialog.

Lineage_sources.showSourcesDialog(forceDialog) ⇒ void#

Displays the source selection dialog, allowing users to choose ontology sources. If a source is provided via URL parameters, it is loaded directly.

Kind: static method of Lineage_sources

Param

Type

Description

forceDialog

boolean

Whether to force the display of the selection dialog.

Lineage_sources.loadSources(sources, [callback]) ⇒ void#

Loads the specified sources asynchronously, initializing each if not already loaded. After loading, sets the first source as the current active source.

Kind: static method of Lineage_sources

Param

Type

Description

sources

string | Array.<string>

The source(s) to be loaded.

[callback]

function

Optional callback function executed after loading.

Lineage_sources.setCurrentSource(source) ⇒ void#

Sets the specified source as the current active source. Updates the UI accordingly, initializes the whiteboard, and loads source-specific elements.

Kind: static method of Lineage_sources

Param

Type

Description

source

string

The source to be set as active.

Lineage_sources.initSourcesSearchSelect() ⇒ void#

Initializes the source search selection based on the user’s selected search scope. Updates available class options for searching within the selected source.

Kind: static method of Lineage_sources

Lineage_sources.showHideLineageLeftPanels() ⇒ void#

Shows or hides the left panels in the lineage UI based on the current ontology configuration. Adjusts the display of the legend wrapper section accordingly.

Kind: static method of Lineage_sources

Lineage_sources.showHideEditButtons(source, [hide]) ⇒ void#

Shows or hides edit buttons based on the source’s editability. Disables edit mode for the graph and updates the UI accordingly.

Kind: static method of Lineage_sources

Param

Type

Description

source

string

The source to check for editability.

[hide]

boolean

Optional flag to force hiding the buttons.

Lineage_sources.whiteboard_setGraphOpacity(source) ⇒ void#

Adjusts the opacity of nodes and edges in the whiteboard graph based on the active source. Nodes and edges belonging to the active source remain fully visible, while others become transparent.

Kind: static method of Lineage_sources

Param

Type

Description

source

string

The currently active source.

Lineage_sources.initSource(source, callback) ⇒ void#

Initializes a given source by registering it and setting up ontology imports. Optionally draws top-level concepts if needed.

Kind: static method of Lineage_sources

Param

Type

Description

source

string

The source to initialize.

callback

function

Callback function executed after initialization.

Lineage_sources.indexSourceIfNotIndexed(source) ⇒ void#

Checks if a source is indexed in ElasticSearch. If not, it triggers the indexing process.

Kind: static method of Lineage_sources

Param

Type

Description

source

string

The source to check and index if necessary.

Lineage_sources.registerSource(sourceLabel, [callback]) ⇒ void#

Registers a source, ensuring it is loaded and displayed in the UI.

Kind: static method of Lineage_sources

Param

Type

Description

sourceLabel

string

The label of the source to register.

[callback]

function

Optional callback function to execute after registration.

Lineage_sources.showSourceDivPopupMenu(sourceDivId) ⇒ void#

Displays a contextual popup menu for a source, allowing various actions such as hiding, grouping, or editing.

Kind: static method of Lineage_sources

Param

Type

Description

sourceDivId

string

The ID of the source’s div element.

Lineage_sources.registerSourceImports(sourceLabel, callback) ⇒ void#

Registers all imported sources of a given source.

Kind: static method of Lineage_sources

Param

Type

Description

sourceLabel

string

The label of the source whose imports should be registered.

callback

function

Callback function executed after all imports are registered.

Lineage_sources.setAllWhiteBoardSources(remove) ⇒ void#

Toggles the selection of all whiteboard sources, affecting UI highlighting and opacity settings.

Kind: static method of Lineage_sources

Param

Type

Description

remove

boolean

If true, sets a flag to remove sources from the whiteboard.

Lineage_sources.showHideCurrentSourceNodes(source, hide) ⇒ void#

Toggles the visibility of nodes belonging to a given source in the lineage graph.

Kind: static method of Lineage_sources

Param

Type

Description

source

string

The source whose nodes should be shown or hidden.

hide

boolean

Whether to hide (true) or show (false) the nodes.

Lineage_sources.setTopLevelOntologyFromImports(sourceLabel) ⇒ string | null#

Sets the current top-level ontology based on a source’s imports.

Kind: static method of Lineage_sources
Returns: string | null - The selected top-level ontology or null if none found.

Param

Type

Description

sourceLabel

string

The source label to check for imports.

Lineage_sources.setTopLevelOntologyFromPrefix(prefix) ⇒ string | null#

Sets the current top-level ontology based on a prefix.

Kind: static method of Lineage_sources
Returns: string | null - The selected top-level ontology or null if none found.

Param

Type

Description

prefix

string

The prefix to search for in top-level ontologies.

Lineage_sources.isSourceOwnedByUser(sourceName) ⇒ boolean#

Checks if a source is owned by the current user.

Kind: static method of Lineage_sources
Returns: boolean - True if the source is owned by the current user, false otherwise.

Param

Type

Description

sourceName

string

The name of the source to check.

Lineage_sources.isSourceEditableForUser(source) ⇒ boolean#

Checks if a source is editable by the current user based on access control settings.

Kind: static method of Lineage_sources
Returns: boolean - True if the source is editable by the current user, false otherwise.

Param

Type

Description

source

string

The source to check.

Lineage_sources.clearSource([source]) ⇒ void#

Clears all nodes belonging to a source from the graph.

Kind: static method of Lineage_sources

Param

Type

Description

[source]

string

The source to clear. If not provided, uses the active source.

Lineage_sources.setTheme(theme) ⇒ void#

Sets the theme for the lineage graph, affecting background and text colors.

Kind: static method of Lineage_sources

Param

Type

Description

theme

string

The theme to apply (“white” or other).

Lineage_whiteboard#

Lineage_whiteboard.onSourceSelect(sourceLabel) ⇒ void#

Handle source selection changes. Resets the current whiteboard so the graph and legend always match the active source context.

Kind: static method of Lineage_whiteboard

Param

Type

Description

sourceLabel

string

Selected source label.

Lineage_whiteboard.drawTopConcepts(source, [options], graphDiv, callback) ⇒ void#

Retrieves and displays the top-level concepts for a given ontology source. It ensures that concepts are properly linked to their respective sources and adds them to the graph.

Kind: static method of Lineage_whiteboard

Param

Type

Default

Description

source

string

The ontology source to retrieve top concepts from.

[options]

Object

{}

Configuration options for fetching and displaying concepts.

graphDiv

string

The ID of the div container where the graph will be drawn.

callback

function

Callback function executed after fetching top concepts.

Lineage_whiteboard.isResultAcceptable(result) ⇒ boolean#

Checks if the result set is acceptable based on predefined constraints. If too many nodes are present, an alert is shown, and false is returned. If no data is found, a message is displayed.

Kind: static method of Lineage_whiteboard
Returns: boolean - - Returns true if the result is acceptable, otherwise false.

Param

Type

Description

result

Array

The result array to be evaluated.

Lineage_whiteboard.initWhiteBoard(force) ⇒ void#

Initializes the whiteboard by clearing or redrawing the graph if necessary. If the graph is empty or the force parameter is set to true, a new empty graph is drawn.

Kind: static method of Lineage_whiteboard

Param

Type

Description

force

boolean

If true, forces the graph to reset even if it’s not empty.

Lineage_whiteboard.drawNewGraph(visjsData, graphDiv, [_options]) ⇒ void#

Draws a new graph with provided data and options. Configures visualization settings such as physics, layout, and interaction settings. Also manages node and edge interactions.

Kind: static method of Lineage_whiteboard

Param

Type

Default

Description

visjsData

Object

The data containing nodes and edges to be displayed.

graphDiv

string

The ID of the div container where the graph will be rendered.

[_options]

Object

{}

Optional configuration settings for the graph.

[_options.visjsOptions]

Object

Custom options for the Vis.js graph.

[_options.layoutHierarchical]

boolean

If true, enables hierarchical layout.

[_options.physics]

Object

Custom physics settings for the graph.

[_options.noDecorations]

boolean

If true, skips the decoration step after drawing.

[_options.legendType]

string

Type of legend to be used for decoration.

Lineage_whiteboard.drawDictionarySameAs() ⇒ void#

Draws the sameAs restrictions for the dictionary. This function fetches and visualizes the sameAs properties for the dictionary source, displaying the relationships in a graph format.

Kind: static method of Lineage_whiteboard

Lineage_whiteboard.drawNamedLinkedData([classIds]) ⇒ void#

Draws linked data for named classes. This function fetches named linked data from a source based on the provided class IDs, and visualizes the results in the graph, adding new nodes and edges as necessary.

Kind: static method of Lineage_whiteboard

Param

Type

Description

[classIds]

Array.<any>

The list of class IDs to filter the linked data by. If not provided, it will be retrieved from the active source.

Lineage_whiteboard.collapseNode(nodeId) ⇒ void#

Collapses a node and removes its connected children from the graph. This function collapses the specified node and removes any connected nodes in the “from” direction.

Kind: static method of Lineage_whiteboard

Param

Type

Description

nodeId

any

The ID of the node to collapse.

Lineage_whiteboard.setGraphPopupMenus(node, event) ⇒ void#

Sets the context menu for a graph node based on the node’s type and context. This function generates a dynamic context menu for the clicked node with options such as opening clusters, showing property information, or removing nodes from the graph.

Kind: static method of Lineage_whiteboard

Param

Type

Description

node

Object

The node that was clicked on in the graph.

event

Event

The event triggered by the click, used to set the context menu options.

KGquery#

KGquery Module Module for querying and visualizing knowledge graphs. Provides functionality to build and execute queries on knowledge graphs.

KGquery.unload() ⇒ void#

Unloads the module and restores initial state.

Kind: static method of KGquery

KGquery.init() ⇒ void#

Initializes the module. Draws the graph model and sets up saved queries.

Kind: static method of KGquery

KGquery.initOutputType() ⇒ void#

Initializes the output type selector with available tools.

Kind: static method of KGquery

KGquery.loadSource() ⇒ void#

Loads a source and initializes the graph visualization.

Kind: static method of KGquery

KGquery.addQuerySet(booleanOperator) ⇒ Object#

Adds a new query set with a boolean operator.

Kind: static method of KGquery
Returns: Object - querySet - The newly created query set

Param

Type

Description

booleanOperator

string

The boolean operator to use (AND, OR, etc.)

Properties

Name

Type

Description

querySet.divId

string

The ID of the div containing the query set

querySet.elements

Array

Array of query elements in this set

querySet.color

string

The color assigned to this query set

querySet.booleanOperator

string

The boolean operator for this set

querySet.classFiltersMap

Object

Map of class filters

querySet.index

number

Index of this query set

KGquery.addQueryElementToQuerySet(querySet) ⇒ Object#

Adds a query element to a query set.

Kind: static method of KGquery
Returns: Object - queryElement - The newly created query element

Param

Type

Description

querySet

Object

The query set to add the element to

Properties

Name

Type

Description

queryElement.divId

string

The ID of the div containing this element

queryElement.fromNode

string

The source node

queryElement.toNode

string

The target node

queryElement.paths

Array

Array of paths between fromNode and toNode

queryElement.queryElementDivId

string

The element’s div ID

queryElement.fromNodeDivId

string

The source node’s div ID

queryElement.toNodeDivId

string

The target node’s div ID

queryElement.index

number

Index within the query set

queryElement.setIndex

number

Index of the parent query set

KGquery.addNodeToQueryElement(queryElement, node, role) ⇒ void#

Adds a node to a query element.

Kind: static method of KGquery

Param

Type

Description

queryElement

Object

The query element to add the node to

node

Object

The node to add

role

string

The role of the node (‘fromNode’ or ‘toNode’)

KGquery.addNode(selectedNode, nodeEvent, [callback]) ⇒ void#

Adds a node to the graph.

Kind: static method of KGquery

Param

Type

Description

selectedNode

Object

The node to add

nodeEvent

Object

The event that triggered the addition

[callback]

function

Optional callback after adding

KGquery.addEdgeNodes(fromNode, toNode, edge) ⇒ void#

Adds edge nodes to the graph.

Kind: static method of KGquery

Param

Type

Description

fromNode

Object

The source node

toNode

Object

The target node

edge

Object

The edge data

KGquery.addEdge(edge, evt) ⇒ void#

Adds edges between nodes in the graph.

Kind: static method of KGquery

Param

Type

Description

edge

Object

The edge to add

evt

Object

The event that triggered the addition

KGquery.aggregateQuery() ⇒ void#

Performs aggregation on query results. Shows a dialog for selecting aggregate clauses and validates that variables belong to the same set.

Kind: static method of KGquery

KGquery.queryKG(output, [options], [isVirtualSQLquery]) ⇒ void#

Executes a query on the knowledge graph.

Kind: static method of KGquery
Throws:

  • Error If the query execution fails

Param

Type

Default

Description

output

string

The desired output format (‘table’, ‘Graph’, ‘shacl’, or custom tool name)

[options]

Object

Additional query options

[options.aggregate]

Object

Aggregation settings for the query

[isVirtualSQLquery]

boolean

false

Whether this is a virtual SQL query

KGquery.execPathQuery(options, callback) ⇒ void#

Executes a SPARQL path query based on the provided options. The query is constructed dynamically and executed in multiple steps.

Kind: static method of KGquery

Param

Type

Description

options

Object

The options for query execution

options.output

string

The desired output format (e.g., “shacl”)

callback

function

Callback function to handle the query results

callback.err

Error

Error object if the query fails

callback.result

Object

The query results if successful

KGquery.queryResultToVisjsGraph(result) ⇒ void#

Converts query results to a Vis.js graph visualization.

Kind: static method of KGquery
Throws:

  • Error If result size exceeds maxResultSizeforLineageViz

Param

Type

Description

result

Object

The query results to convert

KGquery.queryToTagsGeometry(result) ⇒ void#

Converts query results to a tags geometry visualization.

Kind: static method of KGquery

Param

Type

Description

result

Object

The query results to convert

KGquery.queryToTagsCalendar(result) ⇒ void#

Converts query results to a tags calendar visualization.

Kind: static method of KGquery

Param

Type

Description

result

Object

The query results to convert

KGquery.queryResultToTable(result) ⇒ void#

Converts query results to a table format and displays it in a dialog. Handles large result sets by exporting to CSV if size exceeds 10000 rows.

Kind: static method of KGquery

Param

Type

Description

result

Object

The query results to convert

result.results.bindings

Array

The query result bindings

result.head.vars

Array

The query result variables

KGquery.clearAll([exceptSetQueries]) ⇒ void#

Clears all query sets and resets the graph state. Optionally preserves set queries if specified.

Kind: static method of KGquery

Param

Type

Description

[exceptSetQueries]

boolean

If true, preserves set queries during cleanup

KGquery.getVarName(node, [withoutQuestionMark]) ⇒ string#

Gets the variable name for a node.

Kind: static method of KGquery
Returns: string - The variable name for the node

Param

Type

Description

node

Object

The node to get variable name for

[withoutQuestionMark]

boolean

Whether to omit the question mark prefix

KGquery.getAllQueryPathClasses() ⇒ Array.<Object>#

Gets all classes used in query paths.

Kind: static method of KGquery
Returns: Array.<Object> - Array of class objects used in query paths

KGquery.message(message, [stopWaitImg]) ⇒ void#

Displays a message in the UI and controls the wait image.

Kind: static method of KGquery

Param

Type

Default

Description

message

string

The message to display

[stopWaitImg]

boolean

false

If true, hides the wait image

KGquery.switchRightPanel([forceGraph]) ⇒ void#

Switches the right panel display between graph and other views.

Kind: static method of KGquery

Param

Type

Description

[forceGraph]

boolean

Whether to force graph display

KGquery.onBooleanOperatorChange(querySetDivId, value) ⇒ void#

Handles boolean operator changes for query sets.

Kind: static method of KGquery

Param

Type

Description

querySetDivId

string

ID of the query set div

value

string

New boolean operator value (‘AND’, ‘OR’, ‘Union’, etc.)

KGquery.removeQueryElement(queryElementDivId) ⇒ void#

Removes a query element from the graph.

Kind: static method of KGquery

Param

Type

Description

queryElementDivId

string

ID of the query element div to remove

KGquery.removeSet(querySetDivId) ⇒ void#

Removes a query set from the graph.

Kind: static method of KGquery

Param

Type

Description

querySetDivId

string

ID of the query set div to remove

KGquery.onOutputTypeSelect(output) ⇒ void#

Handles output type selection changes.

Kind: static method of KGquery

Param

Type

Description

output

string

The selected output type

KGquery.addOutputType() ⇒ void#

Adds an output type to the select options.

Kind: static method of KGquery

KGquery.initQuery() ⇒ void#

Initializes the query interface. Loads the query tab HTML if not already loaded.

Kind: static method of KGquery

KGquery.initGraph() ⇒ void#

Initializes the graph interface. Loads the graph tab HTML if not already loaded and initializes the graph visualization.

Kind: static method of KGquery

KGquery.checkRequirements() ⇒ void#

Checks requirements by executing a SHACL query.

Kind: static method of KGquery

KGquery.initMyQuery() ⇒ void#

Initializes the query management interface.

Kind: static method of KGquery

KGquery.unload() ⇒ void#

Unloads the module and restores initial state.

Kind: static method of KGquery

KGquery.init() ⇒ void#

Initializes the module. Draws the graph model and sets up saved queries.

Kind: static method of KGquery

KGquery.initOutputType() ⇒ void#

Initializes the output type selector with available tools.

Kind: static method of KGquery

KGquery.loadSource() ⇒ void#

Loads a source and initializes the graph visualization.

Kind: static method of KGquery

KGquery.addQuerySet(booleanOperator) ⇒ Object#

Adds a new query set with a boolean operator.

Kind: static method of KGquery
Returns: Object - querySet - The newly created query set

Param

Type

Description

booleanOperator

string

The boolean operator to use (AND, OR, etc.)

Properties

Name

Type

Description

querySet.divId

string

The ID of the div containing the query set

querySet.elements

Array

Array of query elements in this set

querySet.color

string

The color assigned to this query set

querySet.booleanOperator

string

The boolean operator for this set

querySet.classFiltersMap

Object

Map of class filters

querySet.index

number

Index of this query set

KGquery.addQueryElementToQuerySet(querySet) ⇒ Object#

Adds a query element to a query set.

Kind: static method of KGquery
Returns: Object - queryElement - The newly created query element

Param

Type

Description

querySet

Object

The query set to add the element to

Properties

Name

Type

Description

queryElement.divId

string

The ID of the div containing this element

queryElement.fromNode

string

The source node

queryElement.toNode

string

The target node

queryElement.paths

Array

Array of paths between fromNode and toNode

queryElement.queryElementDivId

string

The element’s div ID

queryElement.fromNodeDivId

string

The source node’s div ID

queryElement.toNodeDivId

string

The target node’s div ID

queryElement.index

number

Index within the query set

queryElement.setIndex

number

Index of the parent query set

KGquery.addNodeToQueryElement(queryElement, node, role) ⇒ void#

Adds a node to a query element.

Kind: static method of KGquery

Param

Type

Description

queryElement

Object

The query element to add the node to

node

Object

The node to add

role

string

The role of the node (‘fromNode’ or ‘toNode’)

KGquery.addNode(selectedNode, nodeEvent, [callback]) ⇒ void#

Adds a node to the graph.

Kind: static method of KGquery

Param

Type

Description

selectedNode

Object

The node to add

nodeEvent

Object

The event that triggered the addition

[callback]

function

Optional callback after adding

KGquery.addEdgeNodes(fromNode, toNode, edge) ⇒ void#

Adds edge nodes to the graph.

Kind: static method of KGquery

Param

Type

Description

fromNode

Object

The source node

toNode

Object

The target node

edge

Object

The edge data

KGquery.addEdge(edge, evt) ⇒ void#

Adds edges between nodes in the graph.

Kind: static method of KGquery

Param

Type

Description

edge

Object

The edge to add

evt

Object

The event that triggered the addition

KGquery.aggregateQuery() ⇒ void#

Performs aggregation on query results. Shows a dialog for selecting aggregate clauses and validates that variables belong to the same set.

Kind: static method of KGquery

KGquery.queryKG(output, [options], [isVirtualSQLquery]) ⇒ void#

Executes a query on the knowledge graph.

Kind: static method of KGquery
Throws:

  • Error If the query execution fails

Param

Type

Default

Description

output

string

The desired output format (‘table’, ‘Graph’, ‘shacl’, or custom tool name)

[options]

Object

Additional query options

[options.aggregate]

Object

Aggregation settings for the query

[isVirtualSQLquery]

boolean

false

Whether this is a virtual SQL query

KGquery.execPathQuery(options, callback) ⇒ void#

Executes a SPARQL path query based on the provided options. The query is constructed dynamically and executed in multiple steps.

Kind: static method of KGquery

Param

Type

Description

options

Object

The options for query execution

options.output

string

The desired output format (e.g., “shacl”)

[options.aggregate]

Object

Aggregation settings for the query

callback

function

Callback function to handle the query results

callback.err

Error

Error object if the query fails

callback.result

Object

The query results if successful

KGquery.queryResultToVisjsGraph(result) ⇒ void#

Converts query results to a Vis.js graph visualization.

Kind: static method of KGquery
Throws:

  • Error If result size exceeds maxResultSizeforLineageViz

Param

Type

Description

result

Object

The query results to convert

KGquery.queryToTagsGeometry(result) ⇒ void#

Converts query results to a tags geometry visualization.

Kind: static method of KGquery

Param

Type

Description

result

Object

The query results to convert

KGquery.queryToTagsCalendar(result) ⇒ void#

Converts query results to a tags calendar visualization.

Kind: static method of KGquery

Param

Type

Description

result

Object

The query results to convert

KGquery.queryResultToTable(result) ⇒ void#

Converts query results to a table format and displays it in a dialog. Handles large result sets by exporting to CSV if size exceeds 10000 rows.

Kind: static method of KGquery

Param

Type

Description

result

Object

The query results to convert

result.results.bindings

Array

The query result bindings

result.head.vars

Array

The query result variables

KGquery.clearAll([exceptSetQueries]) ⇒ void#

Clears all query sets and resets the graph state. Optionally preserves set queries if specified.

Kind: static method of KGquery

Param

Type

Description

[exceptSetQueries]

boolean

If true, preserves set queries during cleanup

KGquery.getVarName(node, [withoutQuestionMark]) ⇒ string#

Gets the variable name for a node.

Kind: static method of KGquery
Returns: string - The variable name for the node

Param

Type

Description

node

Object

The node to get variable name for

[withoutQuestionMark]

boolean

Whether to omit the question mark prefix

KGquery.getAllQueryPathClasses() ⇒ Array.<Object>#

Gets all classes used in query paths.

Kind: static method of KGquery
Returns: Array.<Object> - Array of class objects used in query paths

KGquery.message(message, [stopWaitImg]) ⇒ void#

Displays a message in the UI and controls the wait image.

Kind: static method of KGquery

Param

Type

Default

Description

message

string

The message to display

[stopWaitImg]

boolean

false

If true, hides the wait image

KGquery.switchRightPanel([forceGraph]) ⇒ void#

Switches the right panel display between graph and other views.

Kind: static method of KGquery

Param

Type

Description

[forceGraph]

boolean

Whether to force graph display

KGquery.onBooleanOperatorChange(querySetDivId, value) ⇒ void#

Handles boolean operator changes for query sets.

Kind: static method of KGquery

Param

Type

Description

querySetDivId

string

ID of the query set div

value

string

New boolean operator value (‘AND’, ‘OR’, ‘Union’, etc.)

KGquery.removeQueryElement(queryElementDivId) ⇒ void#

Removes a query element from the graph.

Kind: static method of KGquery

Param

Type

Description

queryElementDivId

string

ID of the query element div to remove

KGquery.removeSet(querySetDivId) ⇒ void#

Removes a query set from the graph.

Kind: static method of KGquery

Param

Type

Description

querySetDivId

string

ID of the query set div to remove

KGquery.onOutputTypeSelect(output) ⇒ void#

Handles output type selection changes.

Kind: static method of KGquery

Param

Type

Description

output

string

The selected output type

KGquery.addOutputType() ⇒ void#

Adds an output type to the select options.

Kind: static method of KGquery

KGquery.initQuery() ⇒ void#

Initializes the query interface. Loads the query tab HTML if not already loaded.

Kind: static method of KGquery

KGquery.initGraph() ⇒ void#

Initializes the graph interface. Loads the graph tab HTML if not already loaded and initializes the graph visualization.

Kind: static method of KGquery

KGquery.checkRequirements() ⇒ void#

Checks requirements by executing a SHACL query.

Kind: static method of KGquery

KGquery.initMyQuery() ⇒ void#

Initializes the query management interface.

Kind: static method of KGquery

KGquery.onLoaded() ⇒ void#

Called when the module is loaded. Initializes the user interface and loads saved queries.

Kind: static method of KGquery
Category: KGquery
Access: public

KGquery.onLoaded() ⇒ void#

Called when the module is loaded. Initializes the user interface and loads saved queries.

Kind: static method of KGquery
Category: KGquery
Access: public

KGquery#

KGquery Module Module for querying and visualizing knowledge graphs. Provides functionality to build and execute queries on knowledge graphs.

KGquery.unload() ⇒ void#

Unloads the module and restores initial state.

Kind: static method of KGquery

KGquery.init() ⇒ void#

Initializes the module. Draws the graph model and sets up saved queries.

Kind: static method of KGquery

KGquery.initOutputType() ⇒ void#

Initializes the output type selector with available tools.

Kind: static method of KGquery

KGquery.loadSource() ⇒ void#

Loads a source and initializes the graph visualization.

Kind: static method of KGquery

KGquery.addQuerySet(booleanOperator) ⇒ Object#

Adds a new query set with a boolean operator.

Kind: static method of KGquery
Returns: Object - querySet - The newly created query set

Param

Type

Description

booleanOperator

string

The boolean operator to use (AND, OR, etc.)

Properties

Name

Type

Description

querySet.divId

string

The ID of the div containing the query set

querySet.elements

Array

Array of query elements in this set

querySet.color

string

The color assigned to this query set

querySet.booleanOperator

string

The boolean operator for this set

querySet.classFiltersMap

Object

Map of class filters

querySet.index

number

Index of this query set

KGquery.addQueryElementToQuerySet(querySet) ⇒ Object#

Adds a query element to a query set.

Kind: static method of KGquery
Returns: Object - queryElement - The newly created query element

Param

Type

Description

querySet

Object

The query set to add the element to

Properties

Name

Type

Description

queryElement.divId

string

The ID of the div containing this element

queryElement.fromNode

string

The source node

queryElement.toNode

string

The target node

queryElement.paths

Array

Array of paths between fromNode and toNode

queryElement.queryElementDivId

string

The element’s div ID

queryElement.fromNodeDivId

string

The source node’s div ID

queryElement.toNodeDivId

string

The target node’s div ID

queryElement.index

number

Index within the query set

queryElement.setIndex

number

Index of the parent query set

KGquery.addNodeToQueryElement(queryElement, node, role) ⇒ void#

Adds a node to a query element.

Kind: static method of KGquery

Param

Type

Description

queryElement

Object

The query element to add the node to

node

Object

The node to add

role

string

The role of the node (‘fromNode’ or ‘toNode’)

KGquery.addNode(selectedNode, nodeEvent, [callback]) ⇒ void#

Adds a node to the graph.

Kind: static method of KGquery

Param

Type

Description

selectedNode

Object

The node to add

nodeEvent

Object

The event that triggered the addition

[callback]

function

Optional callback after adding

KGquery.addEdgeNodes(fromNode, toNode, edge) ⇒ void#

Adds edge nodes to the graph.

Kind: static method of KGquery

Param

Type

Description

fromNode

Object

The source node

toNode

Object

The target node

edge

Object

The edge data

KGquery.addEdge(edge, evt) ⇒ void#

Adds edges between nodes in the graph.

Kind: static method of KGquery

Param

Type

Description

edge

Object

The edge to add

evt

Object

The event that triggered the addition

KGquery.aggregateQuery() ⇒ void#

Performs aggregation on query results. Shows a dialog for selecting aggregate clauses and validates that variables belong to the same set.

Kind: static method of KGquery

KGquery.queryKG(output, [options], [isVirtualSQLquery]) ⇒ void#

Executes a query on the knowledge graph.

Kind: static method of KGquery
Throws:

  • Error If the query execution fails

Param

Type

Default

Description

output

string

The desired output format (‘table’, ‘Graph’, ‘shacl’, or custom tool name)

[options]

Object

Additional query options

[options.aggregate]

Object

Aggregation settings for the query

[isVirtualSQLquery]

boolean

false

Whether this is a virtual SQL query

KGquery.execPathQuery(options, callback) ⇒ void#

Executes a SPARQL path query based on the provided options. The query is constructed dynamically and executed in multiple steps.

Kind: static method of KGquery

Param

Type

Description

options

Object

The options for query execution

options.output

string

The desired output format (e.g., “shacl”)

callback

function

Callback function to handle the query results

callback.err

Error

Error object if the query fails

callback.result

Object

The query results if successful

KGquery.queryResultToVisjsGraph(result) ⇒ void#

Converts query results to a Vis.js graph visualization.

Kind: static method of KGquery
Throws:

  • Error If result size exceeds maxResultSizeforLineageViz

Param

Type

Description

result

Object

The query results to convert

KGquery.queryToTagsGeometry(result) ⇒ void#

Converts query results to a tags geometry visualization.

Kind: static method of KGquery

Param

Type

Description

result

Object

The query results to convert

KGquery.queryToTagsCalendar(result) ⇒ void#

Converts query results to a tags calendar visualization.

Kind: static method of KGquery

Param

Type

Description

result

Object

The query results to convert

KGquery.queryResultToTable(result) ⇒ void#

Converts query results to a table format and displays it in a dialog. Handles large result sets by exporting to CSV if size exceeds 10000 rows.

Kind: static method of KGquery

Param

Type

Description

result

Object

The query results to convert

result.results.bindings

Array

The query result bindings

result.head.vars

Array

The query result variables

KGquery.clearAll([exceptSetQueries]) ⇒ void#

Clears all query sets and resets the graph state. Optionally preserves set queries if specified.

Kind: static method of KGquery

Param

Type

Description

[exceptSetQueries]

boolean

If true, preserves set queries during cleanup

KGquery.getVarName(node, [withoutQuestionMark]) ⇒ string#

Gets the variable name for a node.

Kind: static method of KGquery
Returns: string - The variable name for the node

Param

Type

Description

node

Object

The node to get variable name for

[withoutQuestionMark]

boolean

Whether to omit the question mark prefix

KGquery.getAllQueryPathClasses() ⇒ Array.<Object>#

Gets all classes used in query paths.

Kind: static method of KGquery
Returns: Array.<Object> - Array of class objects used in query paths

KGquery.message(message, [stopWaitImg]) ⇒ void#

Displays a message in the UI and controls the wait image.

Kind: static method of KGquery

Param

Type

Default

Description

message

string

The message to display

[stopWaitImg]

boolean

false

If true, hides the wait image

KGquery.switchRightPanel([forceGraph]) ⇒ void#

Switches the right panel display between graph and other views.

Kind: static method of KGquery

Param

Type

Description

[forceGraph]

boolean

Whether to force graph display

KGquery.onBooleanOperatorChange(querySetDivId, value) ⇒ void#

Handles boolean operator changes for query sets.

Kind: static method of KGquery

Param

Type

Description

querySetDivId

string

ID of the query set div

value

string

New boolean operator value (‘AND’, ‘OR’, ‘Union’, etc.)

KGquery.removeQueryElement(queryElementDivId) ⇒ void#

Removes a query element from the graph.

Kind: static method of KGquery

Param

Type

Description

queryElementDivId

string

ID of the query element div to remove

KGquery.removeSet(querySetDivId) ⇒ void#

Removes a query set from the graph.

Kind: static method of KGquery

Param

Type

Description

querySetDivId

string

ID of the query set div to remove

KGquery.onOutputTypeSelect(output) ⇒ void#

Handles output type selection changes.

Kind: static method of KGquery

Param

Type

Description

output

string

The selected output type

KGquery.addOutputType() ⇒ void#

Adds an output type to the select options.

Kind: static method of KGquery

KGquery.initQuery() ⇒ void#

Initializes the query interface. Loads the query tab HTML if not already loaded.

Kind: static method of KGquery

KGquery.initGraph() ⇒ void#

Initializes the graph interface. Loads the graph tab HTML if not already loaded and initializes the graph visualization.

Kind: static method of KGquery

KGquery.checkRequirements() ⇒ void#

Checks requirements by executing a SHACL query.

Kind: static method of KGquery

KGquery.initMyQuery() ⇒ void#

Initializes the query management interface.

Kind: static method of KGquery

KGquery.unload() ⇒ void#

Unloads the module and restores initial state.

Kind: static method of KGquery

KGquery.init() ⇒ void#

Initializes the module. Draws the graph model and sets up saved queries.

Kind: static method of KGquery

KGquery.initOutputType() ⇒ void#

Initializes the output type selector with available tools.

Kind: static method of KGquery

KGquery.loadSource() ⇒ void#

Loads a source and initializes the graph visualization.

Kind: static method of KGquery

KGquery.addQuerySet(booleanOperator) ⇒ Object#

Adds a new query set with a boolean operator.

Kind: static method of KGquery
Returns: Object - querySet - The newly created query set

Param

Type

Description

booleanOperator

string

The boolean operator to use (AND, OR, etc.)

Properties

Name

Type

Description

querySet.divId

string

The ID of the div containing the query set

querySet.elements

Array

Array of query elements in this set

querySet.color

string

The color assigned to this query set

querySet.booleanOperator

string

The boolean operator for this set

querySet.classFiltersMap

Object

Map of class filters

querySet.index

number

Index of this query set

KGquery.addQueryElementToQuerySet(querySet) ⇒ Object#

Adds a query element to a query set.

Kind: static method of KGquery
Returns: Object - queryElement - The newly created query element

Param

Type

Description

querySet

Object

The query set to add the element to

Properties

Name

Type

Description

queryElement.divId

string

The ID of the div containing this element

queryElement.fromNode

string

The source node

queryElement.toNode

string

The target node

queryElement.paths

Array

Array of paths between fromNode and toNode

queryElement.queryElementDivId

string

The element’s div ID

queryElement.fromNodeDivId

string

The source node’s div ID

queryElement.toNodeDivId

string

The target node’s div ID

queryElement.index

number

Index within the query set

queryElement.setIndex

number

Index of the parent query set

KGquery.addNodeToQueryElement(queryElement, node, role) ⇒ void#

Adds a node to a query element.

Kind: static method of KGquery

Param

Type

Description

queryElement

Object

The query element to add the node to

node

Object

The node to add

role

string

The role of the node (‘fromNode’ or ‘toNode’)

KGquery.addNode(selectedNode, nodeEvent, [callback]) ⇒ void#

Adds a node to the graph.

Kind: static method of KGquery

Param

Type

Description

selectedNode

Object

The node to add

nodeEvent

Object

The event that triggered the addition

[callback]

function

Optional callback after adding

KGquery.addEdgeNodes(fromNode, toNode, edge) ⇒ void#

Adds edge nodes to the graph.

Kind: static method of KGquery

Param

Type

Description

fromNode

Object

The source node

toNode

Object

The target node

edge

Object

The edge data

KGquery.addEdge(edge, evt) ⇒ void#

Adds edges between nodes in the graph.

Kind: static method of KGquery

Param

Type

Description

edge

Object

The edge to add

evt

Object

The event that triggered the addition

KGquery.aggregateQuery() ⇒ void#

Performs aggregation on query results. Shows a dialog for selecting aggregate clauses and validates that variables belong to the same set.

Kind: static method of KGquery

KGquery.queryKG(output, [options], [isVirtualSQLquery]) ⇒ void#

Executes a query on the knowledge graph.

Kind: static method of KGquery
Throws:

  • Error If the query execution fails

Param

Type

Default

Description

output

string

The desired output format (‘table’, ‘Graph’, ‘shacl’, or custom tool name)

[options]

Object

Additional query options

[options.aggregate]

Object

Aggregation settings for the query

[isVirtualSQLquery]

boolean

false

Whether this is a virtual SQL query

KGquery.execPathQuery(options, callback) ⇒ void#

Executes a SPARQL path query based on the provided options. The query is constructed dynamically and executed in multiple steps.

Kind: static method of KGquery

Param

Type

Description

options

Object

The options for query execution

options.output

string

The desired output format (e.g., “shacl”)

[options.aggregate]

Object

Aggregation settings for the query

callback

function

Callback function to handle the query results

callback.err

Error

Error object if the query fails

callback.result

Object

The query results if successful

KGquery.queryResultToVisjsGraph(result) ⇒ void#

Converts query results to a Vis.js graph visualization.

Kind: static method of KGquery
Throws:

  • Error If result size exceeds maxResultSizeforLineageViz

Param

Type

Description

result

Object

The query results to convert

KGquery.queryToTagsGeometry(result) ⇒ void#

Converts query results to a tags geometry visualization.

Kind: static method of KGquery

Param

Type

Description

result

Object

The query results to convert

KGquery.queryToTagsCalendar(result) ⇒ void#

Converts query results to a tags calendar visualization.

Kind: static method of KGquery

Param

Type

Description

result

Object

The query results to convert

KGquery.queryResultToTable(result) ⇒ void#

Converts query results to a table format and displays it in a dialog. Handles large result sets by exporting to CSV if size exceeds 10000 rows.

Kind: static method of KGquery

Param

Type

Description

result

Object

The query results to convert

result.results.bindings

Array

The query result bindings

result.head.vars

Array

The query result variables

KGquery.clearAll([exceptSetQueries]) ⇒ void#

Clears all query sets and resets the graph state. Optionally preserves set queries if specified.

Kind: static method of KGquery

Param

Type

Description

[exceptSetQueries]

boolean

If true, preserves set queries during cleanup

KGquery.getVarName(node, [withoutQuestionMark]) ⇒ string#

Gets the variable name for a node.

Kind: static method of KGquery
Returns: string - The variable name for the node

Param

Type

Description

node

Object

The node to get variable name for

[withoutQuestionMark]

boolean

Whether to omit the question mark prefix

KGquery.getAllQueryPathClasses() ⇒ Array.<Object>#

Gets all classes used in query paths.

Kind: static method of KGquery
Returns: Array.<Object> - Array of class objects used in query paths

KGquery.message(message, [stopWaitImg]) ⇒ void#

Displays a message in the UI and controls the wait image.

Kind: static method of KGquery

Param

Type

Default

Description

message

string

The message to display

[stopWaitImg]

boolean

false

If true, hides the wait image

KGquery.switchRightPanel([forceGraph]) ⇒ void#

Switches the right panel display between graph and other views.

Kind: static method of KGquery

Param

Type

Description

[forceGraph]

boolean

Whether to force graph display

KGquery.onBooleanOperatorChange(querySetDivId, value) ⇒ void#

Handles boolean operator changes for query sets.

Kind: static method of KGquery

Param

Type

Description

querySetDivId

string

ID of the query set div

value

string

New boolean operator value (‘AND’, ‘OR’, ‘Union’, etc.)

KGquery.removeQueryElement(queryElementDivId) ⇒ void#

Removes a query element from the graph.

Kind: static method of KGquery

Param

Type

Description

queryElementDivId

string

ID of the query element div to remove

KGquery.removeSet(querySetDivId) ⇒ void#

Removes a query set from the graph.

Kind: static method of KGquery

Param

Type

Description

querySetDivId

string

ID of the query set div to remove

KGquery.onOutputTypeSelect(output) ⇒ void#

Handles output type selection changes.

Kind: static method of KGquery

Param

Type

Description

output

string

The selected output type

KGquery.addOutputType() ⇒ void#

Adds an output type to the select options.

Kind: static method of KGquery

KGquery.initQuery() ⇒ void#

Initializes the query interface. Loads the query tab HTML if not already loaded.

Kind: static method of KGquery

KGquery.initGraph() ⇒ void#

Initializes the graph interface. Loads the graph tab HTML if not already loaded and initializes the graph visualization.

Kind: static method of KGquery

KGquery.checkRequirements() ⇒ void#

Checks requirements by executing a SHACL query.

Kind: static method of KGquery

KGquery.initMyQuery() ⇒ void#

Initializes the query management interface.

Kind: static method of KGquery

KGquery.onLoaded() ⇒ void#

Called when the module is loaded. Initializes the user interface and loads saved queries.

Kind: static method of KGquery
Category: KGquery
Access: public

KGquery.onLoaded() ⇒ void#

Called when the module is loaded. Initializes the user interface and loads saved queries.

Kind: static method of KGquery
Category: KGquery
Access: public

KGquery_controlPanel#

KGquery_controlPanel Module Handles the user interface control panel for knowledge graph queries.

KGquery_controlPanel.addQuerySet(toDivId, booleanOperator, label, color) ⇒ string#

Adds a new query set to the interface.

Kind: static method of KGquery_controlPanel
Returns: string - The ID of the created query set div

Param

Type

Description

toDivId

string

The ID of the container div

booleanOperator

string

The boolean operator for the set (Union/Minus)

label

string

The label for the query set

color

string

The color for the query set visualization

KGquery_controlPanel.addQueryElementToCurrentSet(querySetDivId, [color]) ⇒ string#

Adds a query element to the current set.

Kind: static method of KGquery_controlPanel
Returns: string - The ID of the created query element div

Param

Type

Description

querySetDivId

string

The ID of the query set div

[color]

string

Optional color for the query element

KGquery_controlPanel.addNodeToQueryElementDiv(queryElementDivId, role, label) ⇒ string#

Adds a node to a query element div.

Kind: static method of KGquery_controlPanel
Returns: string - The ID of the created node div

Param

Type

Description

queryElementDivId

string

The ID of the query element div

role

string

The role of the node (fromNode/toNode)

label

string

The label for the node

KGquery_controlPanel.addPredicateToQueryElementDiv(queryElementDivId, label) ⇒ void#

Adds a predicate to a query element div.

Kind: static method of KGquery_controlPanel

Param

Type

Description

queryElementDivId

string

The ID of the query element div

label

string

The label for the predicate

KGquery_controlPanel.getQueryElementPredicateLabel(queryElement) ⇒ string#

Gets the predicate label for a query element.

Kind: static method of KGquery_controlPanel
Returns: string - The formatted predicate label

Param

Type

Description

queryElement

Object

The query element

queryElement.paths

Array

Array of paths in the query element

KGquery_filter#

KGquery_filter Module Handles filtering functionality for knowledge graph queries.

KGquery_filter.selectOptionalPredicates(querySets, options, callback) ⇒ void#

Selects optional predicates for the query.

Kind: static method of KGquery_filter

Param

Type

Description

querySets

Object

The query sets to process

options

Object

Options for predicate selection

callback

function

Callback function called with (err, result)

KGquery_filter.getOptionalPredicates(propertyNodes, options, callback) ⇒ void#

Gets the SPARQL representation of selected optional predicates.

Kind: static method of KGquery_filter

Param

Type

Description

propertyNodes

Array

Array of selected property nodes

options

Object

options.noConfirm

boolean

callback

function

Callback function called with (err, result)

callback.result

Object

The result object containing:

callback.result.optionalPredicatesSparql

string

The OPTIONAL clauses in SPARQL

callback.result.selectClauseSparql

string

The SELECT clause variables

KGquery_filter.getAggregateFilterOptionalPredicates(querySet, filter) ⇒ string#

Gets optional predicates for aggregate filters.

Kind: static method of KGquery_filter
Returns: string - The filter string with optional predicates

Param

Type

Description

querySet

Object

The query set to process

filter

string

The filter string to check

KGquery_filter.getAggregatePredicates(groupByPredicates, groupByPredicates[key) ⇒ string#

Gets aggregate predicates for grouping.

Kind: static method of KGquery_filter
Returns: string - SPARQL string for aggregate predicates

Param

Type

Description

groupByPredicates

Object

Map of predicates to group by

groupByPredicates[key

Object

A predicate object

KGquery_filter.applyFilterToNode(classDivId, aClass, classSetIndex, result, addTojsTreeNode) ⇒ void#

Applies the filter result to a node and updates the UI.

Kind: static method of KGquery_filter

Param

Type

Description

classDivId

string

The ID of the class div

aClass

Object

The class object

classSetIndex

number

The index of the class set

result

Object

The filter result object

result.filter

string

The filter string

result.filterLabel

string

The filter label

addTojsTreeNode

string

The node to add the filter to (optional)

KGquery_filter.addNodeFilter(classDivId, addTojsTreeNode, propertyId) ⇒ void#

Adds a filter to a node based on a property.

Kind: static method of KGquery_filter

Param

Type

Description

classDivId

string

The ID of the class div

addTojsTreeNode

string

The node to add the filter to

propertyId

string

The ID of the property to filter on

KGquery_myQueries#

KGquery_myQueries Module Handles saving and loading of knowledge graph queries.

KGquery_myQueries.save(callback) ⇒ void#

Saves the current query state.

Kind: static method of KGquery_myQueries

Param

Type

Description

callback

function

Callback function called with (err, data) where data contains:

callback.data

Object

The data to save

callback.data.querySets

Object

The current query sets

callback.data.sparqlQuery

string

The current SPARQL query

callback.data.optionalPredicatesSparql

string

Optional predicates in SPARQL format

callback.data.selectClauseSparql

string

The SELECT clause in SPARQL format

KGquery_myQueries.load(err, result) ⇒ void#

Loads a saved query state.

Kind: static method of KGquery_myQueries

Param

Type

Description

err

Error

Error object if loading failed

result

Object

The saved query state to load

result.querySets

Object

The saved query sets

result.optionalPredicatesSparql

string

Optional predicates in SPARQL format

result.selectClauseSparql

string

The SELECT clause in SPARQL format

KGquery_nodeSelector#

KGquery_nodeSelector Module Module for selecting and managing nodes in knowledge graph queries.

KGquery_nodeSelector.showImplicitModelInJstree(visjsData) ⇒ void#

Shows the implicit model in a jsTree structure.

Kind: static method of KGquery_nodeSelector

Param

Type

Description

visjsData

Object

The Vis.js graph data containing nodes and edges

visjsData.nodes

Array

Array of nodes in the graph

visjsData.edges

Array

Array of edges in the graph

KGquery_nodeSelector.onSelectNode(node) ⇒ void#

Handles node selection in the jsTree.

Kind: static method of KGquery_nodeSelector

Param

Type

Description

node

Object

The selected node from jsTree

node.id

string

The node ID

node.text

string

The node text/label

node.data

Object

Additional node data

KGquery_paths#

Module for managing paths in knowledge graph queries. This module provides functionality for:

  • Configuring and managing paths between nodes

  • Manipulating identifiers and variables in paths

  • Managing graphical display of paths

  • Finding shortest paths between nodes

  • Managing path ambiguities

Requires: module:shared/common, module:KGquery_graph, module:uiWidgets/simpleListSelectorWidget, module:sparqlProxies/sparql_common

DataSourceManager#

DataSourceManager module Responsible for managing data source configurations and operations.

See: [Tutorial: Overview]{@tutorial overview}

DataSourceManager.getSlsvSourceConfig(source, callback) ⇒ void#

Retrieves the configuration for a given data source. Transfers the “main.json” configuration to the Vis.js graph if not already transferred.

Kind: static method of DataSourceManager

Param

Type

Description

source

string

The source name.

callback

function

The callback function to be executed after the operation.

DataSourceManager.initNewSlsvSource(source, callback) ⇒ void#

Initializes a new data source and sets the current configuration.

Kind: static method of DataSourceManager

Param

Type

Description

source

string

The source name.

callback

function

The callback function to be executed after the initialization.

DataSourceManager.loaDataSourcesJstree(jstreeDiv, tableStatsMap, callback) ⇒ void#

Loads data sources into a Jstree widget for visualization and interaction.

Kind: static method of DataSourceManager

Param

Type

Description

jstreeDiv

string

The DOM element where the tree should be loaded.

tableStatsMap

string

map where key is a table and value the number of triples created from this table

callback

function

The callback function to be executed after loading the data sources.

DataSourceManager.initNewDataSource(name, type, sqlType, table) ⇒ void#

Initializes a new data source, updating the current configuration. This function handles both CSV and non-CSV sources by adding them to the Jstree and updating the current data source configuration.

Kind: static method of DataSourceManager

Param

Type

Description

name

string

The name of the data source.

type

string

The type of the data source (e.g., “csvSource” or other types).

sqlType

string

The SQL type of the data source, relevant for non-CSV sources.

table

string

The initial table to be set for the data source.

DataSourceManager.loadCsvSource(slsvSource, fileName, loadJstree, callback) ⇒ void#

Loads a CSV source by fetching data from the server, including headers and sample data. This function updates the current configuration with the columns of the CSV source and its sample data.

Kind: static method of DataSourceManager

Param

Type

Description

slsvSource

string

The name of the CSV source.

fileName

string

The name of the CSV file to load.

loadJstree

boolean

A flag indicating whether to reload the Jstree.

callback

function

A callback function to be executed after loading the CSV source.

DataSourceManager.loadDataBaseSource(slsvSource, dataSource, sqlType, callback) ⇒ void#

Loads a database source and its associated model by fetching data from the server. This function retrieves the model for a given data source and updates the configuration with its tables. It also updates the Jstree with the available tables for the data source.

Kind: static method of DataSourceManager

Param

Type

Description

slsvSource

string

The name of the source.

dataSource

string

The name of the database source to load.

sqlType

string

The SQL type of the database source.

callback

function

A callback function to be executed after the source is loaded.

DataSourceManager.onDataSourcesJstreeSelect(event, obj) ⇒ void#

Handles the selection of a node in the Jstree, which represents different types of data sources, including databases, CSVs, and tables. It updates the configuration and loads the corresponding data source or table based on the selection. Also handles UI updates for the mapping modeler and left panel tabs.

Kind: static method of DataSourceManager

Param

Type

Description

event

Object

The event object triggered by the selection.

obj

Object

The Jstree node object containing details about the selected node.

DataSourceManager.saveSlsvSourceConfig(callback) ⇒ void#

Saves the current configuration of the SlsvSource by using the MappingColumnsGraph save function. Calls the provided callback once the saving operation is complete.

Kind: static method of DataSourceManager

Param

Type

Description

callback

function

The callback to invoke after saving the configuration.

DataSourceManager.displayUploadApp(displayForm) ⇒ void#

Displays the upload form app for uploading database or CSV sources. Depending on the form type, it loads the appropriate form and handles initialization of the React app.

Kind: static method of DataSourceManager

Param

Type

Description

displayForm

string

The type of form to display (“database” or “file”).

DataSourceManager.createDataBaseSourceMappings() ⇒ void#

Creates mappings for a selected database source. Closes the upload app dialog, adds the selected database source to the current configuration, and saves the updated configuration. Calls the provided callback once the operation is complete.

Kind: static method of DataSourceManager

DataSourceManager.createCsvSourceMappings() ⇒ void#

Creates mappings for a selected CSV source. Closes the upload app dialog, adds the selected CSV source to the current configuration, and saves the updated configuration. Calls the provided callback once the operation is complete.

Kind: static method of DataSourceManager

DataSourceManager.deleteDataSource(jstreeNode) ⇒ void#

Deletes a data source (either database or CSV) from the configuration. Removes the data source from the raw configuration, updates the JSTree, and removes related nodes and edges from the graph. The updated configuration is then saved. If the source is a CSV, additional steps would be taken to remove the file.

Kind: static method of DataSourceManager

Param

Type

Description

jstreeNode

Object

The JSTree node representing the data source to be deleted.

MappingColumnsGraph#

MappingColumnsGraph module. Handles the visualization and management of mapping columns in a graph.

See: [Tutorial: Overview]{@tutorial overview}

MappingColumnsGraph.self.currentOffset : Object#

Current graph node being manipulated.

Kind: static property of MappingColumnsGraph

MappingColumnsGraph.self.currentGraphNode#

Stores the currently selected graph node.

Kind: static property of MappingColumnsGraph

MappingColumnsGraph.self.visjsGraph : Object#

Instance of the Vis.js graph.

Kind: static property of MappingColumnsGraph

MappingColumnsGraph.self.graphDiv#

ID of the HTML container where the graph is rendered.

Kind: static property of MappingColumnsGraph

MappingColumnsGraph.stepX : number#

X-axis step size for node positioning.

Kind: static property of MappingColumnsGraph

MappingColumnsGraph.stepY : number#

Y-axis step size for node positioning.

Kind: static property of MappingColumnsGraph

MappingColumnsGraph.minX : number#

Minimum X position for graph layout adjustments.

Kind: static property of MappingColumnsGraph

MappingColumnsGraph.drawResource(newResource) ⇒ void#

Draws a new resource node in the Vis.js graph. Positions the node dynamically and links it with existing nodes if necessary.

Kind: static method of MappingColumnsGraph

Param

Type

Description

newResource

Object

The resource to be added to the graph.

MappingColumnsGraph.initOffsets() ⇒ void#

Initializes the offset values for positioning nodes in the graph. Ensures that the offset is set correctly before adding new nodes.

Kind: static method of MappingColumnsGraph

MappingColumnsGraph.objectIdExistsInGraph(id) ⇒ boolean#

Checks if a given object ID already exists in the Vis.js graph. Iterates through existing nodes to determine if the ID is present.

Kind: static method of MappingColumnsGraph
Returns: boolean - True if the object exists, otherwise false.

Param

Type

Description

id

string

The ID of the object to check.

MappingColumnsGraph.drawGraphCanvas(graphDiv, visjsData, [callback]) ⇒ void#

Draws the graph canvas using Vis.js with specified options. Configures the graph’s visual settings and event handlers.

Kind: static method of MappingColumnsGraph

Param

Type

Description

graphDiv

string

The ID of the div container for the graph.

visjsData

Object

Data containing nodes and edges for the graph.

[callback]

function

Optional callback function to execute after drawing.

MappingColumnsGraph.adjustEdgeCurvatures() ⇒ void#

Adjusts edge curvatures so that multiple edges between the same node pair do not overlap. Edges are spread using alternating curvedCW / curvedCCW directions with increasing roundness.

Kind: static method of MappingColumnsGraph

MappingColumnsGraph.onVisjsGraphClick(node, event, options) ⇒ void#

Handles click events on the Vis.js graph. Updates the current selected node and manages relations between columns.

Kind: static method of MappingColumnsGraph

Param

Type

Default

Description

node

Object

The clicked node object.

event

Object

The click event object.

options

Object

Additional event options.

[options.ctrlKey]

boolean

false

Indicates if the Ctrl key was pressed during the click.

[options.shiftKey]

boolean

false

Indicates if the Shift key was pressed during the click.

[options.altKey]

boolean

false

Indicates if the Alt key was pressed during the click.

MappingColumnsGraph.showGraphPopupMenu(node, point, event) ⇒ void#

Displays the context menu for a graph node. Shows relevant options based on the node type (Class, Column, or Edge).

Kind: static method of MappingColumnsGraph

Param

Type

Description

node

Object

The node where the menu should appear.

point

Object

The coordinates for the popup menu.

event

Object

The event triggering the menu.

MappingColumnsGraph.outlineNode(nodeId) ⇒ void#

Outlines a selected node by increasing its border width.

Kind: static method of MappingColumnsGraph

Param

Type

Description

nodeId

string

The ID of the node to highlight.

MappingColumnsGraph.removeNodeFromGraph() ⇒ void#

Removes a node from the graph after user confirmation. Also removes its connected edges.

Kind: static method of MappingColumnsGraph

MappingColumnsGraph.removeNodeEdgeGraph() ⇒ void#

Removes an edge from the graph after user confirmation.

Kind: static method of MappingColumnsGraph

MappingColumnsGraph.addSuperClassToGraph() ⇒ void#

Adds a superclass to the graph for the selected node. Queries the ontology for superclass relationships.

Kind: static method of MappingColumnsGraph

MappingColumnsGraph.drawColumnToClassEdge() ⇒ void#

Draws an edge between a column and a class in the graph.

Kind: static method of MappingColumnsGraph

MappingColumnsGraph.showNodeInfos() ⇒ void#

Displays detailed information about the selected node.

Kind: static method of MappingColumnsGraph

MappingColumnsGraph.showSampledata() ⇒ void#

Displays sample data related to the selected column.

Kind: static method of MappingColumnsGraph

MappingColumnsGraph.showColumnDetails([node]) ⇒ void#

Shows detailed mappings for the selected column in a dialog.

Kind: static method of MappingColumnsGraph

Param

Type

Description

[node]

Object

The node for which details should be displayed. Defaults to the currently selected node.

MappingColumnsGraph.addNodesByDataTableBatch(nodes) ⇒ void#

Adds nodes to the Vis.js graph in batches based on their associated data tables. Nodes are grouped by their dataTable property and added to the graph incrementally. Ensures that the graph layout is adjusted after each batch is added. Permits to have a structured visualisation

Kind: static method of MappingColumnsGraph

Param

Type

Description

nodes

Array.<Object>

The list of nodes to be added to the graph.

MappingColumnsGraph.loadVisjsGraph([callback]) ⇒ void#

Loads the Vis.js graph for the current mapping source. Retrieves graph data from a JSON file and adjusts layout positioning. Clusters nodes based on data tables for better visualization.

Kind: static method of MappingColumnsGraph

Param

Type

Description

[callback]

function

Optional callback function executed after loading the graph.

MappingColumnsGraph.saveVisjsGraph([callback]) ⇒ void#

Saves the current Vis.js graph to a JSON file. Captures nodes, edges, positions, and configuration data before sending it to the backend for storage.

Kind: static method of MappingColumnsGraph

Param

Type

Description

[callback]

function

Optional callback function executed after saving the graph.

MappingColumnsGraph.getDatasourceTablesFromVisjsGraph() ⇒ Array.<string>#

Retrieves distinct data tables from the Vis.js graph nodes. Filters out undefined values and returns a list of unique data tables.

Kind: static method of MappingColumnsGraph
Returns: Array.<string> - List of unique data table names.

MappingColumnsGraph.updateNode(node) ⇒ void#

Updates a node in the Vis.js graph and saves the updated graph.

Kind: static method of MappingColumnsGraph

Param

Type

Description

node

Object

The node to be updated.

MappingColumnsGraph.removeNode(node) ⇒ void#

Removes a node from the Vis.js graph and saves the updated graph.

Kind: static method of MappingColumnsGraph

Param

Type

Description

node

Object

The node to be removed.

MappingColumnsGraph.addNodes(node) ⇒ void#

Adds a new node to the Vis.js graph and saves the updated graph.

Kind: static method of MappingColumnsGraph

Param

Type

Description

node

Object

The node to be added.

MappingColumnsGraph.updateEdge(edge) ⇒ void#

Updates an edge in the Vis.js graph and saves the updated graph.

Kind: static method of MappingColumnsGraph

Param

Type

Description

edge

Object

The edge to be updated.

MappingColumnsGraph.removeEdge(edge) ⇒ void#

Removes an edge from the Vis.js graph and saves the updated graph.

Kind: static method of MappingColumnsGraph

Param

Type

Description

edge

Object

The edge to be removed.

MappingColumnsGraph.sortVisjsColumns(nodes) ⇒ void#

Adds a new edge to the Vis.js graph and saves the updated graph.

Kind: static method of MappingColumnsGraph

Param

Type

Description

nodes

array

The nodes to be sorted.

MappingColumnsGraph.addEdge(edge) ⇒ void#

Adds a new edge to the Vis.js graph and saves the updated graph.

Kind: static method of MappingColumnsGraph

Param

Type

Description

edge

Object

The edge to be added.

MappingColumnsGraph.saveVisjsGraphWithConfig(callback) ⇒ void#

Saves the Vis.js graph with the current configuration.

Kind: static method of MappingColumnsGraph

Param

Type

Description

callback

function

Optional callback to execute after saving.

MappingColumnsGraph.clearGraph() ⇒ void#

Clears the current graph, resets offsets, and reinitializes the graph canvas.

Kind: static method of MappingColumnsGraph

MappingColumnsGraph.exportMappings() ⇒ void#

Exports the current mappings from the Vis.js graph to a JSON file. Saves the graph data before exporting Handles errors during the export process and displays appropriate messages.

Kind: static method of MappingColumnsGraph

MappingColumnsGraph.importMappingsFromJSONFile() ⇒ void#

Imports a mappings JSON file into the current mapping graph and saves it on the server.

To prevent crashes when importing a graph created on another server, this import validates data source identifiers before writing the graph file:

  1. JSON integrity: each nodes[i].data.datasource must be declared in options.config.databaseSources or options.config.csvSources.

  2. Target server availability: if options.config.databaseSources contains ids, the import calls GET /databases and checks that each id exists and/or is authorized. If validation fails, an “Import blocked” dialog is shown with actionable guidance (and tries to display approximate JSON line numbers when possible).

Kind: static method of MappingColumnsGraph

MappingColumnsGraph~createDataSourcesClusters() ⇒ void#

Creates clusters from the different data sources used in the graph. Groups nodes based on their associated data tables and clusters them for better visualization.

Kind: inner method of MappingColumnsGraph

MappingModeler#

MappingModeler module. The MappingModeler tool helps creating new mappings from sources, and visualising and editing these mappings.

See: [Tutorial: Overview]{@tutorial overview}

MappingModeler.self.jstreeDivId : string#

ID of the tree container.

Kind: static property of MappingModeler

MappingModeler.self.legendGraphDivId : string#

ID of the legend container.

Kind: static property of MappingModeler

MappingModeler.self.legendItemsArray : Array.<{label: string, color: string, shape: string, size: number}>#

Array defining the legend items for the graph. Each item includes label, color, shape, and size properties.

Kind: static property of MappingModeler

MappingModeler.onLoaded() ⇒ void#

Initializes the MappingModeler module.

This method performs the following steps in sequence:

  1. Sets up the current source and initializes the UI menu bar.

  2. Loads the source configuration using DataSourceManager.

  3. Loads the HTML structure for the graph container.

  4. Initializes an empty VisJS graph canvas.

  5. Loads the VisJS mapping graph with data.

  6. Loads and sets up the lateral panel with tabs and the data source tree.

Kind: static method of MappingModeler
Throws:

  • Error If any step in the initialization sequence fails.

MappingModeler.loadSuggestionSelectJstree(objects, parentName)#

Loads and initializes a suggestion tree in the specified container.

Kind: static method of MappingModeler

Param

Type

Description

objects

Array.<Object>

The objects to populate the tree with.

parentName

string

The name of the parent node.

MappingModeler.initActiveLegend(divId)#

Initializes the active legend for a given container.

Kind: static method of MappingModeler

Param

Type

Description

divId

string

The ID of the container where the legend will be displayed.

MappingModeler.hideForbiddenResources(resourceType)#

Hides specific resources in the legend based on the resource type.

Kind: static method of MappingModeler

Param

Type

Description

resourceType

string

The type of resource to hide.

MappingModeler.onSuggestionsSelect(event, obj)#

Handles the selection of a suggestion from the tree.

Kind: static method of MappingModeler

Param

Type

Description

event

Object

The selection event object.

obj

Object

The selected tree node object.

MappingModeler.onLegendNodeClick(node, event)#

Performs actions such as:

  • Creating a specific URI resource.

  • Loading suggestions for columns, classes, or properties.

  • Managing virtual columns or row indices.

Kind: static method of MappingModeler

Param

Type

Description

node

Object

The legend node clicked, containing its ID and properties.

event

Object

The click event triggering the action.

MappingModeler.showLegendGraphPopupMenu()#

Displays the legend graph popup menu (TO DO).

Kind: static method of MappingModeler

MappingModeler.get AllClasses(source, callback)#

  • If the classes are already cached in self.allClasses, returns the cached list.

  • Otherwise, fetches all classes using CommonBotFunctions.listSourceAllClasses.

  • Filters out duplicate class IDs and formats labels with source prefixes.

  • The resulting class list is sorted alphabetically by label.

  • Calls the callback with the formatted list or an error if the API call fails.

Kind: static method of MappingModeler

Param

Type

Description

source

string

The source to retrieve classes from. Defaults to self.currentSource if not provided.

callback

function

Callback function to handle the result. Receives two arguments: error and result.

MappingModeler.getAllProperties(source, callback)#

  • If the properties are already cached in self.allProperties, returns the cached list.

  • Otherwise, fetches all object properties using CommonBotFunctions.listSourceAllObjectProperties.

  • Filters out duplicate property IDs and prepares labels for each property.

  • Sorts the resulting property list alphabetically by label.

  • Calls the callback with the formatted list or an error if the API call fails.

Kind: static method of MappingModeler

Param

Type

Description

source

string

The source to retrieve properties from. Defaults to self.currentSource if not provided.

callback

function

Callback function to handle the result. Receives two arguments: error and result.

Example

self.getAllProperties("mySource", function(err, properties) {
    if (err) {
        console.error(err);
    } else {
        console.log(properties);
    }
});

MappingModeler.hideLegendItems(hiddenNodes)#

  • Retrieves all legend node IDs from Axiom_activeLegend.data.nodes.

  • Iterates through each node ID, marking them as hidden if they are not in the hiddenNodes list.

  • Updates the visibility of legend items using self.updateNode.

Kind: static method of MappingModeler

Param

Type

Description

hiddenNodes

Array

Array of node IDs to keep visible. If not provided, all legend items are hidden.

Example

self.hideLegendItems(["node1", "node2"]);

MappingModeler.initResourcesMap(source, callback)#

  • Initializes self.allResourcesMap as an empty object.

  • Resets self.allClasses and self.allProperties to null.

  • Calls self.getAllClasses to fetch all classes, adding each to the self.allResourcesMap by ID.

  • Calls self.getAllProperties to fetch all properties, adding each to the self.allResourcesMap by ID.

  • If a callback is provided, it is invoked after all resources are processed.

Kind: static method of MappingModeler

Param

Type

Description

source

string

The data source from which resources are fetched.

callback

function

Callback function invoked after resources are initialized. Receives two arguments: error and result.

Example

self.initResourcesMap("mySource", function(err, result) {
    if (err) {
        console.error(err);
    } else {
        console.log("Resources initialized:", self.allResourcesMap);
    }
});

MappingModeler.clearMappings()#

  • Clears the visjsGraph object, which contains the graph visualization data.

  • Removes all content from the graph’s HTML container using its ID.

  • Resets self.visjsGraph to null.

  • Reinitializes an empty graph canvas using self.drawGraphCanvas with empty nodes and edges.

Kind: static method of MappingModeler
Example

self.clearMappings();

MappingModeler.showCreateResourceBot(resourceType, filteredUris)#

  • Initializes the workflow for creating a new resource based on the resource type.

  • If the resource type is “Class”, it uses the workflowNewClass workflow, otherwise, if it’s “ObjectProperty”, it uses the workflowNewObjectProperty workflow.

  • Updates internal data structures (allClasses, allProperties, allResourcesMap) with the newly created resource.

  • Adds the new resource to a suggestion list displayed in a jsTree widget.

  • If the resource type is invalid, it alerts the user.

Kind: static method of MappingModeler

Param

Type

Description

resourceType

string

The type of resource to create (“Class” or “ObjectProperty”).

filteredUris

Array

The URIs to filter the resource creation process.

Example

self.showCreateResourceBot("Class", filteredUris);

MappingModeler.viewSampleTriples(mappings)#

  • Constructs a payload with the current source, data source, table name, and options.

  • Sends a POST request to the server to generate sample triples based on the provided mappings.

  • Displays the generated triples in a data table using TripleFactory.showTriplesInDataTable.

  • Shows a dialog with the generated triples and allows the user to close the dialog.

  • If an error occurs during the request, an alert is shown with the error message.

Kind: static method of MappingModeler

Param

Type

Description

mappings

Object

The mappings to be applied as a filter when generating the sample triples.

Example

self.viewSampleTriples(mappings);

MappingModeler.filterSuggestionTree()#

  • Retrieves the input keyword from the filter field and converts it to lowercase.

  • Checks if the suggestion tree data exists and creates a copy of it if necessary.

  • Filters the nodes in the suggestion tree, only including leaf nodes whose text contains the keyword.

  • Updates the jstree with the filtered nodes using JstreeWidget.updateJstree.

Kind: static method of MappingModeler
Example

self.filterSuggestionTree();

MappingModeler.predicateFunctionShowDialog()#

  • Loads the HTML content from functionDialog.html into the #smallDialogDiv element.

  • Opens the dialog to display the loaded content.

Kind: static method of MappingModeler
Example

self.predicateFunctionShowDialog();

MappingModeler.addPredicateFunction()#

  • Creates an edge with a label “function” and a diamond-shaped arrow pointing to the target node.

  • The edge’s data contains the function body retrieved from the #MappingModeler_fnBody input field.

  • Adds the edge to the graph and then closes the dialog displaying the function input.

Kind: static method of MappingModeler
Example

self.addPredicateFunction();

MappingModeler.loadSource(callback)#

  • Uses Lineage_sources.loadSources to load the current source specified in MainController.currentSource.

  • On success, hides the graph edition buttons and calls the provided callback function.

  • If an error occurs during the loading process, an alert is displayed with the error message.

Kind: static method of MappingModeler

Param

Type

Description

callback

function

The function to be executed once the source is loaded successfully.

Example

self.loadSource(function() {
  console.log("Source loaded successfully");
});

MappingModeler.showSampleData(node, columns, callback)#

  • Checks if columns are specified and prepares the table accordingly.

  • Fetches and displays sample data from either a database or CSV source.

  • For a database source, it fetches the first 200 rows based on a predefined SQL query.

  • Displays the data in a table with the specified columns.

  • Alerts the user if the CSV source is not yet implemented.

Kind: static method of MappingModeler

Param

Type

Description

node

Object

The selected node from which to fetch data.

columns

Array | string

The specific columns to display, can be an array or a single column name.

callback

function

A callback function to be executed after showing the data (optional).

Example

self.showSampleData(node, ['column1', 'column2'], function() {
  console.log("Sample data displayed");
});

MappingTransform#

Module responsible for generating and managing mappings for the MappingTransform process. It interacts with the Vis.js graph to retrieve mappings and formats them as JSON for use in the application. It also provides functionality for generating SLS mappings and R2ML mappings (coming soon).

See: [Tutorial: Overview]{@tutorial overview}

MappingTransform.generateR2MLmappings() ⇒ void#

Placeholder function for generating R2ML mappings. Currently displays an alert.

Kind: static method of MappingTransform

MappingTransform.fetchDirectSuperClasses(source, callback) ⇒ void#

Queries the triplestore for direct rdfs:subClassOf links to non-restriction parent classes for all class nodes present in the current Vis.js graph. Used to enrich TBox TriplesMaps with class hierarchy (BFO, IOF-CORE, etc.).

Kind: static method of MappingTransform

Param

Type

Description

source

string | null

SousLeSens source label

callback

function

function(subClassOfMap) where subClassOfMap is { classUri: [parentUri, …] }

MappingTransform.getNonNullableColsMap(model, callback) ⇒ void#

Reads CSV files for all CSV datasources in the model and returns a map of non-nullable columns (columns that have a non-empty value in every row). Used to build composite IRI templates that won’t cause RMLMapper to skip rows where optional columns (e.g. dates) are empty.

Kind: static method of MappingTransform

Param

Type

Description

model

object

The export model from buildExportModel()

callback

function

Called with (err, map) where map is { [table]: string[] }

MappingTransform.writeTBoxDeclarations(model) ⇒ string#

Generates owl:Class TBox declarations for all entity types found in the model. These declarations are needed for SousLeSens to display the semantic model after import.

Kind: static method of MappingTransform
Returns: string - Turtle snippet with owl:Class declarations

Param

Type

Description

model

object

The export model built by buildExportModel()

MappingTransform.getSqlDatasourceInfo(dsId) ⇒ Object#

Returns JDBC connection info (DSN template and driver class) for a SQL datasource. Uses the sqlType stored in DataSourceManager to pick the correct driver.

Kind: static method of MappingTransform
Returns: Object - JDBC DSN template and driver class name.

Param

Type

Description

dsId

string

The datasource identifier.

MappingTransform.iriLocalName(iri) ⇒ string#

Extracts the local name from an IRI (the part after the last # or /). Example: “http://testClasses_Shirelle/Author” -> “Author”

Kind: static method of MappingTransform
Returns: string - The local name, or the full IRI if no separator found.

Param

Type

Description

iri

string

The IRI string.

MappingTransform._findPrimaryKeyColumn(table, nodesById) ⇒ string | null#

Finds the primary key column name for a given table by looking for a node with isMainColumn===true and type===”Column” in the same table. Used to create join conditions for RowIndex and VirtualColumn blank nodes.

Kind: static method of MappingTransform
Returns: string | null - The column name (node data id) or null if not found.

Param

Type

Description

table

string

The table name to search in.

nodesById

Object

Map of all graph nodes keyed by ID.

MappingTransform.isColumnName(v) ⇒ boolean#

Returns true if the value looks like a plain column name (simple identifier, no spaces, no http://, no colon-separated prefix). Used to distinguish column references from literal constants in otherPredicates.

Kind: static method of MappingTransform
Returns: boolean - True if the value is a plain column identifier.

Param

Type

Description

v

string

The value to test.

MappingTransform.findVirtualColumnKey(vcData, nodesById, nonNullCols) ⇒ string | null#

Returns the join key column for a VirtualColumn node. Uses the same resolution order as writeSubjectMapProper for VirtualColumn subjects:

  1. Column in nonNullCols whose normalized name matches the VirtualColumn’s safeId (e.g. “Data actor gain of role” → “dataactorgainofrole” → matches “DataActorGainOfRole”)

  2. “RowId” if present in nonNullCols or graph nodes

  3. findPrimaryKeyColumn fallback

Kind: static method of MappingTransform
Returns: string | null - The column name to use as join key, or null.

Param

Type

Description

vcData

Object

The VirtualColumn node’s data object.

nodesById

Object

Map of all graph nodes keyed by ID.

nonNullCols

Array.<string> | null

Non-nullable CSV column names for the table.

MappingTransform.mapXsdType(range) ⇒ string | null#

Maps a SousLeSens range/type string to an XSD datatype CURIE. Returns null if the range represents an IRI/object property (not a literal).

Kind: static method of MappingTransform
Returns: string | null - XSD datatype CURIE (e.g. “xsd:string”) or null if the range is an IRI class.

Param

Type

Description

range

string | null

The range string from the mapping model (e.g. “xsd:string”, “http://…#integer”, “Resource”).

MappingTransform.isIriRange(range) ⇒ boolean#

Returns true if the range string represents an IRI/class (object property), as opposed to a literal datatype.

Kind: static method of MappingTransform
Returns: boolean - True if the range is an IRI class reference.

Param

Type

Description

range

string | null

The range string to check.

MappingTransform.getGrelFunctionForTransform(transform) ⇒ string | null#

Returns the GREL/idlab-fn function IRI for a known SousLeSens transform string. Returns null for unknown transforms.

Kind: static method of MappingTransform
Returns: string | null - A GREL/idlab-fn function CURIE, or null if not mapped.

Param

Type

Description

transform

string

The transform identifier (e.g. “toLowerCase”, “toUpperCase”, “trim”).

MappingTransform._writeFnoTransformObjectMap(format, predicate, columnRef, transform, datatype) ⇒ string#

Writes a full FnO-based predicateObjectMap that applies a GREL transformation to a column. Falls back to a plain rml:reference with a comment if the transform is unknown.

Kind: static method of MappingTransform
Returns: string - Turtle snippet for the predicateObjectMap.

Param

Type

Description

format

string

“rml” or “r2rml”.

predicate

string

The predicate CURIE or IRI.

columnRef

string

The source column name.

transform

string

The transform identifier.

datatype

string | null

Optional XSD datatype CURIE.

MappingTransform.getSLSmappingsFromVisjsGraph([table]) ⇒ Object#

Retrieves the SLS mappings for the current table from the Vis.js graph. Filters nodes that belong to the specified table and exclude those with type “Class” or “table”.

Kind: static method of MappingTransform
Returns: Object - The generated JSON object containing the SLS mappings for the specified table.

Param

Type

Description

[table]

string

The name of the table for which to retrieve the mappings. Defaults to the current table if not provided.

MappingTransform.nodeToKGcreatorColumnName(data) ⇒ string#

Converts a node’s data to a KGcreator-compatible column name based on its URI type and data type. It generates column names based on different conditions such as blankNode, randomIdentifier, or URI. Virtual columns and URI columns have specific suffixes added to the column name

Kind: static method of MappingTransform
Returns: string - The generated column name in KGcreator format.

Param

Type

Description

data

Object

The node’s data containing the URI type and other properties.

MappingTransform.mappingsToKGcreatorJson(columnsMap) ⇒ Array#

Transforms a columns map into KGcreator-compatible JSON format, generating mappings between columns, predicates, and objects. This function handles RDF types, labels, transformations, and other predicates for each column. It also processes connections between nodes and generates appropriate triples for each mapping

Kind: static method of MappingTransform
Returns: Array - An array of mapping objects in KGcreator JSON format.

Param

Type

Description

columnsMap

Object

A map of nodes containing columns to be transformed.

MappingTransform.addMappingsRestrictions(allMappings) ⇒ Array#

Adds restrictions to the mappings if both subject and object are classes and are different from each other. This function checks if the subject and object in a mapping are OWL classes, and if they are, it marks the mapping as a restriction.

Kind: static method of MappingTransform
Returns: Array - The modified array of mappings with restrictions added where applicable.

Param

Type

Description

allMappings

Array

The array of mappings to which restrictions will be added.

MappingTransform.copyKGcreatorMappings()#

Copies the KGcreator mappings from the textarea to the clipboard. It retrieves the current mappings as text from the UI and uses a common utility to copy the content to the clipboard.

Kind: static method of MappingTransform

MappingsDetails : Object#

MappingsDetails manages technical mappings (non structural mappings)

See: [Tutorial: Overview]{@tutorial overview}

MappingsDetails.transform : object#

The transform module handles operations related to transforming columns in the mapping model. It includes functions for displaying a dialog, creating prefix transformation functions, testing the transformation, and saving the transformation.

Kind: static namespace of MappingsDetails

transform.showTansformDialog([column]) ⇒ void#

Displays a dialog for transforming the selected column. If no column is provided, it defaults to the currently selected column.

Kind: static method of transform

Param

Type

Description

[column]

string

The column to transform (optional).

transform.createPrefixTransformFn() ⇒ void#

Creates a prefix transformation function and applies it to the selected column. The user is prompted to enter a prefix, and the function is generated accordingly.

Kind: static method of transform

transform.testTransform() ⇒ void#

Tests the transformation function by applying it to a sample mapping. It checks for any errors in the transformation code and then creates triples using the mapping.

Kind: static method of transform

MappingsDetails.showDetailsDialog([divId], [callback]) ⇒ void#

Displays the details dialog for mappings. If no table is selected, an alert is shown. Otherwise, it loads the details dialog HTML and activates the right panel in the UI. It also sets up the detailed mappings tree and graph, and binds the search input to search the mappings in the tree.

Kind: static method of MappingsDetails

Param

Type

Default

Description

[divId]

string

”&quot;mainDialogDiv&quot;”

The ID of the dialog div to display the details in. Default is “mainDialogDiv”.

[callback]

function

Optional callback function to execute after showing the dialog.

MappingsDetails.showDetailedMappingsTree([column], [divId], [_options]) ⇒ void#

Displays the detailed mappings tree for the current table. It populates the tree with nodes and mappings related to the selected table and columns. The tree allows search and interaction with mapping nodes.

Kind: static method of MappingsDetails

Param

Type

Default

Description

[column]

Object

Optional column data to filter the tree by.

[divId]

string

”&quot;detailedMappings_jsTreeDiv&quot;”

The ID of the div to display the tree in. Default is “detailedMappings_jsTreeDiv”.

[_options]

Object

{}

Optional configuration options for the tree, such as context menu behavior.

[_options.withoutContextMenu]

boolean

false

If true, disables the context menu.

[_options.searchPlugin]

boolean

true

Enables or disables the search plugin.

[_options.openAll]

boolean

true

If true, expands all nodes by default.

[_options.selectTreeNodeFn]

function

Callback function for when a tree node is selected.

MappingsDetails.saveMappingsDetailsToVisjsGraph(columnId) ⇒ void#

Saves the mapping details to the Vis.js graph for a specific column. It updates the column’s URI type, RDF type, and rdfs:label based on the user’s selection, then saves the updated data to the graph and triggers any necessary transformations.

Kind: static method of MappingsDetails

Param

Type

Description

columnId

string

The ID of the column whose mapping details are to be saved.

MappingsDetails.deleteMappingInVisjsNode(treeNode) ⇒ void#

Deletes a specific mapping from the Vis.js graph node. It identifies the mapping based on the node’s ID and removes the corresponding property or predicate from the node’s data. After deletion, the tree is updated and the graph is re-rendered.

Kind: static method of MappingsDetails

Param

Type

Description

treeNode

Object

The tree node representing the mapping to be deleted.

MappingsDetails.showSpecificMappingsBot(columnId) ⇒ void#

Displays a button for configuring specific mappings for a column. The button initiates a workflow that allows the user to add various predicates (rdf:type, rdfs:subClassOf, non-object properties) to the column’s data in the graph. The changes are applied and saved to the graph upon completion of the workflow.

Kind: static method of MappingsDetails

Param

Type

Description

columnId

string

The ID of the column for which the specific mappings are to be configured.

MappingsDetails.onSelectTreeNode(event, obj) ⇒ void#

Handles the selection of a tree node and displays the corresponding column’s technical details. If the selected node is a column node, it opens the column technical mappings dialog.

Kind: static method of MappingsDetails

Param

Type

Description

event

Object

The event object triggered by the tree node selection.

obj

Object

The selected tree node object containing node details.

MappingsDetails.drawDetailedMappingsGraph([column]) ⇒ void#

Draws a detailed mappings graph based on the column’s mappings. It visualizes the mappings in a graph format, with nodes representing the columns and edges representing the relationships between them. Optionally filters the graph to a specific column if provided.

Kind: static method of MappingsDetails

Param

Type

Description

[column]

string

The column to filter the mappings by (optional).

MappingsDetails.onDetailedMappingsGraphClick(obj, event, options) ⇒ void#

Handles the click event on the detailed mappings graph. Currently, it serves as a placeholder function for handling interactions with the graph.

Kind: static method of MappingsDetails

Param

Type

Description

obj

Object

The clicked object details from the graph.

event

Object

The event object triggered by the click.

options

Object

Additional options for handling the click event.

MappingsDetails.getColumnType(nodeId) ⇒ string | null#

Retrieves the RDF type of a column based on its connected edges in the graph. Searches through the edges to find the rdf:type and returns the type if it’s a valid URI.

Kind: static method of MappingsDetails
Returns: string | null - - The RDF type of the column if found, otherwise null.

Param

Type

Description

nodeId

string

The ID of the node whose type is to be retrieved.

MappingsDetails.setDefinedInColumnNodesProperties() ⇒ void#

Updates URI properties of nodes that reference other nodes via definedInColumn. For each node with data.definedInColumn, copies prefixURI, suffixURI, baseURI, and uriType from the referenced node. Also processes edges’ fromNode and toNode if they have definedInColumn.

Kind: static method of MappingsDetails

MappingsDetails.setNodeAsMainColumn(nodeId) ⇒ void#

Sets a node as the main column for its class. Removes definedInColumn reference, sets isMainColumn to true, and reapplies mapping logic.

Kind: static method of MappingsDetails

Param

Type

Description

nodeId

string

The ID of the node to set as main column

TripleFactory#

The TripleFactory module handles the creation, filtering, and writing of RDF triples. It includes functions for generating sample triples, creating all mappings triples, and indexing the graph.

See: [Tutorial: Overview]{@tutorial overview}

TripleFactory.indexGraph()#

Indexes the RDF graph in ElasticSearch for the current MappingModeler source.

Kind: static method of TripleFactory

TripleFactory.initFilterMappingDialog(isSample)#

Displays a dialog for filtering mappings, allowing the user to choose between sample and actual triples. The dialog is populated with a tree view of detailed mappings that can be filtered by the user.

Kind: static method of TripleFactory

Param

Type

Description

isSample

boolean

If true, the dialog is for displaying sample mappings; if false, for writing actual triples.

TripleFactory.runSlsFilteredMappings()#

Runs the filtered mappings for the SLS (Semantic Linked Set) based on the selected nodes in the tree view. It filters and creates unique mappings by checking the selected attributes and mapping nodes.

Kind: static method of TripleFactory

TripleFactory.checkCurrentTable() ⇒ boolean#

Checks if the current table is valid and if its mappings details are loaded. Prompts the user to select a table or load the mappings details if they are not available.

Kind: static method of TripleFactory
Returns: boolean - - Returns true if the current table is valid and its mappings details are loaded, otherwise false.

TripleFactory.deleteTriples(all, [callback])#

Deletes triples created by KGCreator from the datasource. Confirms with the user before deleting triples, and sends a DELETE request to the API.

Kind: static method of TripleFactory

Param

Type

Description

all

boolean

Indicates whether to delete all triples or just for the current table.

[callback]

function

A callback function to be executed after the deletion process.

TripleFactory.createTriples(sampleData, table, [options], callback)#

Creates triples for a given table using the selected mappings. Confirms with the user before creating triples, and sends a POST request to the API.

Kind: static method of TripleFactory

Param

Type

Default

Description

sampleData

boolean

Indicates whether to create sample data triples or full triples.

table

string

The table for which to create triples.

[options]

Object

Options for creating triples, such as sample size and filter options.

[options.deleteOldGraph]

boolean

false

If true, deletes the existing graph before creating new triples.

[options.sampleSize]

number

500

The number of sample triples to create if sampleData is true.

[options.clientSocketId]

string

The client socket ID for real-time updates.

[options.mappingsFilter]

Object

Filters for selecting specific mappings.

[options.filteredMappings]

Object

Alternative mapping filter.

[options.deleteTriples]

boolean

false

If true, deletes existing triples before creation.

callback

function

A callback function to be executed after the triples creation process.

TripleFactory.recreateGraphSelectTables()#

Generates KGcreator triples for the entire datasource, deleting any previous triples before creating new ones. It proceeds with a series of steps: deleting old triples, creating new triples, and reindexing the graph.

Kind: static method of TripleFactory

TripleFactory.showTriplesInDataTable(data, div)#

Displays the triples data in a table format within the specified div element. The table includes columns for subject, predicate, and object, and the data is escaped to prevent HTML injection.

Kind: static method of TripleFactory

Param

Type

Description

data

Array

The triples data to display, each item should contain ‘s’, ‘p’, and ‘o’ properties.

div

string

The ID of the div element where the table should be displayed.

UIcontroller#

UIcontroller module manages the display of panels in the mapping modeler interface, handling tab activation and panel visibility for data sources, column mappings, technical mappings, and triples.

See: [Tutorial: Overview]{@tutorial overview}

UIcontroller.onActivateLeftPanelTab(tabId)#

Handles the activation of left panel tabs in the UI based on the provided tab ID. It shows or hides the corresponding panels based on the selected tab.

Kind: static method of UIcontroller

Param

Type

Description

tabId

string

The ID of the tab to activate.

UIcontroller.switchLeftPanel(target)#

Switches the active left panel tab to the target tab. It also performs necessary UI updates based on the target tab, such as loading columns or technical mappings.

Kind: static method of UIcontroller

Param

Type

Description

target

string

The name of the target tab to activate.

UIcontroller.activateRightPanel(PanelLabel)#

Activates the specified right panel based on the provided panel label. It controls the visibility of different right panels like “Data Sources”, “Column Mappings”, and “Technical Mappings”.

Kind: static method of UIcontroller

Param

Type

Description

PanelLabel

string

The label of the right panel to activate.

Sparql_OWL#

Sparql_OWL Module OWL controller: builds and runs the SPARQL queries for sources whose schemaType is "OWL" (and KNOWLEDGE_GRAPH). Navigates class hierarchies via rdfs:subClassOf, reads owl:Class/owl:ObjectProperty/owl:DatatypeProperty/owl:NamedIndividual, resolves OWL restrictions (owl:onProperty + owl:someValuesFrom/allValuesFrom/cardinality) and property domains/ranges. It is selected per source through Config.sources[source].controller and invoked by Sparql_generic; query fragments come from Sparql_common and execution from Sparql_proxy.

Sparql_OWL.getSourceTaxonomyPredicates(sourceLabel, [options]) ⇒ string#

Builds the SPARQL property path expressing the parent/child (taxonomy) relation for a source. Uses options.specificPredicates if provided, otherwise the source’s configured taxonomyPredicates, falling back to rdfs:subClassOf. Multiple predicates are joined with |; options.memberPredicate appends ^rdfs:member.

Kind: static method of Sparql_OWL
Returns: string - A SPARQL property-path string defining the taxonomy relation

Param

Type

Description

sourceLabel

string

Source name whose taxonomyPredicates are read (null → default rdfs:subClassOf)

[options]

Object

Predicate options

[options.specificPredicates]

string | Array.<string>

Predicate(s) to use instead of the source config

[options.memberPredicate]

boolean

Append ^rdfs:member to the path

Sparql_OWL.getTopConcepts(sourceLabel, [options], callback) ⇒ err | Array#

Returns the top-level classes of an OWL source: owl:Class instances that have no parent via the source’s taxonomy predicates. Blank nodes are excluded; labels are fetched optionally and language-filtered.

Top-class filter priority (first match wins):

  1. options.skipTopClassFilter → no filter at all

  2. sources.json[source].topClassFilter (non-empty, non-"_default") → custom SPARQL filter string

  3. Default: ?topConcept rdf:type owl:Class. FILTER(NOT EXISTS { ?topConcept <taxonomyPredicate> ?z })

Other source-level config knobs (sources.json):

  • schemaType: "KNOWLEDGE_GRAPH" — omits the ?topConcept rdf:type owl:Class. triple

  • sparql_server.no_params — sends query as plain URL body instead of ?query= param

Kind: static method of Sparql_OWL
Returns: err | Array - Throws an error or returns SPARQL results with variables: topConcept, topConceptLabel (optional), subjectGraph (optional).
Expose:

Param

Type

Description

sourceLabel

string

OWL source name to query

[options]

Object

Query options

[options.selectGraph]

boolean

Also bind each triple’s named graph (?subjectGraph)

[options.withoutImports]

boolean

Exclude imported graphs from the FROM clause

[options.skipTopClassFilter]

boolean

Do not apply any top-class filter

[options.filter]

string

Extra SPARQL filter appended after the top-class filter

[options.filterCollections]

string | Array.<string>

Restrict to top concepts reachable from these SKOS collections

[options.returnQueryStr]

boolean

Return the SPARQL query string instead of executing it

callback

function

Error-first callback (err, bindings) with ?topConcept/?topConceptLabel(/?subjectGraph)

Sparql_OWL.getNodeChildren(sourceLabel, words, ids, descendantsDepth, [options], callback) ⇒ err | Array#

Returns the children of node(s) down to a given depth in an OWL class hierarchy. Matches ?child1 <taxonomyPredicate> ?subject for the parent (ids or words), then chains nested OPTIONAL blocks ?childN+1 <taxonomyPredicate> ?childN with their labels. A filterCollections option switches to a SKOS-collection-scoped variant.

Kind: static method of Sparql_OWL
Returns: err | Array - Throws an error or returns SPARQL results with variables: subject, subjectLabel (optional), child1, child1Label (optional), child1Type (optional), child1Graph (optional), depth-indexed childN (optional), childNLabel (optional), collection (optional), acollection (optional), collectionLabel (optional), acollectionLabel (optional).
Expose:

Param

Type

Description

sourceLabel

string

OWL source name to query

words

string | Array.<string>

Label word(s) for fuzzy/exact parent match; mutually exclusive with ids

ids

string | Array.<string>

Parent class URI(s) whose children are fetched

descendantsDepth

number

Number of taxonomy levels to expand

[options]

Object

Query options

[options.selectGraph]

boolean

Bind each triple’s named graph

[options.exactMatch]

boolean

Treat words as exact rather than regex matches

[options.withoutImports]

boolean

Exclude imported graphs from the FROM clause

[options.specificPredicates]

string | Array.<string>

Override taxonomy predicate(s) used for the parent/child relation

[options.filter]

string

Extra SPARQL filter appended to the query

[options.filterCollections]

string | Array.<string>

Restrict children to members of these SKOS collections

[options.sort]

string

Variable name to order results by

[options.limit]

number

Result limit (defaults to Config.queryLimit)

callback

function

Error-first callback (err, bindings) with ?subject/?child1…(labels), label-enriched

Sparql_OWL.getNodeInfos(sourceLabel, conceptId, [options], callback) ⇒ err | Array#

Returns all triples describing a resource (<conceptId> ?prop ?value), optionally also the inverse triples where it is the object, with property/value labels. Can exclude blank nodes and OWL restrictions.

Kind: static method of Sparql_OWL
Returns: err | Array - Throws an error or returns SPARQL results with variables: prop, value, propLabel (optional), valueLabel (optional), g (optional).
Expose:

Param

Type

Description

sourceLabel

string

OWL source name to query

conceptId

string

URI of the resource to describe

[options]

Object

Query options

[options.selectGraph]

boolean

Bind each triple’s named graph

[options.getValuesLabels]

boolean

Add rdfs:label of properties and values

[options.inverseProperties]

boolean

Also return triples where the resource is the object

[options.noRestrictions]

boolean

Exclude values that are owl:Restriction

[options.limit]

number

Result limit (defaults to Config.queryLimit)

callback

function

Error-first callback (err, bindings) with ?prop/?value(/labels/graph)

Sparql_OWL.getNodeParents(sourceLabel, words, ids, ancestorsDepth, [options]) ⇒ err | Array#

Returns the ancestors of node(s) up to a given depth in an OWL hierarchy. Builds nested OPTIONAL blocks chaining ?broaderN-1 rdfs:subClassOf|rdf:type ?broaderN (excluding owl:Restriction/owl:Class), grouping each node’s types/superclasses/graphs via GROUP_CONCAT with an explicit GROUP BY per (subject, broader, labels). Depth is capped at 9 (Virtuoso allows at most 20 GROUP BY / hash-join keys: 2 fixed + 2 per level, so 2 + 2*9 = 20).

Kind: static method of Sparql_OWL
Returns: err | Array - Throws an error or returns SPARQL results with variables: subject, subjectLabel (optional), subjectTypes, subjectSuperClasses (optional), broader1, broader1Label (optional), broaderGraphs1, and depth-indexed broaderN (optional), broaderNLabel (optional), broaderGraphsN.
Expose:

Param

Type

Description

sourceLabel

string

OWL source name to query

words

string | Array.<string>

Label word(s) identifying the start node; mutually exclusive with ids

ids

string | Array.<string>

Start class URI(s) whose ancestors are fetched

ancestorsDepth

number

Number of levels to climb (capped as described above)

[options]

Object

Query options

[options.selectGraph]

boolean

Bind broader nodes’ named graphs

[options.withoutImports]

boolean

Exclude imported graphs from the FROM clause

[options.excludeType]

boolean

Reserved flag to drop type variables from the SELECT clause

[options.filterCollections]

string | Array.<string>

Exclude ancestors that are members of these collections

[options.limit]

number

Result limit (defaults to Config.queryLimit)

Sparql_OWL.getNodesAncestorsOrDescendants(sourceLabel, classIds, [options], callback) ⇒ err | Object#

Returns the ancestor (or descendant) hierarchies of given class(es), supporting multiple hierarchy branches per class. Runs a nested ?class rdfs:subClassOf*[+] ?superClass query (direction depends on options.descendants) and rebuilds, for each input class, its hierarchy as an array of hierarchy items in JS, skipping blank-node superclasses. Used by OntologyModels to fetch the hierarchies of a set of nodes (start/end nodes).

Kind: static method of Sparql_OWL
Returns: err | Object - Throws an error or returns {hierarchies, rawResult}; each rawResult binding contains subject, class, type, classLabel (optional), superClass, superClassType, superClassSubClass, superClassLabel (optional), subjectTypes.
Expose:

Param

Type

Description

sourceLabel

string

OWL source name to query

classIds

string | Array.<string>

Class URI(s) whose hierarchy is built

[options]

Object

Query options

[options.descendants]

boolean

Build descendant hierarchies instead of ancestors

[options.excludeItself]

boolean

Use + instead of * (exclude the class itself)

[options.filter]

string

Extra SPARQL filter appended to the query

[options.withoutImports]

boolean

Exclude imported graphs from the FROM clause

callback

function

Error-first callback (err, {hierarchies, rawResult}) where hierarchies maps each class URI to its ordered hierarchy

Sparql_OWL.getFilteredTriples2(sourceLabel, [subjectIds], [propertyIds], [objectIds], [options], callback) ⇒ err | Array#

Alternative to getFilteredTriples that resolves the type and label of subject, property and object from any graph, then matches the actual triples in the source’s own graph. Filters by subject/property/object ids.

Not historical — selected over getFilteredTriples on demand: Lineage_whiteboard toggles between the two via options.getFilteredTriples2, and nodeRelations_bot calls it directly to extract a node’s distinct properties (options.distinct = "?prop ?propLabel").

Kind: static method of Sparql_OWL
Returns: err | Array - Throws an error or returns SPARQL results with variables: subject, subjectType, subjectLabel (optional), prop, x, propType, propLabel (optional), object, objectType, objectLabel (optional), g.
Expose:

Param

Type

Description

sourceLabel

string

OWL source name to query

[subjectIds]

string | Array.<string>

Subject URI(s) to match (optional)

[propertyIds]

string | Array.<string>

Property URI(s) to match (optional)

[objectIds]

string | Array.<string>

Object URI(s) to match (optional)

[options]

Object

Query options

[options.withImports]

boolean

Include imported graphs in the FROM clause (imports are excluded by default here)

[options.distinct]

string

Variables for the SELECT clause (defaults to *)

[options.filter]

string

Extra SPARQL filter appended to the query

[options.limit]

number

Result limit (defaults to Config.queryLimit)

callback

function

Error-first callback (err, bindings) with the matching triples and their labels/types

Sparql_OWL.getFilteredTriples(sourceLabel, [subjectIds], [propertyIds], [objectIds], [options], callback) ⇒ err | Array#

Returns triples filtered by any combination of subject/property/object ids, with subject, property and object labels and types. Literal objects are excluded by default. Subject or object id lists are sliced into Sparql_generic.slicesSize batches and queried with async.eachSeries, concatenating results.

Canonical, widely used triple-fetch helper (Lineage, MappingModeler, bots). See getFilteredTriples2 for the cross-graph variant.

Kind: static method of Sparql_OWL
Returns: err | Array - Throws an error or returns SPARQL results with variables: subject, prop, object, subjectType (optional), subjectLabel (optional), propLabel (optional), objectType (optional), objectValue (optional), objectLabel (optional).
Expose:

Param

Type

Description

sourceLabel

string

OWL source name to query

[subjectIds]

string | Array.<string>

Subject URI(s) to match (optional)

[propertyIds]

string | Array.<string>

Property URI(s) to match (optional)

[objectIds]

string | Array.<string>

Object URI(s) to match (optional)

[options]

Object

Query options

[options.filter]

string

Extra SPARQL filter appended to the query

[options.onlyObjectProperties]

boolean

Restrict to owl:ObjectProperty predicates

[options.onlyDataTypeProperties]

boolean

Restrict to literal objects

[options.includeLiterals]

boolean

Allow literal objects (otherwise excluded)

[options.withoutImports]

boolean

Exclude imported graphs from the FROM clause

[options.distinct]

string

Variables for the SELECT clause (defaults to *)

[options.limit]

number

Result limit (defaults to Config.queryLimit)

callback

function

Error-first callback (err, bindings) with ?subject/?prop/?object and their labels

Sparql_OWL.getObjectPropertiesDomainAndRange(sourceLabel, [domainIds], [options], callback) ⇒ err | Array#

Returns object (or datatype) properties with their domains, ranges, sub-properties and inverse properties (plus all labels). The id filter can target the domain, range, prop or subProp depending on options, and a searchType mode searches by words on prop/domain/range. With addInverseRestrictions, recursively merges the inverse-direction results.

Kind: static method of Sparql_OWL
Returns: err | Array - Throws an error or returns SPARQL results with variables: domain (optional), domainLabel (optional), prop, propLabel (optional), range (optional), rangeLabel (optional), subProp (optional), subPropLabel (optional), inverseProp (optional), inversePropLabel (optional).
Expose:

Param

Type

Description

sourceLabel

string

OWL source name to query

[domainIds]

string | Array.<string>

Domain (or range) class URI(s) to filter by (optional)

[options]

Object

Query options

[options.inverseRestriction]

boolean

Filter on range instead of domain

[options.propIds]

string | Array.<string>

Filter by property URI(s)

[options.subPropIds]

string | Array.<string>

Filter by sub-property URI(s)

[options.dataTypeProperties]

boolean

Query owl:DatatypeProperty instead of owl:ObjectProperty

[options.inheritedProperties]

boolean

Include inherited properties via rdfs:subPropertyOf*

[options.searchType]

string

One of property/domain/range to search by options.words

[options.words]

string | Array.<string>

Label word(s) used when searchType is set

[options.addInverseRestrictions]

boolean

Also fetch and merge inverse-direction results

[options.filter]

string

Extra SPARQL filter (replaces the id filter)

[options.selectGraph]

boolean

Bind each triple’s named graph

[options.limit]

number

Result limit (defaults to Config.queryLimit)

callback

function

Error-first callback (err, bindings) with ?domain/?prop/?range/?subProp/?inverseProp (+labels)

Sparql_OWL.getObjectRestrictions(sourceLabel, [subClassIds], [options], callback) ⇒ err | Array#

Returns OWL restrictions on classes: matches ?subject rdfs:subClassOf ?node, ?node rdf:type owl:Restriction, ?node owl:onProperty ?prop and the constraint value (owl:someValuesFrom/allValuesFrom/hasValue/onClass) plus any cardinality. Property and value labels are filled afterwards (including from imported sources via getLabelsMap).

Kind: static method of Sparql_OWL
Returns: err | Array - Throws an error or returns SPARQL results with variables: subject, subjectLabel (optional), node, prop, propLabel (optional), constraintType, value, valueLabel (optional), cardinalityType (optional), cardinalityValue (optional), g (optional), status (optional), creationDate (optional), creator (optional), provenance (optional), domainSourceLabel (optional), rangeSourceLabel (optional).
Expose:

Param

Type

Description

sourceLabel

string

OWL source name to query

[subClassIds]

string | Array.<string>

Class URI(s) carrying the restrictions (or restriction values when inverseRestriction)

[options]

Object

Query options

[options.inverseRestriction]

boolean

Filter on the restriction value (range) instead of the subject

[options.restrictionIds]

string | Array.<string>

Filter by restriction value URI(s)

[options.listPropertiesOnly]

boolean

Select only ?prop/?propLabel

[options.withoutBlankNodes]

boolean

Select an explicit non-blank-node variable set

[options.turtle]

boolean

Emit a CONSTRUCT query

[options.someValuesFrom]

boolean

Restrict to owl:someValuesFrom/owl:onClass

[options.allValuesFrom]

boolean

Restrict to owl:allValuesFrom/owl:onClass

[options.hasValue]

boolean

Restrict to owl:hasValue/owl:onClass

[options.getMetadata]

boolean

Also fetch status/creator/date/provenance metadata of each restriction

[options.withoutImports]

boolean

Exclude imported graphs from the FROM clause

[options.filter]

string

Extra SPARQL filter (its object is mapped to value)

[options.limit]

number

Result limit (defaults to Config.queryLimit)

callback

function

Error-first callback (err, bindings) with ?subject/?prop/?value/?node/?constraintType (+labels)

Sparql_OWL.getNamedIndividuals(sourceLabel, [ids], [options], callback) ⇒ err | Array#

Returns the owl:NamedIndividual instances of given class(es): matches ?subject rdf:type ?node (filtered by ids) and ?subject rdf:type owl:NamedIndividual, with subject and class labels.

Kind: static method of Sparql_OWL
Returns: err | Array - Throws an error or returns SPARQL results with variables: subject, node, subjectLabel (optional), nodeLabel (optional), g (optional).
Expose:

Param

Type

Description

sourceLabel

string

OWL source name to query

[ids]

string | Array.<string>

Class URI(s) whose individuals are fetched

[options]

Object

Query options

[options.selectGraph]

boolean

Bind each triple’s named graph

[options.limit]

number

Result limit (defaults to Config.queryLimit)

callback

function

Error-first callback (err, bindings) with ?subject/?node (+labels)

Sparql_OWL.getNodesTypes(sourceLabel, ids, callback) ⇒ err | Array#

Returns the rdf:type triples (with their graph) for given resources, batching the ids into slices of 200 and concatenating results (GRAPH ?g { ?subject rdf:type ?type }).

Historical: no remaining caller in the codebase (kept for backward compatibility / plugins). Note: its body references an undeclared options variable, so it would currently throw if called.

Kind: static method of Sparql_OWL
Returns: err | Array - Throws an error or returns SPARQL results with variables: subject, type, and g.

Param

Type

Description

sourceLabel

string

Source name whose endpoint is queried

ids

string | Array.<string>

Resource URI(s) whose types are fetched

callback

function

Error-first callback (err, allData) with ?subject/?type/?g bindings

Sparql_OWL.getNodesOwlTypeMap(sourceLabel, ids, callback) ⇒ err | Object#

Returns a map of each resource URI to a simplified OWL type — "NamedIndividual", "Class" or "Restriction" — derived from its concatenated rdf:type values, batching the ids into slices of 200.

Live: used by Lineage_createRelation to determine a node’s OWL kind. The canonical of the three getNodesType* helpers (getNodesTypes/getNodesTypesMap are historical).

Kind: static method of Sparql_OWL
Returns: err | Object - Throws an error or returns a map from each resource URI to NamedIndividual, Class, or Restriction.
Expose:

Param

Type

Description

sourceLabel

string

Source name whose endpoint is queried

ids

string | Array.<string>

Resource URI(s) whose OWL type is determined

callback

function

Error-first callback (err, typesMap) mapping URI → "NamedIndividual"/"Class"/"Restriction"

Sparql_OWL.getPropertiesRestrictionsDescription(sourceLabel, propIds, [options], callback) ⇒ err | Array#

Returns, for given properties, the restrictions that use them and the source/target classes involved: ?restriction owl:onProperty ?prop, ?sourceClass <taxonomyPredicate> ?restriction, plus the constraint value (owl:someValuesFrom/allValuesFrom/hasValue/ cardinality) as ?targetClass. Missing labels are filled afterwards.

Kind: static method of Sparql_OWL
Returns: err | Array - Throws an error or returns SPARQL results with variables: restriction, prop, sourceClass, constraintType (optional), targetClass (optional).
Expose:

Param

Type

Description

sourceLabel

string

OWL source name to query

propIds

string | Array.<string>

Property URI(s) whose restrictions are described

[options]

Object

Query options

[options.subPropIds]

string | Array.<string>

Filter by sub-property URI(s) instead of propIds

[options.filter]

string

Extra SPARQL filter (replaces the property filter)

[options.selectGraph]

boolean

Bind each triple’s named graph

[options.limit]

number

Result limit (defaults to Config.queryLimit)

callback

function

Error-first callback (err, bindings) with ?prop/?restriction/?sourceClass/?targetClass (+labels)

Sparql_OWL.getUrisLabelsMap(sourceLabel, uris, callback) ⇒ err | Object#

Returns a map of URI → rdfs:label for given URIs (?s rdfs:label ?sLabel), falling back to the URI’s local name for any URI without a label.

Kind: static method of Sparql_OWL
Returns: err | Object - Throws an error or returns a map from each requested URI to its label.
Expose:

Param

Type

Description

sourceLabel

string

Source name to query

uris

Array.<string>

URIs whose labels are fetched

callback

function

Error-first callback (err, labelsMap) mapping URI → label

Sparql_OWL.getLabelsMap(sourceLabel, [options], callback) ⇒ err | Object#

Returns a map of URI → rdfs:label for a source, paginating through results in pages of 2000 (async.whilst over offset) until Config.queryLimit is reached. URIs without a label fall back to their local name. Returns {} immediately when options.noExecute.

Kind: static method of Sparql_OWL
Returns: err | Object - Throws an error or returns a map from each source URI to its label.
Expose:

Param

Type

Description

sourceLabel

string

OWL source name to query

[options]

Object

Query options

[options.noExecute]

boolean

Skip the query and return an empty map

[options.lang]

string

Restrict labels to this language (or untagged)

[options.filter]

string

Extra SPARQL filter appended to the query

[options.selectGraph]

boolean

Bind each triple’s named graph

[options.withoutImports]

boolean

Exclude imported graphs from the FROM clause

[options.processorFectchSize]

number

Page size for pagination (defaults to 2000)

[options.limit]

number

Total result cap (defaults to Config.queryLimit)

callback

function

Error-first callback (err, labelsMap) mapping URI → label

Sparql_OWL.getDictionary(sourceLabel, [options], [processor], callback) ⇒ err | Array#

Returns the dictionary of a source — the list of its resources as {id, label} (plus the graph when selectGraph) — paginating in chunks of 2000 with async.whilst. Each page is either passed to a processor callback (for streaming) or accumulated and returned at the end. Supports type/label/blank-node filters and skos:prefLabel.

Primary use across the app is id→label retrieval: building selection lists (promptedSelectWidget), label maps for models (KGquery_graph), and search/standardizer lookups. Callers fall back to getLabelFromURI when label is absent.

Kind: static method of Sparql_OWL
Returns: err | Array - Throws an error or returns accumulated SPARQL results with variables: id, type (optional), label (optional).
Expose:

Param

Type

Description

sourceLabel

string

OWL source name to query

[options]

Object

Query options

[options.lang]

string

Restrict labels to this language (or untagged)

[options.type]

string

Restrict to resources of this rdf:type

[options.filter]

string

Extra SPARQL filter appended to the query

[options.selectGraph]

boolean

Bind each triple’s named graph

[options.includeBlankNodes]

boolean

Include blank-node ids

[options.withoutImports]

boolean

Exclude imported graphs from the FROM clause

[options.skosPrefLabel]

boolean

Also fetch skos:prefLabel

[options.indexedPredicates]

Array.<string>

Extra predicates fetched for indexation, see getIndexedPredicatesClauses

[options.processorFectchSize]

number

Page size (defaults to 2000)

[options.limit]

number

Total result cap (defaults to Config.queryLimit)

[processor]

function

Optional (pageBindings, cb) processor invoked per page; if omitted, pages are accumulated

callback

function

Error-first callback (err, allData) with the accumulated bindings (empty when a processor is used)

Sparql_OWL.getObjectProperties(sourceLabel, [options], callback) ⇒ err | Array#

Lists all owl:ObjectProperty of a source with their labels (?property rdf:type owl:ObjectProperty + language-filtered label).

Kind: static method of Sparql_OWL
Returns: err | Array - Throws an error or returns SPARQL results with variables: property, propertyLabel, g (optional).
Expose:

Param

Type

Description

sourceLabel

string

OWL source name to query

[options]

Object

Query options

[options.withGraph]

boolean

Wrap in GRAPH ?g { ... } and bind the graph

[options.withoutImports]

boolean

Exclude imported graphs from the FROM clause

[options.skosLabels]

boolean

Also match skos:prefLabel for labels

[options.filter]

string

Extra SPARQL filter appended to the query

callback

function

Error-first callback (err, bindings) with ?property (+label)

Sparql_OWL.generateInverseRestrictions(sourceLabel, propId, inversePropId, cardinality, callback) ⇒ err | number#

Materialises the inverse of every restriction using a given property: fetches the restrictions on propId via getObjectRestrictions, builds the inverse restriction triples (swapping subject/value, using inversePropId) and inserts them in batches of 200.

Kind: static method of Sparql_OWL
Returns: err | number - Throws an error or returns the number of generated triples inserted.

Param

Type

Description

sourceLabel

string

Source name whose graph is edited

propId

string

Property URI whose restrictions are inverted

inversePropId

string

Property URI used in the generated inverse restrictions

cardinality

number

Cardinality for the generated restrictions

callback

function

Error-first callback (err, totalItems) with the number of triples inserted

Sparql_OWL.getPropertiesInheritedConstraints(sourceLabel, properties, options, callback) ⇒ err | Object#

Returns, for each given property, the domain/range inherited from its super-properties (?prop0 rdfs:subPropertyOf+ ?prop where ?prop carries rdfs:domain/rdfs:range), as a map keyed by the original property.

Kind: static method of Sparql_OWL
Returns: err | Object - Throws an error or returns a map keyed by property URI with fields: parentProp, prop, domain (optional), range (optional), domainLabel (optional), rangeLabel (optional).
Expose:

Param

Type

Description

sourceLabel

string

OWL source name to query

properties

Array.<string>

Property URIs whose inherited constraints are fetched

options

Object

Query options

[options.withGraph]

boolean

Bind the graph in the FROM clause

[options.withoutImports]

boolean

Exclude imported graphs from the FROM clause

callback

function

Error-first callback (err, propsMap) mapping property URI → {parentProp, prop, domain, range, domainLabel, rangeLabel}

Sparql_OWL.getInferredPropertiesDomainsAndRanges(sourceLabel, [options], callback) ⇒ err | Object#

Returns all object properties of a source with their inferred domains, ranges, sub-properties and inverse properties (and their labels), assembled from a multi-UNION query and folded into a per-property map. Domains/ranges of inverse properties are also covered.

Example entry:

"…/hasArrangedPart": {
  "prop": "…/hasArrangedPart", "propLabel": "hasArrangedPart",
  "subProps": ["…/hasAssembledPart", "…/hasFeature"],
  "domain": "…/PhysicalObject", "domainLabel": "PhysicalObject",
  "range": "…/xx", "rangeLabel": "xx",
  "inverseProp": "…/arrangedPartOf", "inversePropLabel": "arrangedPartOf"
}

Kind: static method of Sparql_OWL
Returns: err | Object - Throws an error or returns a map keyed by property URI with fields: prop, propLabel, subProps, domain (optional), domainLabel (optional), range (optional), rangeLabel (optional), inverseProp (optional), inversePropLabel (optional).
Expose:

Param

Type

Description

sourceLabel

string

OWL source name to query

[options]

Object

Query options

[options.prefLabelAlso]

boolean

Match skos:prefLabel in addition to rdfs:label

[options.filter]

string

Extra SPARQL filter applied within each UNION branch

callback

function

Error-first callback (err, propsMap) mapping property URI → {prop, propLabel, subProps, domain, domainLabel, range, rangeLabel, inverseProp, inversePropLabel}

Sparql_OWL.getAllTriples(sourceLabel, role, ids, [options], callback) ⇒ err | Array#

Returns all triples of a source (or explicit graph) with subject/predicate/object labels, optionally restricted to triples where a given role (subject/predicate/object) is one of ids (batched into Sparql_generic.slicesSize slices). Blank-node objects can be excluded.

Kind: static method of Sparql_OWL
Returns: err | Array - Throws an error or returns SPARQL results with variables: subject, predicate, object, subjectLabel (optional), predicateLabel (optional), objectLabel (optional).

Param

Type

Description

sourceLabel

string

OWL source name to query (or null with options.graphUri)

role

string

Variable (subject/predicate/object) the ids filter applies to

ids

string | Array.<string>

URI(s) restricting the chosen role

[options]

Object

Query options

[options.source]

string

Override source (sets graphUri from it)

[options.graphUri]

string

Explicit graph URI when no source is given

[options.removeBlankNodesObjects]

boolean

Exclude blank-node objects

callback

function

Error-first callback (err, allResults) with ?subject/?predicate/?object (+labels)

Sparql_OWL.generateOWL(sourceLabel, [options], callback) ⇒ err | string#

Serialises a source to Turtle by paginating DESCRIBE ?s ?p ?o queries (text/turtle Accept header) in pages of 1000, separating @prefix lines from the body and concatenating everything into a single Turtle document.

Kind: static method of Sparql_OWL
Returns: err | string - Throws an error or returns the source serialized as a Turtle string.
Expose:

Param

Type

Description

sourceLabel

string

OWL source name to serialise

[options]

Object

Query options

[options.filter]

string

Reserved filter (currently unused in the query body)

callback

function

Error-first callback (err, turtle) with the full Turtle string

Sparql_OWL.getDistinctClassLabels(sourceLabel, classIds, [options], callback) ⇒ err | Array#

Returns the distinct labels (or another property’s values) of instances of given classes (?id rdf:type ?type filtered by classIds, then ?id <labelProperty> ?label).

Kind: static method of Sparql_OWL
Returns: err | Array - Throws an error or returns SPARQL results with variables: label, id (optional).

Param

Type

Description

sourceLabel

string

OWL source name to query

classIds

string | Array.<string>

Class URI(s) whose instances’ labels are fetched

[options]

Object

Query options

[options.otherProperty]

string

Use this property instead of rdfs:label

callback

function

Error-first callback (err, bindings) with ?label(/?id)

Sparql_OWL.getIndividualsType(sourceLabel, allIds, [options], callback) ⇒ err | Array#

Returns the (non-owl:NamedIndividual) rdf:type(s) of given individuals, batching the ids into slices of 50.

Kind: static method of Sparql_OWL
Returns: err | Array - Throws an error or returns SPARQL results with variable: type.
Expose:

Param

Type

Description

sourceLabel

string

OWL source name to query

allIds

Array.<string>

Individual URIs whose class types are fetched

[options]

Object

Reserved options object

callback

function

Error-first callback (err, allBindings) with the ?type bindings

Sparql_OWL.getIndividualsOfClass(sourceLabel, classIds, [options], callback) ⇒ err | Array#

Returns the owl:NamedIndividual instances of given classes with their labels (?id rdf:type ?type filtered by classIds + ?id rdf:type owl:NamedIndividual), batching the class ids into slices of 50.

Kind: static method of Sparql_OWL
Returns: err | Array - Throws an error or returns SPARQL results with variables: id and label.
Expose:

Param

Type

Description

sourceLabel

string

OWL source name to query

classIds

Array.<string>

Class URIs whose individuals are fetched

[options]

Object

Reserved options object

callback

function

Error-first callback (err, allBindings) with ?id/?label

Sparql_OWL.clearGraph(graphUri, callback) ⇒ err | undefined#

Empties a named graph by POSTing to the backend /kg/clearGraph endpoint (not a SPARQL query).

Kind: static method of Sparql_OWL
Returns: err | undefined - Throws an error or completes without a result after clearing the graph.

Param

Type

Description

graphUri

string

URI of the graph to clear

callback

function

Error-first callback (err)

Sparql_OWL.copyUriTriplesFromSourceToSource(fromSource, toSource, subjectUri, callback) ⇒ err | undefined#

Intended to copy a resource’s triples from one source to another. Currently fetches the resource’s triples via getNodeInfos and builds the triple list, but does not yet insert them (incomplete).

Kind: static method of Sparql_OWL
Returns: err | undefined - Throws an error or completes without a result; returns "nothing to copy" as an error when no triples exist.

Param

Type

Description

fromSource

string

Source name to copy the resource from

toSource

string

Destination source name

subjectUri

string

URI of the resource to copy

callback

function

Error-first callback (err); errors with "nothing to copy" when the resource has no triples

Sparql_OWL.getAllDescendants(sourceLabel, [resourcesIds], [taxonomyPredicate], [options], callback) ⇒ err | Array#

Returns all descendants of given resources via a configurable taxonomy predicate, with each descendant’s direct parent and labels. The path operator adapts to options (+ default, * to include the parent, {0,depth} for bounded depth), and results are paginated in pages of 2000 with async.whilst.

Kind: static method of Sparql_OWL
Returns: err | Array - Throws an error or returns SPARQL results with variables: descendant, descendantParent, descendantLabel (optional), descendantParentLabel (optional).
Expose:

Param

Type

Default

Description

sourceLabel

string

Source name to query

[resourcesIds]

string | Array.<string>

Ancestor resource URI(s) whose descendants are fetched

[taxonomyPredicate]

string

”&quot;rdfs:subClassOf&quot;”

Predicate defining the parent relation

[options]

Object

Query options

[options.includeParent]

boolean

Include the starting resource(s) (* path)

[options.depth]

number

Limit traversal to this depth ({0,depth} path)

[options.filter]

string

Extra SPARQL filter appended to the query

callback

function

Error-first callback (err, allResults) with ?descendant/?descendantParent (+labels)

Sparql_OWL.getGraphsWithSameClasses(sourceLabel, filter, callback) ⇒ err | Array#

Finds the named graphs that share subjects with a source’s graph: an inner SELECT ?sub over the source graph feeds an outer GRAPH ?g { ?sub ?p ?obj }, returning the distinct graphs containing those subjects.

Historical: no remaining caller in the codebase (kept for backward compatibility / plugins).

Kind: static method of Sparql_OWL
Returns: err | Array - Throws an error or returns SPARQL results with variable: g.

Param

Type

Description

sourceLabel

string

OWL source name whose subjects anchor the search

filter

string

SPARQL filter restricting the inner subjects

callback

function

Error-first callback (err, bindings) with the distinct ?g graphs

Sparql_OWL.createSkgFromOntology(sourceLabel, skgGraphUri, callback) ⇒ err | undefined#

Generates a Semantic Knowledge Graph (SKG) from an OWL ontology into a target graph, in a sequence of INSERT queries: turning rdfs:subClassOf into rdf:type (classes become owl:NamedIndividual) and turning OWL restrictions (owl:onProperty + owl:someValuesFrom) into direct predicates between individuals.

Kind: static method of Sparql_OWL
Returns: err | undefined - Throws an error or completes without a result after generating the SKG triples.

Param

Type

Description

sourceLabel

string

OWL source name to transform

skgGraphUri

string

Target graph URI receiving the generated SKG triples

callback

function

Error-first callback (err)

Sparql_OWL.getNodeLabel(sourceLabel, id, callback) ⇒ err | Array#

Returns the label and RDF type of one resource.

Kind: static method of Sparql_OWL
Returns: err | Array - Throws an error or returns SPARQL results with variables: subject, type, and subjectLabel.
Expose:

Param

Type

Description

sourceLabel

string

OWL source name to query

id

string

URI of the resource whose label is fetched

callback

function

Error-first callback receiving the matching SPARQL bindings

Sparql_OWL.getNodesSuperClassesAndDefinition(sourceLabel, nodeIds, [options], callback) ⇒ err | Array#

Returns, for each given node, its label, definition (dcterms:description| rdfs:isDefinedBy|skos:definition) and up to four levels of OWL super-classes with their labels, by chaining nested OPTIONAL blocks on rdfs:subClassOf (each super-class is restricted to rdf:type owl:Class). Used by Lineage_selection.exportCsv to dump the whiteboard classes and their hierarchy/definition as a tab-separated file.

Kind: static method of Sparql_OWL
Returns: err | Array - Throws an error or returns SPARQL results with variables: node, node_label, definition (optional), superClass1Label (optional), superClass2Label (optional), superClass3Label (optional), superClass4Label (optional), description (optional), propLabel (optional), targetClass_label (optional).
Expose:

Param

Type

Description

sourceLabel

string

OWL source name to query

nodeIds

string | Array.<string>

Node URI(s) to describe (matched on ?node)

[options]

Object

Query options

[options.returnQueryStr]

boolean

Return the SPARQL query string instead of executing it

callback

function

Error-first callback (err, bindings) with ?node/?node_label/?definition/?superClass1Label?superClass4Label

Sparql_OWL.getClassesWithoutTaxonomy(sourceLabel, [options], callback) ⇒ err | Object#

Retrieves all OWL classes of a source that has no taxonomy (no rdfs:subClassOf hierarchy), attaching each class to owl:Thing so flat ontologies can still be indexed and searched. Used as a fallback by SearchUtil.generateElasticIndex when getSourceTaxonomy returns no class.

Kind: static method of Sparql_OWL
Returns: err | Object - Returns {classesMap, labels} through the callback; empty map for non-OWL sources.
Expose:

Param

Type

Description

sourceLabel

string

Source name whose classes are retrieved

[options]

Object

Build options

[options.filter]

string

Extra SPARQL clause appended to the query

[options.withoutImports]

boolean

Exclude imported graphs from the FROM clause

callback

function

Error-first callback (err, {classesMap, labels}) where classesMap maps each class URI to {id, label, lang, skoslabels, parents, type} with parents set to [sourceLabel, owl:Thing]

Sparql_OWL~Sparql_OWL#

The MIT License Copyright 2020 Claude Fauconnet / SousLesens Claude.fauconnet@gmail.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Kind: inner property of Sparql_OWL

Sparql_SKOS#

Sparql_SKOS Module SKOS controller: builds and runs the SPARQL queries for sources whose schemaType is "SKOS". Navigates thesauri/taxonomies via skos:broader/skos:narrower, reads labels through skos:prefLabel/skos:altLabel, and supports SKOS collections. It is selected per source through Config.sources[source].controller and invoked by Sparql_generic; query building blocks (prefixes, predicates, FROM clause, limit) come from getSourceVariables and execution from Sparql_proxy.

Sparql_SKOS.getTopConcepts(sourceLabel, options, callback) ⇒ err | Array#

Returns the top concepts of a SKOS source (concept-scheme roots). Runs select distinct ?topConcept ?topConceptLabel ... WHERE { <topConceptFilter> ?topConcept prefLabel ?topConceptLabel. } ordered by label, optionally restricting to a language and to concepts reachable from given collections.

Kind: static method of Sparql_SKOS
Returns: err | Array - Throws an error or returns SPARQL results with variables: topConcept, topConceptLabel.
Expose:

Param

Type

Description

sourceLabel

string

SKOS source name to query

options

Object

Query options

[options.noLang]

boolean

Skip the preferred-language filter

[options.filterCollections]

string | Array.<string>

Collection URI(s) the top concepts must belong to

callback

function

Error-first callback (err, bindings) with the top-concept bindings

Sparql_SKOS.getNodeChildren(sourceLabel, words, ids, descendantsDepth, [options], callback) ⇒ err | Array#

Returns the children of node(s) down to a given depth in a SKOS hierarchy. Builds nested OPTIONAL blocks chaining ?childN+1 skos:broader ?childN (up to optionalDepth), each fetching the child’s preferred label (optionally language-filtered) and rdf:type. The ids/words parent filter is required.

Example (collection-filtered children):

select distinct ?child1 ?child1Label ?subjectLabel
FROM <http://souslesens/thesaurus/TEST/>
WHERE { ?child1 skos:broader ?subject. ?subject skos:prefLabel ?subjectLabel.
        OPTIONAL { ?child1 skos:prefLabel ?child1Label. } filter(?subject = <...>) }
ORDER BY ?child1Label limit 1000

Kind: static method of Sparql_SKOS
Returns: err | Array - Throws an error or returns SPARQL results with variables: subject, subjectLabel (optional), child1, child1Label (optional), child1Type (optional), depth-indexed childN (optional), childNLabel (optional), childNType (optional); with options.filterCollections: collection, acollection, collectionLabel, acollectionLabel.
Expose:

Param

Type

Description

sourceLabel

string

SKOS source name to query

words

string | Array.<string>

Label word(s) identifying the parent; mutually exclusive with ids

ids

string | Array.<string>

Parent concept URI(s) whose children are fetched

descendantsDepth

number

Number of skos:broader levels to expand (capped at optionalDepth)

[options]

Object

Query options

[options.noLang]

boolean

Skip the language filter on labels

callback

function

Error-first callback (err, bindings) with the children, label-enriched and sorted by child1Label

Sparql_SKOS.getCollectionNodes(sourceLabel, collection, [options], callback) ⇒ err | Array#

Returns the concepts belonging to a SKOS collection (and their skos:broader links). With no collection, lists all non-collection subjects; with a collection URI, walks ?collection skos:member* ?acollection to the target collection and returns its members’ concepts with their preferred labels (filtered to English).

Kind: static method of Sparql_SKOS
Returns: err | Array - Throws an error or returns SPARQL results with variables: subject, predicate, object, type; with a collection: collection, acollection, collectionLabel, acollectionLabel, subjectLabel.
Expose:

Param

Type

Description

sourceLabel

string

SKOS source name to query

collection

string

Collection URI whose member concepts are fetched (empty = all concepts)

[options]

Object

Query options

[options.filter]

Object

{predicates} to restrict the predicates returned

callback

function

Error-first callback (err, bindings) with the collection’s concept bindings

Sparql_SKOS.getNodeParents(sourceLabel, words, ids, ancestorsDepth, [options], callback) ⇒ err | Array#

Returns the ancestors of node(s) up to a given depth in a SKOS hierarchy. Builds nested OPTIONAL blocks chaining ?broaderN-1 skos:broader ?broaderN (up to optionalDepth), each fetching the broader concept’s preferred label and type. Can search alt labels and exclude collection-only branches.

Kind: static method of Sparql_SKOS
Returns: err | Array - Throws an error or returns SPARQL results with variables: subject, subjectLabel (optional), type (optional), broader1 (optional), broader1Label (optional), broader1Type (optional), depth-indexed broaderN (optional), broaderNLabel (optional), broaderNType (optional).
Expose:

Param

Type

Description

sourceLabel

string

SKOS source name to query

words

string | Array.<string>

Label word(s) identifying the start node; mutually exclusive with ids

ids

string | Array.<string>

Start concept URI(s) whose ancestors are fetched

ancestorsDepth

number

Number of skos:broader levels to climb (capped at optionalDepth)

[options]

Object

Query options

[options.noLang]

boolean

Skip the language filter on labels

[options.searchAltLabels]

boolean

Also match skos:altLabel on the start node

[options.filterCollections]

string | Array.<string>

Exclude ancestors that are members of these collections

[options.limit]

number

Result limit (defaults to Config.queryLimit)

callback

function

Error-first callback (err, bindings) with the ancestor bindings

Sparql_SKOS.getNodeInfos(sourceLabel, conceptId, [options], callback) ⇒ err | Array#

Returns all triples (?id ?prop ?value) describing a concept. Delegates to a non-SKOS controller when the source’s controllerName is not Sparql_SKOS. Can also fetch value/property labels and restrict to a given property.

Kind: static method of Sparql_SKOS
Returns: err | Array - Throws an error or returns SPARQL results with variables: id, prop, value, valueLabel (optional), propLabel (optional).
Expose:

Param

Type

Description

sourceLabel

string

Source name to query

conceptId

string | Array.<string>

Concept URI(s) to describe

[options]

Object

Query options

[options.propertyFilter]

string | Array.<string>

Restrict to these property URIs

[options.getValuesLabels]

boolean

Also fetch skos:prefLabel of values and properties

callback

function

Error-first callback (err, bindings) with the concept’s triples

Sparql_SKOS.getItems(sourceLabel, [options], callback) ⇒ err | Array#

Returns all concept items of a SKOS source with their preferred labels. Delegates to a non-SKOS controller when applicable. Supports an extra filter, a language filter, and restriction to members of given collections.

Kind: static method of Sparql_SKOS
Returns: err | Array - Throws an error or returns SPARQL results with variables: subject, x, y, subjectLabel (optional).
Expose:

Param

Type

Description

sourceLabel

string

Source name to query

[options]

Object

Query options

[options.filter]

string

Extra SPARQL pattern appended to the WHERE clause

[options.filterCollections]

string | Array.<string>

Collection URI(s) the items must belong to

callback

function

Error-first callback (err, bindings) with the item bindings

Sparql_SKOS.getSingleNodeAllGenealogy(sourceLabel, id, callback) ⇒ err | Array#

Returns the full ancestor chain of a concept via the transitive closure ?subject skos:broader* ?broader, fetching each broader concept’s label and type. Falls back to top concepts for non-SKOS sources.

Kind: static method of Sparql_SKOS
Returns: err | Array - Throws an error or returns SPARQL results with variables: subject, broader, broaderLabel, type.
Expose:

Param

Type

Description

sourceLabel

string

Source name to query

id

string

Concept URI whose ancestors are fetched

callback

function

Error-first callback (err, bindings) with the ancestor bindings

Sparql_SKOS.getSingleNodeAllDescendants(sourceLabel, id, callback) ⇒ err | Array#

Returns the full set of descendants of a concept via the transitive closure over inverse broader / narrower predicates (?subject ^skos:broader*|skos:narrower* ?narrower), fetching each descendant’s label and type.

Kind: static method of Sparql_SKOS
Returns: err | Array - Throws an error or returns SPARQL results with variables: subject, narrower, narrowerLabel, type.
Expose:

Param

Type

Description

sourceLabel

string

Source name to query

id

string

Concept URI whose descendants are fetched

callback

function

Error-first callback (err, bindings) with the descendant bindings

Sparql_SKOS.getNodeLabel(sourceLabel, id, callback) ⇒ err | Array#

Fetches the preferred label and rdf:type of a single concept, optionally language-filtered.

Kind: static method of Sparql_SKOS
Returns: err | Array - Throws an error or returns SPARQL results with variables: subject, type, subjectLabel.
Expose:

Param

Type

Description

sourceLabel

string

Source name to query

id

string

Concept URI whose label is fetched

callback

function

Error-first callback (err, bindings) with the label/type bindings

Sparql_SKOS.getNodesAllTriples(sourceLabel, subjectIds, callback) ⇒ err | Array#

Fetches every outgoing triple for a list of subjects, batching the ids into slices of 2000 (?subject ?prop ?value. FILTER(?subject in (...))) and concatenating results.

Kind: static method of Sparql_SKOS
Returns: err | Array - Throws an error or returns SPARQL results with variables: subject, prop, value.
Expose:

Param

Type

Description

sourceLabel

string

Source name to query

subjectIds

Array.<string>

Subject URIs whose triples are fetched

callback

function

Error-first callback (err, triples) with the concatenated triple bindings

Sparql_SKOS.deleteTriples(sourceLabel, subjectUri, predicateUri, objectUri, callback) ⇒ err | *#

Deletes triples matching a subject/predicate/object pattern from the source’s named graph (with <graphUri> DELETE { ?s ?p ?o } WHERE { ?s ?p ?o <filters> }), each component contributing a Sparql_common.getUriFilter clause.

Kind: static method of Sparql_SKOS
Returns: err | * - Throws an error or returns the callback result.
Expose:

Param

Type

Description

sourceLabel

string

Source name whose graph is edited

subjectUri

string

Subject URI to match (optional)

predicateUri

string

Predicate URI to match (optional)

objectUri

string

Object URI to match (optional)

callback

function

Error-first callback (err, bindings)

Sparql_SKOS.triplesObjectToString(item) ⇒ string#

Serialises a triple descriptor into a SPARQL triple string: URI objects are angle-bracketed, literals are single-quoted with an optional @lang tag. An inverse predicate (prefixed with ^) swaps subject and object.

Kind: static method of Sparql_SKOS
Returns: string - A single subject predicate object . SPARQL triple string

Param

Type

Description

item

Object

Triple descriptor with subject, predicate, object, valueType, and optional sourceVariables.lang

Sparql_SKOS.insertTriples(sourceLabel, triples, callback) ⇒ err | *#

Inserts triples into the source’s named graph as a single WITH GRAPH <graphUri> INSERT DATA { ... } statement, serialising each triple via triplesObjectToString.

Kind: static method of Sparql_SKOS
Returns: err | * - Throws an error or returns the callback result.
Expose:

Param

Type

Description

sourceLabel

string

Source name whose graph receives the triples

triples

Array.<Object>

Triple descriptor objects to insert

callback

function

Error-first callback (err)

Sparql_SKOS.update(sourceLabel, triples, callback) ⇒ err | *#

Replaces all triples of a subject in the source’s graph: deletes every ?s ?p ?o for the subject, then inserts the supplied triples, in one combined WITH GRAPH ... DELETE ... ; INSERT DATA ... statement. The subject is taken from the first triple.

Kind: static method of Sparql_SKOS
Returns: err | * - Throws an error or returns the callback result.
Expose:

Param

Type

Description

sourceLabel

string

Source name whose graph is edited

triples

Array.<Object>

Replacement triple descriptors (all sharing the same subject)

callback

function

Error-first callback (err)

Sparql_SKOS.deleteGraph(sourceLabel, callback) ⇒ err | *#

Empties the source’s named graph by deleting all its triples (WITH <graphUri> DELETE { ?s ?p ?o }).

Kind: static method of Sparql_SKOS
Returns: err | * - Throws an error or returns the callback result.
Expose:

Param

Type

Description

sourceLabel

string

Source name whose graph is emptied

callback

function

Error-first callback (err)

Sparql_SKOS.copyGraph(fromSourceLabel, toGraphUri, callback) ⇒ err | *#

Copies a source’s entire named graph into another graph using a single SPARQL COPY <fromGraph> TO <toGraph> statement.

Kind: static method of Sparql_SKOS
Returns: err | * - Throws an error or returns the callback result.
Expose:

Param

Type

Description

fromSourceLabel

string

Source name whose graph is the copy origin

toGraphUri

string

Destination graph URI

callback

function

Error-first callback (err)

Sparql_SKOS.setBindingsOptionalProperties(bindings, _field, [options]) ⇒ Array.<Object>#

Backfills missing <field>Type and <field>Label cells for a family of indexed fields (field, field1 … up to the first gap, max 20) in result bindings. Defaults the type to skos:Concept (or options.type) and derives labels from the URI’s local name.

Kind: static method of Sparql_SKOS
Returns: Array.<Object> - The same bindings with type/label cells filled in

Param

Type

Description

bindings

Array.<Object>

Result bindings to enrich in place

_field

string

Base variable name; indexed variants are processed until the first missing one

[options]

Object

Enrichment options

[options.type]

string

Type URI to use instead of the default skos:Concept

Sparql_SKOS.getSourceLangsList(sourceLabel, callback) ⇒ err | Array#

Lists the distinct languages used in a source’s skos:prefLabel literals, via select distinct ?language WHERE { ?p skos:prefLabel ?o. BIND(LANG(?o) AS ?language) }.

Kind: static method of Sparql_SKOS
Returns: err | Array - Throws an error or returns an array of language codes.
Expose:

Param

Type

Description

sourceLabel

string

Source name to query

callback

function

Error-first callback (err, langs) with the array of language codes

Sparql_common#

Sparql_common Module Shared helpers for building SPARQL query fragments and parsing results, used by every controller (Sparql_OWL, Sparql_SKOS, Sparql_generic). Provides string/URI escaping, FILTER / VALUES clause builders, FROM <graph> clause assembly from a source and its imports, prefix injection, date filters and source↔graphUri lookups. It builds SPARQL text fragments; it does not execute queries (that is Sparql_proxy).

Sparql_common.getLangFilter(sourceLabel, conceptName) ⇒ string#

Builds a FILTER (lang(?var)='xx') clause restricting a label variable to the source’s preferred language (Config.sources[source].pref_lang).

Kind: static method of Sparql_common
Returns: string - A FILTER (lang(?conceptName)='lang') clause, or "" if the source or pref_lang is missing

Param

Type

Description

sourceLabel

string

Source name used to read pref_lang

conceptName

string

Variable name (without ?) the language filter applies to

Sparql_common.getBindingsValues(bindings) ⇒ Array.<Object>#

Flattens SPARQL JSON result bindings into plain objects, replacing each {type, value} cell with its .value string.

Kind: static method of Sparql_common
Returns: Array.<Object> - One plain object per binding, mapping each variable name to its string value

Param

Type

Description

bindings

Array.<Object>

results.bindings array from a SPARQL JSON response

Sparql_common.setFilter(varName, ids, words, [options]) ⇒ string#

Builds a SPARQL restriction clause for a variable, either from a list of identifiers (URIs/prefixed names/blank nodes) or from a list of label words.

  • With ids: emits a FILTER(?var in (...)) / FILTER(?var = ...) clause, or a VALUES ?var { ... } block when options.values is set. URIs are deduplicated and capped at 100 entries; blank nodes are excluded from VALUES (SPARQL 1.1 restriction).

  • With words: emits a FILTER(regex(?varLabel, "...", "i")) clause, or an exact-match FILTER(?varLabel in (...)) / equality when options.exactMatch is set.

Note: although varName accepts an array, only the clause for the first variable is returned (the multi-variable joining code is currently unreachable).

Kind: static method of Sparql_common
Returns: string - A SPARQL FILTER/VALUES fragment, or "" when no ids/words are supplied

Param

Type

Default

Description

varName

string | Array.<string>

Variable name(s) (without ?) the filter applies to

ids

string | Array.<string>

Identifier(s) to match; ignored when words is provided

words

string | Array.<string>

Label word(s) to match by regex/exact match

[options]

Object

Filter options

[options.exactMatch]

boolean

Match labels/ids exactly instead of by regex

[options.values]

boolean

Emit a VALUES block instead of a FILTER ... in clause

[options.useFilterKeyWord]

boolean | number

Force FILTER(... in ...) form instead of VALUES (set automatically; pass 1 to require it)

[options.labelSuffix]

string

”&quot;Label&quot;”

Suffix appended to the variable name for label matching

Sparql_common.formatSparqlQuery(query) ⇒ string#

Pretty-prints a SPARQL query by inserting line breaks before the main keywords (PREFIX, SELECT, FROM, WHERE, LIMIT) and upper-casing them.

Kind: static method of Sparql_common
Returns: string - The query with keywords placed on their own lines

Param

Type

Description

query

string

SPARQL query to reformat

Sparql_common.setSparqlResultPropertiesLabels(sourceLabel, SparqlResults, propVariable, callback) ⇒ err | Array#

Enriches SPARQL results with property labels: collects the property URIs missing a <propVariable>Label, fetches their labels via getObjectProperties (using a setFilter clause), and injects a literal <propVariable>Label cell into each result row. Falls back to the URI fragment when no label is found.

Kind: static method of Sparql_common
Returns: err | Array - Throws an error or returns the enriched SparqlResults bindings with <propVariable>Label cells filled in.
Expose:

Param

Type

Description

sourceLabel

string

Source name queried for the property labels

SparqlResults

Array.<Object>

Result bindings to enrich in place

propVariable

string

Variable name holding the property URI (its label goes to propVariable + "Label")

callback

function

Error-first callback (err, SparqlResults) returning the enriched results

Sparql_common.getVariableLangLabel(variable, [optional], [skosPrefLabel], [filterStr]) ⇒ string#

Builds the triple pattern that fetches a variable’s rdfs:label (optionally also skos:prefLabel) into a <variable>Label variable, with a language filter favouring Config.default_lang or untagged literals. Returns a plain pattern, an OPTIONAL {...} block, or a filter-free OPTIONAL when the caller already filters on the label variable.

Kind: static method of Sparql_common
Returns: string - A SPARQL triple pattern (optionally wrapped in OPTIONAL) binding the label variable

Param

Type

Description

variable

string

Variable name (without ?) whose label is fetched into <variable>Label

[optional]

boolean

Wrap the pattern in an OPTIONAL { ... } block

[skosPrefLabel]

boolean

Also match skos:prefLabel in addition to rdfs:label

[filterStr]

string

Existing filter string; if it references <variable>Label, the language filter is dropped to avoid conflicts

Sparql_common.getUriFilter(varName, values) ⇒ string#

Builds a FILTER clause matching a variable against URIs, literals and/or Virtuoso blank nodes (nodeID://). A single string-typed {value, isString, lang, datatype} object yields an equality filter with optional language tag or ^^<datatype>. Arrays are split into standard values (compared directly, in (...) when several) and blank nodes (compared via str(?var)), combined with ||.

Kind: static method of Sparql_common
Returns: string - A SPARQL filter (...) clause terminated with .

Param

Type

Description

varName

string

Variable name (without ?) the filter applies to

values

string | Array.<string> | Object

URI/literal string(s), or a {value, isString, lang, datatype} literal descriptor

Sparql_common.formatString(str, [forUri]) ⇒ string#

Alias of formatStringForTriple.

Kind: static method of Sparql_common
Returns: string - The escaped string, or null if the input is not a string

Param

Type

Description

str

string

String to escape

[forUri]

boolean

When true, also replace spaces/-// with _ for use in a URI

Sparql_common.formatStringForTriple(str, [forUri]) ⇒ string#

Escapes a string so it can be embedded safely as a SPARQL triple literal: trims, removes backslashes, escapes quotes, newlines, tabs and $, normalises @_ and non-breaking spaces. With forUri, also replaces spaces, hyphens and slashes with _.

Kind: static method of Sparql_common
Returns: string - The escaped string, or null if the input is falsy/non-string

Param

Type

Description

str

string

String to escape

[forUri]

boolean

When true, also make the string URI-safe (spaces/-//_)

Sparql_common.formatUrl(str) ⇒ string#

Replaces URL percent-escape sequences (%xx) with _ to produce a clean identifier.

Kind: static method of Sparql_common
Returns: string - The string with %... sequences replaced by _

Param

Type

Description

str

string

URL string to clean

Sparql_common.getSourceGraphUrisMap(sourceLabel) ⇒ Object.<string, string>#

Builds a map from graph URI to source name covering a source and all of its imports.

Kind: static method of Sparql_common
Returns: Object.<string, string> - Map keyed by graph URI, valued by source name

Param

Type

Description

sourceLabel

string

Source name whose own graph and imports are included

Sparql_common.getSourceFromUri(uri, [mainSource]) ⇒ string#

Resolves the source name owning a resource URI by stripping the local name (after the last # or /) and looking the resulting namespace up among a source’s import scope.

Kind: static method of Sparql_common
Returns: string - The owning source name, or null if the URI has no namespace separator

Param

Type

Description

uri

string

Resource URI to resolve

[mainSource]

string

Source providing the import scope to search; if omitted, all sources are searched

Sparql_common.getSourceFromGraphUris(graphUris, mainSource) ⇒ string#

Given a list of graph URIs, returns the matching source within mainSource’s import scope; defaults to mainSource when none of the imports match.

Kind: static method of Sparql_common
Returns: string - The matching source name, or mainSource as fallback

Param

Type

Description

graphUris

Array.<string>

Graph URIs to look up

mainSource

string

Source whose own graph and imports define the search scope

Sparql_common.getSourceFromGraphUri(graphUri, [mainSource]) ⇒ string | undefined#

Resolves a single graph URI to its source name. With mainSource, searches only that source plus its imports; without it, searches (and caches) all sources in Config.sources.

Kind: static method of Sparql_common
Returns: string | undefined - The matching source name, or undefined if no source uses that graph

Param

Type

Description

graphUri

string

Graph URI to resolve

[mainSource]

string

Source defining the import scope; when omitted, all sources are searched via the cached self.graphUrisMap

Sparql_common.getLabelFromURI(id) ⇒ string | undefined#

Extracts the local name of a URI: the substring after the last #, or after the last / when there is no #.

Kind: static method of Sparql_common
Returns: string | undefined - The local name, or undefined if the input has no .indexOf (not a string)

Param

Type

Description

id

string

URI to extract the local name from

Sparql_common.setFilterGraph(sourceLabel, filter) ⇒ string#

Wraps a SPARQL pattern fragment in a GRAPH <graphUri> { ... } block targeting the source’s named graph (looked up in Config.basicVocabularies then Config.sources).

Kind: static method of Sparql_common
Returns: string - The fragment wrapped in GRAPH <...> {}, or the unchanged fragment if the source is unknown

Param

Type

Description

sourceLabel

string

Source name whose graphUri scopes the pattern

filter

string

SPARQL pattern fragment to wrap

Sparql_common.getFromStr(sourceLabel, [named], [withoutImports], [options]) ⇒ string#

Assembles the FROM <graphUri> (or FROM NAMED <graphUri>) clauses for a SPARQL query, covering the source’s own graph plus, unless suppressed, all of its imported sources’ graphs. Also honours Lineage_sources.fromAllWhiteboardSources, dictionary sources when self.includeImports is set, and any options.includeSources / options.excludeImports. This is the canonical way to scope a query to a source and is used pervasively.

Kind: static method of Sparql_common
Returns: string - A concatenation of FROM/FROM NAMED clauses, "" when the source has no graph, or "XXX no graphUri" when the source is unknown

Param

Type

Description

sourceLabel

string

Source name to scope the query to

[named]

boolean

Emit FROM NAMED instead of FROM

[withoutImports]

boolean

Exclude imported graphs (defaults to self.withoutImports)

[options]

Object

Extra scoping options

[options.excludeImports]

Array.<string>

Import source names to skip

[options.includeSources]

string | Array.<string>

Additional source names whose graphs to add

[options.includeBasicVocabularies]

boolean

Add every graph declared in Config.basicVocabularies

Sparql_common.getSparqlDate([date], [withHours]) ⇒ string#

Formats a date as a SPARQL "..."^^xsd:dateTime typed literal.

Kind: static method of Sparql_common
Returns: string - A "<rdf-date>"^^xsd:dateTime literal

Param

Type

Description

[date]

Date

Date to format; defaults to now

[withHours]

boolean

Include the time component in the RDF string

Sparql_common.getSourceFromUriInDefaultServer(uri, callback) ⇒ err | string#

Finds which source owns a URI by querying the default server for the named graph containing it: SELECT ?g WHERE { graph ?g { <uri> ?p ?o } } LIMIT 1, then matching the returned graph URI against Config.sources.

Kind: static method of Sparql_common
Returns: err | string - Throws an error or returns the owning source name, or null if the URI is in no graph.
Expose:

Param

Type

Description

uri

string

Resource URI to locate

callback

function

Error-first callback (err, source); source is the owning source name, or null if the URI is in no graph

Sparql_common.replaceSparqlPrefixByUri(str, prefixes) ⇒ string#

Expands prefixed names (prefix:local) in a SPARQL string into full <uri> form using the supplied prefix→namespace map, handling a trailing . after the local name.

Kind: static method of Sparql_common
Returns: string - The string with prefixed names replaced by full <uri> references

Param

Type

Description

str

string

SPARQL string containing prefixed names

prefixes

Object.<string, string>

Map of prefix to namespace URI

Sparql_common.getSpecificPredicates(options) ⇒ string#

Builds a SPARQL property-path alternation (p1|p2|...) from a list of custom predicates, optionally appending ^rdfs:member for member-based hierarchies.

Kind: static method of Sparql_common
Returns: string - The property-path alternation string, or null if no specificPredicates are provided

Param

Type

Description

options

Object

Predicate options

options.specificPredicates

string | Array.<string>

Predicate(s) to combine into the property path

[options.memberPredicate]

boolean

Append ^rdfs:member to the path

Sparql_common.setDateRangeSparqlFilter(varName, startDate, [endDate], [options]) ⇒ string#

Builds a SPARQL date-range filter on a variable’s owl:hasValue date. When only a start date and a precision (sec/min/hour/day/month/year) are given, derives the end date by widening the start to that precision’s boundaries, then emits filter(?dateValue >= start) / filter(?dateValue <= end) clauses.

Kind: static method of Sparql_common
Returns: string - A SPARQL pattern binding ?dateValue plus the range filter(...) clauses

Param

Type

Description

varName

string

Variable name (without ?) carrying the date value

startDate

Date

Range start (mutated when precision is used)

[endDate]

Date

Range end; derived from startDate + precision when omitted

[options]

Object

Filter options

[options.precision]

string

One of sec, min, hour, day, month, year to derive the end date

Sparql_common.isTripleObjectString(property, [object]) ⇒ boolean#

Heuristically decides whether a triple’s object should be treated as a string literal, based mainly on the property name (label/comment/definition/description/example); the object-based branches all fall through to false, so the decision is effectively property-driven.

Used by the predicate widgets/bots to drive both UI and SPARQL generation: showing String operators and hiding the vocabulary/class selector (predicatesSelectorWidget), quoting the value in the generated Filter(...) (individualValuefilterWidget), and formatting the value as a plain literal rather than a URI/typed literal (predicates_bot).

Kind: static method of Sparql_common
Returns: boolean - true when the object is a textual literal property, false otherwise

Param

Type

Description

property

string

Property URI or name of the triple

[object]

string

Object value of the triple

Sparql_common.setPrefixesInSelectQuery(query) ⇒ string#

Rewrites a SELECT query to declare PREFIX clauses for every namespace used as a full <uri> in the WHERE clause: collects distinct namespaces, assigns generated ns1, ns2 … prefixes, replaces the full URIs with prefixed names and prepends the PREFIX block.

Kind: static method of Sparql_common
Returns: string - The query with generated PREFIX nsN: <...> declarations and prefixed names in the WHERE clause

Param

Type

Description

query

string

SELECT query whose WHERE clause contains full <uri> references

Sparql_common.addBasicVocabulariesPrefixes(query) ⇒ string#

Prepends PREFIX declarations for the basic vocabularies (rdfs, rdf, owl) to a query when they are not already declared before the WHERE clause.

Kind: static method of Sparql_common
Returns: string - The query with any missing rdfs/rdf/owl PREFIX declarations prepended

Param

Type

Description

query

string

SPARQL query to augment

Sparql_common.getIntFromTypeLiteral(value) ⇒ number#

Parses the integer part of a typed literal value of the form "42"^^xsd:integer.

Kind: static method of Sparql_common
Returns: number - The integer value parsed from the literal’s lexical part

Param

Type

Description

value

string

Typed literal string (value optionally followed by ^^datatype)

Sparql_common.getPrefixedLabelFromURI(sourceLabel, uri) ⇒ string#

Builds a short prefixed label for a URI of the form xxx:localName, where xxx is the first three characters of the source name and localName is the URI’s local part.

Kind: static method of Sparql_common
Returns: string - "<prefix>:<localName>", the bare uri if no source, or "" if no uri

Param

Type

Description

sourceLabel

string

Source name whose first 3 characters form the prefix

uri

string

URI whose local name is used

Sparql_common.getUriFromPrefixedName(prefixedName) ⇒ string | null#

Resolves a prefixed name (skos:prefLabel) into its full URI, using Config.defaultSparqlPrefixes then the module basicPrefixes as fallback.

Kind: static method of Sparql_common
Returns: string | null - The full URI, or null when the prefix is unknown or the name is not prefixed

Param

Type

Description

prefixedName

string

Prefixed name to resolve

Sparql_common.getPrefixedNameFromUri(uri) ⇒ string#

Shortens a URI into a prefixed name (skos:prefLabel). When several declared namespaces match, the longest one wins, so a namespace nested in another one is never shadowed.

Kind: static method of Sparql_common
Returns: string - The prefixed name, or "" when no declared namespace matches

Param

Type

Description

uri

string

URI to shorten

Sparql_common.getDefaultIndexedPredicates() ⇒ Array#

The predicates always indexed into the skoslabels field, whatever the user selects: they are hard-coded in the indexation queries themselves.

Kind: static method of Sparql_common
Returns: Array - [{id, label}] where id is the full URI and label the prefixed name

Sparql_common.getDefaultIndexedPredicateIdsMap() ⇒ Object#

Same predicates as getDefaultIndexedPredicates, as a {[predicateUri]: true} lookup map to filter them out of the selectable predicates.

Kind: static method of Sparql_common
Returns: Object - Map of the default indexed predicate URIs

Sparql_common.getIndexedPredicatesClauses([subjectVariableName], [options]) ⇒ Object#

Builds the OPTIONAL clauses fetching the extra datatype properties selected for the current indexation run. Their values are appended to the skoslabels field of the Elasticsearch documents so they become searchable alongside the usual alt labels.

Kind: static method of Sparql_common
Returns: Object - {optionalClauses, variableNames, selectVariablesStr}; all empty when no predicate is selected. selectVariablesStr is only needed by queries selecting explicit variables instead of *

Param

Type

Default

Description

[subjectVariableName]

string

”&quot;subject&quot;”

SPARQL variable holding the indexed subject

[options]

Object

Indexation options

[options.indexedPredicates]

Array.<string>

Explicit predicates for this run

Sparql_common.pushIndexedPredicateValues(binding, variableNames, labels)#

Pushes into labels the values bound by getIndexedPredicatesClauses for one SPARQL result row, skipping duplicates and unbound variables.

Kind: static method of Sparql_common

Param

Type

Description

binding

Object

One SPARQL result row

variableNames

Array.<string>

Variable names returned by getIndexedPredicatesClauses

labels

Array.<string>

Array of labels to enrich (mutated in place)

Sparql_generic#

Sparql_generic Module Schema-agnostic CRUD and traversal layer over the triple store. Read operations (getTopConcepts, getNodeChildren, getNodeInfos, …) delegate to the per-source controller (Sparql_OWL or Sparql_SKOS) chosen by Config.sources[source].controller, automatically batching large id/word lists into slices. Write operations build and run INSERT / DELETE / COPY SPARQL against the source’s named graph, and helpers convert triple objects to SPARQL text and post-process result bindings (labels, types, sorting).

Sparql_generic.getSourceVariables(sourceLabel) ⇒ Object#

Builds and memoizes a per-source bundle of SPARQL building blocks (prefixes string, FROM clause, hierarchy predicates, preferred-label predicate, language, limit, endpoint URL). For SKOS sources, defaults come from Sparql_SKOS.defaultPredicates, overridden by the source’s own predicates config.

Kind: static method of Sparql_generic
Returns: Object - Cached object with prefixesStr, fromStr, broaderPredicate, narrowerPredicate, prefLabelPredicate, topConceptFilter, lang, limit, optionalDepth, url, queryOptions, graphUri

Param

Type

Description

sourceLabel

string

Source name to compute query variables for

Sparql_generic.getTopConcepts(sourceLabel, [options], callback) ⇒ err | Array#

Returns the top-level concepts/classes of a source by delegating to its controller (Sparql_OWL or Sparql_SKOS).

Kind: static method of Sparql_generic
Returns: err | Array - Throws an error or returns the delegated controller’s top-concept bindings.
Expose:

Param

Type

Description

sourceLabel

string

Source name to query

[options]

Object

Controller-specific options

callback

function

Error-first callback (err, result) with the top concepts

Sparql_generic.getNodeInfos(sourceLabel, conceptId, [options], callback) ⇒ err | Array#

Returns all properties/triples describing a node (or nodes) by delegating to the source controller. Used to inspect a resource’s outgoing predicates and values.

Kind: static method of Sparql_generic
Returns: err | Array - Throws an error or returns the delegated controller’s node triple bindings.
Expose:

Param

Type

Description

sourceLabel

string

Source name to query

conceptId

string | Array.<string>

URI(s) of the node(s) to describe

[options]

Object

Controller-specific options

callback

function

Error-first callback (err, result) with the node’s triples

Sparql_generic.getItems(sourceLabel, [options], callback) ⇒ err | Array#

Returns all items (concepts/classes) of a source by delegating to its controller.

Kind: static method of Sparql_generic
Returns: err | Array - Throws an error or returns the delegated controller’s item bindings.
Expose:

Param

Type

Description

sourceLabel

string

Source name to query

[options]

Object

Controller-specific options

callback

function

Error-first callback (err, result) with the items

Sparql_generic.getNodeChildren(sourceLabel, [words], [ids], descendantsDepth, [options], callback) ⇒ err | Array#

Returns the children of node(s) down to a given depth, delegating to the source controller. The ids or words filter is split into slices of self.slicesSize and queried sequentially with async.eachSeries, concatenating the per-slice results.

Example controller query (SKOS, with collection filtering):

select distinct ?child1 ?child1Label ?subjectLabel ?collLabel
FROM <http://souslesens/thesaurus/TEST/>
WHERE { ?child1 skos:broader ?subject. ?subject skos:prefLabel ?subjectLabel.
        OPTIONAL { ?child1 skos:prefLabel ?child1Label. } filter(?subject = <...>) }
ORDER BY ?child1Label limit 1000

Kind: static method of Sparql_generic
Returns: err | Array - Throws an error or returns the concatenated children bindings from each slice.
Expose:

Param

Type

Description

sourceLabel

string

Source name to query

[words]

string | Array.<string>

Label word(s) to match; mutually exclusive with ids

[ids]

string | Array.<string>

Parent node URI(s) whose children are fetched

descendantsDepth

number

Depth of descendants to retrieve

[options]

Object

Controller-specific options (merged with {depth: 0, source})

callback

function

Error-first callback (err, bulkResult) with the concatenated children

Sparql_generic.getNodeParents(sourceLabel, [words], [ids], ancestorsDepth, [options], callback) ⇒ err | Array#

Returns the ancestors of node(s) up to a given depth, delegating to the source controller. The ids or words filter is sliced into self.slicesSize chunks and queried sequentially, concatenating the per-slice results. Returns [] when the source has no controller.

Kind: static method of Sparql_generic
Returns: err | Array - Throws an error or returns the concatenated ancestor bindings from each slice; returns [] when the source has no controller.
Expose:

Param

Type

Description

sourceLabel

string

Source name to query

[words]

string | Array.<string>

Label word(s) to match; mutually exclusive with ids

[ids]

string | Array.<string>

Child node URI(s) whose ancestors are fetched

ancestorsDepth

number

Depth of ancestors to retrieve

[options]

Object

Controller-specific options (merged with {depth: 0, source})

callback

function

Error-first callback (err, bulkResult) with the concatenated ancestors

Sparql_generic.getSingleNodeAllGenealogy(sourceLabel, id, callback) ⇒ err | Array#

Returns the full chain of ancestors of a node. For non-SKOS sources, falls back to the controller’s getTopConcepts. For SKOS, runs a transitive-closure query (?subject broaderPredicate* ?broader) fetching every broader concept’s label and type.

Kind: static method of Sparql_generic
Returns: err | Array - Throws an error or returns SPARQL results with variables: subject, broader, broaderLabel, type.
Expose:

Param

Type

Description

sourceLabel

string

Source name to query

id

string

URI of the node whose ancestors are fetched

callback

function

Error-first callback (err, bindings) with the ancestor bindings

Sparql_generic.getSingleNodeAllDescendants(sourceLabel, id, callback) ⇒ err | Array#

Returns the full set of descendants of a node by running a transitive-closure query over the inverse broader / narrower predicates (?subject ^broader*|narrower* ?narrower), fetching each descendant’s preferred label and type.

Kind: static method of Sparql_generic
Returns: err | Array - Throws an error or returns SPARQL results with variables: subject, narrower, narrowerLabel, type.
Expose:

Param

Type

Description

sourceLabel

string

Source name to query

id

string

URI of the node whose descendants are fetched

callback

function

Error-first callback (err, bindings) with the descendant bindings

Sparql_generic.getNodeLabel(sourceLabel, id, callback) ⇒ err | Array#

Fetches the preferred label and rdf:type of a single node, optionally filtered by language. Runs SELECT * WHERE { ?subject rdf:type ?type. ?subject prefLabel ?subjectLabel. filter(?subject = <id>) }.

Kind: static method of Sparql_generic
Returns: err | Array - Throws an error or returns SPARQL results with variables: subject, type, subjectLabel.
Expose:

Param

Type

Description

sourceLabel

string

Source name to query

id

string

URI of the node whose label is fetched

callback

function

Error-first callback (err, bindings) with the label/type bindings

Sparql_generic.getEndPointAllGraphsMap([sparqlServerUrl], callback) ⇒ err | Object#

Lists all named graphs available on an endpoint by running SELECT distinct ?g WHERE { GRAPH ?g { ?s ?p ?o } } LIMIT 10000.

Kind: static method of Sparql_generic
Returns: err | Object - Throws an error or returns a map of graph URI to 1.
Expose:

Param

Type

Description

[sparqlServerUrl]

string

Endpoint URL to query; defaults to the main server

callback

function

Error-first callback (err, graphs); graphs is a map of graph URI → 1

Sparql_generic.getNodesAllTriples(sourceLabel, subjectIds, callback) ⇒ err | Array#

Fetches every outgoing triple (?subject ?prop ?value) for a list of subjects, batching the subject ids into slices of 2000 and combining results. Used to bulk-export node data.

Kind: static method of Sparql_generic
Returns: err | Array - Throws an error or returns SPARQL results with variables: subject, prop, value.
Expose:

Param

Type

Description

sourceLabel

string

Source name to query

subjectIds

Array.<string>

Subject URIs whose triples are fetched

callback

function

Error-first callback (err, triples) with the concatenated triple bindings

Sparql_generic.deleteTriples(sourceLabel, subjectUri, predicateUri, object, callback) ⇒ err | *#

Deletes triples matching a subject/predicate/object pattern from a source’s named graph. Builds with <graphUri> DELETE { ?s ?p ?o } WHERE { ?s ?p ?o <filters> }, where each supplied component contributes a Sparql_common.getUriFilter clause. Refuses to run when all three filters are empty (would delete the whole graph).

Kind: static method of Sparql_generic
Returns: err | * - Throws an error or returns the callback result; early-returns a string error when no filter is supplied.
Expose:

Param

Type

Description

sourceLabel

string

Source name whose graph is edited

subjectUri

string

Subject URI to match (optional)

predicateUri

string

Predicate URI to match (optional)

object

string | Object

Object to match: a URI/literal string or a literal descriptor (optional)

callback

function

Error-first callback (err, bindings); errors with a message if no filter is given

Sparql_generic.triplesObjectToString(item) ⇒ string#

Serialises a triple descriptor object into a SPARQL/Turtle triple string, choosing the right syntax for each element: angle-bracketed URIs and blank nodes, quoted literals with optional @lang tag, prefixed names for allowed prefixes, and ^^datatype typed literals (with numeric and xsd:dateTime normalisation). An inverse predicate (prefixed with ^) swaps subject and object.

Kind: static method of Sparql_generic
Returns: string - A single subject predicate object . SPARQL triple string

Param

Type

Description

item

Object

Triple descriptor with subject/s, predicate/p, object/o, and optional lang, isString, valueType

Sparql_generic.getDefaultSparqlPrefixesStr() ⇒ string#

Builds a PREFIX key: <uri> string for every prefix declared in Config.defaultSparqlPrefixes, to prepend to INSERT/DELETE queries.

Kind: static method of Sparql_generic
Returns: string - Concatenated PREFIX declarations for all default prefixes

Sparql_generic.insertTriples(sourceLabel, _triples, [options], callback) ⇒ err | *#

Inserts triples into a source’s named graph (or an explicit options.graphUri). Each triple descriptor is serialised via triplesObjectToString, deduplicated, batched into slices of 200 and run as WITH GRAPH <graphUri> INSERT { ... }. With options.getSparqlOnly, returns the generated query instead of executing it.

Kind: static method of Sparql_generic
Returns: err | * - Throws an error or returns the inserted count (or the query string when options.getSparqlOnly).
Expose:

Param

Type

Description

sourceLabel

string

Source name whose graph receives the triples (may be null if options.graphUri is set)

_triples

Array.<Object>

Triple descriptor objects to insert

[options]

Object

Insert options

[options.graphUri]

string

Target graph URI when no sourceLabel is given

[options.sparqlPrefixes]

Object

Prefix map used to expand prefixed names before insertion

[options.getSparqlOnly]

boolean

Return the generated INSERT query instead of executing it

callback

function

Error-first callback (err, insertedCount) (or (null, query) when getSparqlOnly)

Sparql_generic.deleteTriplesWithFilter(sourceLabel, filter, callback) ⇒ err | *#

Deletes triples from a source’s graph matching a SPARQL filter expression (WITH <graphUri> DELETE { ?s ?x ?y } WHERE { ?s ?x ?y. ?s ?p ?o. filter(<filter>) }). When no filter is given, prompts for confirmation before deleting the entire graph.

Kind: static method of Sparql_generic
Returns: err | * - Throws an error or returns the callback result.
Expose:

Param

Type

Description

sourceLabel

string

Source name whose graph is edited

filter

string

SPARQL filter expression selecting the triples to delete; empty deletes all (after confirmation)

callback

function

Error-first callback (err, result)

Sparql_generic.copyGraph(fromSourceLabel, toGraphUri, callback) ⇒ err | number#

Copies all triples from a source’s graph into another graph using paginated with <fromGraph> insert { graph <toGraph> { ?s ?p ?o } } where { ?s ?p ?o } runs, looping with async.whilst over offset/limit windows of 100000 until exhausted.

Kind: static method of Sparql_generic
Returns: err | number - Throws an error or returns the last batch size.
Expose:

Param

Type

Description

fromSourceLabel

string

Source name whose graph is the copy origin

toGraphUri

string

Destination graph URI

callback

function

Error-first callback (err, resultSize) with the last batch size

Sparql_generic.getDistinctPredicates(sourceLabel, [options], callback) ⇒ err | Array#

Lists the distinct predicates used in a source, with their optional labels. Runs select distinct ?p ?pLabel WHERE { ?s ?p ?o. optional { ?p ?x ?pLabel. filter(?x in (skos:prefLabel, rdfs:label)) } } then fills missing labels via setBindingsOptionalProperties.

Kind: static method of Sparql_generic
Returns: err | Array - Throws an error or returns SPARQL results with variables: p, pLabel (optional).
Expose:

Param

Type

Description

sourceLabel

string

Source name to query

[options]

Object

Reserved options object

callback

function

Error-first callback (err, bindings) with ?p/?pLabel bindings

Sparql_generic.copyNodes(fromSourceLabel, toGraphUri, sourceIds, [options], callback) ⇒ err | number#

Copies selected nodes (and their properties) from a source into a target graph, optionally minting fresh URIs. Fetches each node’s triples via getNodeInfos, remaps subject/object URIs (random hexa ids unless keepOriginalUris), can add skos:exactMatch/rdfs:sameAs back-links, parent links and rdf:type triples per the target schema, then INSERTs the rebuilt triples in batches of 100.

Kind: static method of Sparql_generic
Returns: err | number - Throws an error or returns the number of triples inserted.
Expose:

Param

Type

Description

fromSourceLabel

string

Source name the nodes come from

toGraphUri

string

Destination graph URI

sourceIds

Array.<string>

URIs of the nodes to copy

[options]

Object

Copy options

[options.keepOriginalUris]

boolean

Reuse source URIs instead of minting new ones

[options.addExactMatchPredicate]

boolean

Add an exactMatch/sameAs link back to the source node

[options.setParentNode]

Object

{sourceUri, targetUri} to attach a parent (broader/subClassOf) link

[options.properties]

Array.<string>

Only copy these property URIs

[options.excludedProperties]

Array.<string>

Skip these property URIs

[options.additionalTriplesNt]

Array.<string>

Extra N-Triples strings to insert

[options.setSubjectFn]

function

Hook to mutate each item’s subject

[options.setPredicateFn]

function

Hook to mutate each item’s predicate

[options.setObjectFn]

function

Hook to mutate each item’s object

callback

function

Error-first callback (err, insertedCount)

Sparql_generic.sortBindings(bindings, field, [_options]) ⇒ Array.<Object>#

Sorts SPARQL result bindings in place by the string value of a given field (missing values sort as empty string).

Kind: static method of Sparql_generic
Returns: Array.<Object> - The same array, sorted ascending by the field value

Param

Type

Description

bindings

Array.<Object>

Result bindings to sort

field

string

Variable name to sort by (binding[field].value)

[_options]

Object

Reserved (unused)

Sparql_generic.setMissingLabels(bindings, _fields, [options]) ⇒ Array.<Object>#

Fills missing <field>Label cells in result bindings by deriving a label from the field’s URI value (its local name) via getLabelFromURI.

Kind: static method of Sparql_generic
Returns: Array.<Object> - The same bindings with <field>Label cells added where missing

Param

Type

Description

bindings

Array.<Object>

Result bindings to enrich in place

_fields

string | Array.<string>

Variable name(s) whose labels to backfill

[options]

Object

Reserved options object

Sparql_generic.setBindingsOptionalProperties(bindings, _fields, [options]) ⇒ Array.<Object>#

Backfills missing <field>Type and <field>Label cells for a family of indexed fields (field, field1field4) in result bindings. Defaults the type to skos:Concept (or options.type) and derives labels from the URI local name; blank nodes get an empty label.

Kind: static method of Sparql_generic
Returns: Array.<Object> - The same bindings with type/label cells filled in

Param

Type

Description

bindings

Array.<Object>

Result bindings to enrich in place

_fields

string | Array.<string>

Base variable name(s); indexed variants 0–4 are processed

[options]

Object

Enrichment options

[options.noType]

boolean

Do not add <field>Type cells

[options.type]

string

Type URI to use instead of the default skos:Concept

Sparql_generic.getLangFilterStr(options, variable) ⇒ string#

Builds a SPARQL language filter that keeps a variable’s literals in the requested language or with no language tag (FILTER (lang(var)='xx' || !lang(var))).

Kind: static method of Sparql_generic
Returns: string - The language FILTER clause, or "" when no options.lang is given

Param

Type

Description

options

Object

Filter options

[options.lang]

string

BCP-47 language code to keep (alongside untagged literals); no filter emitted when absent

variable

string

SPARQL variable expression (including ?) the filter applies to

Sparql_generic.getSourceTaxonomy(sourceLabel, [options], callback) ⇒ err | Object#

Builds the complete subsumption taxonomy (class/concept hierarchy) of a source as a flat map of nodes with resolved ancestor chains. The parent predicate and concept type are chosen from the schema (rdfs:subClassOf/owl:Class for OWL, skos:broader/skos:Concept for SKOS, rdf:type/owl:NamedIndividual for KNOWLEDGE_GRAPH, or options.parentType). The hierarchy query is paginated (limit 500) with async.whilst; results are then folded into allClassesMap (collecting labels/altLabels per node), each node’s direct parents are expanded into a single most-specific ancestor chain, and orphan parents are back-filled (labels fetched via getLabelsMap for OWL).

Kind: static method of Sparql_generic
Returns: err | Object - Throws an error or returns {classesMap, labels}; each classesMap entry has id, label, lang, skoslabels, parents, type.
Expose:

Param

Type

Description

sourceLabel

string

Source name whose taxonomy is built

[options]

Object

Build options

[options.ids]

Array.<string>

Restrict to these subject URIs (adds a setFilter clause)

[options.filter]

string

Extra SPARQL filter appended to the hierarchy query

[options.parentType]

string

Parent predicate to use when the schema type is unrecognised

[options.withoutImports]

boolean

Exclude imported graphs from the FROM clause

callback

function

Error-first callback (err, {classesMap, labels}) where classesMap maps each node URI to {id, label, lang, skoslabels, parents, type} and labels maps URI → label

Sparql_generic.createDecapitalizedLabelTriples(sourceLabel, callback) ⇒ err | number#

For every item whose preferred label is capitalised, inserts a skos:altLabel triple holding the decapitalised variant (improves search matching). Items are fetched via getItems, and the new triples are inserted in batches of 100.

Kind: static method of Sparql_generic
Returns: err | number - Throws an error or returns the number of triples inserted.
Expose:

Param

Type

Description

sourceLabel

string

Source name to process

callback

function

Error-first callback (err, total) with the number of triples inserted

Sparql_generic.triplesToTurtle(triples) ⇒ void#

Stub intended to serialise an array of triples into Turtle (not yet implemented).

Kind: static method of Sparql_generic

Param

Type

Description

triples

Array.<Object>

Triple descriptors to serialise

Sparql_proxy#

Sparql_proxy Module Low-level execution layer for SPARQL queries. Wraps every query in an AJAX call to the backend /sparqlProxy endpoint (which forwards it to the triple store), handling GET/POST method selection, custom headers, CONSTRUCT vs SELECT response formats and query history logging. This is the single entry point used by all higher-level modules (Sparql_OWL, Sparql_SKOS, Sparql_generic) to talk to an endpoint.

Sparql_proxy.querySPARQL_GET_proxy(url, query, queryOptions, options, callback) ⇒ err | Object#

Executes a SPARQL query against an endpoint through the backend /sparqlProxy. Resolves the effective endpoint URL (_default → main Virtuoso), picks the HTTP method from the source config (sparql_server.method), sets the Accept header (application/sparql-results+json for SELECT/ASK, text/turtle for CONSTRUCT), prepends basic vocabulary prefixes and posts the query. The query itself is passed in by the caller; this function does not build SPARQL, only transports it.

Kind: static method of Sparql_proxy
Returns: err | Object - Throws an error or returns the parsed SPARQL JSON result (result.results.bindings), or raw turtle for CONSTRUCT queries.
Expose:

Param

Type

Description

url

string

URL of the SPARQL endpoint to query (_default resolves to Config.sparql_server.url)

query

string

SPARQL query string to execute (SELECT, ASK, CONSTRUCT, INSERT, DELETE)

queryOptions

string

Extra URL parameters appended to the endpoint URL

options

Object

Execution options

[options.source]

string

Source name used to look up Config.sources[source] (endpoint, method, headers)

[options.acceptHeader]

string

Overrides the Accept header sent to the endpoint

[options.dontCacheCurrentQuery]

boolean

When true, does not store the query in self.currentQuery

[options.caller]

string

Key under which the query body is pushed into self.queriesHistory

callback

function

Error-first callback (err, result); result is the parsed JSON (result.results.bindings) or raw turtle for CONSTRUCT

Sparql_proxy.exportGraph(sourceLabel) ⇒ void#

Exports the full content of a source’s named graph as Turtle and copies it to the clipboard. Runs CONSTRUCT { ?s ?p ?o } WHERE { GRAPH <graphUri> { ?s ?p ?o } } against the source endpoint with an application/x-nice-turtle Accept header, then writes the returned turtle to the clipboard via module:common.

Kind: static method of Sparql_proxy

Param

Type

Description

sourceLabel

string

Source name whose graphUri and sparql_server.url are read from Config.sources

Sparql_proxy.executeAsyncQuery(url, query, queryOptions, options) ⇒ Promise.<Object>#

Promise-based wrapper around querySPARQL_GET_proxy for callers using async/await instead of error-first callbacks. Resolves with the query result, rejects with the error.

Kind: static method of Sparql_proxy
Returns: Promise.<Object> - Resolves with the parsed query result, rejects with the error

Param

Type

Description

url

string

URL of the SPARQL endpoint to query

query

string

SPARQL query string to execute

queryOptions

string

Extra URL parameters appended to the endpoint URL

options

Object

Execution options (see querySPARQL_GET_proxy)

Sparql_proxy.addFromLabelsGraphToQuery(query) ⇒ string#

Injects a FROM <labelsGraphUri> clause into a query when it references any ?xxxLabel variable, so the dedicated labels graph is searched alongside the data. Returns the query unchanged if it has no WHERE keyword or no ?...Label variables.

Kind: static method of Sparql_proxy
Returns: string - The query with a FROM <Config.labelsGraphUri> clause inserted before WHERE, or the original query if not applicable

Param

Type

Description

query

string

SPARQL query to augment

Implicit_legendOverlay#

Implicit_legendOverlay Implicit Model legend overlay config (categories/labels/order + tableColors).

Kind: global variable

Mapping_legendOverlay#

Mapping_legendOverlay Mapping Modeler legend overlay config (categories/labels/order only). Uses LegendOverlayWidget.attachVisjsGraph for automatic refresh on graph changes.

Kind: global variable

sparqlTests#

The MIT License Copyright 2020 Claude Fauconnet / SousLesens Claude.fauconnet@gmail.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Kind: global variable

saveVisjsModelGraph([callback])#

Saves the current Vis.js graph model.

Kind: global function

Param

Type

Description

[callback]

function

Callback function called after saving