  We present a method for the construction of SHACL or ShEx constraints for an
existing RDF dataset. It has two components that are used conjointly: an
algorithm for automatic schema construction, and an interactive workflow for
editing the schema. The schema construction algorithm takes as input sets of
sample nodes and constructs a shape constraint for every sample set. It can be
parametrized by a schema pattern that defines structural requirements for the
schema to be constructed. Schema patterns are also used to feed the algorithm
with relevant information about the dataset coming from a domain expert or from
some ontology. The interactive workflow provides useful information about the
dataset, shows validation results w.r.t. the schema under construction, and
offers schema editing operations that combined with the schema construction
algorithm allow to build a complex ShEx or SHACL schema.
