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
schemaTypeis"OWL"(and KNOWLEDGE_GRAPH). Navigates class hierarchies viardfs:subClassOf, readsowl: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 throughConfig.sources[source].controllerand 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
schemaTypeis"SKOS". Navigates thesauri/taxonomies viaskos:broader/skos:narrower, reads labels throughskos:prefLabel/skos:altLabel, and supports SKOS collections. It is selected per source throughConfig.sources[source].controllerand 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_OWLorSparql_SKOS) chosen byConfig.sources[source].controller, automatically batching large id/word lists into slices. Write operations build and runINSERT/DELETE/COPYSPARQL 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
/sparqlProxyendpoint (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] |
|
The name of the data source. Defaults to the active source if not provided. |
[axiomType] |
|
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
-
.showSourcesDialog() ⇒
void.init() ⇒
void.addSelectedSourcesToGraph() ⇒
void.setGraphPopupMenus() ⇒
void.mergeNodesUI([testObj]) ⇒
void
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.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] |
|
The node from which the merge is initiated. |
[toNode] |
|
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] |
|
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 |
|
The nodes selected for merging, represented as jstree objects. |
mergeMode |
|
The merging mode, e.g., “keepUri”. |
mergeDepth |
|
Defines the depth of the merge operation (“nodeOnly”, “nodeAndDirectChildren”, “nodeDescendantsOnly”). |
mergeRestrictions |
|
Whether to include ontology restrictions in the merge. |
mergedNodesType |
|
The RDF type of the merged nodes (e.g., “owl:NamedIndividual”, “owl:Class”). |
targetSource |
|
The target source where merged nodes will be inserted. |
[targetNode] |
|
The optional parent node under which merged nodes will be placed. |
callback |
|
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
-
.deleteNode(node, jstreeId) ⇒
void.onshowImportsCBXChange(cbx) ⇒
void
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 |
|
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 |
|
The node to delete. |
jstreeId |
|
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 |
|
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 |
|
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 |
|
The URI of the resource (subject) |
predicate |
|
The predicate of the triple |
object |
|
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
-
.onLoaded() ⇒
void.onChangeFilterSelect(value) ⇒
void.getDictionarySources(dictionary, [domainSource], [rangeSource], callback) ⇒
void.getDictionaryFilters() ⇒
string.getFilterPredicates(subjectVarname) ⇒
string
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 |
|
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 |
|
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 |
|
The dictionary source to query. |
[domainSource] |
|
Optional domain source filter. |
[rangeSource] |
|
Optional range source filter. |
callback |
|
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 |
|
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 |
|
The CSS class name for filter elements. |
source |
|
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 |
|
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
-
.init() ⇒
void.showPropInfos(_event, obj) ⇒
void.jstreeContextMenu() ⇒
Object.openNode(node) ⇒
void.getPropertiesjsTreeData(source, ids, words, options, callback) ⇒
void
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 |
|
The event object (unused). |
obj |
|
Object containing the node information. |
obj.node |
|
The node object. |
obj.node.id |
|
The ID of the node. |
Lineage_properties.onTreeNodeClick(_event, obj) ⇒ void#
Handles click events on tree nodes.
Kind: static method of Lineage_properties
Param |
Type |
Description |
|---|---|---|
_event |
|
The click event object. |
obj |
|
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 |
|
The node to open. |
node.data |
|
The node’s data. |
node.data.id |
|
The node’s ID. |
node.data.source |
|
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 |
|
The source to query. |
ids |
|
Array of property IDs to filter by. |
words |
|
Array of words to search for in property labels. |
options |
|
Additional options for the query. |
[options.searchType] |
|
Type of search to perform (filters properties on words present in predicate or subject or object label). |
callback |
|
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
-
.showReasonerDialog() ⇒
void.runOperation(operation) ⇒
void.runConsistency() ⇒
void.runUnsatisfiable() ⇒
void.showInferencePredicates() ⇒
void.execute() ⇒
void.listInferenceSubjects() ⇒
void.displayInference() ⇒
void
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 |
|
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 of predicates to use for inference. |
callback |
|
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
-
.showAddFilterDiv(clear) ⇒
void.onSelectRoleType(role) ⇒
void.addFilter() ⇒
void
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 |
|
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 |
|
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 |
|
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.)
-
.getPropertiesJstreeMenu() ⇒
Object.drawRelations(direction, type, caller, options, [graphDiv]) ⇒
void.callPreviousQuery() ⇒
void.loadUserQueries() ⇒
void.onSelectSavedQuery(id) ⇒
void.saveCurrentQuery() ⇒
void.deleteSavedQuery(id) ⇒
void
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 |
|
The caller of the function (“Graph”, “Tree”, etc.). |
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 |
|
The selection event. |
object |
|
The object containing node data. |
object.node |
|
The selected node. |
object.node.parent |
|
The parent node ID. |
object.node.data |
|
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 |
|
The role of the object (subject or object). |
type |
|
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 |
|
The action to execute (“clear” or “draw”). |
[_type] |
|
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 |
|
Configuration options for outlining nodes. |
options.filter |
|
SPARQL filter to apply when querying nodes. |
options.output |
|
The output format (“outline”). |
options.edgesColor |
|
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 |
|
Direction of relations (“direct”, “inverse”, or “both”). |
|
type |
|
Type of relations to draw (“restrictions”, “dictionary”, etc.). |
|
caller |
|
The caller of the function (“Graph”, “Tree”, “leftPanel”, etc.). |
|
options |
|
Configuration options for drawing relations. |
|
[options.skipLiterals] |
|
|
Whether to skip literal nodes. |
[options.source] |
|
Source to use for relations. |
|
[options.data] |
|
Data to use for relations (node IDs). |
|
[options.output] |
|
Output format (“table” or graph). |
|
[options.returnVisjsData] |
|
Whether to return Vis.js data. |
|
[options.filter] |
|
SPARQL filter to apply. |
|
[options.includeSources] |
|
Sources to include. |
|
[graphDiv] |
|
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 |
|
The source from which to get inferred properties. |
callback |
|
Callback function with signature (error, result). |
result |
|
The jstree data structure containing inferred properties. |
result.nodes |
|
Array of nodes representing properties and their constraints. |
result.nodes[].data |
|
Node data containing property information. |
result.nodes[].data.id |
|
Property ID. |
result.nodes[].data.label |
|
Property label. |
result.nodes[].data.constraints |
|
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 |
|
The selection event. |
obj |
|
The object containing node data. |
obj.node |
|
The selected node. |
obj.node.data |
|
Node data containing property information. |
obj.node.data.constraints |
|
Property constraints. |
obj.node.data.label |
|
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 |
|
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 |
|
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 |
|
The source containing the equivalent classes. |
data |
|
Array of class IDs to find equivalents for. |
callback |
|
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
-
.showRulesDialog() ⇒
void.onSearchClassKeyDown(event) ⇒
void.searchItem(term, type) ⇒
void.getContextMenu() ⇒
Object.clearPremise(div) ⇒
void.getImplicitModel() ⇒
void.addPropertiesToTree(node) ⇒
void.execRule() ⇒
void
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 |
|
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 |
|
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 |
|
The search term. |
type |
|
The type of item to search for (“Class” or “ObjectProperty”). |
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 |
|
The selection event. |
obj |
|
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 |
|
The node to add. |
role |
|
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 |
|
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 |
|
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
-
.self.filterBy :
object.self.decorate :
object.self.classDecorate :
object.addNodeToSelection(node) ⇒
void.clearNodesSelection([ids]) ⇒
void.getSelectedNodesTree() ⇒
Array.<Object>.getSelectedNodes(onlyIds) ⇒
Array.<(string|Object)>
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 |
|
The node to add to the selection. |
node.data |
|
The node’s data. |
node.data.id |
|
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] |
|
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 |
|
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 |
|
The node being hovered. |
point |
|
The point where the hover occurred. |
options |
|
Keyboard modifier options. |
options.ctrlKey |
|
Whether the Ctrl key is pressed. |
options.altKey |
|
Whether the Alt key is pressed. |
options.shiftKey |
|
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 |
|
The click event. |
obj |
|
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 |
|
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 |
|
The action to execute (“filterBy”, “decorate”, “classDecorate”, etc.). |
checkSelected |
|
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
-
.showDialog(selection) ⇒
void.onChangeSelection(value) ⇒
void.showSourcesTree() ⇒
void.onSourceSelected(evt, obj) ⇒
void.onValidateSources() ⇒
void.drawSimilars() ⇒
void.getStartingNodes() ⇒
Array.<Object>|null.drawWhiteBoardSimilars([selectedMode], [mode], [output]) ⇒
void
Lineage_similars.showDialog(selection) ⇒ void#
Shows the dialog for finding similar nodes.
Kind: static method of Lineage_similars
Param |
Type |
Description |
|---|---|---|
selection |
|
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 |
|
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 |
|
The selection event. |
obj |
|
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 |
|
The starting source |
source |
|
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] |
|
Optional selected mode. “AllWhiteboardNodes” or “SelectedNodes” |
[mode] |
|
Optional mode. “exactMatch” or “fuzzyMatch” |
[output] |
|
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
-
.self.menuActions :
object.init(showDialog) ⇒
void.resetAll(showDialog) ⇒
void.setCurrentSource(source) ⇒
void.initSourcesSearchSelect() ⇒
void.showHideLineageLeftPanels() ⇒
void.setTopLevelOntologyFromImports(sourceLabel) ⇒
string|null.setTopLevelOntologyFromPrefix(prefix) ⇒
string|null.isSourceOwnedByUser(sourceName) ⇒
boolean.isSourceEditableForUser(source) ⇒
boolean.clearSource([source]) ⇒
void.setTheme(theme) ⇒
void
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 |
|
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 |
|
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 |
|
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 |
|
The source(s) to be loaded. |
[callback] |
|
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 |
|
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.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 |
|
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 |
|
The source to initialize. |
callback |
|
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 |
|
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 |
|
The label of the source to register. |
[callback] |
|
Optional callback function to execute after registration. |
Lineage_sources.registerSourceImports(sourceLabel, callback) ⇒ void#
Registers all imported sources of a given source.
Kind: static method of Lineage_sources
Param |
Type |
Description |
|---|---|---|
sourceLabel |
|
The label of the source whose imports should be registered. |
callback |
|
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 |
|
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 |
|
The source whose nodes should be shown or hidden. |
hide |
|
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 |
|
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 |
|
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 |
|
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 |
|
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] |
|
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 |
|
The theme to apply (“white” or other). |
Lineage_whiteboard#
-
.onSourceSelect(sourceLabel) ⇒
void.drawTopConcepts(source, [options], graphDiv, callback) ⇒
void.isResultAcceptable(result) ⇒
boolean.initWhiteBoard(force) ⇒
void.drawDictionarySameAs() ⇒
void.collapseNode(nodeId) ⇒
void
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 |
|
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 |
|
The ontology source to retrieve top concepts from. |
|
[options] |
|
|
Configuration options for fetching and displaying concepts. |
graphDiv |
|
The ID of the div container where the graph will be drawn. |
|
callback |
|
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 |
|
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 |
|
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 |
|
The data containing nodes and edges to be displayed. |
|
graphDiv |
|
The ID of the div container where the graph will be rendered. |
|
[_options] |
|
|
Optional configuration settings for the graph. |
[_options.visjsOptions] |
|
Custom options for the Vis.js graph. |
|
[_options.layoutHierarchical] |
|
If true, enables hierarchical layout. |
|
[_options.physics] |
|
Custom physics settings for the graph. |
|
[_options.noDecorations] |
|
If true, skips the decoration step after drawing. |
|
[_options.legendType] |
|
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] |
|
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 |
|
The ID of the node to collapse. |
KGquery#
KGquery Module Module for querying and visualizing knowledge graphs. Provides functionality to build and execute queries on knowledge graphs.
-
.unload() ⇒
void.init() ⇒
void.initOutputType() ⇒
void.loadSource() ⇒
void.addQuerySet(booleanOperator) ⇒
Object.addQueryElementToQuerySet(querySet) ⇒
Object.addEdge(edge, evt) ⇒
void.aggregateQuery() ⇒
void.queryToTagsGeometry(result) ⇒
void.queryToTagsCalendar(result) ⇒
void.queryResultToTable(result) ⇒
void.getAllQueryPathClasses() ⇒
Array.<Object>.removeSet(querySetDivId) ⇒
void.onOutputTypeSelect(output) ⇒
void.addOutputType() ⇒
void.initQuery() ⇒
void.initGraph() ⇒
void.checkRequirements() ⇒
void.initMyQuery() ⇒
void.unload() ⇒
void.init() ⇒
void.initOutputType() ⇒
void.loadSource() ⇒
void.addQuerySet(booleanOperator) ⇒
Object.addQueryElementToQuerySet(querySet) ⇒
Object.addEdge(edge, evt) ⇒
void.aggregateQuery() ⇒
void.queryToTagsGeometry(result) ⇒
void.queryToTagsCalendar(result) ⇒
void.queryResultToTable(result) ⇒
void.getAllQueryPathClasses() ⇒
Array.<Object>.removeSet(querySetDivId) ⇒
void.onOutputTypeSelect(output) ⇒
void.addOutputType() ⇒
void.initQuery() ⇒
void.initGraph() ⇒
void.checkRequirements() ⇒
void.initMyQuery() ⇒
voidKGquery
.onLoaded() ⇒
void.onLoaded() ⇒
void
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 |
|
The boolean operator to use (AND, OR, etc.) |
Properties
Name |
Type |
Description |
|---|---|---|
querySet.divId |
|
The ID of the div containing the query set |
querySet.elements |
|
Array of query elements in this set |
querySet.color |
|
The color assigned to this query set |
querySet.booleanOperator |
|
The boolean operator for this set |
querySet.classFiltersMap |
|
Map of class filters |
querySet.index |
|
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 |
|
The query set to add the element to |
Properties
Name |
Type |
Description |
|---|---|---|
queryElement.divId |
|
The ID of the div containing this element |
queryElement.fromNode |
|
The source node |
queryElement.toNode |
|
The target node |
queryElement.paths |
|
Array of paths between fromNode and toNode |
queryElement.queryElementDivId |
|
The element’s div ID |
queryElement.fromNodeDivId |
|
The source node’s div ID |
queryElement.toNodeDivId |
|
The target node’s div ID |
queryElement.index |
|
Index within the query set |
queryElement.setIndex |
|
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 |
|
The query element to add the node to |
node |
|
The node to add |
role |
|
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 |
|
The node to add |
nodeEvent |
|
The event that triggered the addition |
[callback] |
|
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 |
|
The source node |
toNode |
|
The target node |
edge |
|
The edge data |
KGquery.addEdge(edge, evt) ⇒ void#
Adds edges between nodes in the graph.
Kind: static method of KGquery
Param |
Type |
Description |
|---|---|---|
edge |
|
The edge to add |
evt |
|
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:
ErrorIf the query execution fails
Param |
Type |
Default |
Description |
|---|---|---|---|
output |
|
The desired output format (‘table’, ‘Graph’, ‘shacl’, or custom tool name) |
|
[options] |
|
Additional query options |
|
[options.aggregate] |
|
Aggregation settings for the query |
|
[isVirtualSQLquery] |
|
|
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 |
|
The options for query execution |
options.output |
|
The desired output format (e.g., “shacl”) |
callback |
|
Callback function to handle the query results |
callback.err |
|
Error object if the query fails |
callback.result |
|
The query results if successful |
KGquery.queryResultToVisjsGraph(result) ⇒ void#
Converts query results to a Vis.js graph visualization.
Kind: static method of KGquery
Throws:
ErrorIf result size exceeds maxResultSizeforLineageViz
Param |
Type |
Description |
|---|---|---|
result |
|
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 |
|
The query results to convert |
result.results.bindings |
|
The query result bindings |
result.head.vars |
|
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] |
|
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 |
|
The node to get variable name for |
[withoutQuestionMark] |
|
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 |
|
The message to display |
|
[stopWaitImg] |
|
|
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] |
|
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 |
|
ID of the query set div |
value |
|
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 |
|
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 |
|
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 |
|
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 |
|
The boolean operator to use (AND, OR, etc.) |
Properties
Name |
Type |
Description |
|---|---|---|
querySet.divId |
|
The ID of the div containing the query set |
querySet.elements |
|
Array of query elements in this set |
querySet.color |
|
The color assigned to this query set |
querySet.booleanOperator |
|
The boolean operator for this set |
querySet.classFiltersMap |
|
Map of class filters |
querySet.index |
|
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 |
|
The query set to add the element to |
Properties
Name |
Type |
Description |
|---|---|---|
queryElement.divId |
|
The ID of the div containing this element |
queryElement.fromNode |
|
The source node |
queryElement.toNode |
|
The target node |
queryElement.paths |
|
Array of paths between fromNode and toNode |
queryElement.queryElementDivId |
|
The element’s div ID |
queryElement.fromNodeDivId |
|
The source node’s div ID |
queryElement.toNodeDivId |
|
The target node’s div ID |
queryElement.index |
|
Index within the query set |
queryElement.setIndex |
|
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 |
|
The query element to add the node to |
node |
|
The node to add |
role |
|
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 |
|
The node to add |
nodeEvent |
|
The event that triggered the addition |
[callback] |
|
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 |
|
The source node |
toNode |
|
The target node |
edge |
|
The edge data |
KGquery.addEdge(edge, evt) ⇒ void#
Adds edges between nodes in the graph.
Kind: static method of KGquery
Param |
Type |
Description |
|---|---|---|
edge |
|
The edge to add |
evt |
|
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:
ErrorIf the query execution fails
Param |
Type |
Default |
Description |
|---|---|---|---|
output |
|
The desired output format (‘table’, ‘Graph’, ‘shacl’, or custom tool name) |
|
[options] |
|
Additional query options |
|
[options.aggregate] |
|
Aggregation settings for the query |
|
[isVirtualSQLquery] |
|
|
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 |
|
The options for query execution |
options.output |
|
The desired output format (e.g., “shacl”) |
[options.aggregate] |
|
Aggregation settings for the query |
callback |
|
Callback function to handle the query results |
callback.err |
|
Error object if the query fails |
callback.result |
|
The query results if successful |
KGquery.queryResultToVisjsGraph(result) ⇒ void#
Converts query results to a Vis.js graph visualization.
Kind: static method of KGquery
Throws:
ErrorIf result size exceeds maxResultSizeforLineageViz
Param |
Type |
Description |
|---|---|---|
result |
|
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 |
|
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 |
|
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 |
|
The query results to convert |
result.results.bindings |
|
The query result bindings |
result.head.vars |
|
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] |
|
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 |
|
The node to get variable name for |
[withoutQuestionMark] |
|
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 |
|
The message to display |
|
[stopWaitImg] |
|
|
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] |
|
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 |
|
ID of the query set div |
value |
|
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 |
|
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 |
|
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 |
|
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.
-
.unload() ⇒
void.init() ⇒
void.initOutputType() ⇒
void.loadSource() ⇒
void.addQuerySet(booleanOperator) ⇒
Object.addQueryElementToQuerySet(querySet) ⇒
Object.addEdge(edge, evt) ⇒
void.aggregateQuery() ⇒
void.queryToTagsGeometry(result) ⇒
void.queryToTagsCalendar(result) ⇒
void.queryResultToTable(result) ⇒
void.getAllQueryPathClasses() ⇒
Array.<Object>.removeSet(querySetDivId) ⇒
void.onOutputTypeSelect(output) ⇒
void.addOutputType() ⇒
void.initQuery() ⇒
void.initGraph() ⇒
void.checkRequirements() ⇒
void.initMyQuery() ⇒
void.unload() ⇒
void.init() ⇒
void.initOutputType() ⇒
void.loadSource() ⇒
void.addQuerySet(booleanOperator) ⇒
Object.addQueryElementToQuerySet(querySet) ⇒
Object.addEdge(edge, evt) ⇒
void.aggregateQuery() ⇒
void.queryToTagsGeometry(result) ⇒
void.queryToTagsCalendar(result) ⇒
void.queryResultToTable(result) ⇒
void.getAllQueryPathClasses() ⇒
Array.<Object>.removeSet(querySetDivId) ⇒
void.onOutputTypeSelect(output) ⇒
void.addOutputType() ⇒
void.initQuery() ⇒
void.initGraph() ⇒
void.checkRequirements() ⇒
void.initMyQuery() ⇒
voidKGquery
.onLoaded() ⇒
void.onLoaded() ⇒
void
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 |
|
The boolean operator to use (AND, OR, etc.) |
Properties
Name |
Type |
Description |
|---|---|---|
querySet.divId |
|
The ID of the div containing the query set |
querySet.elements |
|
Array of query elements in this set |
querySet.color |
|
The color assigned to this query set |
querySet.booleanOperator |
|
The boolean operator for this set |
querySet.classFiltersMap |
|
Map of class filters |
querySet.index |
|
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 |
|
The query set to add the element to |
Properties
Name |
Type |
Description |
|---|---|---|
queryElement.divId |
|
The ID of the div containing this element |
queryElement.fromNode |
|
The source node |
queryElement.toNode |
|
The target node |
queryElement.paths |
|
Array of paths between fromNode and toNode |
queryElement.queryElementDivId |
|
The element’s div ID |
queryElement.fromNodeDivId |
|
The source node’s div ID |
queryElement.toNodeDivId |
|
The target node’s div ID |
queryElement.index |
|
Index within the query set |
queryElement.setIndex |
|
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 |
|
The query element to add the node to |
node |
|
The node to add |
role |
|
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 |
|
The node to add |
nodeEvent |
|
The event that triggered the addition |
[callback] |
|
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 |
|
The source node |
toNode |
|
The target node |
edge |
|
The edge data |
KGquery.addEdge(edge, evt) ⇒ void#
Adds edges between nodes in the graph.
Kind: static method of KGquery
Param |
Type |
Description |
|---|---|---|
edge |
|
The edge to add |
evt |
|
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:
ErrorIf the query execution fails
Param |
Type |
Default |
Description |
|---|---|---|---|
output |
|
The desired output format (‘table’, ‘Graph’, ‘shacl’, or custom tool name) |
|
[options] |
|
Additional query options |
|
[options.aggregate] |
|
Aggregation settings for the query |
|
[isVirtualSQLquery] |
|
|
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 |
|
The options for query execution |
options.output |
|
The desired output format (e.g., “shacl”) |
callback |
|
Callback function to handle the query results |
callback.err |
|
Error object if the query fails |
callback.result |
|
The query results if successful |
KGquery.queryResultToVisjsGraph(result) ⇒ void#
Converts query results to a Vis.js graph visualization.
Kind: static method of KGquery
Throws:
ErrorIf result size exceeds maxResultSizeforLineageViz
Param |
Type |
Description |
|---|---|---|
result |
|
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 |
|
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 |
|
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 |
|
The query results to convert |
result.results.bindings |
|
The query result bindings |
result.head.vars |
|
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] |
|
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 |
|
The node to get variable name for |
[withoutQuestionMark] |
|
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 |
|
The message to display |
|
[stopWaitImg] |
|
|
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] |
|
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 |
|
ID of the query set div |
value |
|
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 |
|
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 |
|
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 |
|
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 |
|
The boolean operator to use (AND, OR, etc.) |
Properties
Name |
Type |
Description |
|---|---|---|
querySet.divId |
|
The ID of the div containing the query set |
querySet.elements |
|
Array of query elements in this set |
querySet.color |
|
The color assigned to this query set |
querySet.booleanOperator |
|
The boolean operator for this set |
querySet.classFiltersMap |
|
Map of class filters |
querySet.index |
|
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 |
|
The query set to add the element to |
Properties
Name |
Type |
Description |
|---|---|---|
queryElement.divId |
|
The ID of the div containing this element |
queryElement.fromNode |
|
The source node |
queryElement.toNode |
|
The target node |
queryElement.paths |
|
Array of paths between fromNode and toNode |
queryElement.queryElementDivId |
|
The element’s div ID |
queryElement.fromNodeDivId |
|
The source node’s div ID |
queryElement.toNodeDivId |
|
The target node’s div ID |
queryElement.index |
|
Index within the query set |
queryElement.setIndex |
|
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 |
|
The query element to add the node to |
node |
|
The node to add |
role |
|
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 |
|
The node to add |
nodeEvent |
|
The event that triggered the addition |
[callback] |
|
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 |
|
The source node |
toNode |
|
The target node |
edge |
|
The edge data |
KGquery.addEdge(edge, evt) ⇒ void#
Adds edges between nodes in the graph.
Kind: static method of KGquery
Param |
Type |
Description |
|---|---|---|
edge |
|
The edge to add |
evt |
|
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:
ErrorIf the query execution fails
Param |
Type |
Default |
Description |
|---|---|---|---|
output |
|
The desired output format (‘table’, ‘Graph’, ‘shacl’, or custom tool name) |
|
[options] |
|
Additional query options |
|
[options.aggregate] |
|
Aggregation settings for the query |
|
[isVirtualSQLquery] |
|
|
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 |
|
The options for query execution |
options.output |
|
The desired output format (e.g., “shacl”) |
[options.aggregate] |
|
Aggregation settings for the query |
callback |
|
Callback function to handle the query results |
callback.err |
|
Error object if the query fails |
callback.result |
|
The query results if successful |
KGquery.queryResultToVisjsGraph(result) ⇒ void#
Converts query results to a Vis.js graph visualization.
Kind: static method of KGquery
Throws:
ErrorIf result size exceeds maxResultSizeforLineageViz
Param |
Type |
Description |
|---|---|---|
result |
|
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 |
|
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 |
|
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 |
|
The query results to convert |
result.results.bindings |
|
The query result bindings |
result.head.vars |
|
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] |
|
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 |
|
The node to get variable name for |
[withoutQuestionMark] |
|
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 |
|
The message to display |
|
[stopWaitImg] |
|
|
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] |
|
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 |
|
ID of the query set div |
value |
|
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 |
|
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 |
|
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 |
|
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 |
|
The ID of the container div |
booleanOperator |
|
The boolean operator for the set (Union/Minus) |
label |
|
The label for the query set |
color |
|
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 |
|
The ID of the query set div |
[color] |
|
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 |
|
The ID of the query element div |
role |
|
The role of the node (fromNode/toNode) |
label |
|
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 |
|
The ID of the query element div |
label |
|
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 |
|
The query element |
queryElement.paths |
|
Array of paths in the query element |
KGquery_filter#
KGquery_filter Module Handles filtering functionality for knowledge graph queries.
-
.selectOptionalPredicates(querySets, options, callback) ⇒
void.getOptionalPredicates(propertyNodes, options, callback) ⇒
void.getAggregateFilterOptionalPredicates(querySet, filter) ⇒
string[.getAggregatePredicates(groupByPredicates, groupByPredicateskey) ⇒
string.applyFilterToNode(classDivId, aClass, classSetIndex, result, addTojsTreeNode) ⇒
void.addNodeFilter(classDivId, addTojsTreeNode, propertyId) ⇒
void
KGquery_filter.selectOptionalPredicates(querySets, options, callback) ⇒ void#
Selects optional predicates for the query.
Kind: static method of KGquery_filter
Param |
Type |
Description |
|---|---|---|
querySets |
|
The query sets to process |
options |
|
Options for predicate selection |
callback |
|
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 of selected property nodes |
options |
|
|
options.noConfirm |
|
|
callback |
|
Callback function called with (err, result) |
callback.result |
|
The result object containing: |
callback.result.optionalPredicatesSparql |
|
The OPTIONAL clauses in SPARQL |
callback.result.selectClauseSparql |
|
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 |
|
The query set to process |
filter |
|
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 |
|
Map of predicates to group by |
groupByPredicates[key |
|
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 |
|
The ID of the class div |
aClass |
|
The class object |
classSetIndex |
|
The index of the class set |
result |
|
The filter result object |
result.filter |
|
The filter string |
result.filterLabel |
|
The filter label |
addTojsTreeNode |
|
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 |
|
The ID of the class div |
addTojsTreeNode |
|
The node to add the filter to |
propertyId |
|
The ID of the property to filter on |
KGquery_myQueries#
KGquery_myQueries Module Handles saving and loading of knowledge graph queries.
-
.save(callback) ⇒
void.load(err, result) ⇒
void
KGquery_myQueries.save(callback) ⇒ void#
Saves the current query state.
Kind: static method of KGquery_myQueries
Param |
Type |
Description |
|---|---|---|
callback |
|
Callback function called with (err, data) where data contains: |
callback.data |
|
The data to save |
callback.data.querySets |
|
The current query sets |
callback.data.sparqlQuery |
|
The current SPARQL query |
callback.data.optionalPredicatesSparql |
|
Optional predicates in SPARQL format |
callback.data.selectClauseSparql |
|
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 object if loading failed |
result |
|
The saved query state to load |
result.querySets |
|
The saved query sets |
result.optionalPredicatesSparql |
|
Optional predicates in SPARQL format |
result.selectClauseSparql |
|
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 |
|
The Vis.js graph data containing nodes and edges |
visjsData.nodes |
|
Array of nodes in the graph |
visjsData.edges |
|
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 |
|
The selected node from jsTree |
node.id |
|
The node ID |
node.text |
|
The node text/label |
node.data |
|
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 |
|
The source name. |
callback |
|
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 |
|
The source name. |
callback |
|
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 |
|
The DOM element where the tree should be loaded. |
tableStatsMap |
|
map where key is a table and value the number of triples created from this table |
callback |
|
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 |
|
The name of the data source. |
type |
|
The type of the data source (e.g., “csvSource” or other types). |
sqlType |
|
The SQL type of the data source, relevant for non-CSV sources. |
table |
|
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 |
|
The name of the CSV source. |
fileName |
|
The name of the CSV file to load. |
loadJstree |
|
A flag indicating whether to reload the Jstree. |
callback |
|
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 |
|
The name of the source. |
dataSource |
|
The name of the database source to load. |
sqlType |
|
The SQL type of the database source. |
callback |
|
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 |
|
The event object triggered by the selection. |
obj |
|
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 |
|
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 |
|
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 |
|
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}
-
static
.self.currentOffset :
Object.self.visjsGraph :
Object.stepX :
number.stepY :
number.minX :
number.drawResource(newResource) ⇒
void.initOffsets() ⇒
void.objectIdExistsInGraph(id) ⇒
boolean.adjustEdgeCurvatures() ⇒
void.outlineNode(nodeId) ⇒
void.removeNodeFromGraph() ⇒
void.removeNodeEdgeGraph() ⇒
void.addSuperClassToGraph() ⇒
void.drawColumnToClassEdge() ⇒
void.showNodeInfos() ⇒
void.showSampledata() ⇒
void.showColumnDetails([node]) ⇒
void.loadVisjsGraph([callback]) ⇒
void.saveVisjsGraph([callback]) ⇒
void.getDatasourceTablesFromVisjsGraph() ⇒
Array.<string>.updateNode(node) ⇒
void.removeNode(node) ⇒
void.addNodes(node) ⇒
void.updateEdge(edge) ⇒
void.removeEdge(edge) ⇒
void.sortVisjsColumns(nodes) ⇒
void.addEdge(edge) ⇒
void.clearGraph() ⇒
void.exportMappings() ⇒
void
inner
~createDataSourcesClusters() ⇒
void
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 |
|
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 |
|
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 |
|
The ID of the div container for the graph. |
visjsData |
|
Data containing nodes and edges for the graph. |
[callback] |
|
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 |
|
The clicked node object. |
|
event |
|
The click event object. |
|
options |
|
Additional event options. |
|
[options.ctrlKey] |
|
|
Indicates if the Ctrl key was pressed during the click. |
[options.shiftKey] |
|
|
Indicates if the Shift key was pressed during the click. |
[options.altKey] |
|
|
Indicates if the Alt key was pressed during the click. |
MappingColumnsGraph.outlineNode(nodeId) ⇒ void#
Outlines a selected node by increasing its border width.
Kind: static method of MappingColumnsGraph
Param |
Type |
Description |
|---|---|---|
nodeId |
|
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] |
|
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 |
|
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] |
|
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] |
|
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 |
|
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 |
|
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 |
|
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 |
|
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 |
|
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 |
|
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 |
|
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 |
|
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:
JSON integrity: each
nodes[i].data.datasourcemust be declared inoptions.config.databaseSourcesoroptions.config.csvSources.Target server availability: if
options.config.databaseSourcescontains ids, the import callsGET /databasesand 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}
-
.self.jstreeDivId :
string.self.legendGraphDivId :
string.self.legendItemsArray :
Array.<{label: string, color: string, shape: string, size: number}>.onLoaded() ⇒
void[.get AllClasses(source, callback)](#module_MappingModeler.get AllClasses)
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:
Sets up the current source and initializes the UI menu bar.
Loads the source configuration using
DataSourceManager.Loads the HTML structure for the graph container.
Initializes an empty VisJS graph canvas.
Loads the VisJS mapping graph with data.
Loads and sets up the lateral panel with tabs and the data source tree.
Kind: static method of MappingModeler
Throws:
ErrorIf 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 |
|
The objects to populate the tree with. |
parentName |
|
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 |
|
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 |
|
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 |
|
The selection event object. |
obj |
|
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 |
|
The legend node clicked, containing its ID and properties. |
event |
|
The click event triggering the action. |
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 |
|
The source to retrieve classes from. Defaults to |
callback |
|
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 |
|
The source to retrieve properties from. Defaults to |
callback |
|
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.initResourcesMap(source, callback)#
Initializes
self.allResourcesMapas an empty object.Resets
self.allClassesandself.allPropertiestonull.Calls
self.getAllClassesto fetch all classes, adding each to theself.allResourcesMapby ID.Calls
self.getAllPropertiesto fetch all properties, adding each to theself.allResourcesMapby ID.If a callback is provided, it is invoked after all resources are processed.
Kind: static method of MappingModeler
Param |
Type |
Description |
|---|---|---|
source |
|
The data source from which resources are fetched. |
callback |
|
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
visjsGraphobject, which contains the graph visualization data.Removes all content from the graph’s HTML container using its ID.
Resets
self.visjsGraphtonull.Reinitializes an empty graph canvas using
self.drawGraphCanvaswith 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
workflowNewClassworkflow, otherwise, if it’s “ObjectProperty”, it uses theworkflowNewObjectPropertyworkflow.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 |
|
The type of resource to create (“Class” or “ObjectProperty”). |
filteredUris |
|
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 |
|
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.htmlinto the#smallDialogDivelement.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_fnBodyinput 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.loadSourcesto load the current source specified inMainController.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 |
|
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 |
|
The selected node from which to fetch data. |
columns |
|
The specific columns to display, can be an array or a single column name. |
callback |
|
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}
-
.generateR2MLmappings() ⇒
void.writeTBoxDeclarations(model) ⇒
string.getSqlDatasourceInfo(dsId) ⇒
Object.iriLocalName(iri) ⇒
string._findPrimaryKeyColumn(table, nodesById) ⇒
string|null.isColumnName(v) ⇒
boolean.findVirtualColumnKey(vcData, nodesById, nonNullCols) ⇒
string|null.mapXsdType(range) ⇒
string|null.isIriRange(range) ⇒
boolean.getGrelFunctionForTransform(transform) ⇒
string|null._writeFnoTransformObjectMap(format, predicate, columnRef, transform, datatype) ⇒
string.nodeToKGcreatorColumnName(data) ⇒
string
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 |
|
SousLeSens source label |
callback |
|
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 |
|
The export model from buildExportModel() |
callback |
|
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 |
|
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 |
|
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 |
|
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 |
|
The table name to search in. |
nodesById |
|
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 |
|
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:
Column in nonNullCols whose normalized name matches the VirtualColumn’s safeId (e.g. “Data actor gain of role” → “dataactorgainofrole” → matches “DataActorGainOfRole”)
“RowId” if present in nonNullCols or graph nodes
findPrimaryKeyColumn fallback
Kind: static method of MappingTransform
Returns: string | null - The column name to use as join key, or null.
Param |
Type |
Description |
|---|---|---|
vcData |
|
The VirtualColumn node’s data object. |
nodesById |
|
Map of all graph nodes keyed by ID. |
nonNullCols |
|
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 |
|
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 |
|
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 |
|
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 |
|
“rml” or “r2rml”. |
predicate |
|
The predicate CURIE or IRI. |
columnRef |
|
The source column name. |
transform |
|
The transform identifier. |
datatype |
|
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] |
|
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 |
|
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 |
|
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 |
|
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 :
Object.transform :
object.createPrefixTransformFn() ⇒
void.testTransform() ⇒
void
.showDetailedMappingsTree([column], [divId], [_options]) ⇒
void.getColumnType(nodeId) ⇒
string|null.setNodeAsMainColumn(nodeId) ⇒
void
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 :
object.createPrefixTransformFn() ⇒
void.testTransform() ⇒
void
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] |
|
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] |
|
|
The ID of the dialog div to display the details in. Default is “mainDialogDiv”. |
[callback] |
|
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] |
|
Optional column data to filter the tree by. |
|
[divId] |
|
|
The ID of the div to display the tree in. Default is “detailedMappings_jsTreeDiv”. |
[_options] |
|
|
Optional configuration options for the tree, such as context menu behavior. |
[_options.withoutContextMenu] |
|
|
If true, disables the context menu. |
[_options.searchPlugin] |
|
|
Enables or disables the search plugin. |
[_options.openAll] |
|
|
If true, expands all nodes by default. |
[_options.selectTreeNodeFn] |
|
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 |
|
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 |
|
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 |
|
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 |
|
The event object triggered by the tree node selection. |
obj |
|
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] |
|
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 |
|
The clicked object details from the graph. |
event |
|
The event object triggered by the click. |
options |
|
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 |
|
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 |
|
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 |
|
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 |
|
Indicates whether to delete all triples or just for the current table. |
[callback] |
|
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 |
|
Indicates whether to create sample data triples or full triples. |
|
table |
|
The table for which to create triples. |
|
[options] |
|
Options for creating triples, such as sample size and filter options. |
|
[options.deleteOldGraph] |
|
|
If true, deletes the existing graph before creating new triples. |
[options.sampleSize] |
|
|
The number of sample triples to create if |
[options.clientSocketId] |
|
The client socket ID for real-time updates. |
|
[options.mappingsFilter] |
|
Filters for selecting specific mappings. |
|
[options.filteredMappings] |
|
Alternative mapping filter. |
|
[options.deleteTriples] |
|
|
If true, deletes existing triples before creation. |
callback |
|
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 |
|
The triples data to display, each item should contain ‘s’, ‘p’, and ‘o’ properties. |
div |
|
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 |
|
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 |
|
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 |
|
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.
-
static
.getSourceTaxonomyPredicates(sourceLabel, [options]) ⇒
string.getTopConcepts(sourceLabel, [options], callback) ⇒
err|Array.getNodeChildren(sourceLabel, words, ids, descendantsDepth, [options], callback) ⇒
err|Array.getNodeInfos(sourceLabel, conceptId, [options], callback) ⇒
err|Array.getNodeParents(sourceLabel, words, ids, ancestorsDepth, [options]) ⇒
err|Array.getNodesAncestorsOrDescendants(sourceLabel, classIds, [options], callback) ⇒
err|Object.getFilteredTriples2(sourceLabel, [subjectIds], [propertyIds], [objectIds], [options], callback) ⇒
err|Array.getFilteredTriples(sourceLabel, [subjectIds], [propertyIds], [objectIds], [options], callback) ⇒
err|Array.getObjectPropertiesDomainAndRange(sourceLabel, [domainIds], [options], callback) ⇒
err|Array.getObjectRestrictions(sourceLabel, [subClassIds], [options], callback) ⇒
err|Array.getNamedIndividuals(sourceLabel, [ids], [options], callback) ⇒
err|Array.getNodesTypes(sourceLabel, ids, callback) ⇒
err|Array.getNodesOwlTypeMap(sourceLabel, ids, callback) ⇒
err|Object.getPropertiesRestrictionsDescription(sourceLabel, propIds, [options], callback) ⇒
err|Array.getUrisLabelsMap(sourceLabel, uris, callback) ⇒
err|Object.getLabelsMap(sourceLabel, [options], callback) ⇒
err|Object.getDictionary(sourceLabel, [options], [processor], callback) ⇒
err|Array.getObjectProperties(sourceLabel, [options], callback) ⇒
err|Array.generateInverseRestrictions(sourceLabel, propId, inversePropId, cardinality, callback) ⇒
err|number.getPropertiesInheritedConstraints(sourceLabel, properties, options, callback) ⇒
err|Object.getInferredPropertiesDomainsAndRanges(sourceLabel, [options], callback) ⇒
err|Object.getAllTriples(sourceLabel, role, ids, [options], callback) ⇒
err|Array.generateOWL(sourceLabel, [options], callback) ⇒
err|string.getDistinctClassLabels(sourceLabel, classIds, [options], callback) ⇒
err|Array.getIndividualsType(sourceLabel, allIds, [options], callback) ⇒
err|Array.getIndividualsOfClass(sourceLabel, classIds, [options], callback) ⇒
err|Array.clearGraph(graphUri, callback) ⇒
err|undefined.copyUriTriplesFromSourceToSource(fromSource, toSource, subjectUri, callback) ⇒
err|undefined.getAllDescendants(sourceLabel, [resourcesIds], [taxonomyPredicate], [options], callback) ⇒
err|Array.getGraphsWithSameClasses(sourceLabel, filter, callback) ⇒
err|Array.createSkgFromOntology(sourceLabel, skgGraphUri, callback) ⇒
err|undefined.getNodeLabel(sourceLabel, id, callback) ⇒
err|Array.getNodesSuperClassesAndDefinition(sourceLabel, nodeIds, [options], callback) ⇒
err|Array.getClassesWithoutTaxonomy(sourceLabel, [options], callback) ⇒
err|Object
inner
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 |
|
Source name whose |
[options] |
|
Predicate options |
[options.specificPredicates] |
|
Predicate(s) to use instead of the source config |
[options.memberPredicate] |
|
Append |
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):
options.skipTopClassFilter→ no filter at allsources.json[source].topClassFilter(non-empty, non-"_default") → custom SPARQL filter stringDefault:
?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.triplesparql_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 |
|
OWL source name to query |
[options] |
|
Query options |
[options.selectGraph] |
|
Also bind each triple’s named graph ( |
[options.withoutImports] |
|
Exclude imported graphs from the |
[options.skipTopClassFilter] |
|
Do not apply any top-class filter |
[options.filter] |
|
Extra SPARQL filter appended after the top-class filter |
[options.filterCollections] |
|
Restrict to top concepts reachable from these SKOS collections |
[options.returnQueryStr] |
|
Return the SPARQL query string instead of executing it |
callback |
|
Error-first callback |
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 |
|
OWL source name to query |
words |
|
Label word(s) for fuzzy/exact parent match; mutually exclusive with |
ids |
|
Parent class URI(s) whose children are fetched |
descendantsDepth |
|
Number of taxonomy levels to expand |
[options] |
|
Query options |
[options.selectGraph] |
|
Bind each triple’s named graph |
[options.exactMatch] |
|
Treat |
[options.withoutImports] |
|
Exclude imported graphs from the |
[options.specificPredicates] |
|
Override taxonomy predicate(s) used for the parent/child relation |
[options.filter] |
|
Extra SPARQL filter appended to the query |
[options.filterCollections] |
|
Restrict children to members of these SKOS collections |
[options.sort] |
|
Variable name to order results by |
[options.limit] |
|
Result limit (defaults to |
callback |
|
Error-first callback |
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 |
|
OWL source name to query |
conceptId |
|
URI of the resource to describe |
[options] |
|
Query options |
[options.selectGraph] |
|
Bind each triple’s named graph |
[options.getValuesLabels] |
|
Add |
[options.inverseProperties] |
|
Also return triples where the resource is the object |
[options.noRestrictions] |
|
Exclude values that are |
[options.limit] |
|
Result limit (defaults to |
callback |
|
Error-first callback |
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 |
|
OWL source name to query |
words |
|
Label word(s) identifying the start node; mutually exclusive with |
ids |
|
Start class URI(s) whose ancestors are fetched |
ancestorsDepth |
|
Number of levels to climb (capped as described above) |
[options] |
|
Query options |
[options.selectGraph] |
|
Bind broader nodes’ named graphs |
[options.withoutImports] |
|
Exclude imported graphs from the |
[options.excludeType] |
|
Reserved flag to drop type variables from the SELECT clause |
[options.filterCollections] |
|
Exclude ancestors that are members of these collections |
[options.limit] |
|
Result limit (defaults to |
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 |
|
OWL source name to query |
classIds |
|
Class URI(s) whose hierarchy is built |
[options] |
|
Query options |
[options.descendants] |
|
Build descendant hierarchies instead of ancestors |
[options.excludeItself] |
|
Use |
[options.filter] |
|
Extra SPARQL filter appended to the query |
[options.withoutImports] |
|
Exclude imported graphs from the |
callback |
|
Error-first callback |
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 |
|
OWL source name to query |
[subjectIds] |
|
Subject URI(s) to match (optional) |
[propertyIds] |
|
Property URI(s) to match (optional) |
[objectIds] |
|
Object URI(s) to match (optional) |
[options] |
|
Query options |
[options.withImports] |
|
Include imported graphs in the |
[options.distinct] |
|
Variables for the SELECT clause (defaults to |
[options.filter] |
|
Extra SPARQL filter appended to the query |
[options.limit] |
|
Result limit (defaults to |
callback |
|
Error-first callback |
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 |
|
OWL source name to query |
[subjectIds] |
|
Subject URI(s) to match (optional) |
[propertyIds] |
|
Property URI(s) to match (optional) |
[objectIds] |
|
Object URI(s) to match (optional) |
[options] |
|
Query options |
[options.filter] |
|
Extra SPARQL filter appended to the query |
[options.onlyObjectProperties] |
|
Restrict to |
[options.onlyDataTypeProperties] |
|
Restrict to literal objects |
[options.includeLiterals] |
|
Allow literal objects (otherwise excluded) |
[options.withoutImports] |
|
Exclude imported graphs from the |
[options.distinct] |
|
Variables for the SELECT clause (defaults to |
[options.limit] |
|
Result limit (defaults to |
callback |
|
Error-first callback |
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 |
|
OWL source name to query |
[domainIds] |
|
Domain (or range) class URI(s) to filter by (optional) |
[options] |
|
Query options |
[options.inverseRestriction] |
|
Filter on range instead of domain |
[options.propIds] |
|
Filter by property URI(s) |
[options.subPropIds] |
|
Filter by sub-property URI(s) |
[options.dataTypeProperties] |
|
Query |
[options.inheritedProperties] |
|
Include inherited properties via |
[options.searchType] |
|
One of |
[options.words] |
|
Label word(s) used when |
[options.addInverseRestrictions] |
|
Also fetch and merge inverse-direction results |
[options.filter] |
|
Extra SPARQL filter (replaces the id filter) |
[options.selectGraph] |
|
Bind each triple’s named graph |
[options.limit] |
|
Result limit (defaults to |
callback |
|
Error-first callback |
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 |
|
OWL source name to query |
[subClassIds] |
|
Class URI(s) carrying the restrictions (or restriction values when |
[options] |
|
Query options |
[options.inverseRestriction] |
|
Filter on the restriction value (range) instead of the subject |
[options.restrictionIds] |
|
Filter by restriction value URI(s) |
[options.listPropertiesOnly] |
|
Select only |
[options.withoutBlankNodes] |
|
Select an explicit non-blank-node variable set |
[options.turtle] |
|
Emit a CONSTRUCT query |
[options.someValuesFrom] |
|
Restrict to |
[options.allValuesFrom] |
|
Restrict to |
[options.hasValue] |
|
Restrict to |
[options.getMetadata] |
|
Also fetch status/creator/date/provenance metadata of each restriction |
[options.withoutImports] |
|
Exclude imported graphs from the |
[options.filter] |
|
Extra SPARQL filter (its |
[options.limit] |
|
Result limit (defaults to |
callback |
|
Error-first callback |
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 |
|
OWL source name to query |
[ids] |
|
Class URI(s) whose individuals are fetched |
[options] |
|
Query options |
[options.selectGraph] |
|
Bind each triple’s named graph |
[options.limit] |
|
Result limit (defaults to |
callback |
|
Error-first callback |
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 |
|
Source name whose endpoint is queried |
ids |
|
Resource URI(s) whose types are fetched |
callback |
|
Error-first callback |
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 |
|
Source name whose endpoint is queried |
ids |
|
Resource URI(s) whose OWL type is determined |
callback |
|
Error-first callback |
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 |
|
OWL source name to query |
propIds |
|
Property URI(s) whose restrictions are described |
[options] |
|
Query options |
[options.subPropIds] |
|
Filter by sub-property URI(s) instead of |
[options.filter] |
|
Extra SPARQL filter (replaces the property filter) |
[options.selectGraph] |
|
Bind each triple’s named graph |
[options.limit] |
|
Result limit (defaults to |
callback |
|
Error-first callback |
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 |
|
Source name to query |
uris |
|
URIs whose labels are fetched |
callback |
|
Error-first callback |
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 |
|
OWL source name to query |
[options] |
|
Query options |
[options.noExecute] |
|
Skip the query and return an empty map |
[options.lang] |
|
Restrict labels to this language (or untagged) |
[options.filter] |
|
Extra SPARQL filter appended to the query |
[options.selectGraph] |
|
Bind each triple’s named graph |
[options.withoutImports] |
|
Exclude imported graphs from the |
[options.processorFectchSize] |
|
Page size for pagination (defaults to 2000) |
[options.limit] |
|
Total result cap (defaults to |
callback |
|
Error-first callback |
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 |
|
OWL source name to query |
[options] |
|
Query options |
[options.lang] |
|
Restrict labels to this language (or untagged) |
[options.type] |
|
Restrict to resources of this |
[options.filter] |
|
Extra SPARQL filter appended to the query |
[options.selectGraph] |
|
Bind each triple’s named graph |
[options.includeBlankNodes] |
|
Include blank-node ids |
[options.withoutImports] |
|
Exclude imported graphs from the |
[options.skosPrefLabel] |
|
Also fetch |
[options.indexedPredicates] |
|
Extra predicates fetched for indexation, see getIndexedPredicatesClauses |
[options.processorFectchSize] |
|
Page size (defaults to 2000) |
[options.limit] |
|
Total result cap (defaults to |
[processor] |
|
Optional |
callback |
|
Error-first callback |
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 |
|
OWL source name to query |
[options] |
|
Query options |
[options.withGraph] |
|
Wrap in |
[options.withoutImports] |
|
Exclude imported graphs from the |
[options.skosLabels] |
|
Also match |
[options.filter] |
|
Extra SPARQL filter appended to the query |
callback |
|
Error-first callback |
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 |
|
Source name whose graph is edited |
propId |
|
Property URI whose restrictions are inverted |
inversePropId |
|
Property URI used in the generated inverse restrictions |
cardinality |
|
Cardinality for the generated restrictions |
callback |
|
Error-first callback |
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 |
|
OWL source name to query |
properties |
|
Property URIs whose inherited constraints are fetched |
options |
|
Query options |
[options.withGraph] |
|
Bind the graph in the |
[options.withoutImports] |
|
Exclude imported graphs from the |
callback |
|
Error-first callback |
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 |
|
OWL source name to query |
[options] |
|
Query options |
[options.prefLabelAlso] |
|
Match |
[options.filter] |
|
Extra SPARQL filter applied within each UNION branch |
callback |
|
Error-first callback |
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 |
|
OWL source name to query (or null with |
role |
|
Variable ( |
ids |
|
URI(s) restricting the chosen role |
[options] |
|
Query options |
[options.source] |
|
Override source (sets |
[options.graphUri] |
|
Explicit graph URI when no source is given |
[options.removeBlankNodesObjects] |
|
Exclude blank-node objects |
callback |
|
Error-first callback |
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 |
|
OWL source name to serialise |
[options] |
|
Query options |
[options.filter] |
|
Reserved filter (currently unused in the query body) |
callback |
|
Error-first callback |
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 |
|
OWL source name to query |
classIds |
|
Class URI(s) whose instances’ labels are fetched |
[options] |
|
Query options |
[options.otherProperty] |
|
Use this property instead of |
callback |
|
Error-first callback |
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 |
|
OWL source name to query |
allIds |
|
Individual URIs whose class types are fetched |
[options] |
|
Reserved options object |
callback |
|
Error-first callback |
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 |
|
OWL source name to query |
classIds |
|
Class URIs whose individuals are fetched |
[options] |
|
Reserved options object |
callback |
|
Error-first callback |
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 |
|
URI of the graph to clear |
callback |
|
Error-first callback |
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 |
|
Source name to copy the resource from |
toSource |
|
Destination source name |
subjectUri |
|
URI of the resource to copy |
callback |
|
Error-first callback |
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 |
|
Source name to query |
|
[resourcesIds] |
|
Ancestor resource URI(s) whose descendants are fetched |
|
[taxonomyPredicate] |
|
|
Predicate defining the parent relation |
[options] |
|
Query options |
|
[options.includeParent] |
|
Include the starting resource(s) ( |
|
[options.depth] |
|
Limit traversal to this depth ( |
|
[options.filter] |
|
Extra SPARQL filter appended to the query |
|
callback |
|
Error-first callback |
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 |
|
OWL source name whose subjects anchor the search |
filter |
|
SPARQL filter restricting the inner subjects |
callback |
|
Error-first callback |
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 |
|
OWL source name to transform |
skgGraphUri |
|
Target graph URI receiving the generated SKG triples |
callback |
|
Error-first callback |
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 |
|
OWL source name to query |
id |
|
URI of the resource whose label is fetched |
callback |
|
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 |
|
OWL source name to query |
nodeIds |
|
Node URI(s) to describe (matched on |
[options] |
|
Query options |
[options.returnQueryStr] |
|
Return the SPARQL query string instead of executing it |
callback |
|
Error-first callback |
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 |
|
Source name whose classes are retrieved |
[options] |
|
Build options |
[options.filter] |
|
Extra SPARQL clause appended to the query |
[options.withoutImports] |
|
Exclude imported graphs from the |
callback |
|
Error-first callback |
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.
-
.getTopConcepts(sourceLabel, options, callback) ⇒
err|Array.getNodeChildren(sourceLabel, words, ids, descendantsDepth, [options], callback) ⇒
err|Array.getCollectionNodes(sourceLabel, collection, [options], callback) ⇒
err|Array.getNodeParents(sourceLabel, words, ids, ancestorsDepth, [options], callback) ⇒
err|Array.getNodeInfos(sourceLabel, conceptId, [options], callback) ⇒
err|Array.getItems(sourceLabel, [options], callback) ⇒
err|Array.getSingleNodeAllGenealogy(sourceLabel, id, callback) ⇒
err|Array.getSingleNodeAllDescendants(sourceLabel, id, callback) ⇒
err|Array.getNodeLabel(sourceLabel, id, callback) ⇒
err|Array.getNodesAllTriples(sourceLabel, subjectIds, callback) ⇒
err|Array.deleteTriples(sourceLabel, subjectUri, predicateUri, objectUri, callback) ⇒
err|*.triplesObjectToString(item) ⇒
string.update(sourceLabel, triples, callback) ⇒
err|*.deleteGraph(sourceLabel, callback) ⇒
err|*.setBindingsOptionalProperties(bindings, _field, [options]) ⇒
Array.<Object>.getSourceLangsList(sourceLabel, callback) ⇒
err|Array
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 |
|
SKOS source name to query |
options |
|
Query options |
[options.noLang] |
|
Skip the preferred-language filter |
[options.filterCollections] |
|
Collection URI(s) the top concepts must belong to |
callback |
|
Error-first callback |
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 |
|
SKOS source name to query |
words |
|
Label word(s) identifying the parent; mutually exclusive with |
ids |
|
Parent concept URI(s) whose children are fetched |
descendantsDepth |
|
Number of |
[options] |
|
Query options |
[options.noLang] |
|
Skip the language filter on labels |
callback |
|
Error-first callback |
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 |
|
SKOS source name to query |
collection |
|
Collection URI whose member concepts are fetched (empty = all concepts) |
[options] |
|
Query options |
[options.filter] |
|
|
callback |
|
Error-first callback |
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 |
|
SKOS source name to query |
words |
|
Label word(s) identifying the start node; mutually exclusive with |
ids |
|
Start concept URI(s) whose ancestors are fetched |
ancestorsDepth |
|
Number of |
[options] |
|
Query options |
[options.noLang] |
|
Skip the language filter on labels |
[options.searchAltLabels] |
|
Also match |
[options.filterCollections] |
|
Exclude ancestors that are members of these collections |
[options.limit] |
|
Result limit (defaults to |
callback |
|
Error-first callback |
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 |
|
Source name to query |
conceptId |
|
Concept URI(s) to describe |
[options] |
|
Query options |
[options.propertyFilter] |
|
Restrict to these property URIs |
[options.getValuesLabels] |
|
Also fetch |
callback |
|
Error-first callback |
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 |
|
Source name to query |
[options] |
|
Query options |
[options.filter] |
|
Extra SPARQL pattern appended to the WHERE clause |
[options.filterCollections] |
|
Collection URI(s) the items must belong to |
callback |
|
Error-first callback |
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 |
|
Source name to query |
id |
|
Concept URI whose ancestors are fetched |
callback |
|
Error-first callback |
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 |
|
Source name to query |
id |
|
Concept URI whose descendants are fetched |
callback |
|
Error-first callback |
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 |
|
Source name to query |
id |
|
Concept URI whose label is fetched |
callback |
|
Error-first callback |
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 |
|
Source name to query |
subjectIds |
|
Subject URIs whose triples are fetched |
callback |
|
Error-first callback |
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 |
|
Source name whose graph is edited |
subjectUri |
|
Subject URI to match (optional) |
predicateUri |
|
Predicate URI to match (optional) |
objectUri |
|
Object URI to match (optional) |
callback |
|
Error-first callback |
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 |
|
Triple descriptor with |
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 |
|
Source name whose graph receives the triples |
triples |
|
Triple descriptor objects to insert |
callback |
|
Error-first callback |
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 |
|
Source name whose graph is edited |
triples |
|
Replacement triple descriptors (all sharing the same subject) |
callback |
|
Error-first callback |
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 |
|
Source name whose graph is emptied |
callback |
|
Error-first callback |
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 |
|
Source name whose graph is the copy origin |
toGraphUri |
|
Destination graph URI |
callback |
|
Error-first callback |
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 |
|
Result bindings to enrich in place |
_field |
|
Base variable name; indexed variants are processed until the first missing one |
[options] |
|
Enrichment options |
[options.type] |
|
Type URI to use instead of the default |
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 |
|
Source name to query |
callback |
|
Error-first callback |
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).
-
.getBindingsValues(bindings) ⇒
Array.<Object>.formatSparqlQuery(query) ⇒
string.setSparqlResultPropertiesLabels(sourceLabel, SparqlResults, propVariable, callback) ⇒
err|Array.getVariableLangLabel(variable, [optional], [skosPrefLabel], [filterStr]) ⇒
string.getUriFilter(varName, values) ⇒
string.formatString(str, [forUri]) ⇒
string.formatUrl(str) ⇒
string.getSourceGraphUrisMap(sourceLabel) ⇒
Object.<string, string>.getSourceFromUri(uri, [mainSource]) ⇒
string.getSourceFromGraphUri(graphUri, [mainSource]) ⇒
string|undefined.getLabelFromURI(id) ⇒
string|undefined.setFilterGraph(sourceLabel, filter) ⇒
string.getFromStr(sourceLabel, [named], [withoutImports], [options]) ⇒
string.getSparqlDate([date], [withHours]) ⇒
string.getSourceFromUriInDefaultServer(uri, callback) ⇒
err|string.getSpecificPredicates(options) ⇒
string.setDateRangeSparqlFilter(varName, startDate, [endDate], [options]) ⇒
string.setPrefixesInSelectQuery(query) ⇒
string.addBasicVocabulariesPrefixes(query) ⇒
string.getIntFromTypeLiteral(value) ⇒
number.getUriFromPrefixedName(prefixedName) ⇒
string|null.getPrefixedNameFromUri(uri) ⇒
string.getDefaultIndexedPredicates() ⇒
Array.getDefaultIndexedPredicateIdsMap() ⇒
Object.getIndexedPredicatesClauses([subjectVariableName], [options]) ⇒
Object
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 |
|
Source name used to read |
conceptName |
|
Variable name (without |
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 |
|
|
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 aFILTER(?var in (...))/FILTER(?var = ...)clause, or aVALUES ?var { ... }block whenoptions.valuesis set. URIs are deduplicated and capped at 100 entries; blank nodes are excluded fromVALUES(SPARQL 1.1 restriction).With
words: emits aFILTER(regex(?varLabel, "...", "i"))clause, or an exact-matchFILTER(?varLabel in (...))/ equality whenoptions.exactMatchis 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 |
|
Variable name(s) (without |
|
ids |
|
Identifier(s) to match; ignored when |
|
words |
|
Label word(s) to match by regex/exact match |
|
[options] |
|
Filter options |
|
[options.exactMatch] |
|
Match labels/ids exactly instead of by regex |
|
[options.values] |
|
Emit a |
|
[options.useFilterKeyWord] |
|
Force |
|
[options.labelSuffix] |
|
|
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 |
|
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 |
|
Source name queried for the property labels |
SparqlResults |
|
Result bindings to enrich in place |
propVariable |
|
Variable name holding the property URI (its label goes to |
callback |
|
Error-first callback |
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 |
|
Variable name (without |
[optional] |
|
Wrap the pattern in an |
[skosPrefLabel] |
|
Also match |
[filterStr] |
|
Existing filter string; if it references |
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 |
|
Variable name (without |
values |
|
URI/literal string(s), or a |
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 to escape |
[forUri] |
|
When true, also replace spaces/ |
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 to escape |
[forUri] |
|
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 |
|
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 |
|
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 |
|
Resource URI to resolve |
[mainSource] |
|
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 |
|
Graph URIs to look up |
mainSource |
|
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 |
|
Graph URI to resolve |
[mainSource] |
|
Source defining the import scope; when omitted, all sources are searched via the cached |
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 |
|
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 |
|
Source name whose |
filter |
|
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 |
|
Source name to scope the query to |
[named] |
|
Emit |
[withoutImports] |
|
Exclude imported graphs (defaults to |
[options] |
|
Extra scoping options |
[options.excludeImports] |
|
Import source names to skip |
[options.includeSources] |
|
Additional source names whose graphs to add |
[options.includeBasicVocabularies] |
|
Add every graph declared in |
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 to format; defaults to now |
[withHours] |
|
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 |
|
Resource URI to locate |
callback |
|
Error-first callback |
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 |
|
SPARQL string containing prefixed names |
prefixes |
|
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 |
|
Predicate options |
options.specificPredicates |
|
Predicate(s) to combine into the property path |
[options.memberPredicate] |
|
Append |
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 |
|
Variable name (without |
startDate |
|
Range start (mutated when |
[endDate] |
|
Range end; derived from |
[options] |
|
Filter options |
[options.precision] |
|
One of |
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 |
|
Property URI or name of the triple |
[object] |
|
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 |
|
SELECT query whose WHERE clause contains full |
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 |
|
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 |
|
Typed literal string (value optionally followed by |
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 |
|
Source name whose first 3 characters form the prefix |
uri |
|
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 |
|
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 |
|
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] |
|
|
SPARQL variable holding the indexed subject |
[options] |
|
Indexation options |
|
[options.indexedPredicates] |
|
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 |
|
One SPARQL result row |
variableNames |
|
Variable names returned by |
labels |
|
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).
-
.getSourceVariables(sourceLabel) ⇒
Object.getTopConcepts(sourceLabel, [options], callback) ⇒
err|Array.getNodeInfos(sourceLabel, conceptId, [options], callback) ⇒
err|Array.getItems(sourceLabel, [options], callback) ⇒
err|Array.getNodeChildren(sourceLabel, [words], [ids], descendantsDepth, [options], callback) ⇒
err|Array.getNodeParents(sourceLabel, [words], [ids], ancestorsDepth, [options], callback) ⇒
err|Array.getSingleNodeAllGenealogy(sourceLabel, id, callback) ⇒
err|Array.getSingleNodeAllDescendants(sourceLabel, id, callback) ⇒
err|Array.getNodeLabel(sourceLabel, id, callback) ⇒
err|Array.getEndPointAllGraphsMap([sparqlServerUrl], callback) ⇒
err|Object.getNodesAllTriples(sourceLabel, subjectIds, callback) ⇒
err|Array.deleteTriples(sourceLabel, subjectUri, predicateUri, object, callback) ⇒
err|*.triplesObjectToString(item) ⇒
string.getDefaultSparqlPrefixesStr() ⇒
string.insertTriples(sourceLabel, _triples, [options], callback) ⇒
err|*.deleteTriplesWithFilter(sourceLabel, filter, callback) ⇒
err|*.copyGraph(fromSourceLabel, toGraphUri, callback) ⇒
err|number.getDistinctPredicates(sourceLabel, [options], callback) ⇒
err|Array.copyNodes(fromSourceLabel, toGraphUri, sourceIds, [options], callback) ⇒
err|number.sortBindings(bindings, field, [_options]) ⇒
Array.<Object>.setMissingLabels(bindings, _fields, [options]) ⇒
Array.<Object>.setBindingsOptionalProperties(bindings, _fields, [options]) ⇒
Array.<Object>.getLangFilterStr(options, variable) ⇒
string.getSourceTaxonomy(sourceLabel, [options], callback) ⇒
err|Object.createDecapitalizedLabelTriples(sourceLabel, callback) ⇒
err|number.triplesToTurtle(triples) ⇒
void
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 |
|
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 |
|
Source name to query |
[options] |
|
Controller-specific options |
callback |
|
Error-first callback |
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 |
|
Source name to query |
conceptId |
|
URI(s) of the node(s) to describe |
[options] |
|
Controller-specific options |
callback |
|
Error-first callback |
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 |
|
Source name to query |
[options] |
|
Controller-specific options |
callback |
|
Error-first callback |
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 |
|
Source name to query |
[words] |
|
Label word(s) to match; mutually exclusive with |
[ids] |
|
Parent node URI(s) whose children are fetched |
descendantsDepth |
|
Depth of descendants to retrieve |
[options] |
|
Controller-specific options (merged with |
callback |
|
Error-first callback |
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 |
|
Source name to query |
[words] |
|
Label word(s) to match; mutually exclusive with |
[ids] |
|
Child node URI(s) whose ancestors are fetched |
ancestorsDepth |
|
Depth of ancestors to retrieve |
[options] |
|
Controller-specific options (merged with |
callback |
|
Error-first callback |
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 |
|
Source name to query |
id |
|
URI of the node whose ancestors are fetched |
callback |
|
Error-first callback |
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 |
|
Source name to query |
id |
|
URI of the node whose descendants are fetched |
callback |
|
Error-first callback |
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 |
|
Source name to query |
id |
|
URI of the node whose label is fetched |
callback |
|
Error-first callback |
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] |
|
Endpoint URL to query; defaults to the main server |
callback |
|
Error-first callback |
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 |
|
Source name to query |
subjectIds |
|
Subject URIs whose triples are fetched |
callback |
|
Error-first callback |
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 |
|
Source name whose graph is edited |
subjectUri |
|
Subject URI to match (optional) |
predicateUri |
|
Predicate URI to match (optional) |
object |
|
Object to match: a URI/literal string or a literal descriptor (optional) |
callback |
|
Error-first callback |
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 |
|
Triple descriptor with |
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 |
|
Source name whose graph receives the triples (may be null if |
_triples |
|
Triple descriptor objects to insert |
[options] |
|
Insert options |
[options.graphUri] |
|
Target graph URI when no |
[options.sparqlPrefixes] |
|
Prefix map used to expand prefixed names before insertion |
[options.getSparqlOnly] |
|
Return the generated INSERT query instead of executing it |
callback |
|
Error-first callback |
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 |
|
Source name whose graph is edited |
filter |
|
SPARQL filter expression selecting the triples to delete; empty deletes all (after confirmation) |
callback |
|
Error-first callback |
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 |
|
Source name whose graph is the copy origin |
toGraphUri |
|
Destination graph URI |
callback |
|
Error-first callback |
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 |
|
Source name to query |
[options] |
|
Reserved options object |
callback |
|
Error-first callback |
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 |
|
Source name the nodes come from |
toGraphUri |
|
Destination graph URI |
sourceIds |
|
URIs of the nodes to copy |
[options] |
|
Copy options |
[options.keepOriginalUris] |
|
Reuse source URIs instead of minting new ones |
[options.addExactMatchPredicate] |
|
Add an exactMatch/sameAs link back to the source node |
[options.setParentNode] |
|
|
[options.properties] |
|
Only copy these property URIs |
[options.excludedProperties] |
|
Skip these property URIs |
[options.additionalTriplesNt] |
|
Extra N-Triples strings to insert |
[options.setSubjectFn] |
|
Hook to mutate each item’s subject |
[options.setPredicateFn] |
|
Hook to mutate each item’s predicate |
[options.setObjectFn] |
|
Hook to mutate each item’s object |
callback |
|
Error-first callback |
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 |
|
Result bindings to sort |
field |
|
Variable name to sort by ( |
[_options] |
|
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 |
|
Result bindings to enrich in place |
_fields |
|
Variable name(s) whose labels to backfill |
[options] |
|
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, field1 … field4) 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 |
|
Result bindings to enrich in place |
_fields |
|
Base variable name(s); indexed variants 0–4 are processed |
[options] |
|
Enrichment options |
[options.noType] |
|
Do not add |
[options.type] |
|
Type URI to use instead of the default |
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 |
|
Filter options |
[options.lang] |
|
BCP-47 language code to keep (alongside untagged literals); no filter emitted when absent |
variable |
|
SPARQL variable expression (including |
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 |
|
Source name whose taxonomy is built |
[options] |
|
Build options |
[options.ids] |
|
Restrict to these subject URIs (adds a |
[options.filter] |
|
Extra SPARQL filter appended to the hierarchy query |
[options.parentType] |
|
Parent predicate to use when the schema type is unrecognised |
[options.withoutImports] |
|
Exclude imported graphs from the |
callback |
|
Error-first callback |
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 |
|
Source name to process |
callback |
|
Error-first callback |
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 |
|
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.
-
.querySPARQL_GET_proxy(url, query, queryOptions, options, callback) ⇒
err|Object.exportGraph(sourceLabel) ⇒
void.executeAsyncQuery(url, query, queryOptions, options) ⇒
Promise.<Object>.addFromLabelsGraphToQuery(query) ⇒
string
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 |
|
URL of the SPARQL endpoint to query ( |
query |
|
SPARQL query string to execute (SELECT, ASK, CONSTRUCT, INSERT, DELETE) |
queryOptions |
|
Extra URL parameters appended to the endpoint URL |
options |
|
Execution options |
[options.source] |
|
Source name used to look up |
[options.acceptHeader] |
|
Overrides the |
[options.dontCacheCurrentQuery] |
|
When true, does not store the query in |
[options.caller] |
|
Key under which the query body is pushed into |
callback |
|
Error-first callback |
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 |
|
Source name whose |
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 |
|
URL of the SPARQL endpoint to query |
query |
|
SPARQL query string to execute |
queryOptions |
|
Extra URL parameters appended to the endpoint URL |
options |
|
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 |
|
SPARQL query to augment |
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.
saveVisjsModelGraph([callback])#
Saves the current Vis.js graph model.
Kind: global function
Param |
Type |
Description |
|---|---|---|
[callback] |
|
Callback function called after saving |