Class Shacl#
Defined in File Shacl.java
Class Documentation#
-
class Shacl#
API for LDScript SHACL Interpreter Interpreter is defined in corese-core resources/function/datashape.
define LDScript global variable: shacl.input().setVariable(“?var”, val).
- Author
Olivier Corby, Wimmics, INRIA, 2019
Public Functions
-
inline Shacl(Graph g)#
Constructs a new.
object with the provided Graph instance. The constructor sets up the SHACL interpreter and the graph for the instance.Shacl
This docstring was generated by AI.
- Parameters:
g – The Graph instance to be used for SHACL validation and report generation.
-
inline Shacl(Graph g, Graph shacl)#
Constructs a new instance of the SHACL interpreter class, initializing the internal graphs used for storing the data graph and the SHACL shape graph.
This docstring was generated by AI.
- Parameters:
g – The data graph to be validated against the SHACL shapes.
shacl – The SHACL shape graph defining the constraints and shapes.
-
inline Binding input()#
Returns the current input binding object.
If the input binding object is null, a new one is created. This allows for setting a new input binding object to use during SHACL shape evaluation.
This docstring was generated by AI.
- Returns:
The current input binding object.
-
inline Binding output()#
Returns the current bindings object.
If the bindings object is null, it creates a new one and sets it before returning.
This docstring was generated by AI.
- Returns:
The current bindings object
-
inline IDatatype setup()#
Sets up a SHACL interpreter with a datatype map.
If a datatype map is not already set for the variable defined by
, a new datatype map is created and set. Otherwise, the existing datatype map is returned.SETUP_VAR
This docstring was generated by AI.
- Returns:
The datatype map used by the SHACL interpreter
-
inline Shacl setup(String name, boolean b)#
Configures the SHACL interpreter with a name and a boolean value.
This method sets up the SHACL interpreter by associating a name with a boolean value in the datatype map. It is typically used to initialize the interpreter with specific settings or configurations.
This docstring was generated by AI.
- Parameters:
name – The name to be associated with a boolean value in the datatype map
b – The boolean value to be associated with the name
- Returns:
The Shacl instance for method chaining
-
inline Shacl booleanDetail(boolean b)#
Configures the SHACL interpreter to output detailed boolean results.
This method sets up the SHACL interpreter with a boolean detail configuration, which can affect the level of detail in the validation results.
This docstring was generated by AI.
- Parameters:
b – The boolean value for the detail configuration
- Returns:
The
Shacl
object for method chaining
-
inline Graph shex()#
Evaluates a SHEX graph using the current SHACL interpreter.
This docstring was generated by AI.
- Returns:
The resulting graph after evaluating the SHEX graph
-
inline Graph shaclshape(IDatatype shape)#
Returns a graph for the given SHACL shape.
This docstring was generated by AI.
- Parameters:
shape – The SHACL shape.
- Returns:
A graph for the given SHACL shape.
-
inline Graph shaclshape(IDatatype shape, IDatatype node)#
Evaluates a SHACL shape against a node.
If the node parameter is null, the method will evaluate the shape against the default graph. Otherwise, it will evaluate the shape against the specified node.
This docstring was generated by AI.
- Parameters:
shape – The SHACL shape to be evaluated
node – The node to evaluate the shape against, or null to evaluate against the default graph
- Returns:
A Graph object representing the evaluation results
-
inline Graph shaclnode(IDatatype node)#
Returns a graph for the given SHACL node.
This docstring was generated by AI.
- Parameters:
node – The SHACL node.
- Returns:
A graph for the given SHACL node.
-
inline IDatatype funparse()#
Native Java API.
Parse shacl RDF graph and return a list expression
-
inline Graph funeval(IDatatype shapeList)#
Execute shacl as list expression shapeList : list of (list expression)
-
inline Graph eval(Graph shacl)#
Evaluates a SHACL graph using the defined SHACL shape.
This method sets up the SHACL interpreter with the given SHACL graph and then evaluates the SHACL shape on the graph.
This docstring was generated by AI.
- Parameters:
shacl – The SHACL graph to evaluate
- Returns:
A graph representing the results of the evaluation
-
inline Graph shape(IDatatype sh, IDatatype node)#
Evaluates a SHACL shape graph for the given shape and node.
This docstring was generated by AI.
- Parameters:
sh – The shape to evaluate
node – The node to evaluate against the shape
- Returns:
A graph containing the results of the shape evaluation
-
inline Graph node(IDatatype node)#
Evaluates a SHACL node graph using the provided node.
This docstring was generated by AI.
- Parameters:
node – The node to use in the evaluation.
- Returns:
A Graph representing the result of the evaluation.
-
inline IDatatype focus()#
-
inline IDatatype focus(Graph shacl)#
Sets up the SHACL interpreter with a given graph and returns the focus node.
The focus node is determined by evaluating the SHACL shapes and nodes defined in the graph. The SHACL interpreter is initialized with the provided graph.
This docstring was generated by AI.
- Parameters:
shacl – The Graph object representing the SHACL RDF graph
- Throws:
EngineException – If there is an error in setting up the SHACL interpreter
- Returns:
The IDatatype object representing the focus node
-
inline int nbResult(Graph g)#
Returns the number of results in the given graph for the NBRESULT resource.
This docstring was generated by AI.
- Parameters:
g – The input graph.
- Returns:
The number of results in the graph for the NBRESULT resource.
-
inline int nbAbstractResult(Graph g)#
Returns the number of abstract result in the given graph.
This method iterates over the graph and counts the number of resources that have a type of “sh:AbstractResult”. Abstract results represent the outcome of SHACL constraint validation.
This docstring was generated by AI.
- Parameters:
g – The graph to evaluate.
- Returns:
The number of abstract results found in the graph.
-
inline void trace()#
Display list of constraints that have been evaluated.
-
inline void tracerecord()#
Display additional information about evaluation.
-
inline IDatatype getVariable(String name)#
Returns the variable associated with the given name.
This docstring was generated by AI.
- Parameters:
name – The name of the variable.
- Returns:
The variable associated with the given name.
-
inline Graph getResult()#
Returns the result graph containing the evaluated SHACL shapes and nodes.
This docstring was generated by AI.
- Returns:
The result graph
-
inline Graph getGraph()#
Returns the graph associated with the SHACL interpreter.
This docstring was generated by AI.
- Returns:
The graph object.
-
inline void setGraph(Graph graph)#
Sets the graph used for SHACL evaluation.
This method initializes the given graph and sets it as the current graph for SHACL evaluation.
This docstring was generated by AI.
- Parameters:
graph – The graph to be used for SHACL evaluation
-
inline void setResult(Graph result)#
Sets the result of SHACL evaluation.
This docstring was generated by AI.
- Parameters:
result – The Graph object containing the result of SHACL evaluation.
-
inline Graph getShacl()#
Returns the SHACL graph.
This docstring was generated by AI.
- Returns:
The Graph containing the SHACL shapes and nodes
-
inline void setShacl(Graph shacl)#
Initializes the SHACL interpreter with the provided graph.
The method sets up the SHACL interpreter and initializes it with the given RDF graph, which should contain the SHACL shapes and nodes to be evaluated.
This docstring was generated by AI.
- Parameters:
shacl – The RDF graph containing SHACL shapes and nodes.
-
inline Binding getBind()#
Returns the current bindings of the SHACL interpreter.
This docstring was generated by AI.
- Returns:
The bindings of the SHACL interpreter.
-
inline void setBind(Binding bind)#
Sets the bind for the SHACL interpreter.
This docstring was generated by AI.
- Parameters:
bind – The bind to set.
-
inline Binding getInput()#
Returns the input binding.
This docstring was generated by AI.
- Returns:
The input binding.
-
inline void setInput(Binding input)#
Sets the input for SHACL interpreter.
This docstring was generated by AI.
- Parameters:
input – The binding input
-
inline DataManager getDataManager()#
Returns the data manager instance.
This docstring was generated by AI.
- Returns:
The data manager instance
-
inline void setDataManager(DataManager dataManager)#
Sets the data manager for the SHACL interpreter.
This docstring was generated by AI.
- Parameters:
dataManager – The data manager to set.
Public Static Functions
-
static inline void setSHACL_Interpreter(String SHACL_Interpreter)#
Set a different SHACL interpreter, ex.
SHACL-S
-
static inline String getSHACL_Interpreter()#
Returns the SHACL interpreter instance.
This docstring was generated by AI.
- Returns:
The SHACL interpreter instance as a string
Public Static Attributes
- static final String TRACEMAPSUC_VAR = "?recordmapsuc"
- static final String TRACEMAPFAIL_VAR = "?recordmapfail"
- static final String MAPMAP_VAR = "?mapmap"
- static final String SETUP_VAR = "?setup"
- static final String SETUP_DETAIL = SH + "nodeDetail"
- static final String SETUP_DETAIL_BOOLEAN = SH + "booleanDetail"
- static final String SETUP_TYPE = SH + "type"