Validator

case class Validator(schema: ResolvedSchema, externalResolver: ExternalResolver, builder: RDFBuilder) extends ShExChecker with ShowValidator

ShEx validator

Companion
object
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Type members

Types

type NodeChecker = Attempt => RDFNode => CheckTyping
type NodeShapeChecker = (RDFNode, Shape) => CheckTyping

Inherited types

type Base[A] = IndexedReaderWriterStateT[[A] =>> IO[A], ConfigEnv, Log, State, State, A]
Inherited from
ShExChecker
type Check[A] = EitherT[Base, Err, A]
Inherited from
ShExChecker
Inherited from
ShExChecker
type Env = Context
Inherited from
ShExChecker
type Err = ShExError
Inherited from
ShExChecker
type Evidence = (NodeShape, String)
Inherited from
ShExChecker
Inherited from
ShExChecker

Value members

Concrete methods

def runValidator(chk: Check[ShapeTyping], rdf: RDFReader, verbose: Boolean): IO[Result]

Execute the validator with a given checker param chk Checker param rdf RDFReader verbose boolean flag to show internal messages

Execute the validator with a given checker param chk Checker param rdf RDFReader verbose boolean flag to show internal messages

def validateNodeDecls(rdf: RDFReader, verbose: Boolean): IO[Result]

Validate a node following target declarations. This methods follows SHACL convention and could be deprecated in the future

Validate a node following target declarations. This methods follows SHACL convention and could be deprecated in the future

def validateNodeShape(rdf: RDFReader, node: IRI, shape: String, verbose: Boolean): IO[Result]

Validate a node against a shape

Validate a node against a shape

def validateNodeStart(rdf: RDFReader, node: IRI, verbose: Boolean): IO[Result]

Validate a node against the START declaration

Validate a node against the START declaration

def validateShapeMap(rdf: RDFReader, shapeMap: FixedShapeMap, verbose: Boolean): IO[Result]

Validate a node against a shape map

Validate a node against a shape map

Inherited methods

def addAction2Log(a: Action): Check[Unit]
Inherited from
ShExChecker
def addEvidence(nodeShape: NodeShape, msg: String): Check[ShapeTyping]
Inherited from
ShExChecker
def addLog(log: Log): Check[Unit]
Inherited from
ShExChecker
def addNotEvidence(nodeShape: NodeShape, e: ShExError, msg: String): Check[ShapeTyping]
Inherited from
ShExChecker
def attempt[A](c: Check[A]): Check[Either[Err, A]]
Inherited from
ShExChecker
def bind[A, Other](c1: Check[Other], c2: Check[A]): Check[A]
Inherited from
ShExChecker
def checkAll[A](xs: List[Check[A]]): Check[List[A]]

Checks all elements in a list If any of the elements fails, it fails

Checks all elements in a list If any of the elements fails, it fails

Inherited from
ShExChecker
def checkAllFailFAtFirstFlag[A, B, F[_]](ls: => LazyList[A], check: A => F[(B, Boolean)], last: => B)(implicit evidence$5: Monoid[B], evidence$6: Monad[F]): F[(B, Boolean)]
Inherited from
ShExChecker
def checkAllFlag[A, B, F[_]](ls: => LazyList[A], check: A => F[(B, Boolean)], last: => B)(implicit evidence$3: Monoid[B], evidence$4: Monad[F]): F[(B, Boolean)]
Inherited from
ShExChecker
def checkCond(condition: Boolean, attempt: Attempt, error: ShExError, evidence: String): CheckTyping
Inherited from
ShExChecker
def checkList[A, B](ls: List[A], check: A => Check[B]): Check[List[B]]
Inherited from
ShExChecker
def checkLs[A](cs: List[Check[A]]): Check[List[A]]

Given a list of checks, return the list of values that pass It never fails (in case of failure, it ignores the value)

Given a list of checks, return the list of values that pass It never fails (in case of failure, it ignores the value)

