Module: RDF::Oxigraph::SHACL

Defined in:
lib/rdf/oxigraph/shacl.rb

Overview

In-process SHACL validation, backed by the rudof shacl engine in the native extension. Decoupled from the store via serialized strings.

Defined Under Namespace

Classes: Report

Class Method Summary collapse

Class Method Details

.validate(data:, shapes:, data_format: :turtle, shapes_format: :turtle) ⇒ Object

Validate a data graph against SHACL shapes. Both data and shapes are strings of serialized RDF (default Turtle), or anything that responds to #to_s. Returns a Report.



11
12
13
14
15
16
# File 'lib/rdf/oxigraph/shacl.rb', line 11

def validate(data:, shapes:, data_format: :turtle, shapes_format: :turtle)
  raw = RDF::Oxigraph.shacl_validate(
    data.to_s, data_format.to_s, shapes.to_s, shapes_format.to_s
  )
  Report.new(raw)
end