Inherited from
ShExChecker
def checkOneOf[A](cs: List[Check[A]], errNone: Err, errMoreThanOne: List[A] => Err): Check[A]
Inherited from
ShExChecker
def checkPair1st[A, B](p: (Check[A], B)): Check[(A, B)]
Inherited from
ShExChecker
def checkPair2nd[A, B](p: (A, Check[B])): Check[(A, B)]
Inherited from
ShExChecker
def checkSequenceFlag[A, F[_]](ls: => List[F[(A, Boolean)]], last: A)(implicit evidence$7: Monoid[A], evidence$8: Monad[F]): F[(A, Boolean)]
Inherited from
ShExChecker
def checkSome[A](cs: LazyList[Check[A]])(implicit ev: Monoid[Err]): Check[A]
Inherited from
ShExChecker
def checkSome[A](cs: List[Check[A]], errorIfNone: Err): Check[A]
Inherited from
ShExChecker
def checkSomeFlag[A, B, F[_]](ls: => LazyList[A], check: A => F[(B, Boolean)], last: F[(B, Boolean)])(implicit evidence$1: Monad[F]): F[(B, Boolean)]

Given a computation check that returns a pair of value and a flag, returns the first value whose flag is true If none is true, returns the value of the computation parameter last

Given a computation check that returns a pair of value and a flag, returns the first value whose flag is true If none is true, returns the value of the computation parameter last

Inherited from
ShExChecker
def checkSomeFlagCount[A, B](ls: => LazyList[A], check: A => Check[(B, Boolean)], last: B)(implicit evidence$2: Monoid[B]): Check[(B, Int)]
Inherited from
ShExChecker
def checkSomeFlagValue[A, B](ls: => LazyList[A], check: A => Check[B], last: Check[B]): Check[(B, Option[A])]
Inherited from
ShExChecker
def checkSomeLazyList[A](cs: LazyList[Check[A]], errIfNone: => Err): Check[A]
Inherited from
ShExChecker
Inherited from
ShExChecker
def cond[A, B](check: Check[A], thenPart: A => Check[B], elsePart: Err => Check[B]): Check[B]

Attempts to execute a check If it fails, applies thenPart to the result, otherwise applies elsePart to the error

Attempts to execute a check If it fails, applies thenPart to the result, otherwise applies elsePart to the error

Type Params
A

type returned by the computation

B

type returned the the condition

Value Params
check

Computation to check

elsePart

part to be executed when the check fails

thenPart

part to be executed when it passes

Inherited from
ShExChecker
def condFlag[A, B](check: Check[A], thenPart: A => Check[B], elsePart: Err => Check[B]): Check[(B, Boolean)]
Inherited from
ShExChecker
def err[A](e: Err): Check[A]
Inherited from
ShExChecker
def errStr[A](msg: String): Check[A]
Inherited from
ShExChecker
def filterSuccess[A, B](ls: List[A], check: A => Check[B]): Check[List[(A, B)]]

Returns the list of values whose computation is successful

Returns the list of values whose computation is successful

Type Params
A

type of values

B

type returned by computation

Value Params
check

computation to check for each value

ls

list of values

Returns

a computation with a list of pairs for whom the computation was successful

Inherited from
ShExChecker
def fromBase[A](b: Base[A]): Check[A]
Inherited from
ShExChecker
def fromEither[A](e: Either[Err, A]): Check[A]
Inherited from
ShExChecker
def fromEitherIO[A](e: EitherT[[A] =>> IO[A], Err, A]): Check[A]
Inherited from
ShExChecker
def fromEitherIOS[A](e: EitherT[[A] =>> IO[A], String, A]): Check[A]
Inherited from
ShExChecker
def fromEitherString[A](e: Either[String, A]): Check[A]
Inherited from
ShExChecker
def fromIO[A](io: IO[A]): Check[A]
Inherited from
ShExChecker
def fromIOUnsafe[A](io: IO[A]): Check[A]
Inherited from
ShExChecker
def fromStream[A](s: Stream[[A] =>> IO[A], A]): Check[List[A]]
Inherited from
ShExChecker
Inherited from
ShExChecker
Inherited from
ShExChecker
def getNeighPaths(node: RDFNode, paths: List[Path]): Check[Neighs]
Inherited from
ShExChecker
def getNeighs(node: RDFNode): Check[Neighs]
Inherited from
ShExChecker
def getNodesPrefixMap: Check[PrefixMap]
Inherited from
ShExChecker
def getNotAllowedPredicates(node: RDFNode, paths: List[Path], neighs: Neighs): Check[Set[IRI]]
Inherited from
ShExChecker
def getPaths(s: Shape, schema: ResolvedSchema): Check[List[Path]]
Inherited from
ShExChecker
def getRDF: Check[RDFReader]
Inherited from
ShExChecker
def getTargetNodeDeclarations(rdf: RDFReader): Check[List[(RDFNode, ShapeLabel)]]
Inherited from
ShExChecker
def getValuesPath(node: RDFNode, path: Path): Check[Set[RDFNode]]
Inherited from
ShExChecker
def getVerbose: Check[Boolean]
Inherited from
ShExChecker
Inherited from
ShExChecker
def info(msg: String): Check[Unit]
Inherited from
ShExChecker
def infoTyping(t: ShapeTyping, msg: String, shapesPrefixMap: PrefixMap): Check[Unit]
Inherited from
ShExChecker
def local[A](f: Env => Env)(comp: Check[A]): Check[A]
Inherited from
ShExChecker
def mkErr[F[_]](e: Err)(implicit evidence$9: Applicative[F]): F[Err]
Inherited from
ShExChecker
def mkLabel(label: ShapeMapLabel): ShapeLabel
Inherited from
ShExChecker
def mkSeq[A, B](vs: List[A], f: A => IO[List[B]]): IO[List[B]]
Inherited from
ShExChecker
def ok[A](x: A): Check[A]
Inherited from
ShExChecker
def optCheck[A, B](c: Option[A], check: A => Check[B], default: => Check[B]): Check[B]

If c is some value, applies check, otherwise applies default

If c is some value, applies check, otherwise applies default

Value Params
c

Optional value

check

check function

default

value in case there is no option

Inherited from
ShExChecker
def orElse[A](c1: Check[A], c2: => Check[A]): Check[A]
Inherited from
ShExChecker
def productElementNames: Iterator[String]
Inherited from
Product
def productIterator: Iterator[Any]
Inherited from
Product
def run[A](c: Check[A])(config: Config)(env: Env): IO[(Log, Either[Err, A])]
Inherited from
ShExChecker
def runCheck[A](c: Check[A], rdf: RDFReader, verbose: Boolean)(implicit evidence$10: Show[A]): IO[CheckResult[ShExError, A, Log]]
Inherited from
ShExChecker
def runLocal[A](c: Check[A], f: Env => Env): Check[A]
Inherited from
ShExChecker
def runLocalNeighs[A](c: Check[A], node: RDFNode, neighs: Neighs): Check[A]
Inherited from
ShExChecker
def runLocalSafe[A](c: Check[A], f: Env => Env, safe: (Err, Env) => A): Check[A]

Run a computation in a local environment. If the computation fails, return the result of calling safe function over the current environment

Run a computation in a local environment. If the computation fails, return the result of calling safe function over the current environment

Value Params
c

computation to run

f

environment

safe

function to call if the computation fails

Inherited from
ShExChecker
def runLocalSafeTyping[A](c: Check[A], f: ShapeTyping => ShapeTyping, safe: (Err, ShapeTyping) => A): Check[A]
Inherited from
ShExChecker
Inherited from
ShExChecker
def sequence[A](xs: List[Check[A]]): Check[List[A]]
Inherited from
ShExChecker
def showCurrentTyping(msg: String, shapesPrefixMap: PrefixMap): Check[Unit]
Inherited from
ShExChecker
def validateCheck(condition: Boolean, e: Err): Check[Unit]
Inherited from
ShExChecker

Inherited fields

lazy val ignoredPathsClosed: List[Path]
Inherited from
ShExChecker

Implicits

Inherited implicits

implicit lazy val showAttempt: Show[Attempt]
Inherited from
ShowValidator
implicit lazy val showIRI: Show[IRI]
Inherited from
ShowValidator
implicit lazy val showPath: Show[Path]
Inherited from
ShowValidator
implicit lazy val showRDFNode: Show[RDFNode]
Inherited from
ShowValidator
implicit lazy val showRDFTriple: Show[RDFTriple]
Inherited from
ShowValidator
implicit lazy val showShapeLabel: Show[ShapeLabel]
Inherited from
ShowValidator