diff --git a/build.sbt b/build.sbt index fbe5b0380..d683e723a 100644 --- a/build.sbt +++ b/build.sbt @@ -87,12 +87,12 @@ lazy val kindProjector = "org.spire-math" %% "kind-projector" % kind lazy val shaclex = project .in(file(".")) - .enablePlugins(ScalaUnidocPlugin, SbtNativePackager, WindowsPlugin, JavaAppPackaging,BuildInfoPlugin) + .enablePlugins(ScalaUnidocPlugin, SbtNativePackager, WindowsPlugin, JavaAppPackaging) .disablePlugins(RevolverPlugin) - .settings( +// .settings( // buildInfoKeys := BuildInfoKey.ofN(name, version, scalaVersion, sbtVersion), - buildInfoPackage := "es.weso.shaclex.buildinfo" - ) +// buildInfoPackage := "es.weso.shaclex.buildinfo" +// ) .settings(commonSettings, packagingSettings, publishSettings, ghPagesSettings, wixSettings) .aggregate(schema, shacl, shex, manifest, srdfJena, srdf, utils, converter, rbe, typing, validating, server, shapeMaps, depGraphs) .dependsOn(schema, shacl, shex, manifest, srdfJena, srdf, utils, converter, rbe, typing, validating, server, shapeMaps, depGraphs) diff --git a/modules/manifest/src/main/scala/es/weso/manifest/Manifest.scala b/modules/manifest/src/main/scala/es/weso/manifest/Manifest.scala index fb8fe8b41..daefc3b10 100644 --- a/modules/manifest/src/main/scala/es/weso/manifest/Manifest.scala +++ b/modules/manifest/src/main/scala/es/weso/manifest/Manifest.scala @@ -6,7 +6,7 @@ case class Manifest( label: Option[String], comment: Option[String], entries: List[Entry], - includes: List[(IRI, Option[Manifest])]) + includes: List[(RDFNode, Manifest)]) object Manifest { def empty: Manifest = Manifest(None, None, List(), List()) @@ -15,7 +15,7 @@ object Manifest { case class Entry( node: RDFNode, entryType: EntryType, - name: String, + name: Option[String], action: ManifestAction, result: Result, status: Status, @@ -30,9 +30,6 @@ final case object Validate extends EntryType { final case object MatchNodeShape extends EntryType { override def iri = sht_MatchNodeShape } -final case object ValidationTest extends EntryType { - override def iri = sht_ValidationTest -} final case object ValidationFailure extends EntryType { override def iri = sht_ValidationFailure } @@ -91,14 +88,7 @@ sealed trait Result { val isValid: Boolean } -final case class ValidResult( - validatedPairs: List[ValidPair]) extends Result { - override val isValid = true -} - -final case class NotValidResult( - report: ValidationReport, - validatedPairs: Set[ValidPair]) extends Result { +final case class ReportResult(report: ValidationReport) extends Result { override val isValid = false } @@ -136,3 +126,4 @@ final case class ViolationError( value: Option[RDFNode]) final case class Status(value: IRI) + diff --git a/modules/manifest/src/main/scala/es/weso/manifest/ManifestPrefixes.scala b/modules/manifest/src/main/scala/es/weso/manifest/ManifestPrefixes.scala index 0ea50df38..7e61525f1 100644 --- a/modules/manifest/src/main/scala/es/weso/manifest/ManifestPrefixes.scala +++ b/modules/manifest/src/main/scala/es/weso/manifest/ManifestPrefixes.scala @@ -6,7 +6,7 @@ object ManifestPrefixes { lazy val mf = IRI("http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#") lazy val qt = IRI("http://www.w3.org/2001/sw/DataAccess/tests/test-query#") - lazy val sht = IRI("http://www.w3.org/ns/shacl/test-suite#") + lazy val sht = IRI("http://www.w3.org/ns/shacl-test#") lazy val dc = IRI("http://purl.org/dc/elements/1.1/") lazy val dawgt = IRI("http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#") lazy val rdfs = IRI("http://www.w3.org/2000/01/rdf-schema#") @@ -30,6 +30,7 @@ object ManifestPrefixes { lazy val sh_sourceShape = sh + "sourceConstraintComponent" lazy val sh_value = sh + "value" lazy val sh_result = sh + "result" + lazy val sh_ValidationReport = sh + "ValidationReport" lazy val rdfs_label = rdfs.add("label") lazy val rdfs_comment = rdfs.add("comment") @@ -49,7 +50,6 @@ object ManifestPrefixes { lazy val sht_shape = sht.add("shape") lazy val sht_details = sht + "details" lazy val sht_pair = sht + "pair" - lazy val sht_validationReport = sht + "validationReport" lazy val sht_validatedPairs = sht + "validatedPairs" lazy val sht_Valid = sht + "Valid" lazy val sht_NotValid = sht + "NotValid" diff --git a/modules/manifest/src/main/scala/es/weso/manifest/RDF2Manifest.scala b/modules/manifest/src/main/scala/es/weso/manifest/RDF2Manifest.scala index c72db3ac9..0a6665da4 100644 --- a/modules/manifest/src/main/scala/es/weso/manifest/RDF2Manifest.scala +++ b/modules/manifest/src/main/scala/es/weso/manifest/RDF2Manifest.scala @@ -1,38 +1,39 @@ package es.weso.manifest import es.weso.rdf.nodes._ -import es.weso.rdf._ import scala.util._ import es.weso.rdf._ import ManifestPrefixes._ import es.weso.rdf.parser.RDFParser import es.weso.rdf.jena.RDFAsJenaModel import es.weso.utils.FileUtils._ +import cats._ +import cats.implicits._ -case class RDF2ManifestException(msg: String) - extends Exception(msg) - -trait RDF2Manifest - extends RDFParser { +case class RDF2Manifest(base: Option[IRI], + derefIncludes: Boolean) extends RDFParser { - def rdf2Manifest( - rdf: RDFReader, - derefIncludes: Boolean): Either[String, List[Manifest]] = { + def rdf2Manifest(rdf: RDFReader, + visited: List[RDFNode] = List() + ): Either[String, List[Manifest]] = { val candidates = subjectsWithType(mf_Manifest, rdf).toList - parseNodes(candidates, manifest(derefIncludes))(rdf) + parseNodes(candidates, manifest(List()))(rdf) } - def manifest(derefIncludes: Boolean): RDFParser[Manifest] = { (n, rdf) => + def manifest(visited: List[IRI]): RDFParser[Manifest] = { (n, rdf) => for { maybeLabel <- stringFromPredicateOptional(rdfs_label)(n, rdf) maybeComment <- stringFromPredicateOptional(rdfs_comment)(n, rdf) entries <- entries(n, rdf) - includes <- includes(derefIncludes)(n, rdf) - } yield Manifest( - label = maybeLabel, - comment = maybeComment, - entries = entries.toList, - includes = includes) + includes <- includes(visited)(n, rdf) + } yield { + println(s"Manifest read. Entries: $entries\nIncludes: $includes") + Manifest( + label = maybeLabel, + comment = maybeComment, + entries = entries.toList, + includes = includes) + } } def entries: RDFParser[Seq[Entry]] = @@ -41,7 +42,6 @@ trait RDF2Manifest def getEntryType(node: RDFNode): Either[String, EntryType] = { node match { case `sht_Validate` => Right(Validate) - case `sht_ValidationTest` => Right(ValidationTest) case `sht_ValidationFailure` => Right(ValidationFailure) case `sht_MatchNodeShape` => Right(MatchNodeShape) case `sht_WellFormedSchema` => Right(WellFormedSchema) @@ -55,7 +55,7 @@ trait RDF2Manifest for { entryTypeUri <- rdfType(n, rdf) entryType <- getEntryType(entryTypeUri) - name <- stringFromPredicate(mf_name)(n, rdf) + maybeName <- stringFromPredicateOptional(mf_name)(n, rdf) actionNode <- objectFromPredicate(mf_action)(n, rdf) action <- action(actionNode, rdf) resultNode <- objectFromPredicate(mf_result)(n, rdf) @@ -65,7 +65,7 @@ trait RDF2Manifest } yield Entry( node = n, entryType = entryType, - name = name, + name = maybeName, action = action, result = result, status = Status(statusIri), @@ -110,15 +110,6 @@ trait RDF2Manifest shape = shape) } - /* def maybeResult: (Option[RDFNode],RDFReader) => Try[Result] = { (m,rdf) =>{ - println(s"Parsing maybe result...$m") - m match { - case None => Success(EmptyResult) - case Some(resultNode) => result(resultNode,rdf) - } - } - } */ - def result: RDFParser[Result] = { (n, rdf) => { n match { @@ -135,12 +126,9 @@ trait RDF2Manifest def compoundResult: RDFParser[Result] = (n, rdf) => { iriFromPredicate(rdf_type)(n, rdf) match { case Right(iri) => iri match { - case `sht_NotValid` => for { - detailsNode <- objectFromPredicate(sht_details)(n, rdf) - validationReport <- parsePropertyValue(sht_validationReport, validationReport)(detailsNode, rdf) - validatedPairs <- parsePropertyValue(sht_validatedPairs, validatedPairs)(detailsNode, rdf) - } yield NotValidResult(validationReport, validatedPairs) - case `sht_Valid` => Right(ValidResult(List())) + case `sh_ValidationReport` => for { + report <- validationReport(n, rdf) + } yield ReportResult(report) case _ => parseFail(s"Unsupporte type of compound result: $iri") } case Left(e) => parseFail(s"compoundResult. Wrong rdf:type of node: $n: $e") @@ -174,13 +162,44 @@ trait RDF2Manifest types.getOrElse(Set()).isEmpty } - def includes(derefIncludes: Boolean): RDFParser[List[(IRI, Option[Manifest])]] = { (n, rdf) => + def includes(visited: List[RDFNode]): RDFParser[List[(RDFNode, Manifest)]] = { (n, rdf) => { + println(s"Parsing includes...$derefIncludes") if (derefIncludes) { - // TODO. Dereference includes in manifest - parseOk(List()) + for { + includes <- { + println(s"Looking for include at node: $n") + objectsFromPredicate(mf_include)(n, rdf) + } + result <- { + println(s"Includes: $includes") + val ds: List[Either[String, (IRI, Manifest)]] = + includes.toList.map(iri => derefInclude(iri, base, iri +: visited)) + ds.sequence + } + } yield + result } else parseOk(List()) } + } + + /* TODO: The following code doesn't take into account possible loops */ + def derefInclude(node: RDFNode, + base: Option[IRI], + visited: List[RDFNode]): Either[String,(IRI,Manifest)] = node match { + case iri: IRI => { + val iriResolved = base.fold(iri)(base => base.resolve(iri)) + println(s"Resolving base: $base with iri: $iri = $iriResolved") + for { + rdf <- RDFAsJenaModel.fromURI(iriResolved.getLexicalForm,"TURTLE",None) + mfs <- RDF2Manifest(Some(iriResolved), true).rdf2Manifest(rdf, iri +: visited) + manifest <- + if (mfs.size == 1) Right(mfs.head) + else Left(s"More than one manifests found: ${mfs} at iri $iri") + } yield (iri, manifest) + } + case _ => Left(s"Trying to deref an include from node $node which is not an IRI") + } def parsePropertyValue[A](pred: IRI, parser: RDFParser[A]): RDFParser[A] = (n, rdf) => for { value <- objectFromPredicate(pred)(n, rdf) @@ -195,24 +214,10 @@ trait RDF2Manifest def parsePropertyList[A]( pred: IRI, parser: RDFParser[A]): RDFParser[List[A]] = (n, rdf) => for { - ls <- rdfListForPredicate(pred)(n, rdf) + ls <- rdfListForPredicateAllowingNone(pred)(n, rdf) vs <- parseNodes(ls, parser)(rdf) } yield vs - /* - def parseList[A](xs: List[RDFNode], - parser: RDFParser[A], - rdf: RDFReader): Try[List[A]] = { - Try(xs.map(n => parser(n,rdf)).map(_.get)) - } - - def parseSet[A](xs: Set[RDFNode], - parser: RDFParser[A], - rdf: RDFReader): Try[Set[A]] = { - Try(xs.map(n => parser(n,rdf)).map(_.get)) - } -*/ - def mapOptional[A, B](optA: Option[A], fn: A => Either[String, B]): Either[String, Option[B]] = { optA match { case None => parseOk(None) @@ -242,27 +247,23 @@ trait RDF2Manifest } } - override def objectFromPredicateOptional(p: IRI): RDFParser[Option[RDFNode]] = { (n, rdf) => - { - optional(objectFromPredicate(p))(n, rdf) - } - } - - def iriFromPredicateOptional(p: IRI): RDFParser[Option[IRI]] = { (n, rdf) => - { - optional(iriFromPredicate(p))(n, rdf) - } - } - } -object RDF2Manifest extends RDF2Manifest { +object RDF2Manifest { - def read(fileName: String, format: String, base: Option[String]): Either[String, Manifest] = { + def read(fileName: String, + format: String, + base: Option[String], + derefIncludes: Boolean + ): Either[String, Manifest] = { for { cs <- getContents(fileName) - rdf <- RDFAsJenaModel.fromChars(cs, format, base) - mfs <- rdf2Manifest(rdf, false) + rdf <- RDFAsJenaModel.fromChars(cs, format, None) + iriBase <- base match { + case None => Right(None) + case Some(str) => IRI.fromString(str).map(Some(_)) + } + mfs <- RDF2Manifest(iriBase,derefIncludes).rdf2Manifest(rdf) manifest <- if (mfs.size == 1) Right(mfs.head) else Left(s"More than one manifests found: ${mfs}") } yield manifest diff --git a/modules/manifest/src/main/scala/es/weso/manifest/RDF2ManifestException.scala b/modules/manifest/src/main/scala/es/weso/manifest/RDF2ManifestException.scala new file mode 100644 index 000000000..d46a80250 --- /dev/null +++ b/modules/manifest/src/main/scala/es/weso/manifest/RDF2ManifestException.scala @@ -0,0 +1,4 @@ +package es.weso.manifest + +case class RDF2ManifestException(msg: String) + extends Exception(msg) diff --git a/modules/manifest/src/test/resources/application.properties b/modules/manifest/src/test/resources/application.properties index a0087c3a9..ab7705086 100644 --- a/modules/manifest/src/test/resources/application.properties +++ b/modules/manifest/src/test/resources/application.properties @@ -1,9 +1,6 @@ # Folders for local shexTest tests -shaclFolder=src/test/resources/shacl +shaclTests=src/test/resources/shacl/tests shaclCore=src/test/resources/shacl/core -shaclLocal=src/test/resources/shaclLocal schemasFolder=src/test/resources/shexTest/schemas shexLocalFolder=src/test/resources/shexLocal -negativeSyntaxFolder=src/test/resources/shexTest/negativeSyntax -validationFolder=src/test/resources/shexTest/validation/ diff --git a/modules/manifest/src/test/resources/complex/manifest.ttl b/modules/manifest/src/test/resources/complex/manifest.ttl new file mode 100644 index 000000000..6e921e565 --- /dev/null +++ b/modules/manifest/src/test/resources/complex/manifest.ttl @@ -0,0 +1,10 @@ +@prefix mf: . +@prefix rdfs: . +@prefix sht: . + +<> + a mf:Manifest ; + rdfs:label "Tests converted from http://datashapes.org/sh/tests/tests/core/complex" ; + mf:include ; + mf:include ; + . \ No newline at end of file diff --git a/modules/manifest/src/test/resources/complex/personexample.ttl b/modules/manifest/src/test/resources/complex/personexample.ttl new file mode 100644 index 000000000..0a249cf89 --- /dev/null +++ b/modules/manifest/src/test/resources/complex/personexample.ttl @@ -0,0 +1,103 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:Alice + rdf:type ex:Person ; + ex:ssn "987-65-432A" ; +. +ex:Bob + rdf:type ex:Person ; + ex:ssn "123-45-6789" ; + ex:ssn "124-35-6789" ; +. +ex:Calvin + rdf:type ex:Person ; + ex:birthDate "1999-09-09"^^xsd:date ; + ex:worksFor ex:UntypedCompany ; +. +ex:PersonShape + rdf:type sh:NodeShape ; + sh:closed "true"^^xsd:boolean ; + sh:ignoredProperties ( + rdf:type + ) ; + sh:property [ + sh:path ex:ssn ; + sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:pattern "^\\d{3}-\\d{2}-\\d{4}$" ; + ] ; + sh:property [ + sh:path ex:worksFor ; + sh:class ex:Company ; + sh:nodeKind sh:IRI ; + ] ; + sh:property [ + sh:path [ + sh:inversePath ex:worksFor ; + ] ; + sh:name "employee" ; + ] ; + sh:targetClass ex:Person ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of personexample" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:Alice ; + sh:resultPath ex:ssn ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:PatternConstraintComponent ; + sh:sourceShape _:b61064 ; + sh:value "987-65-432A" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:Bob ; + sh:resultPath ex:ssn ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxCountConstraintComponent ; + sh:sourceShape _:b61064 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:Calvin ; + sh:resultPath ex:birthDate ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:ClosedConstraintComponent ; + sh:sourceShape ex:PersonShape ; + sh:value "1999-09-09"^^xsd:date ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:Calvin ; + sh:resultPath ex:worksFor ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:ClassConstraintComponent ; + sh:sourceShape [] ; + sh:value ex:UntypedCompany ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/manifest/src/test/resources/complex/shacl-shacl-data-shapes.ttl b/modules/manifest/src/test/resources/complex/shacl-shacl-data-shapes.ttl new file mode 100644 index 000000000..c6b751a77 --- /dev/null +++ b/modules/manifest/src/test/resources/complex/shacl-shacl-data-shapes.ttl @@ -0,0 +1,410 @@ +# baseURI: http://www.w3.org/ns/shacl-shacl# + +# A SHACL shapes graph to validate SHACL shapes graphs +# Draft last edited 2017-04-04 + +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix xsd: . + +@prefix shsh: . + +shsh: + rdfs:label "SHACL for SHACL"@en ; + rdfs:comment "This shapes graph can be used to validate SHACL shapes graphs against a subset of the syntax rules."@en ; + sh:declare [ + sh:prefix "shsh" ; + sh:namespace "http://www.w3.org/ns/shacl-shacl#" ; + ] . + + +shsh:ListShape + a sh:NodeShape ; + rdfs:label "List shape"@en ; + rdfs:comment "A shape describing well-formed RDF lists. Currently does not check for non-recursion. This could be expressed using SHACL-SPARQL."@en ; + rdfs:seeAlso ; + sh:property [ + sh:path [ sh:zeroOrMorePath rdf:rest ] ; + rdfs:comment "Each list member (including this node) must be have the shape shsh:ListNodeShape."@en ; + sh:hasValue rdf:nil ; + sh:node shsh:ListNodeShape ; + ] . + +shsh:ListNodeShape + a sh:NodeShape ; + rdfs:label "List node shape"@en ; + rdfs:comment "Defines constraints on what it means for a node to be a node within a well-formed RDF list. Note that this does not check whether the rdf:rest items are also well-formed lists as this would lead to unsupported recursion."@en ; + sh:or ( [ + sh:hasValue rdf:nil ; + sh:property [ + sh:path rdf:first ; + sh:maxCount 0 ; + ] ; + sh:property [ + sh:path rdf:rest ; + sh:maxCount 0 ; + ] ; + ] + [ + sh:not [ sh:hasValue rdf:nil ] ; + sh:property [ + sh:path rdf:first ; + sh:maxCount 1 ; + sh:minCount 1 ; + ] ; + sh:property [ + sh:path rdf:rest ; + sh:maxCount 1 ; + sh:minCount 1 ; + ] ; + ] ) . + +shsh:ShapeShape + a sh:NodeShape ; + rdfs:label "Shape shape"@en ; + rdfs:comment "A shape that can be used to validate syntax rules for other shapes."@en ; + + # See https://www.w3.org/TR/shacl/#shapes for what counts as a shape + sh:targetClass sh:NodeShape ; + sh:targetClass sh:PropertyShape ; + sh:targetSubjectsOf sh:targetClass, sh:targetNode, sh:targetObjectsOf, sh:targetSubjectsOf ; + sh:targetSubjectsOf sh:and, sh:class, sh:closed, sh:datatype, sh:disjoint, sh:equals, sh:flags, sh:hasValue, + sh:ignoredProperties, sh:in, sh:languageIn, sh:lessThan, sh:lessThanOrEquals, sh:maxCount, sh:maxExclusive, + sh:maxInclusive, sh:maxLength, sh:minCount, sh:minExclusive, sh:minInclusive, sh:minLength, sh:node, sh:nodeKind, + sh:not, sh:or, sh:pattern, sh:property, sh:qualifiedMaxCount, sh:qualifiedMinCount, sh:qualifiedValueShape, + sh:qualifiedValueShape, sh:qualifiedValueShapesDisjoint, sh:qualifiedValueShapesDisjoint, sh:sparql, sh:uniqueLang, sh:xone ; + + sh:targetObjectsOf sh:node ; # node-node + sh:targetObjectsOf sh:not ; # not-node + sh:targetObjectsOf sh:property ; # property-node + sh:targetObjectsOf sh:qualifiedValueShape ; # qualifiedValueShape-node + + # Shapes are either node shapes or property shapes + sh:xone ( shsh:NodeShapeShape shsh:PropertyShapeShape ) ; + + sh:property [ + sh:path sh:targetNode ; + sh:nodeKind sh:IRIOrLiteral ; # targetNode-nodeKind + ] ; + sh:property [ + sh:path sh:targetClass ; + sh:nodeKind sh:IRI ; # targetClass-nodeKind + ] ; + sh:property [ + sh:path sh:targetSubjectsOf ; + sh:nodeKind sh:IRI ; # targetSubjectsOf-nodeKind + ] ; + sh:property [ + sh:path sh:targetObjectsOf ; + sh:nodeKind sh:IRI ; # targetObjectsOf-nodeKind + ] ; + sh:or ( [ sh:not [ + sh:class rdfs:Class ; + sh:or ( [ sh:class sh:NodeShape ] [ sh:class sh:PropertyShape ] ) + ] ] + [ sh:nodeKind sh:IRI ] + ) ; # implicit-targetClass-nodeKind + + sh:property [ + sh:path sh:severity ; + sh:maxCount 1 ; # severity-maxCount + sh:nodeKind sh:IRI ; # severity-nodeKind + ] ; + sh:property [ + sh:path sh:message ; + sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; # message-datatype + ] ; + sh:property [ + sh:path sh:deactivated ; + sh:maxCount 1 ; # deactivated-maxCount + sh:in ( true false ) ; # deactivated-datatype + ] ; + + sh:property [ + sh:path sh:and ; + sh:node shsh:ListShape ; # and-node + ] ; + sh:property [ + sh:path sh:class ; + sh:nodeKind sh:IRI ; # class-nodeKind + ] ; + sh:property [ + sh:path sh:closed ; + sh:datatype xsd:boolean ; # closed-datatype + sh:maxCount 1 ; # multiple-parameters + ] ; + sh:property [ + sh:path sh:ignoredProperties ; + sh:node shsh:ListShape ; # ignoredProperties-node + sh:maxCount 1 ; # multiple-parameters + ] ; + sh:property [ + sh:path ( sh:ignoredProperties [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ; + sh:nodeKind sh:IRI ; # ignoredProperties-members-nodeKind + ] ; + sh:property [ + sh:path sh:datatype ; + sh:nodeKind sh:IRI ; # datatype-nodeKind + sh:maxCount 1 ; # datatype-maxCount + ] ; + sh:property [ + sh:path sh:disjoint ; + sh:nodeKind sh:IRI ; # disjoint-nodeKind + ] ; + sh:property [ + sh:path sh:equals ; + sh:nodeKind sh:IRI ; # equals-nodeKind + ] ; + sh:property [ + sh:path sh:in ; + sh:maxCount 1 ; # in-maxCount + sh:node shsh:ListShape ; # in-node + ] ; + sh:property [ + sh:path sh:languageIn ; + sh:maxCount 1 ; # languageIn-maxCount + sh:node shsh:ListShape ; # languageIn-node + ] ; + sh:property [ + sh:path ( sh:languageIn [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ; + sh:datatype xsd:string ; # languageIn-members-datatype + ] ; + sh:property [ + sh:path sh:lessThan ; + sh:nodeKind sh:IRI ; # lessThan-nodeKind + ] ; + sh:property [ + sh:path sh:lessThanOrEquals ; + sh:nodeKind sh:IRI ; # lessThanOrEquals-nodeKind + ] ; + sh:property [ + sh:path sh:maxCount ; + sh:datatype xsd:integer ; # maxCount-datatype + sh:maxCount 1 ; # maxCount-maxCount + ] ; + sh:property [ + sh:path sh:maxExclusive ; + sh:maxCount 1 ; # maxExclusive-maxCount + sh:nodeKind sh:Literal ; # maxExclusive-nodeKind + ] ; + sh:property [ + sh:path sh:maxInclusive ; + sh:maxCount 1 ; # maxInclusive-maxCount + sh:nodeKind sh:Literal ; # maxInclusive-nodeKind + ] ; + sh:property [ + sh:path sh:maxLength ; + sh:datatype xsd:integer ; # maxLength-datatype + sh:maxCount 1 ; # maxLength-maxCount + ] ; + sh:property [ + sh:path sh:minCount ; + sh:datatype xsd:integer ; # minCount-datatype + sh:maxCount 1 ; # minCount-maxCount + ] ; + sh:property [ + sh:path sh:minExclusive ; + sh:maxCount 1 ; # minExclusive-maxCount + sh:nodeKind sh:Literal ; # minExclusive-nodeKind + ] ; + sh:property [ + sh:path sh:minInclusive ; + sh:maxCount 1 ; # minInclusive-maxCount + sh:nodeKind sh:Literal ; # minInclusive-nodeKind + ] ; + sh:property [ + sh:path sh:minLength ; + sh:datatype xsd:integer ; # minLength-datatype + sh:maxCount 1 ; # minLength-maxCount + ] ; + sh:property [ + sh:path sh:nodeKind ; + sh:in ( sh:BlankNode sh:IRI sh:Literal sh:BlankNodeOrIRI sh:BlankNodeOrLiteral sh:IRIOrLiteral ) ; # nodeKind-in + sh:maxCount 1 ; # nodeKind-maxCount + ] ; + sh:property [ + sh:path sh:or ; + sh:node shsh:ListShape ; # or-node + ] ; + sh:property [ + sh:path sh:pattern ; + sh:datatype xsd:string ; # pattern-datatype + sh:maxCount 1 ; # multiple-parameters + # Not implemented: syntax rule pattern-regex + ] ; + sh:property [ + sh:path sh:flags ; + sh:datatype xsd:string ; # flags-datatype + sh:maxCount 1 ; # multiple-parameters + ] ; + sh:property [ + sh:path sh:qualifiedMaxCount ; + sh:datatype xsd:integer ; # qualifiedMaxCount-datatype + sh:maxCount 1 ; # multiple-parameters + ] ; + sh:property [ + sh:path sh:qualifiedMinCount ; + sh:datatype xsd:integer ; # qualifiedMinCount-datatype + sh:maxCount 1 ; # multiple-parameters + ] ; + sh:property [ + sh:path sh:qualifiedValueShape ; + sh:maxCount 1 ; # multiple-parameters + ] ; + sh:property [ + sh:path sh:qualifiedValueShapesDisjoint ; + sh:datatype xsd:boolean ; # qualifiedValueShapesDisjoint-datatype + sh:maxCount 1 ; # multiple-parameters + ] ; + sh:property [ + sh:path sh:uniqueLang ; + sh:datatype xsd:boolean ; # uniqueLang-datatype + sh:maxCount 1 ; # uniqueLang-maxCount + ] ; + sh:property [ + sh:path sh:xone ; + sh:node shsh:ListShape ; # xone-node + ] . + +shsh:NodeShapeShape + a sh:NodeShape ; + sh:targetObjectsOf sh:node ; # node-node + sh:property [ + sh:path sh:path ; + sh:maxCount 0 ; # NodeShape-path-maxCount + ] ; + sh:property [ + sh:path sh:lessThan ; + sh:maxCount 0 ; # lessThan-scope + ] ; + sh:property [ + sh:path sh:lessThanOrEquals ; + sh:maxCount 0 ; # lessThanOrEquals-scope + ] ; + sh:property [ + sh:path sh:maxCount ; + sh:maxCount 0 ; # maxCount-scope + ] ; + sh:property [ + sh:path sh:minCount ; + sh:maxCount 0 ; # minCount-scope + ] ; + sh:property [ + sh:path sh:qualifiedValueShape ; + sh:maxCount 0 ; # qualifiedValueShape-scope + ] ; + sh:property [ + sh:path sh:uniqueLang ; + sh:maxCount 0 ; # uniqueLang-scope + ] . + +shsh:PropertyShapeShape + a sh:NodeShape ; + sh:targetObjectsOf sh:property ; # property-node + sh:property [ + sh:path sh:path ; + sh:maxCount 1 ; # path-maxCount + sh:minCount 1 ; # PropertyShape-path-minCount + sh:node shsh:PathShape ; # path-node + ] . + +# Values of sh:and, sh:or and sh:xone must be lists of shapes +shsh:ShapesListShape + a sh:NodeShape ; + sh:targetObjectsOf sh:and ; # and-members-node + sh:targetObjectsOf sh:or ; # or-members-node + sh:targetObjectsOf sh:xone ; # xone-members-node + sh:property [ + sh:path ( [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ; + sh:node shsh:ShapeShape ; + ] . + + +# A path of blank node path syntax, used to simulate recursion +_:PathPath + sh:alternativePath ( + ( [ sh:zeroOrMorePath rdf:rest ] rdf:first ) + ( sh:alternativePath [ sh:zeroOrMorePath rdf:rest ] rdf:first ) + sh:inversePath + sh:zeroOrMorePath + sh:oneOrMorePath + sh:zeroOrOnePath + ) . + +shsh:PathShape + a sh:NodeShape ; + rdfs:label "Path shape"@en ; + rdfs:comment "A shape that can be used to validate the syntax rules of well-formed SHACL paths."@en ; + rdfs:seeAlso ; + sh:property [ + sh:path [ sh:zeroOrMorePath _:PathPath ] ; + sh:node shsh:PathNodeShape ; + ] . + +shsh:PathNodeShape + sh:xone ( # path-metarule + [ sh:nodeKind sh:IRI ] # 2.3.1.1: Predicate path + [ sh:nodeKind sh:BlankNode ; # 2.3.1.2: Sequence path + sh:node shsh:PathListWithAtLeast2Members ; + ] + [ sh:nodeKind sh:BlankNode ; # 2.3.1.3: Alternative path + sh:closed true ; + sh:property [ + sh:path sh:alternativePath ; + sh:node shsh:PathListWithAtLeast2Members ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] + ] + [ sh:nodeKind sh:BlankNode ; # 2.3.1.4: Inverse path + sh:closed true ; + sh:property [ + sh:path sh:inversePath ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] + ] + [ sh:nodeKind sh:BlankNode ; # 2.3.1.5: Zero-or-more path + sh:closed true ; + sh:property [ + sh:path sh:zeroOrMorePath ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] + ] + [ sh:nodeKind sh:BlankNode ; # 2.3.1.6: One-or-more path + sh:closed true ; + sh:property [ + sh:path sh:oneOrMorePath ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] + ] + [ sh:nodeKind sh:BlankNode ; # 2.3.1.7: Zero-or-one path + sh:closed true ; + sh:property [ + sh:path sh:zeroOrOnePath ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] + ] + ) . + +shsh:PathListWithAtLeast2Members + a sh:NodeShape ; + sh:node shsh:ListShape ; + sh:property [ + sh:path [ sh:oneOrMorePath rdf:rest ] ; + sh:minCount 2 ; # 1 other list node plus rdf:nil + ] . + +shsh:ShapesGraphShape + a sh:NodeShape ; + sh:targetObjectsOf sh:shapesGraph ; + sh:nodeKind sh:IRI . # shapesGraph-nodeKind + +shsh:EntailmentShape + a sh:NodeShape ; + sh:targetObjectsOf sh:entailment ; + sh:nodeKind sh:IRI . # entailment-nodeKind diff --git a/modules/manifest/src/test/resources/complex/shacl-shacl.ttl b/modules/manifest/src/test/resources/complex/shacl-shacl.ttl new file mode 100644 index 000000000..889071471 --- /dev/null +++ b/modules/manifest/src/test/resources/complex/shacl-shacl.ttl @@ -0,0 +1,19 @@ +@prefix mf: . +@prefix rdfs: . +@prefix xsd: . +@prefix sh: . +@prefix sht: . + +<> a mf:Manifest ; + mf:entries ( + + ) . + + a sht:Validate ; + rdfs:label "frozen eat your own ( eat your own frozen dogfood )" ; + mf:action [ + sht:dataGraph ; + sht:shapesGraph ] ; + mf:result [a sh:ValidationReport ; + sh:conforms "true"^^xsd:boolean ] ; + mf:status sht:approved . diff --git a/modules/manifest/src/test/resources/manifest2.ttl b/modules/manifest/src/test/resources/manifest2.ttl new file mode 100644 index 000000000..3fddf823e --- /dev/null +++ b/modules/manifest/src/test/resources/manifest2.ttl @@ -0,0 +1,14 @@ +@prefix dc: . +@prefix foaf: . +@prefix mf: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . +@prefix ex: . + +<> + a mf:Manifest ; + mf:include ; + . \ No newline at end of file diff --git a/modules/manifest/src/test/scala/es/weso/manifest/RDF2ManifestTest.scala b/modules/manifest/src/test/scala/es/weso/manifest/RDF2ManifestTest.scala index d4780f4cc..9b4d26c8f 100644 --- a/modules/manifest/src/test/scala/es/weso/manifest/RDF2ManifestTest.scala +++ b/modules/manifest/src/test/scala/es/weso/manifest/RDF2ManifestTest.scala @@ -8,15 +8,20 @@ import java.nio.file.Paths class RDF2ManifestTest extends FunSpec with Matchers with TryValues with OptionValues { - describe("RDF2Manifest") { + val conf: Config = ConfigFactory.load() + val shaclFolder = conf.getString("shaclTests") + val shaclFolderURI = Paths.get(shaclFolder).normalize.toUri.toString - val conf: Config = ConfigFactory.load() - val shaclFolder = conf.getString("shaclCore") - val fileName = shaclFolder + "/manifest.ttl" - val shaclFolderURI = Paths.get(shaclFolder).normalize.toUri.toString + describe("RDF2Manifest") { + parseManifest("personexample","core/complex") + parseManifest("manifest", "core/complex") + parseManifest("manifest", "core") + } - it("Read example manifest") { - RDF2Manifest.read(fileName, "TURTLE", Some(shaclFolderURI)) match { + def parseManifest(name: String,folder: String): Unit = { + it(s"Should parse manifest $folder/$name") { + val fileName = s"$shaclFolder/$folder/$name.ttl" + RDF2Manifest.read(fileName, "TURTLE", Some(s"$shaclFolderURI$folder/"), true) match { case Left(e) => fail(s"Error reading $fileName\n$e") case Right(mf) => diff --git a/modules/shacl/src/main/scala/es/weso/shacl/Shacl.scala b/modules/shacl/src/main/scala/es/weso/shacl/Shacl.scala index f7dc6b0ed..27a4994fd 100644 --- a/modules/shacl/src/main/scala/es/weso/shacl/Shacl.scala +++ b/modules/shacl/src/main/scala/es/weso/shacl/Shacl.scala @@ -38,20 +38,14 @@ case class Schema( } def siblingQualifiedShapes(s: ShapeRef): List[ShapeRef] = { - println(s"siblingShapes $s") val parentShapes: List[Shape] = parents(s). map(shapesMap.get(_)). collect { case Some(shape) => shape } - println(s"parent shapes $parentShapes") val qualifiedPropertyShapes = parentShapes. flatMap(_.propertyShapes). filter(_ != s) - println(s"step1 ${parentShapes.flatMap(_.propertyShapes)}") - println(s"step2 ${parentShapes.flatMap(_.propertyShapes).filter(_ != s)}") - // println(s"step2 ${parentShapes.map(_.propertyShapes).filter(_!=s)}") - println(s"qualified parent shapes $qualifiedPropertyShapes") collectQualifiedValueShapes(qualifiedPropertyShapes) } diff --git a/modules/shacl/src/main/scala/es/weso/shacl/validator/Validator.scala b/modules/shacl/src/main/scala/es/weso/shacl/validator/Validator.scala index a5a9684fb..21953ffd2 100644 --- a/modules/shacl/src/main/scala/es/weso/shacl/validator/Validator.scala +++ b/modules/shacl/src/main/scala/es/weso/shacl/validator/Validator.scala @@ -532,20 +532,8 @@ case class Validator(schema: Schema) extends LazyLogging { } private def filterConformSiblings(values: Seq[RDFNode], p: PropertyShape, attempt: Attempt): Check[Seq[RDFNode]] = { - logger.info(s"FilterConformSiblings. values = $values, p = $p, attempt = $attempt") val shapes = schema.siblingQualifiedShapes(ShapeRef(p.id)) - logger.info(s"Sibling shapes: $shapes") - for { - rs <- filterConformShapes(values, shapes, attempt) - } yield { - logger.info(s"Result of filtering on filterConformSiblings($values,...) = $rs") - if (rs.toList.length == values.toList.length) { - logger.info("Size is equal...") - } else { - logger.info("******************** Size is different!!!") - } - rs - } + filterConformShapes(values, shapes, attempt) } private def filterConformShapes(values: Seq[RDFNode], shapes: Seq[ShapeRef], attempt: Attempt): Check[Seq[RDFNode]] = { diff --git a/modules/shacl/src/test/resources/application.properties b/modules/shacl/src/test/resources/application.properties index 42ae3ce0a..3fafe2a41 100644 --- a/modules/shacl/src/test/resources/application.properties +++ b/modules/shacl/src/test/resources/application.properties @@ -1,9 +1,6 @@ # Folders for local tests -shaclFolder=src/test/resources/shacl +shaclTests=src/test/resources/shacl shaclCore=src/test/resources/shacl/core -shaclLocal=src/test/resources/shaclLocal schemasFolder=src/test/resources/shexTest/schemas shexLocalFolder=src/test/resources/shexLocal -negativeSyntaxFolder=src/test/resources/shexTest/negativeSyntax -validationFolder=src/test/resources/shexTest/validation/ diff --git a/modules/shacl/src/test/resources/tests/core/complex/personexample.ttl b/modules/shacl/src/test/resources/tests/core/complex/personexample.ttl index 0bd6ba4ca..0a249cf89 100644 --- a/modules/shacl/src/test/resources/tests/core/complex/personexample.ttl +++ b/modules/shacl/src/test/resources/tests/core/complex/personexample.ttl @@ -1,103 +1,103 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:Alice - rdf:type ex:Person ; - ex:ssn "987-65-432A" ; -. -ex:Bob - rdf:type ex:Person ; - ex:ssn "123-45-6789" ; - ex:ssn "124-35-6789" ; -. -ex:Calvin - rdf:type ex:Person ; - ex:birthDate "1999-09-09"^^xsd:date ; - ex:worksFor ex:UntypedCompany ; -. -ex:PersonShape - rdf:type sh:NodeShape ; - sh:closed "true"^^xsd:boolean ; - sh:ignoredProperties ( - rdf:type - ) ; - sh:property [ - sh:path ex:ssn ; - sh:datatype xsd:string ; - sh:maxCount 1 ; - sh:pattern "^\\d{3}-\\d{2}-\\d{4}$" ; - ] ; - sh:property [ - sh:path ex:worksFor ; - sh:class ex:Company ; - sh:nodeKind sh:IRI ; - ] ; - sh:property [ - sh:path [ - sh:inversePath ex:worksFor ; - ] ; - sh:name "employee" ; - ] ; - sh:targetClass ex:Person ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of personexample" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:Alice ; - sh:resultPath ex:ssn ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:PatternConstraintComponent ; - sh:sourceShape _:b61064 ; - sh:value "987-65-432A" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:Bob ; - sh:resultPath ex:ssn ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxCountConstraintComponent ; - sh:sourceShape _:b61064 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:Calvin ; - sh:resultPath ex:birthDate ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:ClosedConstraintComponent ; - sh:sourceShape ex:PersonShape ; - sh:value "1999-09-09"^^xsd:date ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:Calvin ; - sh:resultPath ex:worksFor ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:ClassConstraintComponent ; - sh:sourceShape [] ; - sh:value ex:UntypedCompany ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:Alice + rdf:type ex:Person ; + ex:ssn "987-65-432A" ; +. +ex:Bob + rdf:type ex:Person ; + ex:ssn "123-45-6789" ; + ex:ssn "124-35-6789" ; +. +ex:Calvin + rdf:type ex:Person ; + ex:birthDate "1999-09-09"^^xsd:date ; + ex:worksFor ex:UntypedCompany ; +. +ex:PersonShape + rdf:type sh:NodeShape ; + sh:closed "true"^^xsd:boolean ; + sh:ignoredProperties ( + rdf:type + ) ; + sh:property [ + sh:path ex:ssn ; + sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:pattern "^\\d{3}-\\d{2}-\\d{4}$" ; + ] ; + sh:property [ + sh:path ex:worksFor ; + sh:class ex:Company ; + sh:nodeKind sh:IRI ; + ] ; + sh:property [ + sh:path [ + sh:inversePath ex:worksFor ; + ] ; + sh:name "employee" ; + ] ; + sh:targetClass ex:Person ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of personexample" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:Alice ; + sh:resultPath ex:ssn ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:PatternConstraintComponent ; + sh:sourceShape _:b61064 ; + sh:value "987-65-432A" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:Bob ; + sh:resultPath ex:ssn ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxCountConstraintComponent ; + sh:sourceShape _:b61064 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:Calvin ; + sh:resultPath ex:birthDate ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:ClosedConstraintComponent ; + sh:sourceShape ex:PersonShape ; + sh:value "1999-09-09"^^xsd:date ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:Calvin ; + sh:resultPath ex:worksFor ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:ClassConstraintComponent ; + sh:sourceShape [] ; + sh:value ex:UntypedCompany ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/node/and-001.ttl b/modules/shacl/src/test/resources/tests/core/node/and-001.ttl index 2a6fb9f04..d0d867680 100644 --- a/modules/shacl/src/test/resources/tests/core/node/and-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/node/and-001.ttl @@ -1,77 +1,77 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidRectangle1 - rdf:type ex:Rectangle ; - ex:height 3 ; -. -ex:InvalidRectangle2 - rdf:type ex:Rectangle ; - ex:width 2 ; -. -ex:Rectangle - rdf:type rdfs:Class ; - rdf:type sh:NodeShape ; - rdfs:subClassOf rdfs:Resource ; - sh:and ( - [ - sh:property [ - sh:path ex:width ; - sh:minCount 1 ; - ] ; - ] - [ - sh:property [ - sh:path ex:height ; - sh:minCount 1 ; - ] ; - ] - ) ; -. -ex:ValidRectangle1 - rdf:type ex:Rectangle ; - ex:height 3 ; - ex:width 2 ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:and at node shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidRectangle1 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:AndConstraintComponent ; - sh:sourceShape ex:Rectangle ; - sh:value ex:InvalidRectangle1 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidRectangle2 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:AndConstraintComponent ; - sh:sourceShape ex:Rectangle ; - sh:value ex:InvalidRectangle2 ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidRectangle1 + rdf:type ex:Rectangle ; + ex:height 3 ; +. +ex:InvalidRectangle2 + rdf:type ex:Rectangle ; + ex:width 2 ; +. +ex:Rectangle + rdf:type rdfs:Class ; + rdf:type sh:NodeShape ; + rdfs:subClassOf rdfs:Resource ; + sh:and ( + [ + sh:property [ + sh:path ex:width ; + sh:minCount 1 ; + ] ; + ] + [ + sh:property [ + sh:path ex:height ; + sh:minCount 1 ; + ] ; + ] + ) ; +. +ex:ValidRectangle1 + rdf:type ex:Rectangle ; + ex:height 3 ; + ex:width 2 ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:and at node shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidRectangle1 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:AndConstraintComponent ; + sh:sourceShape ex:Rectangle ; + sh:value ex:InvalidRectangle1 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidRectangle2 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:AndConstraintComponent ; + sh:sourceShape ex:Rectangle ; + sh:value ex:InvalidRectangle2 ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/node/and-002.ttl b/modules/shacl/src/test/resources/tests/core/node/and-002.ttl index e8303cfd9..f4b018db1 100644 --- a/modules/shacl/src/test/resources/tests/core/node/and-002.ttl +++ b/modules/shacl/src/test/resources/tests/core/node/and-002.ttl @@ -1,74 +1,74 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:AndShape - rdf:type sh:NodeShape ; - sh:and ( - ex:SuperShape - [ - sh:property [ - sh:path ex:property ; - sh:maxCount 1 ; - ] ; - ] - ) ; - sh:targetNode ex:InvalidInstance1 ; - sh:targetNode ex:InvalidInstance2 ; - sh:targetNode ex:ValidInstance1 ; -. -ex:InvalidInstance2 - ex:property "One" ; - ex:property "Two" ; -. -ex:SuperShape - rdf:type sh:NodeShape ; - sh:property [ - sh:path ex:property ; - sh:minCount 1 ; - ] ; -. -ex:ValidInstance1 - ex:property "One" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:and at node shape 002" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance1 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:AndConstraintComponent ; - sh:sourceShape ex:AndShape ; - sh:value ex:InvalidInstance1 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance2 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:AndConstraintComponent ; - sh:sourceShape ex:AndShape ; - sh:value ex:InvalidInstance2 ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:AndShape + rdf:type sh:NodeShape ; + sh:and ( + ex:SuperShape + [ + sh:property [ + sh:path ex:property ; + sh:maxCount 1 ; + ] ; + ] + ) ; + sh:targetNode ex:InvalidInstance1 ; + sh:targetNode ex:InvalidInstance2 ; + sh:targetNode ex:ValidInstance1 ; +. +ex:InvalidInstance2 + ex:property "One" ; + ex:property "Two" ; +. +ex:SuperShape + rdf:type sh:NodeShape ; + sh:property [ + sh:path ex:property ; + sh:minCount 1 ; + ] ; +. +ex:ValidInstance1 + ex:property "One" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:and at node shape 002" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance1 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:AndConstraintComponent ; + sh:sourceShape ex:AndShape ; + sh:value ex:InvalidInstance1 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance2 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:AndConstraintComponent ; + sh:sourceShape ex:AndShape ; + sh:value ex:InvalidInstance2 ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/node/class-001.ttl b/modules/shacl/src/test/resources/tests/core/node/class-001.ttl index e37ce7012..ab9797744 100644 --- a/modules/shacl/src/test/resources/tests/core/node/class-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/node/class-001.ttl @@ -1,70 +1,70 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:John - rdf:type ex:MalePerson ; -. -ex:MalePerson - rdf:type rdfs:Class ; - rdfs:subClassOf ex:Person ; -. -ex:Person - rdf:type rdfs:Class ; - rdfs:subClassOf rdfs:Resource ; -. -ex:Quokki - rdf:type ex:Animal ; -. -ex:Someone - rdf:type ex:Person ; -. -ex:TestShape - rdf:type sh:NodeShape ; - sh:class ex:Person ; - sh:targetNode ex:John ; - sh:targetNode ex:Quokki ; - sh:targetNode ex:Someone ; - sh:targetNode ex:Typeless ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:class at node shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:Quokki ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:ClassConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:Quokki ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:Typeless ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:ClassConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:Typeless ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:John + rdf:type ex:MalePerson ; +. +ex:MalePerson + rdf:type rdfs:Class ; + rdfs:subClassOf ex:Person ; +. +ex:Person + rdf:type rdfs:Class ; + rdfs:subClassOf rdfs:Resource ; +. +ex:Quokki + rdf:type ex:Animal ; +. +ex:Someone + rdf:type ex:Person ; +. +ex:TestShape + rdf:type sh:NodeShape ; + sh:class ex:Person ; + sh:targetNode ex:John ; + sh:targetNode ex:Quokki ; + sh:targetNode ex:Someone ; + sh:targetNode ex:Typeless ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:class at node shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:Quokki ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:ClassConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:Quokki ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:Typeless ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:ClassConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:Typeless ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/node/class-003.ttl b/modules/shacl/src/test/resources/tests/core/node/class-003.ttl index 2806b4458..16b37be4d 100644 --- a/modules/shacl/src/test/resources/tests/core/node/class-003.ttl +++ b/modules/shacl/src/test/resources/tests/core/node/class-003.ttl @@ -1,105 +1,105 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:John # not Animal - rdf:type ex:MalePerson ; -. -ex:Joe # OK - rdf:type ex:MalePerson ; - rdf:type ex:Animal ; -. -ex:MalePerson - rdf:type rdfs:Class ; - rdfs:subClassOf ex:Person ; -. -ex:Person - rdf:type rdfs:Class ; - rdfs:subClassOf rdfs:Resource ; -. -ex:Quokki # not Person - rdf:type ex:Animal ; -. -ex:Quokkip # not Animal - rdf:type ex:Person ; -. -ex:Someone # OK - rdf:type ex:Person ; - rdf:type ex:Animal ; -. -ex:TestShape - rdf:type sh:NodeShape ; - sh:class ex:Person ; - sh:class ex:Animal ; - sh:targetClass ex:MalePerson ; - sh:targetNode ex:John ; - sh:targetNode ex:Quokki ; - sh:targetNode ex:Quokkip ; - sh:targetNode ex:Someone ; - sh:targetNode ex:Typeless ; # not Animal, not Person -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:class at node shape 003 multiple classes, overlapping target sets" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:Typeless ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:ClassConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:Typeless ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:Typeless ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:ClassConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:Typeless ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:Quokki ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:ClassConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:Quokki ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:John ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:ClassConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:John ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:Quokkip ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:ClassConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:Quokkip ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:John # not Animal + rdf:type ex:MalePerson ; +. +ex:Joe # OK + rdf:type ex:MalePerson ; + rdf:type ex:Animal ; +. +ex:MalePerson + rdf:type rdfs:Class ; + rdfs:subClassOf ex:Person ; +. +ex:Person + rdf:type rdfs:Class ; + rdfs:subClassOf rdfs:Resource ; +. +ex:Quokki # not Person + rdf:type ex:Animal ; +. +ex:Quokkip # not Animal + rdf:type ex:Person ; +. +ex:Someone # OK + rdf:type ex:Person ; + rdf:type ex:Animal ; +. +ex:TestShape + rdf:type sh:NodeShape ; + sh:class ex:Person ; + sh:class ex:Animal ; + sh:targetClass ex:MalePerson ; + sh:targetNode ex:John ; + sh:targetNode ex:Quokki ; + sh:targetNode ex:Quokkip ; + sh:targetNode ex:Someone ; + sh:targetNode ex:Typeless ; # not Animal, not Person +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:class at node shape 003 multiple classes, overlapping target sets" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:Typeless ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:ClassConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:Typeless ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:Typeless ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:ClassConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:Typeless ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:Quokki ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:ClassConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:Quokki ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:John ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:ClassConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:John ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:Quokkip ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:ClassConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:Quokkip ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/node/closed-001.ttl b/modules/shacl/src/test/resources/tests/core/node/closed-001.ttl index 2e7a40e27..6bae9de8c 100644 --- a/modules/shacl/src/test/resources/tests/core/node/closed-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/node/closed-001.ttl @@ -1,64 +1,64 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidInstance1 - rdf:type ex:SomeClass ; - ex:otherProperty 4 ; - ex:someProperty 3 ; -. -ex:MyShape - rdf:type sh:NodeShape ; - sh:closed "true"^^xsd:boolean ; - sh:property [ - sh:path ex:someProperty ; - ] ; - sh:targetNode ex:InvalidInstance1 ; - sh:targetNode ex:ValidInstance1 ; -. -ex:ValidInstance1 - ex:someProperty 3 ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:closed at node shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance1 ; - sh:resultPath rdf:type ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:ClosedConstraintComponent ; - sh:sourceShape ex:MyShape ; - sh:value ex:SomeClass ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance1 ; - sh:resultPath ex:otherProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:ClosedConstraintComponent ; - sh:sourceShape ex:MyShape ; - sh:value 4 ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidInstance1 + rdf:type ex:SomeClass ; + ex:otherProperty 4 ; + ex:someProperty 3 ; +. +ex:MyShape + rdf:type sh:NodeShape ; + sh:closed "true"^^xsd:boolean ; + sh:property [ + sh:path ex:someProperty ; + ] ; + sh:targetNode ex:InvalidInstance1 ; + sh:targetNode ex:ValidInstance1 ; +. +ex:ValidInstance1 + ex:someProperty 3 ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:closed at node shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance1 ; + sh:resultPath rdf:type ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:ClosedConstraintComponent ; + sh:sourceShape ex:MyShape ; + sh:value ex:SomeClass ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance1 ; + sh:resultPath ex:otherProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:ClosedConstraintComponent ; + sh:sourceShape ex:MyShape ; + sh:value 4 ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/node/closed-002.ttl b/modules/shacl/src/test/resources/tests/core/node/closed-002.ttl index 7b931afc4..d72eebb49 100644 --- a/modules/shacl/src/test/resources/tests/core/node/closed-002.ttl +++ b/modules/shacl/src/test/resources/tests/core/node/closed-002.ttl @@ -1,58 +1,58 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidInstance1 - ex:otherProperty 4 ; - ex:someProperty 3 ; -. -ex:MyShape - rdf:type sh:NodeShape ; - sh:closed "true"^^xsd:boolean ; - sh:ignoredProperties ( - rdf:type - ) ; - sh:property [ - sh:path ex:someProperty ; - ] ; - sh:targetNode ex:InvalidInstance1 ; - sh:targetNode ex:ValidInstance1 ; -. -ex:ValidInstance1 - rdf:type ex:SomeClass ; - ex:someProperty 3 ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:closed at node shape 002" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance1 ; - sh:resultPath ex:otherProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:ClosedConstraintComponent ; - sh:sourceShape ex:MyShape ; - sh:value 4 ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidInstance1 + ex:otherProperty 4 ; + ex:someProperty 3 ; +. +ex:MyShape + rdf:type sh:NodeShape ; + sh:closed "true"^^xsd:boolean ; + sh:ignoredProperties ( + rdf:type + ) ; + sh:property [ + sh:path ex:someProperty ; + ] ; + sh:targetNode ex:InvalidInstance1 ; + sh:targetNode ex:ValidInstance1 ; +. +ex:ValidInstance1 + rdf:type ex:SomeClass ; + ex:someProperty 3 ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:closed at node shape 002" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance1 ; + sh:resultPath ex:otherProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:ClosedConstraintComponent ; + sh:sourceShape ex:MyShape ; + sh:value 4 ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/node/datatype-001.ttl b/modules/shacl/src/test/resources/tests/core/node/datatype-001.ttl index a6ac937f4..427572d45 100644 --- a/modules/shacl/src/test/resources/tests/core/node/datatype-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/node/datatype-001.ttl @@ -1,64 +1,64 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:TestShape - rdf:type sh:NodeShape ; - sh:datatype xsd:integer ; - sh:targetClass ex:TestClass ; - sh:targetNode xsd:integer ; - sh:targetNode 42 ; - sh:targetNode "aldi"^^xsd:integer ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:datatype at node shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode xsd:integer ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value xsd:integer ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode "aldi"^^xsd:integer ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value "aldi"^^xsd:integer ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode _:b30507 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value _:b30507 ; - ] ; - ] ; - mf:status sht:approved ; -. -_:b30507 - rdf:type ex:TestClass ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:TestShape + rdf:type sh:NodeShape ; + sh:datatype xsd:integer ; + sh:targetClass ex:TestClass ; + sh:targetNode xsd:integer ; + sh:targetNode 42 ; + sh:targetNode "aldi"^^xsd:integer ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:datatype at node shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode xsd:integer ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value xsd:integer ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode "aldi"^^xsd:integer ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value "aldi"^^xsd:integer ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode _:b30507 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value _:b30507 ; + ] ; + ] ; + mf:status sht:approved ; +. +_:b30507 + rdf:type ex:TestClass ; +. diff --git a/modules/shacl/src/test/resources/tests/core/node/disjoint-001.ttl b/modules/shacl/src/test/resources/tests/core/node/disjoint-001.ttl index eddadd79a..d98158ad9 100644 --- a/modules/shacl/src/test/resources/tests/core/node/disjoint-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/node/disjoint-001.ttl @@ -1,51 +1,51 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidResource1 - ex:property ex:InvalidResource1 ; - ex:property ex:ValidResource1 ; -. -ex:TestShape - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:disjoint ex:property ; - sh:targetNode ex:InvalidResource1 ; - sh:targetNode ex:ValidResource1 ; -. -ex:ValidResource1 - ex:property ex:InvalidResource1 ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:disjoint at node shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:DisjointConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:InvalidResource1 ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidResource1 + ex:property ex:InvalidResource1 ; + ex:property ex:ValidResource1 ; +. +ex:TestShape + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:disjoint ex:property ; + sh:targetNode ex:InvalidResource1 ; + sh:targetNode ex:ValidResource1 ; +. +ex:ValidResource1 + ex:property ex:InvalidResource1 ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:disjoint at node shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:DisjointConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:InvalidResource1 ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/node/equals-001.ttl b/modules/shacl/src/test/resources/tests/core/node/equals-001.ttl index 21ed522f0..8f23966b8 100644 --- a/modules/shacl/src/test/resources/tests/core/node/equals-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/node/equals-001.ttl @@ -1,59 +1,59 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidResource1 - ex:property ex:InvalidResource1 ; - ex:property ex:SomeValue ; -. -ex:TestShape - rdf:type sh:NodeShape ; - sh:equals ex:property ; - sh:targetNode ex:InvalidResource1 ; - sh:targetNode ex:InvalidResource2 ; - sh:targetNode ex:ValidResource1 ; -. -ex:ValidResource1 - ex:property ex:ValidResource1 ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:equals at node shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:EqualsConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:SomeValue ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource2 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:EqualsConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:InvalidResource2 ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidResource1 + ex:property ex:InvalidResource1 ; + ex:property ex:SomeValue ; +. +ex:TestShape + rdf:type sh:NodeShape ; + sh:equals ex:property ; + sh:targetNode ex:InvalidResource1 ; + sh:targetNode ex:InvalidResource2 ; + sh:targetNode ex:ValidResource1 ; +. +ex:ValidResource1 + ex:property ex:ValidResource1 ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:equals at node shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:EqualsConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:SomeValue ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource2 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:EqualsConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:InvalidResource2 ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/node/hasValue-001.ttl b/modules/shacl/src/test/resources/tests/core/node/hasValue-001.ttl index 0c401fcff..139b4ddd9 100644 --- a/modules/shacl/src/test/resources/tests/core/node/hasValue-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/node/hasValue-001.ttl @@ -1,44 +1,44 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:TestShape - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:hasValue "Test" ; - sh:targetNode "Invalid String" ; - sh:targetNode "Test" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:hasValue at node shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode "Invalid String" ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:HasValueConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value "Invalid String" ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:TestShape + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:hasValue "Test" ; + sh:targetNode "Invalid String" ; + sh:targetNode "Test" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:hasValue at node shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode "Invalid String" ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:HasValueConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value "Invalid String" ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/node/in-001.ttl b/modules/shacl/src/test/resources/tests/core/node/in-001.ttl index d79083c19..8fb4c0852 100644 --- a/modules/shacl/src/test/resources/tests/core/node/in-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/node/in-001.ttl @@ -1,63 +1,63 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:Green - rdf:type ex:TestShape ; - rdfs:label "Green" ; -. -ex:InvalidInstance - rdf:type ex:TestShape ; - rdfs:label "Invalid instance" ; -. -ex:Red - rdf:type ex:TestShape ; - rdfs:label "Red" ; -. -ex:TestShape - rdf:type rdfs:Class ; - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:in ( - ex:Green - ex:Red - ex:Yellow - ) ; -. -ex:Yellow - rdf:type ex:TestShape ; - rdfs:label "Yellow" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:in at node shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:InConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:InvalidInstance ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:Green + rdf:type ex:TestShape ; + rdfs:label "Green" ; +. +ex:InvalidInstance + rdf:type ex:TestShape ; + rdfs:label "Invalid instance" ; +. +ex:Red + rdf:type ex:TestShape ; + rdfs:label "Red" ; +. +ex:TestShape + rdf:type rdfs:Class ; + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:in ( + ex:Green + ex:Red + ex:Yellow + ) ; +. +ex:Yellow + rdf:type ex:TestShape ; + rdfs:label "Yellow" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:in at node shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:InConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:InvalidInstance ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/node/languageIn-001.ttl b/modules/shacl/src/test/resources/tests/core/node/languageIn-001.ttl index 49f70bccd..b8365d258 100644 --- a/modules/shacl/src/test/resources/tests/core/node/languageIn-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/node/languageIn-001.ttl @@ -1,66 +1,66 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:TestShape - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:languageIn ( - "en" - "fr" - ) ; - sh:targetNode rdfs:Resource ; - sh:targetNode "Deutsch"@de ; - sh:targetNode "English"@en ; - sh:targetNode "Francais"@fr ; - sh:targetNode "Plain String" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:languageIn at node shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode rdfs:Resource ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:LanguageInConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value rdfs:Resource ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode "Deutsch"@de ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:LanguageInConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value "Deutsch"@de ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode "Plain String" ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:LanguageInConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value "Plain String" ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:TestShape + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:languageIn ( + "en" + "fr" + ) ; + sh:targetNode rdfs:Resource ; + sh:targetNode "Deutsch"@de ; + sh:targetNode "English"@en ; + sh:targetNode "Francais"@fr ; + sh:targetNode "Plain String" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:languageIn at node shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode rdfs:Resource ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:LanguageInConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value rdfs:Resource ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode "Deutsch"@de ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:LanguageInConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value "Deutsch"@de ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode "Plain String" ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:LanguageInConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value "Plain String" ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/node/maxExclusive-001.ttl b/modules/shacl/src/test/resources/tests/core/node/maxExclusive-001.ttl index c001c0995..7c2b17718 100644 --- a/modules/shacl/src/test/resources/tests/core/node/maxExclusive-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/node/maxExclusive-001.ttl @@ -1,91 +1,91 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:TestShape - rdf:type sh:NodeShape ; - sh:maxExclusive 4 ; - sh:targetClass ex:TestClass ; - sh:targetNode ex:John ; - sh:targetNode 3.9 ; - sh:targetNode 4 ; - sh:targetNode 4.0 ; - sh:targetNode 4.1 ; - sh:targetNode "Hello" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:maxExclusive at node shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:John ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxExclusiveConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:John ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode 4 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxExclusiveConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value 4 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode 4.0 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxExclusiveConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value 4.0 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode 4.1 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxExclusiveConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value 4.1 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode "Hello" ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxExclusiveConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value "Hello" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode _:b11982 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxExclusiveConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value _:b11982 ; - ] ; - ] ; - mf:status sht:approved ; -. -_:b11982 - rdf:type ex:TestClass ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:TestShape + rdf:type sh:NodeShape ; + sh:maxExclusive 4 ; + sh:targetClass ex:TestClass ; + sh:targetNode ex:John ; + sh:targetNode 3.9 ; + sh:targetNode 4 ; + sh:targetNode 4.0 ; + sh:targetNode 4.1 ; + sh:targetNode "Hello" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:maxExclusive at node shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:John ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxExclusiveConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:John ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode 4 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxExclusiveConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value 4 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode 4.0 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxExclusiveConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value 4.0 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode 4.1 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxExclusiveConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value 4.1 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode "Hello" ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxExclusiveConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value "Hello" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode _:b11982 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxExclusiveConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value _:b11982 ; + ] ; + ] ; + mf:status sht:approved ; +. +_:b11982 + rdf:type ex:TestClass ; +. diff --git a/modules/shacl/src/test/resources/tests/core/node/maxInclusive-001.ttl b/modules/shacl/src/test/resources/tests/core/node/maxInclusive-001.ttl index a1bea3044..f30c9425d 100644 --- a/modules/shacl/src/test/resources/tests/core/node/maxInclusive-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/node/maxInclusive-001.ttl @@ -1,75 +1,75 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:TestShape - rdf:type sh:NodeShape ; - sh:maxInclusive 4 ; - sh:targetClass ex:TestClass ; - sh:targetNode ex:John ; - sh:targetNode 3.9 ; - sh:targetNode 4 ; - sh:targetNode 4.0 ; - sh:targetNode 4.1 ; - sh:targetNode "Hello" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:maxInclusive at node shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:John ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxInclusiveConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:John ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode 4.1 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxInclusiveConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value 4.1 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode "Hello" ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxInclusiveConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value "Hello" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode _:b22005 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxInclusiveConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value _:b22005 ; - ] ; - ] ; - mf:status sht:approved ; -. -_:b22005 - rdf:type ex:TestClass ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:TestShape + rdf:type sh:NodeShape ; + sh:maxInclusive 4 ; + sh:targetClass ex:TestClass ; + sh:targetNode ex:John ; + sh:targetNode 3.9 ; + sh:targetNode 4 ; + sh:targetNode 4.0 ; + sh:targetNode 4.1 ; + sh:targetNode "Hello" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:maxInclusive at node shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:John ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxInclusiveConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:John ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode 4.1 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxInclusiveConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value 4.1 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode "Hello" ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxInclusiveConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value "Hello" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode _:b22005 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxInclusiveConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value _:b22005 ; + ] ; + ] ; + mf:status sht:approved ; +. +_:b22005 + rdf:type ex:TestClass ; +. diff --git a/modules/shacl/src/test/resources/tests/core/node/maxLength-001.ttl b/modules/shacl/src/test/resources/tests/core/node/maxLength-001.ttl index 8eeebb537..bd197e257 100644 --- a/modules/shacl/src/test/resources/tests/core/node/maxLength-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/node/maxLength-001.ttl @@ -1,87 +1,87 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:TestShape - rdf:type sh:NodeShape ; - sh:maxLength 4 ; - sh:targetClass ex:TestClass ; - sh:targetNode ; - sh:targetNode ex:John ; - sh:targetNode 123 ; - sh:targetNode 1234 ; - sh:targetNode 12345 ; - sh:targetNode "2017-03-29"^^xsd:date ; - sh:targetNode "Hel" ; - sh:targetNode "Hell" ; - sh:targetNode "Hell"@en ; - sh:targetNode "Hello" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:maxLength at node shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:John ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxLengthConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:John ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode 12345 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxLengthConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value 12345 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode "2017-03-29"^^xsd:date ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxLengthConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value "2017-03-29"^^xsd:date ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode "Hello" ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxLengthConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value "Hello" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode _:b34236 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxLengthConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value _:b34236 ; - ] ; - ] ; - mf:status sht:approved ; -. -_:b34236 - rdf:type ex:TestClass ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:TestShape + rdf:type sh:NodeShape ; + sh:maxLength 4 ; + sh:targetClass ex:TestClass ; + sh:targetNode ; + sh:targetNode ex:John ; + sh:targetNode 123 ; + sh:targetNode 1234 ; + sh:targetNode 12345 ; + sh:targetNode "2017-03-29"^^xsd:date ; + sh:targetNode "Hel" ; + sh:targetNode "Hell" ; + sh:targetNode "Hell"@en ; + sh:targetNode "Hello" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:maxLength at node shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:John ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxLengthConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:John ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode 12345 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxLengthConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value 12345 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode "2017-03-29"^^xsd:date ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxLengthConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value "2017-03-29"^^xsd:date ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode "Hello" ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxLengthConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value "Hello" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode _:b34236 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxLengthConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value _:b34236 ; + ] ; + ] ; + mf:status sht:approved ; +. +_:b34236 + rdf:type ex:TestClass ; +. diff --git a/modules/shacl/src/test/resources/tests/core/node/minExclusive-001.ttl b/modules/shacl/src/test/resources/tests/core/node/minExclusive-001.ttl index 511629de9..721915043 100644 --- a/modules/shacl/src/test/resources/tests/core/node/minExclusive-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/node/minExclusive-001.ttl @@ -1,91 +1,91 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:TestShape - rdf:type sh:NodeShape ; - sh:minExclusive 4 ; - sh:targetClass ex:TestClass ; - sh:targetNode ex:John ; - sh:targetNode 3.9 ; - sh:targetNode 4 ; - sh:targetNode 4.0 ; - sh:targetNode 4.1 ; - sh:targetNode "Hello" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:minExclusive at node shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:John ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinExclusiveConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:John ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode 3.9 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinExclusiveConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value 3.9 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode 4 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinExclusiveConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value 4 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode 4.0 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinExclusiveConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value 4.0 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode "Hello" ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinExclusiveConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value "Hello" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode _:b33079 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinExclusiveConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value _:b33079 ; - ] ; - ] ; - mf:status sht:approved ; -. -_:b33079 - rdf:type ex:TestClass ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:TestShape + rdf:type sh:NodeShape ; + sh:minExclusive 4 ; + sh:targetClass ex:TestClass ; + sh:targetNode ex:John ; + sh:targetNode 3.9 ; + sh:targetNode 4 ; + sh:targetNode 4.0 ; + sh:targetNode 4.1 ; + sh:targetNode "Hello" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:minExclusive at node shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:John ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinExclusiveConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:John ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode 3.9 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinExclusiveConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value 3.9 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode 4 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinExclusiveConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value 4 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode 4.0 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinExclusiveConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value 4.0 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode "Hello" ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinExclusiveConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value "Hello" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode _:b33079 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinExclusiveConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value _:b33079 ; + ] ; + ] ; + mf:status sht:approved ; +. +_:b33079 + rdf:type ex:TestClass ; +. diff --git a/modules/shacl/src/test/resources/tests/core/node/minInclusive-001.ttl b/modules/shacl/src/test/resources/tests/core/node/minInclusive-001.ttl index 4b6cb4ac3..e2113bf04 100644 --- a/modules/shacl/src/test/resources/tests/core/node/minInclusive-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/node/minInclusive-001.ttl @@ -1,44 +1,44 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:TestShape - rdf:type sh:NodeShape ; - sh:minInclusive 8 ; - sh:targetNode 7 ; - sh:targetNode 8 ; - sh:targetNode 9 ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:minInclusive at node shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode 7 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinInclusiveConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value 7 ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:TestShape + rdf:type sh:NodeShape ; + sh:minInclusive 8 ; + sh:targetNode 7 ; + sh:targetNode 8 ; + sh:targetNode 9 ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:minInclusive at node shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode 7 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinInclusiveConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value 7 ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/node/minInclusive-002.ttl b/modules/shacl/src/test/resources/tests/core/node/minInclusive-002.ttl index 15b5feab9..e9a8d5ee0 100644 --- a/modules/shacl/src/test/resources/tests/core/node/minInclusive-002.ttl +++ b/modules/shacl/src/test/resources/tests/core/node/minInclusive-002.ttl @@ -1,61 +1,61 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:TestShape a sh:NodeShape ; - sh:minInclusive "2002-10-10T12:00:00-05:00"^^xsd:dateTime ; - sh:targetNode "2002-10-10T12:00:00-05:00"^^xsd:dateTime ; - sh:targetNode "2002-10-10T12:00:01-05:00"^^xsd:dateTime ; - sh:targetNode "2002-10-09T12:00:00-05:00"^^xsd:dateTime ; - sh:targetNode "2002-10-10T12:00:00"^^xsd:dateTime ; - sh:targetNode ex:TestShape ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:minInclusive at node shape 002 - dateTime with timezone" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode "2002-10-10T12:00:00"^^xsd:dateTime ; - sh:value "2002-10-10T12:00:00"^^xsd:dateTime ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinInclusiveConstraintComponent ; - sh:sourceShape ex:TestShape ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode "2002-10-09T12:00:00-05:00"^^xsd:dateTime ; - sh:value "2002-10-09T12:00:00-05:00"^^xsd:dateTime ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinInclusiveConstraintComponent ; - sh:sourceShape ex:TestShape ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:TestShape ; - sh:value ex:TestShape ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinInclusiveConstraintComponent ; - sh:sourceShape ex:TestShape ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:TestShape a sh:NodeShape ; + sh:minInclusive "2002-10-10T12:00:00-05:00"^^xsd:dateTime ; + sh:targetNode "2002-10-10T12:00:00-05:00"^^xsd:dateTime ; + sh:targetNode "2002-10-10T12:00:01-05:00"^^xsd:dateTime ; + sh:targetNode "2002-10-09T12:00:00-05:00"^^xsd:dateTime ; + sh:targetNode "2002-10-10T12:00:00"^^xsd:dateTime ; + sh:targetNode ex:TestShape ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:minInclusive at node shape 002 - dateTime with timezone" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode "2002-10-10T12:00:00"^^xsd:dateTime ; + sh:value "2002-10-10T12:00:00"^^xsd:dateTime ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinInclusiveConstraintComponent ; + sh:sourceShape ex:TestShape ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode "2002-10-09T12:00:00-05:00"^^xsd:dateTime ; + sh:value "2002-10-09T12:00:00-05:00"^^xsd:dateTime ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinInclusiveConstraintComponent ; + sh:sourceShape ex:TestShape ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:TestShape ; + sh:value ex:TestShape ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinInclusiveConstraintComponent ; + sh:sourceShape ex:TestShape ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/node/minInclusive-003.ttl b/modules/shacl/src/test/resources/tests/core/node/minInclusive-003.ttl index 99c56f63d..306ca78be 100644 --- a/modules/shacl/src/test/resources/tests/core/node/minInclusive-003.ttl +++ b/modules/shacl/src/test/resources/tests/core/node/minInclusive-003.ttl @@ -1,70 +1,70 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:TestShape - rdf:type sh:NodeShape ; - sh:minInclusive "2002-10-10T12:00:00"^^xsd:dateTime ; - sh:targetNode "2002-10-10T12:00:00-05:00"^^xsd:dateTime ; - sh:targetNode "2002-10-10T12:00:01-05:00"^^xsd:dateTime ; - sh:targetNode "2002-10-09T12:00:00-05:00"^^xsd:dateTime ; - sh:targetNode "2002-10-10T12:00:00"^^xsd:dateTime ; - sh:targetNode ex:TestShape ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:minInclusive at node shape 003 - dateTime without timezone" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode "2002-10-10T12:00:00-05:00"^^xsd:dateTime ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinInclusiveConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value "2002-10-10T12:00:00-05:00"^^xsd:dateTime ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode "2002-10-10T12:00:01-05:00"^^xsd:dateTime ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinInclusiveConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value "2002-10-10T12:00:01-05:00"^^xsd:dateTime ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode "2002-10-09T12:00:00-05:00"^^xsd:dateTime ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinInclusiveConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value "2002-10-09T12:00:00-05:00"^^xsd:dateTime ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:TestShape ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinInclusiveConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:TestShape ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:TestShape + rdf:type sh:NodeShape ; + sh:minInclusive "2002-10-10T12:00:00"^^xsd:dateTime ; + sh:targetNode "2002-10-10T12:00:00-05:00"^^xsd:dateTime ; + sh:targetNode "2002-10-10T12:00:01-05:00"^^xsd:dateTime ; + sh:targetNode "2002-10-09T12:00:00-05:00"^^xsd:dateTime ; + sh:targetNode "2002-10-10T12:00:00"^^xsd:dateTime ; + sh:targetNode ex:TestShape ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:minInclusive at node shape 003 - dateTime without timezone" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode "2002-10-10T12:00:00-05:00"^^xsd:dateTime ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinInclusiveConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value "2002-10-10T12:00:00-05:00"^^xsd:dateTime ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode "2002-10-10T12:00:01-05:00"^^xsd:dateTime ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinInclusiveConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value "2002-10-10T12:00:01-05:00"^^xsd:dateTime ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode "2002-10-09T12:00:00-05:00"^^xsd:dateTime ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinInclusiveConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value "2002-10-09T12:00:00-05:00"^^xsd:dateTime ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:TestShape ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinInclusiveConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:TestShape ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/node/minLength-001.ttl b/modules/shacl/src/test/resources/tests/core/node/minLength-001.ttl index 2dd5e4018..75151fe7f 100644 --- a/modules/shacl/src/test/resources/tests/core/node/minLength-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/node/minLength-001.ttl @@ -1,79 +1,79 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:TestShape - rdf:type sh:NodeShape ; - sh:minLength 4 ; - sh:targetClass ex:TestClass ; - sh:targetNode ; - sh:targetNode ex:John ; - sh:targetNode 123 ; - sh:targetNode 1234 ; - sh:targetNode 12345 ; - sh:targetNode "2017-03-29"^^xsd:date ; - sh:targetNode "Hel" ; - sh:targetNode "Hell" ; - sh:targetNode "Hell"@en ; - sh:targetNode "Hello" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:minLength at node shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinLengthConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode 123 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinLengthConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value 123 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode "Hel" ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinLengthConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value "Hel" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode _:b19019 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinLengthConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value _:b19019 ; - ] ; - ] ; - mf:status sht:approved ; -. -_:b19019 - rdf:type ex:TestClass ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:TestShape + rdf:type sh:NodeShape ; + sh:minLength 4 ; + sh:targetClass ex:TestClass ; + sh:targetNode ; + sh:targetNode ex:John ; + sh:targetNode 123 ; + sh:targetNode 1234 ; + sh:targetNode 12345 ; + sh:targetNode "2017-03-29"^^xsd:date ; + sh:targetNode "Hel" ; + sh:targetNode "Hell" ; + sh:targetNode "Hell"@en ; + sh:targetNode "Hello" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:minLength at node shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinLengthConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode 123 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinLengthConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value 123 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode "Hel" ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinLengthConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value "Hel" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode _:b19019 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinLengthConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value _:b19019 ; + ] ; + ] ; + mf:status sht:approved ; +. +_:b19019 + rdf:type ex:TestClass ; +. diff --git a/modules/shacl/src/test/resources/tests/core/node/node-001.ttl b/modules/shacl/src/test/resources/tests/core/node/node-001.ttl index 692d85eea..b6d717085 100644 --- a/modules/shacl/src/test/resources/tests/core/node/node-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/node/node-001.ttl @@ -1,55 +1,55 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidInstance - rdf:type ex:TestClass ; - rdfs:label "Invalid instance" ; -. -ex:TestClass - rdf:type rdfs:Class ; - rdf:type sh:NodeShape ; - rdfs:label "Test class" ; - rdfs:subClassOf rdfs:Resource ; - sh:node [ - sh:class ex:OtherClass ; - ] ; -. -ex:ValidInstance - rdf:type ex:OtherClass ; - rdf:type ex:TestClass ; - rdfs:label "Valid instance" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:node at node shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeConstraintComponent ; - sh:sourceShape ex:TestClass ; - sh:value ex:InvalidInstance ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidInstance + rdf:type ex:TestClass ; + rdfs:label "Invalid instance" ; +. +ex:TestClass + rdf:type rdfs:Class ; + rdf:type sh:NodeShape ; + rdfs:label "Test class" ; + rdfs:subClassOf rdfs:Resource ; + sh:node [ + sh:class ex:OtherClass ; + ] ; +. +ex:ValidInstance + rdf:type ex:OtherClass ; + rdf:type ex:TestClass ; + rdfs:label "Valid instance" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:node at node shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeConstraintComponent ; + sh:sourceShape ex:TestClass ; + sh:value ex:InvalidInstance ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/node/nodeKind-001.ttl b/modules/shacl/src/test/resources/tests/core/node/nodeKind-001.ttl index 4ec603e6c..004f8fa25 100644 --- a/modules/shacl/src/test/resources/tests/core/node/nodeKind-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/node/nodeKind-001.ttl @@ -1,43 +1,43 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:IRITestShape - rdf:type sh:NodeShape ; - sh:nodeKind sh:IRI ; - sh:targetNode ex:John ; - sh:targetNode "true"^^xsd:boolean ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:nodeKind at node shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode "true"^^xsd:boolean ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape ex:IRITestShape ; - sh:value "true"^^xsd:boolean ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:IRITestShape + rdf:type sh:NodeShape ; + sh:nodeKind sh:IRI ; + sh:targetNode ex:John ; + sh:targetNode "true"^^xsd:boolean ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:nodeKind at node shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode "true"^^xsd:boolean ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape ex:IRITestShape ; + sh:value "true"^^xsd:boolean ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/node/not-001.ttl b/modules/shacl/src/test/resources/tests/core/node/not-001.ttl index 4bb813762..588436cf0 100644 --- a/modules/shacl/src/test/resources/tests/core/node/not-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/node/not-001.ttl @@ -1,59 +1,59 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidResource1 - rdf:type rdfs:Resource ; - ex:property "some value" ; -. -ex:TestShape - rdf:type rdfs:Class ; - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - rdfs:subClassOf rdfs:Resource ; - sh:not [ - rdf:type sh:NodeShape ; - sh:property [ - sh:path ex:property ; - sh:minCount 1 ; - ] ; - ] ; - sh:targetNode ex:InvalidResource1 ; - sh:targetNode ex:ValidResource1 ; -. -ex:ValidResource1 - rdf:type rdfs:Resource ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:not at node shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NotConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:InvalidResource1 ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidResource1 + rdf:type rdfs:Resource ; + ex:property "some value" ; +. +ex:TestShape + rdf:type rdfs:Class ; + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + rdfs:subClassOf rdfs:Resource ; + sh:not [ + rdf:type sh:NodeShape ; + sh:property [ + sh:path ex:property ; + sh:minCount 1 ; + ] ; + ] ; + sh:targetNode ex:InvalidResource1 ; + sh:targetNode ex:ValidResource1 ; +. +ex:ValidResource1 + rdf:type rdfs:Resource ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:not at node shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NotConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:InvalidResource1 ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/node/not-002.ttl b/modules/shacl/src/test/resources/tests/core/node/not-002.ttl index 1303738e9..cf43632de 100644 --- a/modules/shacl/src/test/resources/tests/core/node/not-002.ttl +++ b/modules/shacl/src/test/resources/tests/core/node/not-002.ttl @@ -1,52 +1,52 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidInstance1 - ex:property "Some value" ; -. -ex:NotExampleShape - rdf:type sh:NodeShape ; - sh:not [ - rdf:type sh:NodeShape ; - sh:property [ - sh:path ex:property ; - sh:minCount 1 ; - ] ; - ] ; - sh:targetNode ex:InvalidInstance1 ; - sh:targetNode ex:ValidInstance1 ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:not at node shape 002" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance1 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NotConstraintComponent ; - sh:sourceShape ex:NotExampleShape ; - sh:value ex:InvalidInstance1 ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidInstance1 + ex:property "Some value" ; +. +ex:NotExampleShape + rdf:type sh:NodeShape ; + sh:not [ + rdf:type sh:NodeShape ; + sh:property [ + sh:path ex:property ; + sh:minCount 1 ; + ] ; + ] ; + sh:targetNode ex:InvalidInstance1 ; + sh:targetNode ex:ValidInstance1 ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:not at node shape 002" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance1 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NotConstraintComponent ; + sh:sourceShape ex:NotExampleShape ; + sh:value ex:InvalidInstance1 ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/node/or-001.ttl b/modules/shacl/src/test/resources/tests/core/node/or-001.ttl index ca5a9ab68..455c8c641 100644 --- a/modules/shacl/src/test/resources/tests/core/node/or-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/node/or-001.ttl @@ -1,91 +1,91 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidRectangle1 - rdf:type ex:RectangleWithArea ; - ex:height 3 ; -. -ex:InvalidRectangle2 - rdf:type ex:RectangleWithArea ; -. -ex:RectangleWithArea - rdf:type rdfs:Class ; - rdf:type sh:NodeShape ; - rdfs:subClassOf rdfs:Resource ; - sh:or ( - [ - sh:property [ - sh:path ex:height ; - sh:minCount 1 ; - ] ; - sh:property [ - sh:path ex:width ; - sh:minCount 1 ; - ] ; - ] - [ - sh:property [ - sh:path ex:area ; - sh:minCount 1 ; - ] ; - ] - ) ; -. -ex:ValidRectangle1 - rdf:type ex:RectangleWithArea ; - ex:height 3 ; - ex:width 2 ; -. -ex:ValidRectangle2 - rdf:type ex:RectangleWithArea ; - ex:area 6 ; - ex:height 3 ; - ex:width 2 ; -. -ex:ValidRectangle3 - rdf:type ex:RectangleWithArea ; - ex:area 6 ; - ex:height 3 ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:or at node shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidRectangle1 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:OrConstraintComponent ; - sh:sourceShape ex:RectangleWithArea ; - sh:value ex:InvalidRectangle1 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidRectangle2 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:OrConstraintComponent ; - sh:sourceShape ex:RectangleWithArea ; - sh:value ex:InvalidRectangle2 ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidRectangle1 + rdf:type ex:RectangleWithArea ; + ex:height 3 ; +. +ex:InvalidRectangle2 + rdf:type ex:RectangleWithArea ; +. +ex:RectangleWithArea + rdf:type rdfs:Class ; + rdf:type sh:NodeShape ; + rdfs:subClassOf rdfs:Resource ; + sh:or ( + [ + sh:property [ + sh:path ex:height ; + sh:minCount 1 ; + ] ; + sh:property [ + sh:path ex:width ; + sh:minCount 1 ; + ] ; + ] + [ + sh:property [ + sh:path ex:area ; + sh:minCount 1 ; + ] ; + ] + ) ; +. +ex:ValidRectangle1 + rdf:type ex:RectangleWithArea ; + ex:height 3 ; + ex:width 2 ; +. +ex:ValidRectangle2 + rdf:type ex:RectangleWithArea ; + ex:area 6 ; + ex:height 3 ; + ex:width 2 ; +. +ex:ValidRectangle3 + rdf:type ex:RectangleWithArea ; + ex:area 6 ; + ex:height 3 ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:or at node shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidRectangle1 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:OrConstraintComponent ; + sh:sourceShape ex:RectangleWithArea ; + sh:value ex:InvalidRectangle1 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidRectangle2 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:OrConstraintComponent ; + sh:sourceShape ex:RectangleWithArea ; + sh:value ex:InvalidRectangle2 ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/node/pattern-001.ttl b/modules/shacl/src/test/resources/tests/core/node/pattern-001.ttl index 5a0cab2ec..31d77efc6 100644 --- a/modules/shacl/src/test/resources/tests/core/node/pattern-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/node/pattern-001.ttl @@ -1,76 +1,76 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:TestShape - rdf:type sh:NodeShape ; - sh:pattern "^[2-8][0-9]*$" ; - sh:targetClass ex:TestClass ; - sh:targetNode ex:Test ; - sh:targetNode 20000123 ; - sh:targetNode "3456" ; - sh:targetNode 39 ; - sh:targetNode "777777"@mi ; - sh:targetNode 9 ; - sh:targetNode "John" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:pattern at node shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:Test ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:PatternConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:Test ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode 9 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:PatternConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value 9 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode "John" ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:PatternConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value "John" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode _:b22415 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:PatternConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value _:b22415 ; - ] ; - ] ; - mf:status sht:approved ; -. -_:b22415 - rdf:type ex:TestClass ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:TestShape + rdf:type sh:NodeShape ; + sh:pattern "^[2-8][0-9]*$" ; + sh:targetClass ex:TestClass ; + sh:targetNode ex:Test ; + sh:targetNode 20000123 ; + sh:targetNode "3456" ; + sh:targetNode 39 ; + sh:targetNode "777777"@mi ; + sh:targetNode 9 ; + sh:targetNode "John" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:pattern at node shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:Test ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:PatternConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:Test ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode 9 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:PatternConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value 9 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode "John" ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:PatternConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value "John" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode _:b22415 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:PatternConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value _:b22415 ; + ] ; + ] ; + mf:status sht:approved ; +. +_:b22415 + rdf:type ex:TestClass ; +. diff --git a/modules/shacl/src/test/resources/tests/core/node/pattern-002.ttl b/modules/shacl/src/test/resources/tests/core/node/pattern-002.ttl index a0c9c1476..fadc4d9a5 100644 --- a/modules/shacl/src/test/resources/tests/core/node/pattern-002.ttl +++ b/modules/shacl/src/test/resources/tests/core/node/pattern-002.ttl @@ -1,45 +1,45 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:TestShape - rdf:type sh:NodeShape ; - sh:flags "i" ; - sh:pattern "Aldi" ; - sh:targetNode "Aldi" ; - sh:targetNode "Alti" ; - sh:targetNode "aLdI" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:pattern at node shape 002" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode "Alti" ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:PatternConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value "Alti" ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:TestShape + rdf:type sh:NodeShape ; + sh:flags "i" ; + sh:pattern "Aldi" ; + sh:targetNode "Aldi" ; + sh:targetNode "Alti" ; + sh:targetNode "aLdI" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:pattern at node shape 002" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode "Alti" ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:PatternConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value "Alti" ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/node/xone-001.ttl b/modules/shacl/src/test/resources/tests/core/node/xone-001.ttl index 6ae110d85..79011d8bf 100644 --- a/modules/shacl/src/test/resources/tests/core/node/xone-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/node/xone-001.ttl @@ -1,74 +1,74 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:Bob - rdf:type ex:Person ; - ex:firstName "Robert" ; - ex:lastName "Coin" ; -. -ex:Carla - rdf:type ex:Person ; - ex:fullName "Carla Miller" ; -. -ex:Dory - rdf:type ex:Person ; - ex:firstName "Dory" ; - ex:fullName "Dory Dunce" ; - ex:lastName "Dunce" ; -. -ex:XoneConstraintExampleShape - rdf:type sh:NodeShape ; - sh:targetClass ex:Person ; - sh:xone ( - [ - sh:property [ - sh:path ex:fullName ; - sh:minCount 1 ; - ] ; - ] - [ - sh:property [ - sh:path ex:firstName ; - sh:minCount 1 ; - ] ; - sh:property [ - sh:path ex:lastName ; - sh:minCount 1 ; - ] ; - ] - ) ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:xone at node shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:Dory ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:XoneConstraintComponent ; - sh:sourceShape ex:XoneConstraintExampleShape ; - sh:value ex:Dory ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:Bob + rdf:type ex:Person ; + ex:firstName "Robert" ; + ex:lastName "Coin" ; +. +ex:Carla + rdf:type ex:Person ; + ex:fullName "Carla Miller" ; +. +ex:Dory + rdf:type ex:Person ; + ex:firstName "Dory" ; + ex:fullName "Dory Dunce" ; + ex:lastName "Dunce" ; +. +ex:XoneConstraintExampleShape + rdf:type sh:NodeShape ; + sh:targetClass ex:Person ; + sh:xone ( + [ + sh:property [ + sh:path ex:fullName ; + sh:minCount 1 ; + ] ; + ] + [ + sh:property [ + sh:path ex:firstName ; + sh:minCount 1 ; + ] ; + sh:property [ + sh:path ex:lastName ; + sh:minCount 1 ; + ] ; + ] + ) ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:xone at node shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:Dory ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:XoneConstraintComponent ; + sh:sourceShape ex:XoneConstraintExampleShape ; + sh:value ex:Dory ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/path/path-inverse-001.ttl b/modules/shacl/src/test/resources/tests/core/path/path-inverse-001.ttl index f19b8707f..a4c4ac4d1 100644 --- a/modules/shacl/src/test/resources/tests/core/path/path-inverse-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/path/path-inverse-001.ttl @@ -1,90 +1,90 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidResource1 - rdf:type ex:Person ; -. -ex:InvalidResource2 - rdf:type ex:Person ; -. -ex:Parent1 - ex:child ex:InvalidResource1 ; - ex:child ex:InvalidResource2 ; - ex:child ex:ValidResource1 ; -. -ex:Parent2 - ex:child ex:InvalidResource2 ; - ex:child ex:ValidResource1 ; -. -ex:Parent3 - ex:child ex:InvalidResource2 ; -. -ex:Person - rdf:type rdfs:Class ; - rdf:type sh:NodeShape ; - rdfs:label "Person" ; - rdfs:subClassOf rdfs:Resource ; -. -ex:TestShape - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:property ex:TestShape-P ; - sh:targetClass ex:Person ; -. -ex:TestShape-P - rdf:type sh:PropertyShape ; - sh:path [ - sh:inversePath ex:child ; - ] ; - sh:maxCount 2 ; - sh:minCount 2 ; -. -ex:ValidResource1 - rdf:type ex:Person ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of path sh:inversePath 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultPath [ - sh:inversePath ex:child ; - ] ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinCountConstraintComponent ; - sh:sourceShape ex:TestShape-P ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource2 ; - sh:resultPath [ - sh:inversePath ex:child ; - ] ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxCountConstraintComponent ; - sh:sourceShape ex:TestShape-P ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidResource1 + rdf:type ex:Person ; +. +ex:InvalidResource2 + rdf:type ex:Person ; +. +ex:Parent1 + ex:child ex:InvalidResource1 ; + ex:child ex:InvalidResource2 ; + ex:child ex:ValidResource1 ; +. +ex:Parent2 + ex:child ex:InvalidResource2 ; + ex:child ex:ValidResource1 ; +. +ex:Parent3 + ex:child ex:InvalidResource2 ; +. +ex:Person + rdf:type rdfs:Class ; + rdf:type sh:NodeShape ; + rdfs:label "Person" ; + rdfs:subClassOf rdfs:Resource ; +. +ex:TestShape + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:property ex:TestShape-P ; + sh:targetClass ex:Person ; +. +ex:TestShape-P + rdf:type sh:PropertyShape ; + sh:path [ + sh:inversePath ex:child ; + ] ; + sh:maxCount 2 ; + sh:minCount 2 ; +. +ex:ValidResource1 + rdf:type ex:Person ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of path sh:inversePath 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultPath [ + sh:inversePath ex:child ; + ] ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinCountConstraintComponent ; + sh:sourceShape ex:TestShape-P ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource2 ; + sh:resultPath [ + sh:inversePath ex:child ; + ] ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxCountConstraintComponent ; + sh:sourceShape ex:TestShape-P ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/property/and-001.ttl b/modules/shacl/src/test/resources/tests/core/property/and-001.ttl index c011bdf48..57eeaf456 100644 --- a/modules/shacl/src/test/resources/tests/core/property/and-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/property/and-001.ttl @@ -1,107 +1,107 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:AddressShape - rdf:type sh:NodeShape ; - rdfs:label "Address shape" ; - sh:property ex:AddressShape-address ; - sh:targetNode ex:InvalidResource1 ; - sh:targetNode ex:InvalidResource2 ; - sh:targetNode ex:InvalidResource3 ; - sh:targetNode ex:ValidResource1 ; -. -ex:AddressShape-address - sh:path ex:address ; - sh:and ( - [ - sh:property [ - sh:path ex:suburb ; - sh:minCount 1 ; - ] ; - ] - [ - sh:property [ - sh:path ex:postalCode ; - sh:minCount 1 ; - ] ; - ] - ) ; -. -ex:InvalidResource1 - rdf:type rdfs:Resource ; - ex:address _:b61065 ; -. -ex:InvalidResource2 - rdf:type rdfs:Resource ; - ex:address _:b31477 ; -. -ex:InvalidResource3 - rdf:type rdfs:Resource ; - ex:address _:b94057 ; -. -ex:ValidResource1 - rdf:type rdfs:Resource ; - ex:address [ - ex:postalCode 4879 ; - ex:suburb ex:KewarraBeach ; - ] ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:and at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultPath ex:address ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:AndConstraintComponent ; - sh:sourceShape ex:AddressShape-address ; - sh:value _:b61065 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource2 ; - sh:resultPath ex:address ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:AndConstraintComponent ; - sh:sourceShape ex:AddressShape-address ; - sh:value _:b31477 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource3 ; - sh:resultPath ex:address ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:AndConstraintComponent ; - sh:sourceShape ex:AddressShape-address ; - sh:value _:b94057 ; - ] ; - ] ; - mf:status sht:approved ; -. -_:b31477 - ex:suburb ex:KewarraBeach ; -. -_:b61065 - ex:postalCode 4879 ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:AddressShape + rdf:type sh:NodeShape ; + rdfs:label "Address shape" ; + sh:property ex:AddressShape-address ; + sh:targetNode ex:InvalidResource1 ; + sh:targetNode ex:InvalidResource2 ; + sh:targetNode ex:InvalidResource3 ; + sh:targetNode ex:ValidResource1 ; +. +ex:AddressShape-address + sh:path ex:address ; + sh:and ( + [ + sh:property [ + sh:path ex:suburb ; + sh:minCount 1 ; + ] ; + ] + [ + sh:property [ + sh:path ex:postalCode ; + sh:minCount 1 ; + ] ; + ] + ) ; +. +ex:InvalidResource1 + rdf:type rdfs:Resource ; + ex:address _:b61065 ; +. +ex:InvalidResource2 + rdf:type rdfs:Resource ; + ex:address _:b31477 ; +. +ex:InvalidResource3 + rdf:type rdfs:Resource ; + ex:address _:b94057 ; +. +ex:ValidResource1 + rdf:type rdfs:Resource ; + ex:address [ + ex:postalCode 4879 ; + ex:suburb ex:KewarraBeach ; + ] ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:and at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultPath ex:address ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:AndConstraintComponent ; + sh:sourceShape ex:AddressShape-address ; + sh:value _:b61065 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource2 ; + sh:resultPath ex:address ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:AndConstraintComponent ; + sh:sourceShape ex:AddressShape-address ; + sh:value _:b31477 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource3 ; + sh:resultPath ex:address ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:AndConstraintComponent ; + sh:sourceShape ex:AddressShape-address ; + sh:value _:b94057 ; + ] ; + ] ; + mf:status sht:approved ; +. +_:b31477 + ex:suburb ex:KewarraBeach ; +. +_:b61065 + ex:postalCode 4879 ; +. diff --git a/modules/shacl/src/test/resources/tests/core/property/class-001.ttl b/modules/shacl/src/test/resources/tests/core/property/class-001.ttl index b1a2d66a1..2b97bf823 100644 --- a/modules/shacl/src/test/resources/tests/core/property/class-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/property/class-001.ttl @@ -1,91 +1,91 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidResource1 - rdf:type rdfs:Resource ; - ex:testProperty ex:InvalidResource1 ; - ex:testProperty "A string" ; -. -ex:SubClass - rdf:type rdfs:Class ; - rdfs:subClassOf ex:SuperClass ; -. -ex:SubClassInstance - rdf:type ex:SubClass ; -. -ex:SuperClass - rdf:type rdfs:Class ; -. -ex:SuperClassInstance - rdf:type ex:SuperClass ; -. -ex:TestShape - rdf:type sh:NodeShape ; - sh:property ex:TestShape-testProperty ; - sh:targetNode ex:InvalidResource1 ; - sh:targetNode ex:ValidResource1 ; - sh:targetNode ex:ValidResource2 ; -. -ex:TestShape-testProperty - sh:path ex:testProperty ; - rdfs:label "test property" ; - sh:class ex:SuperClass ; -. -ex:ValidResource1 - rdf:type rdfs:Resource ; - ex:testProperty ex:SubClassInstance ; - ex:testProperty ex:SuperClassInstance ; -. -ex:ValidResource2 - rdf:type rdfs:Resource ; - ex:testProperty [ - rdf:type ex:SubClass ; - ] ; - ex:testProperty [ - rdf:type ex:SuperClass ; - ] ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:class at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultPath ex:testProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:ClassConstraintComponent ; - sh:sourceShape ex:TestShape-testProperty ; - sh:value ex:InvalidResource1 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultPath ex:testProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:ClassConstraintComponent ; - sh:sourceShape ex:TestShape-testProperty ; - sh:value "A string" ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidResource1 + rdf:type rdfs:Resource ; + ex:testProperty ex:InvalidResource1 ; + ex:testProperty "A string" ; +. +ex:SubClass + rdf:type rdfs:Class ; + rdfs:subClassOf ex:SuperClass ; +. +ex:SubClassInstance + rdf:type ex:SubClass ; +. +ex:SuperClass + rdf:type rdfs:Class ; +. +ex:SuperClassInstance + rdf:type ex:SuperClass ; +. +ex:TestShape + rdf:type sh:NodeShape ; + sh:property ex:TestShape-testProperty ; + sh:targetNode ex:InvalidResource1 ; + sh:targetNode ex:ValidResource1 ; + sh:targetNode ex:ValidResource2 ; +. +ex:TestShape-testProperty + sh:path ex:testProperty ; + rdfs:label "test property" ; + sh:class ex:SuperClass ; +. +ex:ValidResource1 + rdf:type rdfs:Resource ; + ex:testProperty ex:SubClassInstance ; + ex:testProperty ex:SuperClassInstance ; +. +ex:ValidResource2 + rdf:type rdfs:Resource ; + ex:testProperty [ + rdf:type ex:SubClass ; + ] ; + ex:testProperty [ + rdf:type ex:SuperClass ; + ] ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:class at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultPath ex:testProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:ClassConstraintComponent ; + sh:sourceShape ex:TestShape-testProperty ; + sh:value ex:InvalidResource1 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultPath ex:testProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:ClassConstraintComponent ; + sh:sourceShape ex:TestShape-testProperty ; + sh:value "A string" ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/property/datatype-001.ttl b/modules/shacl/src/test/resources/tests/core/property/datatype-001.ttl index 9d9e8293a..f1b1b814f 100644 --- a/modules/shacl/src/test/resources/tests/core/property/datatype-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/property/datatype-001.ttl @@ -1,76 +1,76 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidResource1 - rdf:type ex:TestShape ; - ex:dateProperty "2011-01-01"^^xsd:dateTime ; - ex:integerProperty 11.1 ; -. -ex:TestShape - rdf:type rdfs:Class ; - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:property ex:TestShape-dateProperty ; - sh:property ex:TestShape-integerProperty ; -. -ex:TestShape-dateProperty - sh:path ex:dateProperty ; - rdfs:label "date property" ; - sh:datatype xsd:date ; -. -ex:TestShape-integerProperty - sh:path ex:integerProperty ; - rdfs:label "integer property" ; - sh:datatype xsd:integer ; -. -ex:ValidResource - rdf:type ex:TestShape ; - ex:dateProperty "2014-09-01"^^xsd:date ; - ex:integerProperty 0 ; - ex:integerProperty 1234 ; - rdfs:label "Valid resource" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:datatype at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultPath ex:dateProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; - sh:sourceShape ex:TestShape-dateProperty ; - sh:value "2011-01-01"^^xsd:dateTime ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultPath ex:integerProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; - sh:sourceShape ex:TestShape-integerProperty ; - sh:value 11.1 ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidResource1 + rdf:type ex:TestShape ; + ex:dateProperty "2011-01-01"^^xsd:dateTime ; + ex:integerProperty 11.1 ; +. +ex:TestShape + rdf:type rdfs:Class ; + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:property ex:TestShape-dateProperty ; + sh:property ex:TestShape-integerProperty ; +. +ex:TestShape-dateProperty + sh:path ex:dateProperty ; + rdfs:label "date property" ; + sh:datatype xsd:date ; +. +ex:TestShape-integerProperty + sh:path ex:integerProperty ; + rdfs:label "integer property" ; + sh:datatype xsd:integer ; +. +ex:ValidResource + rdf:type ex:TestShape ; + ex:dateProperty "2014-09-01"^^xsd:date ; + ex:integerProperty 0 ; + ex:integerProperty 1234 ; + rdfs:label "Valid resource" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:datatype at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultPath ex:dateProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; + sh:sourceShape ex:TestShape-dateProperty ; + sh:value "2011-01-01"^^xsd:dateTime ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultPath ex:integerProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; + sh:sourceShape ex:TestShape-integerProperty ; + sh:value 11.1 ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/property/datatype-002.ttl b/modules/shacl/src/test/resources/tests/core/property/datatype-002.ttl index 8e9b8eb73..fc563774c 100644 --- a/modules/shacl/src/test/resources/tests/core/property/datatype-002.ttl +++ b/modules/shacl/src/test/resources/tests/core/property/datatype-002.ttl @@ -1,71 +1,71 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidInstance1 - ex:value "A"@en ; -. -ex:InvalidInstance2 - ex:value 42 ; -. -ex:TestShape - rdf:type sh:NodeShape ; - sh:property ex:TestShape-value ; - sh:targetNode ex:InvalidInstance1 ; - sh:targetNode ex:InvalidInstance2 ; - sh:targetNode ex:ValidInstance1 ; - sh:targetNode ex:ValidInstance2 ; -. -ex:TestShape-value - sh:path ex:value ; - sh:datatype xsd:string ; -. -ex:ValidInstance1 - ex:value "A" ; -. -ex:ValidInstance2 - ex:value "A" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:datatype at property shape 002" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance1 ; - sh:resultPath ex:value ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; - sh:sourceShape ex:TestShape-value ; - sh:value "A"@en ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance2 ; - sh:resultPath ex:value ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; - sh:sourceShape ex:TestShape-value ; - sh:value 42 ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidInstance1 + ex:value "A"@en ; +. +ex:InvalidInstance2 + ex:value 42 ; +. +ex:TestShape + rdf:type sh:NodeShape ; + sh:property ex:TestShape-value ; + sh:targetNode ex:InvalidInstance1 ; + sh:targetNode ex:InvalidInstance2 ; + sh:targetNode ex:ValidInstance1 ; + sh:targetNode ex:ValidInstance2 ; +. +ex:TestShape-value + sh:path ex:value ; + sh:datatype xsd:string ; +. +ex:ValidInstance1 + ex:value "A" ; +. +ex:ValidInstance2 + ex:value "A" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:datatype at property shape 002" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance1 ; + sh:resultPath ex:value ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; + sh:sourceShape ex:TestShape-value ; + sh:value "A"@en ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance2 ; + sh:resultPath ex:value ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; + sh:sourceShape ex:TestShape-value ; + sh:value 42 ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/property/datatype-003.ttl b/modules/shacl/src/test/resources/tests/core/property/datatype-003.ttl index ddac579d4..529685073 100644 --- a/modules/shacl/src/test/resources/tests/core/property/datatype-003.ttl +++ b/modules/shacl/src/test/resources/tests/core/property/datatype-003.ttl @@ -1,69 +1,69 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidInstance1 - ex:value 42 ; -. -ex:TestShape - rdf:type sh:NodeShape ; - sh:property ex:TestShape-value ; - sh:targetNode ex:InvalidInstance1 ; - sh:targetNode ex:ValidInstance1 ; - sh:targetNode ex:ValidInstance2 ; - sh:targetNode ex:ValidInstance3 ; -. -ex:TestShape-value - sh:path ex:value ; - sh:or ( - [ - sh:datatype xsd:string ; - ] - [ - sh:datatype rdf:langString ; - ] - ) ; -. -ex:ValidInstance1 - ex:value "A" ; -. -ex:ValidInstance2 - ex:value "A" ; -. -ex:ValidInstance3 - ex:value "A"@en ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:datatype at property shape 003" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance1 ; - sh:resultPath ex:value ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:OrConstraintComponent ; - sh:sourceShape ex:TestShape-value ; - sh:value 42 ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidInstance1 + ex:value 42 ; +. +ex:TestShape + rdf:type sh:NodeShape ; + sh:property ex:TestShape-value ; + sh:targetNode ex:InvalidInstance1 ; + sh:targetNode ex:ValidInstance1 ; + sh:targetNode ex:ValidInstance2 ; + sh:targetNode ex:ValidInstance3 ; +. +ex:TestShape-value + sh:path ex:value ; + sh:or ( + [ + sh:datatype xsd:string ; + ] + [ + sh:datatype rdf:langString ; + ] + ) ; +. +ex:ValidInstance1 + ex:value "A" ; +. +ex:ValidInstance2 + ex:value "A" ; +. +ex:ValidInstance3 + ex:value "A"@en ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:datatype at property shape 003" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance1 ; + sh:resultPath ex:value ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:OrConstraintComponent ; + sh:sourceShape ex:TestShape-value ; + sh:value 42 ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/property/disjoint-001.ttl b/modules/shacl/src/test/resources/tests/core/property/disjoint-001.ttl index 6aa4ce7a3..8bfc6852d 100644 --- a/modules/shacl/src/test/resources/tests/core/property/disjoint-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/property/disjoint-001.ttl @@ -1,84 +1,84 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidResource1 - ex:property1 "A" ; - ex:property2 "A" ; -. -ex:InvalidResource2 - ex:property1 "A" ; - ex:property1 "B" ; - ex:property2 "A" ; -. -ex:TestShape - rdf:type sh:NodeShape ; - sh:property ex:TestShape-property1 ; - sh:targetNode ex:InvalidResource1 ; - sh:targetNode ex:InvalidResource2 ; - sh:targetNode ex:ValidResource1 ; - sh:targetNode ex:ValidResource2 ; -. -ex:TestShape-property1 - sh:path ex:property1 ; - sh:disjoint ex:property2 ; -. -ex:ValidResource1 - ex:property1 "A" ; - ex:property2 "B" ; -. -ex:ValidResource2 - ex:property1 "A" ; - ex:property1 "B" ; - ex:property2 "C" ; - ex:property2 "D" ; -. -ex:property1 - rdf:type rdf:Property ; -. -ex:property2 - rdf:type rdf:Property ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:disjoint at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultPath ex:property1 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:DisjointConstraintComponent ; - sh:sourceShape ex:TestShape-property1 ; - sh:value "A" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource2 ; - sh:resultPath ex:property1 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:DisjointConstraintComponent ; - sh:sourceShape ex:TestShape-property1 ; - sh:value "A" ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidResource1 + ex:property1 "A" ; + ex:property2 "A" ; +. +ex:InvalidResource2 + ex:property1 "A" ; + ex:property1 "B" ; + ex:property2 "A" ; +. +ex:TestShape + rdf:type sh:NodeShape ; + sh:property ex:TestShape-property1 ; + sh:targetNode ex:InvalidResource1 ; + sh:targetNode ex:InvalidResource2 ; + sh:targetNode ex:ValidResource1 ; + sh:targetNode ex:ValidResource2 ; +. +ex:TestShape-property1 + sh:path ex:property1 ; + sh:disjoint ex:property2 ; +. +ex:ValidResource1 + ex:property1 "A" ; + ex:property2 "B" ; +. +ex:ValidResource2 + ex:property1 "A" ; + ex:property1 "B" ; + ex:property2 "C" ; + ex:property2 "D" ; +. +ex:property1 + rdf:type rdf:Property ; +. +ex:property2 + rdf:type rdf:Property ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:disjoint at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultPath ex:property1 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:DisjointConstraintComponent ; + sh:sourceShape ex:TestShape-property1 ; + sh:value "A" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource2 ; + sh:resultPath ex:property1 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:DisjointConstraintComponent ; + sh:sourceShape ex:TestShape-property1 ; + sh:value "A" ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/property/equals-001.ttl b/modules/shacl/src/test/resources/tests/core/property/equals-001.ttl index 625ec369c..64024cd40 100644 --- a/modules/shacl/src/test/resources/tests/core/property/equals-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/property/equals-001.ttl @@ -1,119 +1,119 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidResource1 - ex:property1 "A" ; - ex:property2 "B" ; -. -ex:InvalidResource2 - ex:property1 "A" ; -. -ex:InvalidResource3 - ex:property2 "A" ; -. -ex:InvalidResource4 - ex:property1 "A" ; - ex:property1 "B" ; - ex:property2 "A" ; -. -ex:TestShape - rdf:type sh:NodeShape ; - sh:property ex:TestShape-property1 ; - sh:targetNode ex:InvalidResource1 ; - sh:targetNode ex:InvalidResource2 ; - sh:targetNode ex:InvalidResource3 ; - sh:targetNode ex:InvalidResource4 ; - sh:targetNode ex:ValidResource1 ; - sh:targetNode ex:ValidResource2 ; -. -ex:TestShape-property1 - sh:path ex:property1 ; - sh:equals ex:property2 ; -. -ex:ValidResource1 - ex:property1 "A" ; - ex:property2 "A" ; -. -ex:ValidResource2 - ex:property1 "A" ; - ex:property1 "B" ; - ex:property2 "A" ; - ex:property2 "B" ; -. -ex:property1 - rdf:type rdf:Property ; -. -ex:property2 - rdf:type rdf:Property ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:equals at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultPath ex:property1 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:EqualsConstraintComponent ; - sh:sourceShape ex:TestShape-property1 ; - sh:value "A" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultPath ex:property1 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:EqualsConstraintComponent ; - sh:sourceShape ex:TestShape-property1 ; - sh:value "B" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource2 ; - sh:resultPath ex:property1 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:EqualsConstraintComponent ; - sh:sourceShape ex:TestShape-property1 ; - sh:value "A" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource3 ; - sh:resultPath ex:property1 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:EqualsConstraintComponent ; - sh:sourceShape ex:TestShape-property1 ; - sh:value "A" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource4 ; - sh:resultPath ex:property1 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:EqualsConstraintComponent ; - sh:sourceShape ex:TestShape-property1 ; - sh:value "B" ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidResource1 + ex:property1 "A" ; + ex:property2 "B" ; +. +ex:InvalidResource2 + ex:property1 "A" ; +. +ex:InvalidResource3 + ex:property2 "A" ; +. +ex:InvalidResource4 + ex:property1 "A" ; + ex:property1 "B" ; + ex:property2 "A" ; +. +ex:TestShape + rdf:type sh:NodeShape ; + sh:property ex:TestShape-property1 ; + sh:targetNode ex:InvalidResource1 ; + sh:targetNode ex:InvalidResource2 ; + sh:targetNode ex:InvalidResource3 ; + sh:targetNode ex:InvalidResource4 ; + sh:targetNode ex:ValidResource1 ; + sh:targetNode ex:ValidResource2 ; +. +ex:TestShape-property1 + sh:path ex:property1 ; + sh:equals ex:property2 ; +. +ex:ValidResource1 + ex:property1 "A" ; + ex:property2 "A" ; +. +ex:ValidResource2 + ex:property1 "A" ; + ex:property1 "B" ; + ex:property2 "A" ; + ex:property2 "B" ; +. +ex:property1 + rdf:type rdf:Property ; +. +ex:property2 + rdf:type rdf:Property ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:equals at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultPath ex:property1 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:EqualsConstraintComponent ; + sh:sourceShape ex:TestShape-property1 ; + sh:value "A" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultPath ex:property1 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:EqualsConstraintComponent ; + sh:sourceShape ex:TestShape-property1 ; + sh:value "B" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource2 ; + sh:resultPath ex:property1 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:EqualsConstraintComponent ; + sh:sourceShape ex:TestShape-property1 ; + sh:value "A" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource3 ; + sh:resultPath ex:property1 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:EqualsConstraintComponent ; + sh:sourceShape ex:TestShape-property1 ; + sh:value "A" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource4 ; + sh:resultPath ex:property1 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:EqualsConstraintComponent ; + sh:sourceShape ex:TestShape-property1 ; + sh:value "B" ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/property/hasValue-001.ttl b/modules/shacl/src/test/resources/tests/core/property/hasValue-001.ttl index 548608943..ffaa0ebbf 100644 --- a/modules/shacl/src/test/resources/tests/core/property/hasValue-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/property/hasValue-001.ttl @@ -1,68 +1,68 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidMalePerson - rdf:type ex:MalePerson ; - ex:gender "female" ; - rdfs:label "Invalid male person" ; -. -ex:MalePerson - rdf:type rdfs:Class ; - rdfs:label "Male person" ; - rdfs:subClassOf rdfs:Resource ; -. -ex:PersonShape - rdf:type sh:NodeShape ; - rdfs:label "Person shape" ; - sh:property ex:PersonShape-gender ; - sh:targetClass ex:MalePerson ; -. -ex:PersonShape-gender - sh:path ex:gender ; - rdfs:label "gender" ; - sh:datatype xsd:string ; - sh:hasValue "male" ; -. -ex:ValidMalePerson1 - rdf:type ex:MalePerson ; - ex:gender "male" ; -. -ex:ValidMalePerson2 - rdf:type ex:MalePerson ; - ex:gender "female" ; - ex:gender "male" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:hasValue at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidMalePerson ; - sh:resultPath ex:gender ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:HasValueConstraintComponent ; - sh:sourceShape ex:PersonShape-gender ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidMalePerson + rdf:type ex:MalePerson ; + ex:gender "female" ; + rdfs:label "Invalid male person" ; +. +ex:MalePerson + rdf:type rdfs:Class ; + rdfs:label "Male person" ; + rdfs:subClassOf rdfs:Resource ; +. +ex:PersonShape + rdf:type sh:NodeShape ; + rdfs:label "Person shape" ; + sh:property ex:PersonShape-gender ; + sh:targetClass ex:MalePerson ; +. +ex:PersonShape-gender + sh:path ex:gender ; + rdfs:label "gender" ; + sh:datatype xsd:string ; + sh:hasValue "male" ; +. +ex:ValidMalePerson1 + rdf:type ex:MalePerson ; + ex:gender "male" ; +. +ex:ValidMalePerson2 + rdf:type ex:MalePerson ; + ex:gender "female" ; + ex:gender "male" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:hasValue at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidMalePerson ; + sh:resultPath ex:gender ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:HasValueConstraintComponent ; + sh:sourceShape ex:PersonShape-gender ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/property/in-001.ttl b/modules/shacl/src/test/resources/tests/core/property/in-001.ttl index 6a6a3594a..cfd37cfb7 100644 --- a/modules/shacl/src/test/resources/tests/core/property/in-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/property/in-001.ttl @@ -1,69 +1,69 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidInstance1 - rdf:type ex:ShapeClass ; - ex:property "D" ; - rdfs:label "Invalid instance1" ; -. -ex:ShapeClass - rdf:type rdfs:Class ; - rdf:type sh:NodeShape ; - sh:property ex:ShapeClass-property ; -. -ex:ShapeClass-property - sh:path ex:property ; - sh:datatype xsd:string ; - sh:in ( - "A" - "B" - "C" - ) ; -. -ex:ValidInstance1 - rdf:type ex:ShapeClass ; - ex:property "A" ; - rdfs:label "Valid instance1" ; -. -ex:ValidInstance2 - rdf:type ex:ShapeClass ; - ex:property "A" ; - ex:property "B" ; - ex:property "C" ; - rdfs:label "Valid instance2" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:in at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance1 ; - sh:resultPath ex:property ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:InConstraintComponent ; - sh:sourceShape ex:ShapeClass-property ; - sh:value "D" ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidInstance1 + rdf:type ex:ShapeClass ; + ex:property "D" ; + rdfs:label "Invalid instance1" ; +. +ex:ShapeClass + rdf:type rdfs:Class ; + rdf:type sh:NodeShape ; + sh:property ex:ShapeClass-property ; +. +ex:ShapeClass-property + sh:path ex:property ; + sh:datatype xsd:string ; + sh:in ( + "A" + "B" + "C" + ) ; +. +ex:ValidInstance1 + rdf:type ex:ShapeClass ; + ex:property "A" ; + rdfs:label "Valid instance1" ; +. +ex:ValidInstance2 + rdf:type ex:ShapeClass ; + ex:property "A" ; + ex:property "B" ; + ex:property "C" ; + rdfs:label "Valid instance2" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:in at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance1 ; + sh:resultPath ex:property ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:InConstraintComponent ; + sh:sourceShape ex:ShapeClass-property ; + sh:value "D" ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/property/languageIn-001.ttl b/modules/shacl/src/test/resources/tests/core/property/languageIn-001.ttl index a67085f2b..00e9d98b8 100644 --- a/modules/shacl/src/test/resources/tests/core/property/languageIn-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/property/languageIn-001.ttl @@ -1,79 +1,79 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:Berg - ex:prefLabel ex:BergLabel ; - ex:prefLabel "Berg" ; - ex:prefLabel "Berg"@de ; -. -ex:Mountain - ex:prefLabel "Hill"@en-NZ ; - ex:prefLabel "Maunga"@mi ; - ex:prefLabel "Mountain"@en ; -. -ex:NewZealandLanguagesShape - rdf:type sh:NodeShape ; - sh:property ex:NewZealandLanguagesShape-prefLabel ; - sh:targetNode ex:Berg ; - sh:targetNode ex:Mountain ; -. -ex:NewZealandLanguagesShape-prefLabel - sh:path ex:prefLabel ; - sh:languageIn ( - "en" - "mi" - ) ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:languageIn at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:Berg ; - sh:resultPath ex:prefLabel ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:LanguageInConstraintComponent ; - sh:sourceShape ex:NewZealandLanguagesShape-prefLabel ; - sh:value ex:BergLabel ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:Berg ; - sh:resultPath ex:prefLabel ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:LanguageInConstraintComponent ; - sh:sourceShape ex:NewZealandLanguagesShape-prefLabel ; - sh:value "Berg" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:Berg ; - sh:resultPath ex:prefLabel ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:LanguageInConstraintComponent ; - sh:sourceShape ex:NewZealandLanguagesShape-prefLabel ; - sh:value "Berg"@de ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:Berg + ex:prefLabel ex:BergLabel ; + ex:prefLabel "Berg" ; + ex:prefLabel "Berg"@de ; +. +ex:Mountain + ex:prefLabel "Hill"@en-NZ ; + ex:prefLabel "Maunga"@mi ; + ex:prefLabel "Mountain"@en ; +. +ex:NewZealandLanguagesShape + rdf:type sh:NodeShape ; + sh:property ex:NewZealandLanguagesShape-prefLabel ; + sh:targetNode ex:Berg ; + sh:targetNode ex:Mountain ; +. +ex:NewZealandLanguagesShape-prefLabel + sh:path ex:prefLabel ; + sh:languageIn ( + "en" + "mi" + ) ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:languageIn at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:Berg ; + sh:resultPath ex:prefLabel ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:LanguageInConstraintComponent ; + sh:sourceShape ex:NewZealandLanguagesShape-prefLabel ; + sh:value ex:BergLabel ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:Berg ; + sh:resultPath ex:prefLabel ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:LanguageInConstraintComponent ; + sh:sourceShape ex:NewZealandLanguagesShape-prefLabel ; + sh:value "Berg" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:Berg ; + sh:resultPath ex:prefLabel ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:LanguageInConstraintComponent ; + sh:sourceShape ex:NewZealandLanguagesShape-prefLabel ; + sh:value "Berg"@de ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/property/lessThan-001.ttl b/modules/shacl/src/test/resources/tests/core/property/lessThan-001.ttl index 76198fba3..d76b37dab 100644 --- a/modules/shacl/src/test/resources/tests/core/property/lessThan-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/property/lessThan-001.ttl @@ -1,96 +1,96 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidResource1 - ex:property1 4 ; - ex:property2 4 ; -. -ex:InvalidResource2 - ex:property1 4 ; - ex:property1 6 ; - ex:property2 5 ; -. -ex:InvalidResource3 - ex:property1 5 ; - ex:property2 4 ; -. -ex:TestShape - rdf:type sh:NodeShape ; - sh:property ex:TestShape-property1 ; - sh:targetNode ex:InvalidResource1 ; - sh:targetNode ex:InvalidResource2 ; - sh:targetNode ex:InvalidResource3 ; - sh:targetNode ex:ValidResource1 ; - sh:targetNode ex:ValidResource2 ; -. -ex:TestShape-property1 - sh:path ex:property1 ; - sh:lessThan ex:property2 ; -. -ex:ValidResource1 - ex:property1 4 ; - ex:property2 6 ; -. -ex:ValidResource2 - ex:property1 3.1 ; - ex:property1 3.2 ; -. -ex:property1 - rdf:type rdf:Property ; -. -ex:property2 - rdf:type rdf:Property ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:lessThan at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultPath ex:property1 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:LessThanConstraintComponent ; - sh:sourceShape ex:TestShape-property1 ; - sh:value 4 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource2 ; - sh:resultPath ex:property1 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:LessThanConstraintComponent ; - sh:sourceShape ex:TestShape-property1 ; - sh:value 6 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource3 ; - sh:resultPath ex:property1 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:LessThanConstraintComponent ; - sh:sourceShape ex:TestShape-property1 ; - sh:value 5 ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidResource1 + ex:property1 4 ; + ex:property2 4 ; +. +ex:InvalidResource2 + ex:property1 4 ; + ex:property1 6 ; + ex:property2 5 ; +. +ex:InvalidResource3 + ex:property1 5 ; + ex:property2 4 ; +. +ex:TestShape + rdf:type sh:NodeShape ; + sh:property ex:TestShape-property1 ; + sh:targetNode ex:InvalidResource1 ; + sh:targetNode ex:InvalidResource2 ; + sh:targetNode ex:InvalidResource3 ; + sh:targetNode ex:ValidResource1 ; + sh:targetNode ex:ValidResource2 ; +. +ex:TestShape-property1 + sh:path ex:property1 ; + sh:lessThan ex:property2 ; +. +ex:ValidResource1 + ex:property1 4 ; + ex:property2 6 ; +. +ex:ValidResource2 + ex:property1 3.1 ; + ex:property1 3.2 ; +. +ex:property1 + rdf:type rdf:Property ; +. +ex:property2 + rdf:type rdf:Property ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:lessThan at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultPath ex:property1 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:LessThanConstraintComponent ; + sh:sourceShape ex:TestShape-property1 ; + sh:value 4 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource2 ; + sh:resultPath ex:property1 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:LessThanConstraintComponent ; + sh:sourceShape ex:TestShape-property1 ; + sh:value 6 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource3 ; + sh:resultPath ex:property1 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:LessThanConstraintComponent ; + sh:sourceShape ex:TestShape-property1 ; + sh:value 5 ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/property/lessThan-002.ttl b/modules/shacl/src/test/resources/tests/core/property/lessThan-002.ttl index 8e2b925e6..9f352ef38 100644 --- a/modules/shacl/src/test/resources/tests/core/property/lessThan-002.ttl +++ b/modules/shacl/src/test/resources/tests/core/property/lessThan-002.ttl @@ -1,81 +1,81 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidInstance1 - ex:first 1 ; - ex:first 2 ; - ex:second "a" ; - ex:second "b" ; -. -ex:TestShape - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:property ex:TestShape-first ; - sh:targetNode ex:InvalidInstance1 ; -. -ex:TestShape-first - sh:path ex:first ; - sh:lessThan ex:second ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:lessThan at property shape 002" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance1 ; - sh:resultPath ex:first ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:LessThanConstraintComponent ; - sh:sourceShape ex:TestShape-first ; - sh:value 1 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance1 ; - sh:resultPath ex:first ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:LessThanConstraintComponent ; - sh:sourceShape ex:TestShape-first ; - sh:value 1 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance1 ; - sh:resultPath ex:first ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:LessThanConstraintComponent ; - sh:sourceShape ex:TestShape-first ; - sh:value 2 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance1 ; - sh:resultPath ex:first ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:LessThanConstraintComponent ; - sh:sourceShape ex:TestShape-first ; - sh:value 2 ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidInstance1 + ex:first 1 ; + ex:first 2 ; + ex:second "a" ; + ex:second "b" ; +. +ex:TestShape + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:property ex:TestShape-first ; + sh:targetNode ex:InvalidInstance1 ; +. +ex:TestShape-first + sh:path ex:first ; + sh:lessThan ex:second ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:lessThan at property shape 002" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance1 ; + sh:resultPath ex:first ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:LessThanConstraintComponent ; + sh:sourceShape ex:TestShape-first ; + sh:value 1 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance1 ; + sh:resultPath ex:first ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:LessThanConstraintComponent ; + sh:sourceShape ex:TestShape-first ; + sh:value 1 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance1 ; + sh:resultPath ex:first ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:LessThanConstraintComponent ; + sh:sourceShape ex:TestShape-first ; + sh:value 2 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance1 ; + sh:resultPath ex:first ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:LessThanConstraintComponent ; + sh:sourceShape ex:TestShape-first ; + sh:value 2 ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/property/lessThanOrEquals-001.ttl b/modules/shacl/src/test/resources/tests/core/property/lessThanOrEquals-001.ttl index a1afdebc0..c1ac111cc 100644 --- a/modules/shacl/src/test/resources/tests/core/property/lessThanOrEquals-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/property/lessThanOrEquals-001.ttl @@ -1,87 +1,87 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidResource1 - ex:property1 5 ; - ex:property2 4 ; -. -ex:InvalidResource2 - ex:property1 4 ; - ex:property1 6 ; - ex:property2 5 ; -. -ex:TestShape - rdf:type sh:NodeShape ; - sh:property ex:TestShape-property1 ; - sh:targetNode ex:InvalidResource1 ; - sh:targetNode ex:InvalidResource2 ; - sh:targetNode ex:ValidResource1 ; - sh:targetNode ex:ValidResource2 ; - sh:targetNode ex:ValidResource3 ; -. -ex:TestShape-property1 - sh:path ex:property1 ; - sh:lessThanOrEquals ex:property2 ; -. -ex:ValidResource1 - ex:property1 4 ; - ex:property2 6 ; -. -ex:ValidResource2 - ex:property1 3.1 ; - ex:property1 3.2 ; -. -ex:ValidResource3 - ex:property1 5 ; - ex:property2 5 ; -. -ex:property1 - rdf:type rdf:Property ; -. -ex:property2 - rdf:type rdf:Property ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:lessThanOrEquals at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultPath ex:property1 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:LessThanOrEqualsConstraintComponent ; - sh:sourceShape ex:TestShape-property1 ; - sh:value 5 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource2 ; - sh:resultPath ex:property1 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:LessThanOrEqualsConstraintComponent ; - sh:sourceShape ex:TestShape-property1 ; - sh:value 6 ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidResource1 + ex:property1 5 ; + ex:property2 4 ; +. +ex:InvalidResource2 + ex:property1 4 ; + ex:property1 6 ; + ex:property2 5 ; +. +ex:TestShape + rdf:type sh:NodeShape ; + sh:property ex:TestShape-property1 ; + sh:targetNode ex:InvalidResource1 ; + sh:targetNode ex:InvalidResource2 ; + sh:targetNode ex:ValidResource1 ; + sh:targetNode ex:ValidResource2 ; + sh:targetNode ex:ValidResource3 ; +. +ex:TestShape-property1 + sh:path ex:property1 ; + sh:lessThanOrEquals ex:property2 ; +. +ex:ValidResource1 + ex:property1 4 ; + ex:property2 6 ; +. +ex:ValidResource2 + ex:property1 3.1 ; + ex:property1 3.2 ; +. +ex:ValidResource3 + ex:property1 5 ; + ex:property2 5 ; +. +ex:property1 + rdf:type rdf:Property ; +. +ex:property2 + rdf:type rdf:Property ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:lessThanOrEquals at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultPath ex:property1 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:LessThanOrEqualsConstraintComponent ; + sh:sourceShape ex:TestShape-property1 ; + sh:value 5 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource2 ; + sh:resultPath ex:property1 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:LessThanOrEqualsConstraintComponent ; + sh:sourceShape ex:TestShape-property1 ; + sh:value 6 ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/property/maxCount-001.ttl b/modules/shacl/src/test/resources/tests/core/property/maxCount-001.ttl index f665300eb..52653dec9 100644 --- a/modules/shacl/src/test/resources/tests/core/property/maxCount-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/property/maxCount-001.ttl @@ -1,64 +1,64 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidPerson - rdf:type ex:Person ; - ex:firstName "George" ; - ex:firstName "John" ; - rdfs:label "Invalid person" ; -. -ex:Person - rdf:type rdfs:Class ; - rdfs:label "Person" ; - rdfs:subClassOf rdfs:Resource ; -. -ex:PersonShape - rdf:type sh:NodeShape ; - sh:property ex:PersonShape-firstName ; - sh:targetClass ex:Person ; - sh:targetNode ex:ValidResource ; -. -ex:PersonShape-firstName - sh:path ex:firstName ; - sh:datatype xsd:string ; - sh:maxCount 1 ; -. -ex:ValidResource - rdf:type ex:Person ; - ex:firstName "John" ; - rdfs:label "Valid resource" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:maxCount at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidPerson ; - sh:resultPath ex:firstName ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxCountConstraintComponent ; - sh:sourceShape ex:PersonShape-firstName ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidPerson + rdf:type ex:Person ; + ex:firstName "George" ; + ex:firstName "John" ; + rdfs:label "Invalid person" ; +. +ex:Person + rdf:type rdfs:Class ; + rdfs:label "Person" ; + rdfs:subClassOf rdfs:Resource ; +. +ex:PersonShape + rdf:type sh:NodeShape ; + sh:property ex:PersonShape-firstName ; + sh:targetClass ex:Person ; + sh:targetNode ex:ValidResource ; +. +ex:PersonShape-firstName + sh:path ex:firstName ; + sh:datatype xsd:string ; + sh:maxCount 1 ; +. +ex:ValidResource + rdf:type ex:Person ; + ex:firstName "John" ; + rdfs:label "Valid resource" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:maxCount at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidPerson ; + sh:resultPath ex:firstName ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxCountConstraintComponent ; + sh:sourceShape ex:PersonShape-firstName ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/property/maxCount-002.ttl b/modules/shacl/src/test/resources/tests/core/property/maxCount-002.ttl index 88246afa1..23d82a07a 100644 --- a/modules/shacl/src/test/resources/tests/core/property/maxCount-002.ttl +++ b/modules/shacl/src/test/resources/tests/core/property/maxCount-002.ttl @@ -1,57 +1,57 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidResource - rdf:type rdfs:Resource ; - rdfs:label "Invalid resource" ; - owl:versionInfo "1.0" ; -. -ex:TestShape - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:property ex:TestShape-versionInfo ; - sh:targetNode ex:InvalidResource ; - sh:targetNode ex:ValidResource ; -. -ex:TestShape-versionInfo - sh:path owl:versionInfo ; - sh:maxCount 0 ; -. -ex:ValidResource - rdf:type rdfs:Resource ; - rdfs:label "Valid resource" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:maxCount at property shape 002" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource ; - sh:resultPath owl:versionInfo ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxCountConstraintComponent ; - sh:sourceShape ex:TestShape-versionInfo ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidResource + rdf:type rdfs:Resource ; + rdfs:label "Invalid resource" ; + owl:versionInfo "1.0" ; +. +ex:TestShape + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:property ex:TestShape-versionInfo ; + sh:targetNode ex:InvalidResource ; + sh:targetNode ex:ValidResource ; +. +ex:TestShape-versionInfo + sh:path owl:versionInfo ; + sh:maxCount 0 ; +. +ex:ValidResource + rdf:type rdfs:Resource ; + rdfs:label "Valid resource" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:maxCount at property shape 002" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource ; + sh:resultPath owl:versionInfo ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxCountConstraintComponent ; + sh:sourceShape ex:TestShape-versionInfo ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/property/maxExclusive-001.ttl b/modules/shacl/src/test/resources/tests/core/property/maxExclusive-001.ttl index e75d64e08..47566a8fa 100644 --- a/modules/shacl/src/test/resources/tests/core/property/maxExclusive-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/property/maxExclusive-001.ttl @@ -1,84 +1,84 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidResource1 - ex:property 1 ; -. -ex:InvalidResource2 - ex:property 2 ; -. -ex:InvalidResource3 - ex:property "a" ; -. -ex:TestShape - rdf:type sh:NodeShape ; - sh:property ex:TestShape-property ; - sh:targetNode ex:InvalidResource1 ; - sh:targetNode ex:InvalidResource2 ; - sh:targetNode ex:InvalidResource3 ; - sh:targetNode ex:ValidResource1 ; - sh:targetNode ex:ValidResource2 ; -. -ex:TestShape-property - sh:path ex:property ; - sh:maxExclusive 1 ; -. -ex:ValidResource1 - ex:property 0 ; -. -ex:ValidResource2 - ex:property -1 ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:maxExclusive at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultPath ex:property ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxExclusiveConstraintComponent ; - sh:sourceShape ex:TestShape-property ; - sh:value 1 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource2 ; - sh:resultPath ex:property ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxExclusiveConstraintComponent ; - sh:sourceShape ex:TestShape-property ; - sh:value 2 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource3 ; - sh:resultPath ex:property ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxExclusiveConstraintComponent ; - sh:sourceShape ex:TestShape-property ; - sh:value "a" ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidResource1 + ex:property 1 ; +. +ex:InvalidResource2 + ex:property 2 ; +. +ex:InvalidResource3 + ex:property "a" ; +. +ex:TestShape + rdf:type sh:NodeShape ; + sh:property ex:TestShape-property ; + sh:targetNode ex:InvalidResource1 ; + sh:targetNode ex:InvalidResource2 ; + sh:targetNode ex:InvalidResource3 ; + sh:targetNode ex:ValidResource1 ; + sh:targetNode ex:ValidResource2 ; +. +ex:TestShape-property + sh:path ex:property ; + sh:maxExclusive 1 ; +. +ex:ValidResource1 + ex:property 0 ; +. +ex:ValidResource2 + ex:property -1 ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:maxExclusive at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultPath ex:property ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxExclusiveConstraintComponent ; + sh:sourceShape ex:TestShape-property ; + sh:value 1 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource2 ; + sh:resultPath ex:property ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxExclusiveConstraintComponent ; + sh:sourceShape ex:TestShape-property ; + sh:value 2 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource3 ; + sh:resultPath ex:property ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxExclusiveConstraintComponent ; + sh:sourceShape ex:TestShape-property ; + sh:value "a" ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/property/maxInclusive-001.ttl b/modules/shacl/src/test/resources/tests/core/property/maxInclusive-001.ttl index 5ee7ace61..2c5077f07 100644 --- a/modules/shacl/src/test/resources/tests/core/property/maxInclusive-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/property/maxInclusive-001.ttl @@ -1,71 +1,71 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidResource1 - ex:property 2 ; -. -ex:InvalidResource2 - ex:property "a" ; -. -ex:TestShape - rdf:type sh:NodeShape ; - sh:property ex:TestShape-property ; - sh:targetNode ex:InvalidResource1 ; - sh:targetNode ex:InvalidResource2 ; - sh:targetNode ex:ValidResource1 ; - sh:targetNode ex:ValidResource2 ; -. -ex:TestShape-property - sh:path ex:property ; - sh:maxInclusive 1 ; -. -ex:ValidResource1 - ex:property 0 ; -. -ex:ValidResource2 - ex:property 1 ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:maxInclusive at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultPath ex:property ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxInclusiveConstraintComponent ; - sh:sourceShape ex:TestShape-property ; - sh:value 2 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource2 ; - sh:resultPath ex:property ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxInclusiveConstraintComponent ; - sh:sourceShape ex:TestShape-property ; - sh:value "a" ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidResource1 + ex:property 2 ; +. +ex:InvalidResource2 + ex:property "a" ; +. +ex:TestShape + rdf:type sh:NodeShape ; + sh:property ex:TestShape-property ; + sh:targetNode ex:InvalidResource1 ; + sh:targetNode ex:InvalidResource2 ; + sh:targetNode ex:ValidResource1 ; + sh:targetNode ex:ValidResource2 ; +. +ex:TestShape-property + sh:path ex:property ; + sh:maxInclusive 1 ; +. +ex:ValidResource1 + ex:property 0 ; +. +ex:ValidResource2 + ex:property 1 ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:maxInclusive at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultPath ex:property ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxInclusiveConstraintComponent ; + sh:sourceShape ex:TestShape-property ; + sh:value 2 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource2 ; + sh:resultPath ex:property ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxInclusiveConstraintComponent ; + sh:sourceShape ex:TestShape-property ; + sh:value "a" ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/property/maxLength-001.ttl b/modules/shacl/src/test/resources/tests/core/property/maxLength-001.ttl index b01ec96b8..b6d4b48ff 100644 --- a/modules/shacl/src/test/resources/tests/core/property/maxLength-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/property/maxLength-001.ttl @@ -1,61 +1,61 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidInstance1 - rdf:type ex:TestShape ; - ex:testProperty "ABC" ; -. -ex:TestShape - rdf:type rdfs:Class ; - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:property ex:TestShape-testProperty ; -. -ex:TestShape-testProperty - sh:path ex:testProperty ; - sh:datatype xsd:string ; - sh:maxLength 2 ; -. -ex:ValidInstance1 - rdf:type ex:TestShape ; - ex:testProperty "A" ; - ex:testProperty "AB" ; -. -ex:ValidInstance2 - rdf:type ex:TestShape ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:maxLength at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance1 ; - sh:resultPath ex:testProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxLengthConstraintComponent ; - sh:sourceShape ex:TestShape-testProperty ; - sh:value "ABC" ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidInstance1 + rdf:type ex:TestShape ; + ex:testProperty "ABC" ; +. +ex:TestShape + rdf:type rdfs:Class ; + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:property ex:TestShape-testProperty ; +. +ex:TestShape-testProperty + sh:path ex:testProperty ; + sh:datatype xsd:string ; + sh:maxLength 2 ; +. +ex:ValidInstance1 + rdf:type ex:TestShape ; + ex:testProperty "A" ; + ex:testProperty "AB" ; +. +ex:ValidInstance2 + rdf:type ex:TestShape ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:maxLength at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance1 ; + sh:resultPath ex:testProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxLengthConstraintComponent ; + sh:sourceShape ex:TestShape-testProperty ; + sh:value "ABC" ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/property/minCount-001.ttl b/modules/shacl/src/test/resources/tests/core/property/minCount-001.ttl index c15fa15d7..680f9c4b8 100644 --- a/modules/shacl/src/test/resources/tests/core/property/minCount-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/property/minCount-001.ttl @@ -1,62 +1,62 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidPerson - rdf:type ex:Person ; - rdfs:label "Invalid person" ; -. -ex:Person - rdf:type rdfs:Class ; - rdfs:label "Person" ; - rdfs:subClassOf rdfs:Resource ; -. -ex:PersonShape - rdf:type sh:NodeShape ; - sh:property ex:PersonShape-firstName ; - sh:targetClass ex:Person ; - sh:targetNode ex:ValidResource ; -. -ex:PersonShape-firstName - sh:path ex:firstName ; - sh:datatype xsd:string ; - sh:minCount 1 ; -. -ex:ValidResource - rdf:type ex:Person ; - ex:firstName "John" ; - rdfs:label "Valid resource" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:minCount at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidPerson ; - sh:resultPath ex:firstName ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinCountConstraintComponent ; - sh:sourceShape ex:PersonShape-firstName ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidPerson + rdf:type ex:Person ; + rdfs:label "Invalid person" ; +. +ex:Person + rdf:type rdfs:Class ; + rdfs:label "Person" ; + rdfs:subClassOf rdfs:Resource ; +. +ex:PersonShape + rdf:type sh:NodeShape ; + sh:property ex:PersonShape-firstName ; + sh:targetClass ex:Person ; + sh:targetNode ex:ValidResource ; +. +ex:PersonShape-firstName + sh:path ex:firstName ; + sh:datatype xsd:string ; + sh:minCount 1 ; +. +ex:ValidResource + rdf:type ex:Person ; + ex:firstName "John" ; + rdfs:label "Valid resource" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:minCount at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidPerson ; + sh:resultPath ex:firstName ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinCountConstraintComponent ; + sh:sourceShape ex:PersonShape-firstName ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/property/minCount-002.ttl b/modules/shacl/src/test/resources/tests/core/property/minCount-002.ttl index 95b425398..d4b4f13b2 100644 --- a/modules/shacl/src/test/resources/tests/core/property/minCount-002.ttl +++ b/modules/shacl/src/test/resources/tests/core/property/minCount-002.ttl @@ -1,41 +1,41 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:TestShape - rdf:type sh:NodeShape ; - sh:property [ - sh:path ex:property ; - sh:minCount 0 ; - sh:name "property" ; - ] ; - sh:targetNode ex:ValidResource1 ; -. -ex:ValidResource1 - rdf:type rdfs:Resource ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:minCount at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "true"^^xsd:boolean ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:TestShape + rdf:type sh:NodeShape ; + sh:property [ + sh:path ex:property ; + sh:minCount 0 ; + sh:name "property" ; + ] ; + sh:targetNode ex:ValidResource1 ; +. +ex:ValidResource1 + rdf:type rdfs:Resource ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:minCount at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "true"^^xsd:boolean ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/property/minExclusive-001.ttl b/modules/shacl/src/test/resources/tests/core/property/minExclusive-001.ttl index c3acd2ef1..8c99b43b6 100644 --- a/modules/shacl/src/test/resources/tests/core/property/minExclusive-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/property/minExclusive-001.ttl @@ -1,69 +1,69 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidInstance1 - rdf:type ex:TestShape ; - ex:testProperty 40 ; -. -ex:InvalidInstance2 - rdf:type ex:TestShape ; - ex:testProperty 39 ; -. -ex:TestShape - rdf:type rdfs:Class ; - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:property ex:TestShape-testProperty ; -. -ex:TestShape-testProperty - sh:path ex:testProperty ; - sh:minExclusive 40 ; -. -ex:ValidInstance1 - rdf:type ex:TestShape ; - ex:testProperty 42 ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:minExclusive at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance1 ; - sh:resultPath ex:testProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinExclusiveConstraintComponent ; - sh:sourceShape ex:TestShape-testProperty ; - sh:value 40 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance2 ; - sh:resultPath ex:testProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinExclusiveConstraintComponent ; - sh:sourceShape ex:TestShape-testProperty ; - sh:value 39 ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidInstance1 + rdf:type ex:TestShape ; + ex:testProperty 40 ; +. +ex:InvalidInstance2 + rdf:type ex:TestShape ; + ex:testProperty 39 ; +. +ex:TestShape + rdf:type rdfs:Class ; + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:property ex:TestShape-testProperty ; +. +ex:TestShape-testProperty + sh:path ex:testProperty ; + sh:minExclusive 40 ; +. +ex:ValidInstance1 + rdf:type ex:TestShape ; + ex:testProperty 42 ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:minExclusive at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance1 ; + sh:resultPath ex:testProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinExclusiveConstraintComponent ; + sh:sourceShape ex:TestShape-testProperty ; + sh:value 40 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance2 ; + sh:resultPath ex:testProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinExclusiveConstraintComponent ; + sh:sourceShape ex:TestShape-testProperty ; + sh:value 39 ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/property/minExclusive-002.ttl b/modules/shacl/src/test/resources/tests/core/property/minExclusive-002.ttl index 3bc006182..2612e1661 100644 --- a/modules/shacl/src/test/resources/tests/core/property/minExclusive-002.ttl +++ b/modules/shacl/src/test/resources/tests/core/property/minExclusive-002.ttl @@ -1,65 +1,65 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidInstance1 - rdf:type ex:TestShape ; - ex:testProperty "A string" ; -. -ex:InvalidInstance2 - rdf:type ex:TestShape ; - ex:testProperty rdfs:Resource ; -. -ex:TestShape - rdf:type rdfs:Class ; - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:property ex:TestShape-testProperty ; -. -ex:TestShape-testProperty - sh:path ex:testProperty ; - sh:minExclusive 40 ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:minExclusive at property shape 002" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance1 ; - sh:resultPath ex:testProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinExclusiveConstraintComponent ; - sh:sourceShape ex:TestShape-testProperty ; - sh:value "A string" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance2 ; - sh:resultPath ex:testProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinExclusiveConstraintComponent ; - sh:sourceShape ex:TestShape-testProperty ; - sh:value rdfs:Resource ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidInstance1 + rdf:type ex:TestShape ; + ex:testProperty "A string" ; +. +ex:InvalidInstance2 + rdf:type ex:TestShape ; + ex:testProperty rdfs:Resource ; +. +ex:TestShape + rdf:type rdfs:Class ; + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:property ex:TestShape-testProperty ; +. +ex:TestShape-testProperty + sh:path ex:testProperty ; + sh:minExclusive 40 ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:minExclusive at property shape 002" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance1 ; + sh:resultPath ex:testProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinExclusiveConstraintComponent ; + sh:sourceShape ex:TestShape-testProperty ; + sh:value "A string" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance2 ; + sh:resultPath ex:testProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinExclusiveConstraintComponent ; + sh:sourceShape ex:TestShape-testProperty ; + sh:value rdfs:Resource ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/property/minLength-001.ttl b/modules/shacl/src/test/resources/tests/core/property/minLength-001.ttl index fe70e490f..06f286e2e 100644 --- a/modules/shacl/src/test/resources/tests/core/property/minLength-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/property/minLength-001.ttl @@ -1,61 +1,61 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidInstance1 - rdf:type ex:TestShape ; - ex:testProperty "A" ; -. -ex:TestShape - rdf:type rdfs:Class ; - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:property ex:TestShape-testProperty ; -. -ex:TestShape-testProperty - sh:path ex:testProperty ; - sh:datatype xsd:string ; - sh:minLength 2 ; -. -ex:ValidInstance1 - rdf:type ex:TestShape ; - ex:testProperty "AB" ; - ex:testProperty "ABC" ; -. -ex:ValidInstance2 - rdf:type ex:TestShape ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:minLength at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance1 ; - sh:resultPath ex:testProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinLengthConstraintComponent ; - sh:sourceShape ex:TestShape-testProperty ; - sh:value "A" ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidInstance1 + rdf:type ex:TestShape ; + ex:testProperty "A" ; +. +ex:TestShape + rdf:type rdfs:Class ; + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:property ex:TestShape-testProperty ; +. +ex:TestShape-testProperty + sh:path ex:testProperty ; + sh:datatype xsd:string ; + sh:minLength 2 ; +. +ex:ValidInstance1 + rdf:type ex:TestShape ; + ex:testProperty "AB" ; + ex:testProperty "ABC" ; +. +ex:ValidInstance2 + rdf:type ex:TestShape ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:minLength at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance1 ; + sh:resultPath ex:testProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinLengthConstraintComponent ; + sh:sourceShape ex:TestShape-testProperty ; + sh:value "A" ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/property/node-001.ttl b/modules/shacl/src/test/resources/tests/core/property/node-001.ttl index e82dc91f7..2245930ba 100644 --- a/modules/shacl/src/test/resources/tests/core/property/node-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/property/node-001.ttl @@ -1,113 +1,113 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:Anon - rdf:type ex:Person ; - ex:firstName "Anon" ; -. -ex:Issue - rdf:type rdfs:Class ; - rdf:type sh:NodeShape ; - rdfs:label "Issue" ; - rdfs:subClassOf rdfs:Resource ; - sh:property ex:Issue-assignedTo ; - sh:property ex:Issue-submittedBy ; -. -ex:Issue-assignedTo - sh:path ex:assignedTo ; - sh:class ex:Person ; - sh:node [ - rdfs:comment "All assignees must have an email and a last name." ; - sh:property [ - sh:path ex:email ; - sh:maxCount 1 ; - sh:minCount 1 ; - ] ; - sh:property [ - sh:path ex:lastName ; - sh:maxCount 1 ; - sh:minCount 1 ; - ] ; - ] ; -. -ex:Issue-submittedBy - sh:path ex:submittedBy ; - sh:class ex:Person ; - sh:minCount 1 ; -. -ex:Issue_1 - rdf:type ex:Issue ; - ex:assignedTo ex:Anon ; - ex:submittedBy ex:Anon ; - rdfs:label "Issue 1" ; -. -ex:Issue_2 - rdf:type ex:Issue ; - ex:assignedTo ex:JohnDoeWithEmail ; - ex:submittedBy ex:Anon ; - rdfs:label "Issue 2" ; -. -ex:JohnDoeWithEmail - rdf:type ex:Person ; - ex:email "john@doe.com" ; - ex:firstName "John" ; - ex:lastName "Doe" ; -. -ex:Person - rdf:type rdfs:Class ; - rdf:type sh:NodeShape ; - rdfs:label "Person" ; - rdfs:subClassOf rdfs:Resource ; - sh:property [ - sh:path ex:email ; - ex:datatype xsd:string ; - rdfs:label "email" ; - ] ; - sh:property [ - sh:path ex:firstName ; - rdfs:label "first name" ; - sh:datatype xsd:string ; - sh:maxCount 1 ; - sh:minCount 1 ; - ] ; - sh:property [ - sh:path ex:lastName ; - rdfs:label "last name" ; - sh:datatype xsd:string ; - ] ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:node at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:Issue_1 ; - sh:resultPath ex:assignedTo ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeConstraintComponent ; - sh:sourceShape ex:Issue-assignedTo ; - sh:value ex:Anon ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:Anon + rdf:type ex:Person ; + ex:firstName "Anon" ; +. +ex:Issue + rdf:type rdfs:Class ; + rdf:type sh:NodeShape ; + rdfs:label "Issue" ; + rdfs:subClassOf rdfs:Resource ; + sh:property ex:Issue-assignedTo ; + sh:property ex:Issue-submittedBy ; +. +ex:Issue-assignedTo + sh:path ex:assignedTo ; + sh:class ex:Person ; + sh:node [ + rdfs:comment "All assignees must have an email and a last name." ; + sh:property [ + sh:path ex:email ; + sh:maxCount 1 ; + sh:minCount 1 ; + ] ; + sh:property [ + sh:path ex:lastName ; + sh:maxCount 1 ; + sh:minCount 1 ; + ] ; + ] ; +. +ex:Issue-submittedBy + sh:path ex:submittedBy ; + sh:class ex:Person ; + sh:minCount 1 ; +. +ex:Issue_1 + rdf:type ex:Issue ; + ex:assignedTo ex:Anon ; + ex:submittedBy ex:Anon ; + rdfs:label "Issue 1" ; +. +ex:Issue_2 + rdf:type ex:Issue ; + ex:assignedTo ex:JohnDoeWithEmail ; + ex:submittedBy ex:Anon ; + rdfs:label "Issue 2" ; +. +ex:JohnDoeWithEmail + rdf:type ex:Person ; + ex:email "john@doe.com" ; + ex:firstName "John" ; + ex:lastName "Doe" ; +. +ex:Person + rdf:type rdfs:Class ; + rdf:type sh:NodeShape ; + rdfs:label "Person" ; + rdfs:subClassOf rdfs:Resource ; + sh:property [ + sh:path ex:email ; + ex:datatype xsd:string ; + rdfs:label "email" ; + ] ; + sh:property [ + sh:path ex:firstName ; + rdfs:label "first name" ; + sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:minCount 1 ; + ] ; + sh:property [ + sh:path ex:lastName ; + rdfs:label "last name" ; + sh:datatype xsd:string ; + ] ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:node at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:Issue_1 ; + sh:resultPath ex:assignedTo ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeConstraintComponent ; + sh:sourceShape ex:Issue-assignedTo ; + sh:value ex:Anon ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/property/node-002.ttl b/modules/shacl/src/test/resources/tests/core/property/node-002.ttl index cc01a834a..f028f57fd 100644 --- a/modules/shacl/src/test/resources/tests/core/property/node-002.ttl +++ b/modules/shacl/src/test/resources/tests/core/property/node-002.ttl @@ -1,75 +1,75 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:AddressShape - rdf:type sh:NodeShape ; - sh:property ex:AddressShape-postalCode ; -. -ex:AddressShape-postalCode - sh:path ex:postalCode ; - sh:datatype xsd:string ; - sh:maxCount 1 ; -. -ex:Bob - rdf:type ex:Person ; - ex:address ex:BobsAddress ; -. -ex:BobsAddress - ex:postalCode "1234" ; -. -ex:Person - rdf:type rdfs:Class ; - rdfs:label "Person" ; -. -ex:PersonShape - rdf:type sh:NodeShape ; - sh:property ex:PersonShape-address ; - sh:targetClass ex:Person ; -. -ex:PersonShape-address - sh:path ex:address ; - sh:minCount 1 ; - sh:node ex:AddressShape ; -. -ex:Reto - rdf:type ex:Person ; - ex:address ex:RetosAddress ; -. -ex:RetosAddress - ex:postalCode 5678 ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:node at property shape 002" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:Reto ; - sh:resultPath ex:address ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeConstraintComponent ; - sh:sourceShape ex:PersonShape-address ; - sh:value ex:RetosAddress ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:AddressShape + rdf:type sh:NodeShape ; + sh:property ex:AddressShape-postalCode ; +. +ex:AddressShape-postalCode + sh:path ex:postalCode ; + sh:datatype xsd:string ; + sh:maxCount 1 ; +. +ex:Bob + rdf:type ex:Person ; + ex:address ex:BobsAddress ; +. +ex:BobsAddress + ex:postalCode "1234" ; +. +ex:Person + rdf:type rdfs:Class ; + rdfs:label "Person" ; +. +ex:PersonShape + rdf:type sh:NodeShape ; + sh:property ex:PersonShape-address ; + sh:targetClass ex:Person ; +. +ex:PersonShape-address + sh:path ex:address ; + sh:minCount 1 ; + sh:node ex:AddressShape ; +. +ex:Reto + rdf:type ex:Person ; + ex:address ex:RetosAddress ; +. +ex:RetosAddress + ex:postalCode 5678 ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:node at property shape 002" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:Reto ; + sh:resultPath ex:address ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeConstraintComponent ; + sh:sourceShape ex:PersonShape-address ; + sh:value ex:RetosAddress ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/property/nodeKind-001.ttl b/modules/shacl/src/test/resources/tests/core/property/nodeKind-001.ttl index 137530d8e..d40515d0e 100644 --- a/modules/shacl/src/test/resources/tests/core/property/nodeKind-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/property/nodeKind-001.ttl @@ -1,371 +1,371 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InstanceWithBlankNode - rdf:type ex:MyClass ; - ex:myProperty _:b55454 ; -. -ex:InstanceWithBlankNodeAndIRI - rdf:type ex:MyClass ; - ex:myProperty rdfs:Class ; - ex:myProperty _:b67098 ; -. -ex:InstanceWithBlankNodeAndLiteral - rdf:type ex:MyClass ; - ex:myProperty "Literal" ; - ex:myProperty _:b99026 ; -. -ex:InstanceWithIRI - rdf:type ex:MyClass ; - ex:myProperty rdfs:Class ; -. -ex:InstanceWithIRIAndLiteral - rdf:type ex:MyClass ; - ex:myProperty rdfs:Class ; - ex:myProperty "Literal" ; -. -ex:InstanceWithLiteral - rdf:type ex:MyClass ; - ex:myProperty "Literal" ; -. -ex:MyClass - rdf:type rdfs:Class ; - rdfs:label "My class" ; -. -ex:ShapeWithBlankNode - rdf:type sh:NodeShape ; - sh:property _:b38619 ; - sh:targetClass ex:MyClass ; -. -ex:ShapeWithBlankNodeOrIRI - rdf:type sh:NodeShape ; - sh:property _:b3078 ; - sh:targetClass ex:MyClass ; -. -ex:ShapeWithBlankNodeOrLiteral - rdf:type sh:NodeShape ; - sh:property _:b14975 ; - sh:targetClass ex:MyClass ; -. -ex:ShapeWithIRI - rdf:type sh:NodeShape ; - sh:property _:b97614 ; - sh:targetClass ex:MyClass ; -. -ex:ShapeWithIRIOrLiteral - rdf:type sh:NodeShape ; - sh:property _:b97860 ; - sh:targetClass ex:MyClass ; -. -ex:ShapeWithLiteral - rdf:type sh:NodeShape ; - sh:property _:b79526 ; - sh:targetClass ex:MyClass ; -. -ex:myProperty - rdf:type rdf:Property ; - rdfs:domain ex:MyClass ; - rdfs:label "my property" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:nodeKind at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithBlankNode ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b79526 ; - sh:value _:b55454 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithBlankNode ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b97614 ; - sh:value _:b55454 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithBlankNode ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b97860 ; - sh:value _:b55454 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithBlankNodeAndIRI ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b14975 ; - sh:value rdfs:Class ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithBlankNodeAndIRI ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b38619 ; - sh:value rdfs:Class ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithBlankNodeAndIRI ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b79526 ; - sh:value rdfs:Class ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithBlankNodeAndIRI ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b79526 ; - sh:value _:b67098 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithBlankNodeAndIRI ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b97614 ; - sh:value _:b67098 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithBlankNodeAndIRI ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b97860 ; - sh:value _:b67098 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithBlankNodeAndLiteral ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b3078 ; - sh:value "Literal" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithBlankNodeAndLiteral ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b38619 ; - sh:value "Literal" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithBlankNodeAndLiteral ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b79526 ; - sh:value _:b99026 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithBlankNodeAndLiteral ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b97614 ; - sh:value "Literal" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithBlankNodeAndLiteral ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b97614 ; - sh:value _:b99026 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithBlankNodeAndLiteral ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b97860 ; - sh:value _:b99026 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithIRI ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b14975 ; - sh:value rdfs:Class ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithIRI ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b38619 ; - sh:value rdfs:Class ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithIRI ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b79526 ; - sh:value rdfs:Class ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithIRIAndLiteral ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b3078 ; - sh:value "Literal" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithIRIAndLiteral ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b14975 ; - sh:value rdfs:Class ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithIRIAndLiteral ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b38619 ; - sh:value rdfs:Class ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithIRIAndLiteral ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b38619 ; - sh:value "Literal" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithIRIAndLiteral ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b79526 ; - sh:value rdfs:Class ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithIRIAndLiteral ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b97614 ; - sh:value "Literal" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithLiteral ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b3078 ; - sh:value "Literal" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithLiteral ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b38619 ; - sh:value "Literal" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithLiteral ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b97614 ; - sh:value "Literal" ; - ] ; - ] ; - mf:status sht:approved ; -. -_:b3078 - sh:path ex:myProperty ; - sh:nodeKind sh:BlankNodeOrIRI ; -. -_:b14975 - sh:path ex:myProperty ; - sh:nodeKind sh:BlankNodeOrLiteral ; -. -_:b38619 - sh:path ex:myProperty ; - sh:nodeKind sh:BlankNode ; -. -_:b55454 - rdf:type rdfs:Resource ; -. -_:b67098 - rdf:type rdfs:Resource ; -. -_:b79526 - sh:path ex:myProperty ; - sh:nodeKind sh:Literal ; -. -_:b97614 - sh:path ex:myProperty ; - sh:nodeKind sh:IRI ; -. -_:b97860 - sh:path ex:myProperty ; - sh:nodeKind sh:IRIOrLiteral ; -. -_:b99026 - rdf:type rdfs:Resource ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InstanceWithBlankNode + rdf:type ex:MyClass ; + ex:myProperty _:b55454 ; +. +ex:InstanceWithBlankNodeAndIRI + rdf:type ex:MyClass ; + ex:myProperty rdfs:Class ; + ex:myProperty _:b67098 ; +. +ex:InstanceWithBlankNodeAndLiteral + rdf:type ex:MyClass ; + ex:myProperty "Literal" ; + ex:myProperty _:b99026 ; +. +ex:InstanceWithIRI + rdf:type ex:MyClass ; + ex:myProperty rdfs:Class ; +. +ex:InstanceWithIRIAndLiteral + rdf:type ex:MyClass ; + ex:myProperty rdfs:Class ; + ex:myProperty "Literal" ; +. +ex:InstanceWithLiteral + rdf:type ex:MyClass ; + ex:myProperty "Literal" ; +. +ex:MyClass + rdf:type rdfs:Class ; + rdfs:label "My class" ; +. +ex:ShapeWithBlankNode + rdf:type sh:NodeShape ; + sh:property _:b38619 ; + sh:targetClass ex:MyClass ; +. +ex:ShapeWithBlankNodeOrIRI + rdf:type sh:NodeShape ; + sh:property _:b3078 ; + sh:targetClass ex:MyClass ; +. +ex:ShapeWithBlankNodeOrLiteral + rdf:type sh:NodeShape ; + sh:property _:b14975 ; + sh:targetClass ex:MyClass ; +. +ex:ShapeWithIRI + rdf:type sh:NodeShape ; + sh:property _:b97614 ; + sh:targetClass ex:MyClass ; +. +ex:ShapeWithIRIOrLiteral + rdf:type sh:NodeShape ; + sh:property _:b97860 ; + sh:targetClass ex:MyClass ; +. +ex:ShapeWithLiteral + rdf:type sh:NodeShape ; + sh:property _:b79526 ; + sh:targetClass ex:MyClass ; +. +ex:myProperty + rdf:type rdf:Property ; + rdfs:domain ex:MyClass ; + rdfs:label "my property" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:nodeKind at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithBlankNode ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b79526 ; + sh:value _:b55454 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithBlankNode ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b97614 ; + sh:value _:b55454 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithBlankNode ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b97860 ; + sh:value _:b55454 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithBlankNodeAndIRI ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b14975 ; + sh:value rdfs:Class ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithBlankNodeAndIRI ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b38619 ; + sh:value rdfs:Class ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithBlankNodeAndIRI ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b79526 ; + sh:value rdfs:Class ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithBlankNodeAndIRI ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b79526 ; + sh:value _:b67098 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithBlankNodeAndIRI ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b97614 ; + sh:value _:b67098 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithBlankNodeAndIRI ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b97860 ; + sh:value _:b67098 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithBlankNodeAndLiteral ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b3078 ; + sh:value "Literal" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithBlankNodeAndLiteral ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b38619 ; + sh:value "Literal" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithBlankNodeAndLiteral ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b79526 ; + sh:value _:b99026 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithBlankNodeAndLiteral ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b97614 ; + sh:value "Literal" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithBlankNodeAndLiteral ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b97614 ; + sh:value _:b99026 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithBlankNodeAndLiteral ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b97860 ; + sh:value _:b99026 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithIRI ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b14975 ; + sh:value rdfs:Class ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithIRI ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b38619 ; + sh:value rdfs:Class ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithIRI ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b79526 ; + sh:value rdfs:Class ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithIRIAndLiteral ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b3078 ; + sh:value "Literal" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithIRIAndLiteral ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b14975 ; + sh:value rdfs:Class ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithIRIAndLiteral ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b38619 ; + sh:value rdfs:Class ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithIRIAndLiteral ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b38619 ; + sh:value "Literal" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithIRIAndLiteral ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b79526 ; + sh:value rdfs:Class ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithIRIAndLiteral ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b97614 ; + sh:value "Literal" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithLiteral ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b3078 ; + sh:value "Literal" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithLiteral ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b38619 ; + sh:value "Literal" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithLiteral ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b97614 ; + sh:value "Literal" ; + ] ; + ] ; + mf:status sht:approved ; +. +_:b3078 + sh:path ex:myProperty ; + sh:nodeKind sh:BlankNodeOrIRI ; +. +_:b14975 + sh:path ex:myProperty ; + sh:nodeKind sh:BlankNodeOrLiteral ; +. +_:b38619 + sh:path ex:myProperty ; + sh:nodeKind sh:BlankNode ; +. +_:b55454 + rdf:type rdfs:Resource ; +. +_:b67098 + rdf:type rdfs:Resource ; +. +_:b79526 + sh:path ex:myProperty ; + sh:nodeKind sh:Literal ; +. +_:b97614 + sh:path ex:myProperty ; + sh:nodeKind sh:IRI ; +. +_:b97860 + sh:path ex:myProperty ; + sh:nodeKind sh:IRIOrLiteral ; +. +_:b99026 + rdf:type rdfs:Resource ; +. diff --git a/modules/shacl/src/test/resources/tests/core/property/not-001.ttl b/modules/shacl/src/test/resources/tests/core/property/not-001.ttl index 8cbb7ba8d..bad0e6fb1 100644 --- a/modules/shacl/src/test/resources/tests/core/property/not-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/property/not-001.ttl @@ -1,68 +1,68 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidResource1 - rdf:type rdfs:Resource ; - ex:property 42 ; - ex:property "Test Valid" ; - rdfs:label "Invalid resource1" ; -. -ex:TestShape - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:property ex:TestShape-property ; - sh:targetNode ex:InvalidResource1 ; - sh:targetNode ex:ValidResource1 ; - sh:targetNode ex:ValidResource2 ; -. -ex:TestShape-property - sh:path ex:property ; - sh:not [ - sh:datatype xsd:integer ; - ] ; -. -ex:ValidResource1 - rdf:type rdfs:Resource ; - rdfs:label "Valid resource1" ; -. -ex:ValidResource2 - rdf:type rdfs:Resource ; - ex:property 1.5 ; - ex:property "String" ; - rdfs:label "Valid resource2" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:not at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultPath ex:property ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NotConstraintComponent ; - sh:sourceShape ex:TestShape-property ; - sh:value 42 ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidResource1 + rdf:type rdfs:Resource ; + ex:property 42 ; + ex:property "Test Valid" ; + rdfs:label "Invalid resource1" ; +. +ex:TestShape + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:property ex:TestShape-property ; + sh:targetNode ex:InvalidResource1 ; + sh:targetNode ex:ValidResource1 ; + sh:targetNode ex:ValidResource2 ; +. +ex:TestShape-property + sh:path ex:property ; + sh:not [ + sh:datatype xsd:integer ; + ] ; +. +ex:ValidResource1 + rdf:type rdfs:Resource ; + rdfs:label "Valid resource1" ; +. +ex:ValidResource2 + rdf:type rdfs:Resource ; + ex:property 1.5 ; + ex:property "String" ; + rdfs:label "Valid resource2" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:not at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultPath ex:property ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NotConstraintComponent ; + sh:sourceShape ex:TestShape-property ; + sh:value 42 ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/property/or-001.ttl b/modules/shacl/src/test/resources/tests/core/property/or-001.ttl index 1040662b9..323ed0f57 100644 --- a/modules/shacl/src/test/resources/tests/core/property/or-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/property/or-001.ttl @@ -1,76 +1,76 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:Address - rdf:type rdfs:Class ; - rdfs:label "Address" ; - rdfs:subClassOf rdfs:Resource ; -. -ex:AddressShape - rdf:type sh:NodeShape ; - rdfs:label "Address shape" ; - sh:property ex:AddressShape-address ; - sh:targetNode ex:InvalidResource1 ; - sh:targetNode ex:ValidResource1 ; - sh:targetNode ex:ValidResource2 ; -. -ex:AddressShape-address - sh:path ex:address ; - sh:or ( - [ - sh:datatype xsd:string ; - ] - [ - sh:class ex:Address ; - ] - ) ; -. -ex:InvalidResource1 - rdf:type rdfs:Resource ; - ex:address "true"^^xsd:boolean ; -. -ex:ValidResource1 - rdf:type rdfs:Resource ; - ex:address "Home" ; -. -ex:ValidResource2 - rdf:type rdfs:Resource ; - ex:address [ - rdf:type ex:Address ; - ] ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:or at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultPath ex:address ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:OrConstraintComponent ; - sh:sourceShape ex:AddressShape-address ; - sh:value "true"^^xsd:boolean ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:Address + rdf:type rdfs:Class ; + rdfs:label "Address" ; + rdfs:subClassOf rdfs:Resource ; +. +ex:AddressShape + rdf:type sh:NodeShape ; + rdfs:label "Address shape" ; + sh:property ex:AddressShape-address ; + sh:targetNode ex:InvalidResource1 ; + sh:targetNode ex:ValidResource1 ; + sh:targetNode ex:ValidResource2 ; +. +ex:AddressShape-address + sh:path ex:address ; + sh:or ( + [ + sh:datatype xsd:string ; + ] + [ + sh:class ex:Address ; + ] + ) ; +. +ex:InvalidResource1 + rdf:type rdfs:Resource ; + ex:address "true"^^xsd:boolean ; +. +ex:ValidResource1 + rdf:type rdfs:Resource ; + ex:address "Home" ; +. +ex:ValidResource2 + rdf:type rdfs:Resource ; + ex:address [ + rdf:type ex:Address ; + ] ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:or at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultPath ex:address ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:OrConstraintComponent ; + sh:sourceShape ex:AddressShape-address ; + sh:value "true"^^xsd:boolean ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/property/or-datatypes-001.ttl b/modules/shacl/src/test/resources/tests/core/property/or-datatypes-001.ttl index 8f85b20a5..dc59b4205 100644 --- a/modules/shacl/src/test/resources/tests/core/property/or-datatypes-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/property/or-datatypes-001.ttl @@ -1,95 +1,95 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidResource1 - rdf:type rdfs:Resource ; - rdfs:comment owl:Thing ; - rdfs:comment 42 ; - rdfs:comment "A string" ; - rdfs:comment "none"^^xsd:boolean ; - rdfs:label "Invalid resource1" ; -. -ex:TestShape - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:property ex:TestShape-comment ; - sh:targetNode ex:InvalidResource1 ; - sh:targetNode ex:ValidResource1 ; -. -ex:TestShape-comment - sh:path rdfs:comment ; - sh:or ( - [ - sh:datatype xsd:string ; - ] - [ - sh:datatype rdf:HTML ; - ] - [ - sh:datatype rdf:langString ; - ] - [ - sh:datatype xsd:boolean ; - ] - ) ; -. -ex:ValidResource1 - rdf:type rdfs:Resource ; - rdfs:comment "
HTML
"^^rdf:HTML ; - rdfs:comment "A language string"@en ; - rdfs:comment "A string" ; - rdfs:label "Valid resource1" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:or of sh:datatypes at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultPath rdfs:comment ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:OrConstraintComponent ; - sh:sourceShape ex:TestShape-comment ; - sh:value owl:Thing ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultPath rdfs:comment ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:OrConstraintComponent ; - sh:sourceShape ex:TestShape-comment ; - sh:value 42 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultPath rdfs:comment ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:OrConstraintComponent ; - sh:sourceShape ex:TestShape-comment ; - sh:value "none"^^xsd:boolean ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidResource1 + rdf:type rdfs:Resource ; + rdfs:comment owl:Thing ; + rdfs:comment 42 ; + rdfs:comment "A string" ; + rdfs:comment "none"^^xsd:boolean ; + rdfs:label "Invalid resource1" ; +. +ex:TestShape + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:property ex:TestShape-comment ; + sh:targetNode ex:InvalidResource1 ; + sh:targetNode ex:ValidResource1 ; +. +ex:TestShape-comment + sh:path rdfs:comment ; + sh:or ( + [ + sh:datatype xsd:string ; + ] + [ + sh:datatype rdf:HTML ; + ] + [ + sh:datatype rdf:langString ; + ] + [ + sh:datatype xsd:boolean ; + ] + ) ; +. +ex:ValidResource1 + rdf:type rdfs:Resource ; + rdfs:comment "
HTML
"^^rdf:HTML ; + rdfs:comment "A language string"@en ; + rdfs:comment "A string" ; + rdfs:label "Valid resource1" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:or of sh:datatypes at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultPath rdfs:comment ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:OrConstraintComponent ; + sh:sourceShape ex:TestShape-comment ; + sh:value owl:Thing ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultPath rdfs:comment ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:OrConstraintComponent ; + sh:sourceShape ex:TestShape-comment ; + sh:value 42 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultPath rdfs:comment ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:OrConstraintComponent ; + sh:sourceShape ex:TestShape-comment ; + sh:value "none"^^xsd:boolean ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/property/pattern-001.ttl b/modules/shacl/src/test/resources/tests/core/property/pattern-001.ttl index fa863999e..2c63ad801 100644 --- a/modules/shacl/src/test/resources/tests/core/property/pattern-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/property/pattern-001.ttl @@ -1,74 +1,74 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidInstance1 - rdf:type ex:TestShape ; - ex:property "Maria" ; - rdfs:label "Invalid instance1" ; -. -ex:InvalidInstance2 - rdf:type ex:TestShape ; - ex:property "john" ; - rdfs:label "Invalid instance2" ; -. -ex:TestShape - rdf:type rdfs:Class ; - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:property ex:TestShape-property ; -. -ex:TestShape-property - sh:path ex:property ; - sh:datatype xsd:string ; - sh:pattern "Joh" ; -. -ex:ValidInstance1 - rdf:type ex:TestShape ; - ex:property "Hi Joh" ; - ex:property "John" ; - rdfs:label "Valid instance1" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:pattern at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance1 ; - sh:resultPath ex:property ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:PatternConstraintComponent ; - sh:sourceShape ex:TestShape-property ; - sh:value "Maria" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance2 ; - sh:resultPath ex:property ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:PatternConstraintComponent ; - sh:sourceShape ex:TestShape-property ; - sh:value "john" ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidInstance1 + rdf:type ex:TestShape ; + ex:property "Maria" ; + rdfs:label "Invalid instance1" ; +. +ex:InvalidInstance2 + rdf:type ex:TestShape ; + ex:property "john" ; + rdfs:label "Invalid instance2" ; +. +ex:TestShape + rdf:type rdfs:Class ; + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:property ex:TestShape-property ; +. +ex:TestShape-property + sh:path ex:property ; + sh:datatype xsd:string ; + sh:pattern "Joh" ; +. +ex:ValidInstance1 + rdf:type ex:TestShape ; + ex:property "Hi Joh" ; + ex:property "John" ; + rdfs:label "Valid instance1" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:pattern at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance1 ; + sh:resultPath ex:property ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:PatternConstraintComponent ; + sh:sourceShape ex:TestShape-property ; + sh:value "Maria" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance2 ; + sh:resultPath ex:property ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:PatternConstraintComponent ; + sh:sourceShape ex:TestShape-property ; + sh:value "john" ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/property/pattern-002.ttl b/modules/shacl/src/test/resources/tests/core/property/pattern-002.ttl index 79ee3b27e..498c2a3a1 100644 --- a/modules/shacl/src/test/resources/tests/core/property/pattern-002.ttl +++ b/modules/shacl/src/test/resources/tests/core/property/pattern-002.ttl @@ -1,66 +1,66 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidInstance1 - rdf:type ex:TestShape ; - ex:property "Maria" ; - rdfs:label "Invalid instance1" ; -. -ex:TestShape - rdf:type rdfs:Class ; - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:property ex:TestShape-property ; -. -ex:TestShape-property - sh:path ex:property ; - rdfs:label "property" ; - sh:datatype xsd:string ; - sh:flags "i" ; - sh:pattern "joh" ; -. -ex:ValidInstance1 - rdf:type ex:TestShape ; - ex:property "Hi Joh" ; - ex:property "John" ; - rdfs:label "Valid instance1" ; -. -ex:ValidInstance2 - rdf:type ex:TestShape ; - ex:property "john" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:pattern at property shape 002" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance1 ; - sh:resultPath ex:property ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:PatternConstraintComponent ; - sh:sourceShape ex:TestShape-property ; - sh:value "Maria" ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidInstance1 + rdf:type ex:TestShape ; + ex:property "Maria" ; + rdfs:label "Invalid instance1" ; +. +ex:TestShape + rdf:type rdfs:Class ; + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:property ex:TestShape-property ; +. +ex:TestShape-property + sh:path ex:property ; + rdfs:label "property" ; + sh:datatype xsd:string ; + sh:flags "i" ; + sh:pattern "joh" ; +. +ex:ValidInstance1 + rdf:type ex:TestShape ; + ex:property "Hi Joh" ; + ex:property "John" ; + rdfs:label "Valid instance1" ; +. +ex:ValidInstance2 + rdf:type ex:TestShape ; + ex:property "john" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:pattern at property shape 002" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance1 ; + sh:resultPath ex:property ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:PatternConstraintComponent ; + sh:sourceShape ex:TestShape-property ; + sh:value "Maria" ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/property/property-001.ttl b/modules/shacl/src/test/resources/tests/core/property/property-001.ttl index 8b00d9af7..cd7bfd42f 100644 --- a/modules/shacl/src/test/resources/tests/core/property/property-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/property/property-001.ttl @@ -1,100 +1,100 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:Address - rdf:type rdfs:Class ; - rdfs:label "Address" ; - rdfs:subClassOf rdfs:Resource ; -. -ex:City - rdf:type rdfs:Class ; - rdfs:label "City" ; - rdfs:subClassOf rdfs:Resource ; -. -ex:InvalidAddress - rdf:type ex:Address ; - ex:city ex:InvalidCity ; -. -ex:InvalidPerson1 - rdf:type ex:Person ; - ex:address ex:InvalidAddress ; -. -ex:InvalidPerson2 - rdf:type ex:Person ; - ex:address ex:InvalidAddress ; - ex:address ex:ValidAddress ; -. -ex:Person - rdf:type rdfs:Class ; - rdfs:label "Person" ; - rdfs:subClassOf rdfs:Resource ; -. -ex:PersonShape - rdf:type sh:NodeShape ; - rdfs:label "Person shape" ; - sh:property [ - sh:path ex:address ; - sh:property ex:PersonShape-address-city ; - ] ; - sh:targetClass ex:Person ; -. -ex:PersonShape-address-city - sh:path ex:city ; - sh:class ex:City ; -. -ex:ProperCity - rdf:type ex:City ; - rdfs:label "Proper city" ; -. -ex:ValidAddress - rdf:type ex:Address ; - ex:city ex:ProperCity ; -. -ex:ValidPerson1 - rdf:type ex:Person ; - ex:address ex:ValidAddress ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:property at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidAddress ; - sh:resultPath ex:city ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:ClassConstraintComponent ; - sh:sourceShape ex:PersonShape-address-city ; - sh:value ex:InvalidCity ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidAddress ; - sh:resultPath ex:city ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:ClassConstraintComponent ; - sh:sourceShape ex:PersonShape-address-city ; - sh:value ex:InvalidCity ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:Address + rdf:type rdfs:Class ; + rdfs:label "Address" ; + rdfs:subClassOf rdfs:Resource ; +. +ex:City + rdf:type rdfs:Class ; + rdfs:label "City" ; + rdfs:subClassOf rdfs:Resource ; +. +ex:InvalidAddress + rdf:type ex:Address ; + ex:city ex:InvalidCity ; +. +ex:InvalidPerson1 + rdf:type ex:Person ; + ex:address ex:InvalidAddress ; +. +ex:InvalidPerson2 + rdf:type ex:Person ; + ex:address ex:InvalidAddress ; + ex:address ex:ValidAddress ; +. +ex:Person + rdf:type rdfs:Class ; + rdfs:label "Person" ; + rdfs:subClassOf rdfs:Resource ; +. +ex:PersonShape + rdf:type sh:NodeShape ; + rdfs:label "Person shape" ; + sh:property [ + sh:path ex:address ; + sh:property ex:PersonShape-address-city ; + ] ; + sh:targetClass ex:Person ; +. +ex:PersonShape-address-city + sh:path ex:city ; + sh:class ex:City ; +. +ex:ProperCity + rdf:type ex:City ; + rdfs:label "Proper city" ; +. +ex:ValidAddress + rdf:type ex:Address ; + ex:city ex:ProperCity ; +. +ex:ValidPerson1 + rdf:type ex:Person ; + ex:address ex:ValidAddress ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:property at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidAddress ; + sh:resultPath ex:city ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:ClassConstraintComponent ; + sh:sourceShape ex:PersonShape-address-city ; + sh:value ex:InvalidCity ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidAddress ; + sh:resultPath ex:city ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:ClassConstraintComponent ; + sh:sourceShape ex:PersonShape-address-city ; + sh:value ex:InvalidCity ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/property/qualifiedMinCountDisjoint-001.ttl b/modules/shacl/src/test/resources/tests/core/property/qualifiedMinCountDisjoint-001.ttl index 90f2ccf20..00d91c248 100644 --- a/modules/shacl/src/test/resources/tests/core/property/qualifiedMinCountDisjoint-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/property/qualifiedMinCountDisjoint-001.ttl @@ -1,116 +1,116 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:Digit - rdf:type rdfs:Class ; - rdfs:label "Digit" ; -. -ex:Finger - rdf:type rdfs:Class ; - rdfs:label "Finger" ; - rdfs:subClassOf ex:Digit ; -. -ex:FingerAndThumb - rdf:type ex:Finger ; - rdf:type ex:Thumb ; - rdfs:label "Finger and thumb" ; -. -ex:FingerShape - rdf:type sh:NodeShape ; - rdfs:label "Finger shape" ; - sh:class ex:Finger ; -. -ex:Finger_1 - rdf:type ex:Finger ; - rdfs:label "Finger 1" ; -. -ex:Hand - rdf:type rdfs:Class ; - rdfs:label "Hand" ; -. -ex:HandShape - rdf:type sh:NodeShape ; - rdfs:label "Hand shape" ; - sh:property ex:HandShape-digit-maxCount4 ; - sh:property ex:HandShape-digit-minCount1 ; - sh:targetClass ex:Hand ; -. -ex:HandShape-digit-maxCount4 - rdf:type sh:PropertyShape ; - sh:path ex:digit ; - sh:qualifiedMaxCount 4 ; - sh:qualifiedValueShape ex:FingerShape ; - sh:qualifiedValueShapesDisjoint "true"^^xsd:boolean ; -. -ex:HandShape-digit-minCount1 - rdf:type sh:PropertyShape ; - sh:path ex:digit ; - sh:qualifiedMinCount 1 ; - sh:qualifiedValueShape ex:ThumbShape ; - sh:qualifiedValueShapesDisjoint "true"^^xsd:boolean ; -. -ex:InvalidHand1 - rdf:type ex:Hand ; - ex:digit ex:FingerAndThumb ; - rdfs:label "Invalid hand1" ; -. -ex:Thumb - rdf:type rdfs:Class ; - rdfs:label "Thumb" ; - rdfs:subClassOf ex:Digit ; -. -ex:ThumbShape - rdf:type sh:NodeShape ; - rdfs:label "Thumb shape" ; - sh:class ex:Thumb ; -. -ex:Thumb_1 - rdf:type ex:Thumb ; - rdfs:label "Thumb 1" ; -. -ex:ValidHand1 - rdf:type ex:Hand ; - ex:digit ex:Finger_1 ; - ex:digit ex:Thumb_1 ; - rdfs:label "Valid hand1" ; -. -ex:digit - rdf:type rdf:Property ; - rdfs:domain ex:Hand ; - rdfs:label "digit" ; - rdfs:range ex:Digit ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:qualifiedMinCount with disjoint shapes at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidHand1 ; - sh:resultPath ex:digit ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:QualifiedMinCountConstraintComponent ; - sh:sourceShape ex:HandShape-digit-minCount1 ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:Digit + rdf:type rdfs:Class ; + rdfs:label "Digit" ; +. +ex:Finger + rdf:type rdfs:Class ; + rdfs:label "Finger" ; + rdfs:subClassOf ex:Digit ; +. +ex:FingerAndThumb + rdf:type ex:Finger ; + rdf:type ex:Thumb ; + rdfs:label "Finger and thumb" ; +. +ex:FingerShape + rdf:type sh:NodeShape ; + rdfs:label "Finger shape" ; + sh:class ex:Finger ; +. +ex:Finger_1 + rdf:type ex:Finger ; + rdfs:label "Finger 1" ; +. +ex:Hand + rdf:type rdfs:Class ; + rdfs:label "Hand" ; +. +ex:HandShape + rdf:type sh:NodeShape ; + rdfs:label "Hand shape" ; + sh:property ex:HandShape-digit-maxCount4 ; + sh:property ex:HandShape-digit-minCount1 ; + sh:targetClass ex:Hand ; +. +ex:HandShape-digit-maxCount4 + rdf:type sh:PropertyShape ; + sh:path ex:digit ; + sh:qualifiedMaxCount 4 ; + sh:qualifiedValueShape ex:FingerShape ; + sh:qualifiedValueShapesDisjoint "true"^^xsd:boolean ; +. +ex:HandShape-digit-minCount1 + rdf:type sh:PropertyShape ; + sh:path ex:digit ; + sh:qualifiedMinCount 1 ; + sh:qualifiedValueShape ex:ThumbShape ; + sh:qualifiedValueShapesDisjoint "true"^^xsd:boolean ; +. +ex:InvalidHand1 + rdf:type ex:Hand ; + ex:digit ex:FingerAndThumb ; + rdfs:label "Invalid hand1" ; +. +ex:Thumb + rdf:type rdfs:Class ; + rdfs:label "Thumb" ; + rdfs:subClassOf ex:Digit ; +. +ex:ThumbShape + rdf:type sh:NodeShape ; + rdfs:label "Thumb shape" ; + sh:class ex:Thumb ; +. +ex:Thumb_1 + rdf:type ex:Thumb ; + rdfs:label "Thumb 1" ; +. +ex:ValidHand1 + rdf:type ex:Hand ; + ex:digit ex:Finger_1 ; + ex:digit ex:Thumb_1 ; + rdfs:label "Valid hand1" ; +. +ex:digit + rdf:type rdf:Property ; + rdfs:domain ex:Hand ; + rdfs:label "digit" ; + rdfs:range ex:Digit ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:qualifiedMinCount with disjoint shapes at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidHand1 ; + sh:resultPath ex:digit ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:QualifiedMinCountConstraintComponent ; + sh:sourceShape ex:HandShape-digit-minCount1 ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/property/qualifiedValueShape-001.ttl b/modules/shacl/src/test/resources/tests/core/property/qualifiedValueShape-001.ttl index 2ca5959e9..ead8f719c 100644 --- a/modules/shacl/src/test/resources/tests/core/property/qualifiedValueShape-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/property/qualifiedValueShape-001.ttl @@ -1,80 +1,80 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:APGARObservationShape - rdf:type sh:NodeShape ; - sh:property ex:APGARObservationShape-related ; - sh:targetNode ex:Observation1 ; -. -ex:APGARObservationShape-related - sh:path ex:related ; - sh:qualifiedMaxCount 3 ; - sh:qualifiedMinCount 3 ; - sh:qualifiedValueShape [ - sh:property [ - sh:path ex:related_target ; - sh:node [ - sh:property [ - sh:path ex:reference ; - sh:hasValue ex:something ; - ] ; - ] ; - ] ; - ] ; -. -ex:Observation1 - rdf:type ex:Observation ; - ex:related [ - ex:related_target [ - ex:reference ex:something ; - ] ; - ex:related_type "has-component"^^ex:code ; - ] ; - ex:related [ - ex:related_target [ - ex:reference ex:something ; - ] ; - ex:related_type "has-component"^^ex:code ; - ] ; - ex:related [ - ex:related_target [ - ex:reference ex:unrelated ; - ] ; - ex:related_type "has-component"^^ex:code ; - ] ; - sh:nodeShape ex:APGARObservationShape ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:qualifiedValueShape at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:Observation1 ; - sh:resultPath ex:related ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:QualifiedMinCountConstraintComponent ; - sh:sourceShape ex:APGARObservationShape-related ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:APGARObservationShape + rdf:type sh:NodeShape ; + sh:property ex:APGARObservationShape-related ; + sh:targetNode ex:Observation1 ; +. +ex:APGARObservationShape-related + sh:path ex:related ; + sh:qualifiedMaxCount 3 ; + sh:qualifiedMinCount 3 ; + sh:qualifiedValueShape [ + sh:property [ + sh:path ex:related_target ; + sh:node [ + sh:property [ + sh:path ex:reference ; + sh:hasValue ex:something ; + ] ; + ] ; + ] ; + ] ; +. +ex:Observation1 + rdf:type ex:Observation ; + ex:related [ + ex:related_target [ + ex:reference ex:something ; + ] ; + ex:related_type "has-component"^^ex:code ; + ] ; + ex:related [ + ex:related_target [ + ex:reference ex:something ; + ] ; + ex:related_type "has-component"^^ex:code ; + ] ; + ex:related [ + ex:related_target [ + ex:reference ex:unrelated ; + ] ; + ex:related_type "has-component"^^ex:code ; + ] ; + sh:nodeShape ex:APGARObservationShape ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:qualifiedValueShape at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:Observation1 ; + sh:resultPath ex:related ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:QualifiedMinCountConstraintComponent ; + sh:sourceShape ex:APGARObservationShape-related ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/property/qualifiedValueShapesDisjoint-001.ttl b/modules/shacl/src/test/resources/tests/core/property/qualifiedValueShapesDisjoint-001.ttl index 7aa02ea6a..1cc8cbc1c 100644 --- a/modules/shacl/src/test/resources/tests/core/property/qualifiedValueShapesDisjoint-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/property/qualifiedValueShapesDisjoint-001.ttl @@ -1,128 +1,128 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:Finger - rdf:type rdfs:Class ; - rdf:type sh:NodeShape ; - rdfs:label "Finger" ; - rdfs:subClassOf rdfs:Resource ; -. -ex:Finger1 - rdf:type ex:Finger ; - rdfs:label "Finger1" ; -. -ex:Finger2 - rdf:type ex:Finger ; - rdfs:label "Finger2" ; -. -ex:Finger3 - rdf:type ex:Finger ; - rdfs:label "Finger3" ; -. -ex:Finger4 - rdf:type ex:Finger ; - rdfs:label "Finger4" ; -. -ex:FingerAndThumb - rdf:type ex:Finger ; - rdf:type ex:Thumb ; - rdfs:label "Finger and thumb" ; -. -ex:Hand - rdf:type rdfs:Class ; - rdf:type sh:NodeShape ; - rdfs:label "Hand" ; - rdfs:subClassOf rdfs:Resource ; -. -ex:HandShape - rdf:type sh:NodeShape ; - sh:property ex:HandShape-digit1 ; - sh:property ex:HandShape-digit4 ; - sh:targetClass ex:Hand ; -. -ex:HandShape-digit1 - sh:path ex:digit ; - sh:qualifiedMaxCount 1 ; - sh:qualifiedMinCount 1 ; - sh:qualifiedValueShape [ - sh:class ex:Thumb ; - ] ; - sh:qualifiedValueShapesDisjoint "true"^^xsd:boolean ; -. -ex:HandShape-digit4 - sh:path ex:digit ; - sh:qualifiedMaxCount 4 ; - sh:qualifiedMinCount 4 ; - sh:qualifiedValueShape [ - sh:class ex:Finger ; - ] ; - sh:qualifiedValueShapesDisjoint "true"^^xsd:boolean ; -. -ex:InvalidHand1 - rdf:type ex:Hand ; - ex:digit ex:Finger1 ; - ex:digit ex:Finger2 ; - ex:digit ex:Finger3 ; - ex:digit ex:FingerAndThumb ; -. -ex:Thumb - rdf:type rdfs:Class ; - rdf:type sh:NodeShape ; - rdfs:label "Thumb" ; - rdfs:subClassOf rdfs:Resource ; -. -ex:Thumb1 - rdf:type ex:Thumb ; - rdfs:label "Thumb1" ; -. -ex:ValidHand - rdf:type ex:Hand ; - ex:digit ex:Finger1 ; - ex:digit ex:Finger2 ; - ex:digit ex:Finger3 ; - ex:digit ex:Finger4 ; - ex:digit ex:Thumb1 ; - rdfs:label "Valid hand" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:qualifiedValueShapesDisjoint at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidHand1 ; - sh:resultPath ex:digit ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:QualifiedMinCountConstraintComponent ; - sh:sourceShape ex:HandShape-digit1 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidHand1 ; - sh:resultPath ex:digit ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:QualifiedMinCountConstraintComponent ; - sh:sourceShape ex:HandShape-digit4 ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:Finger + rdf:type rdfs:Class ; + rdf:type sh:NodeShape ; + rdfs:label "Finger" ; + rdfs:subClassOf rdfs:Resource ; +. +ex:Finger1 + rdf:type ex:Finger ; + rdfs:label "Finger1" ; +. +ex:Finger2 + rdf:type ex:Finger ; + rdfs:label "Finger2" ; +. +ex:Finger3 + rdf:type ex:Finger ; + rdfs:label "Finger3" ; +. +ex:Finger4 + rdf:type ex:Finger ; + rdfs:label "Finger4" ; +. +ex:FingerAndThumb + rdf:type ex:Finger ; + rdf:type ex:Thumb ; + rdfs:label "Finger and thumb" ; +. +ex:Hand + rdf:type rdfs:Class ; + rdf:type sh:NodeShape ; + rdfs:label "Hand" ; + rdfs:subClassOf rdfs:Resource ; +. +ex:HandShape + rdf:type sh:NodeShape ; + sh:property ex:HandShape-digit1 ; + sh:property ex:HandShape-digit4 ; + sh:targetClass ex:Hand ; +. +ex:HandShape-digit1 + sh:path ex:digit ; + sh:qualifiedMaxCount 1 ; + sh:qualifiedMinCount 1 ; + sh:qualifiedValueShape [ + sh:class ex:Thumb ; + ] ; + sh:qualifiedValueShapesDisjoint "true"^^xsd:boolean ; +. +ex:HandShape-digit4 + sh:path ex:digit ; + sh:qualifiedMaxCount 4 ; + sh:qualifiedMinCount 4 ; + sh:qualifiedValueShape [ + sh:class ex:Finger ; + ] ; + sh:qualifiedValueShapesDisjoint "true"^^xsd:boolean ; +. +ex:InvalidHand1 + rdf:type ex:Hand ; + ex:digit ex:Finger1 ; + ex:digit ex:Finger2 ; + ex:digit ex:Finger3 ; + ex:digit ex:FingerAndThumb ; +. +ex:Thumb + rdf:type rdfs:Class ; + rdf:type sh:NodeShape ; + rdfs:label "Thumb" ; + rdfs:subClassOf rdfs:Resource ; +. +ex:Thumb1 + rdf:type ex:Thumb ; + rdfs:label "Thumb1" ; +. +ex:ValidHand + rdf:type ex:Hand ; + ex:digit ex:Finger1 ; + ex:digit ex:Finger2 ; + ex:digit ex:Finger3 ; + ex:digit ex:Finger4 ; + ex:digit ex:Thumb1 ; + rdfs:label "Valid hand" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:qualifiedValueShapesDisjoint at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidHand1 ; + sh:resultPath ex:digit ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:QualifiedMinCountConstraintComponent ; + sh:sourceShape ex:HandShape-digit1 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidHand1 ; + sh:resultPath ex:digit ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:QualifiedMinCountConstraintComponent ; + sh:sourceShape ex:HandShape-digit4 ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/property/uniqueLang-001.ttl b/modules/shacl/src/test/resources/tests/core/property/uniqueLang-001.ttl index 9014c7fa1..ffec0ff0f 100644 --- a/modules/shacl/src/test/resources/tests/core/property/uniqueLang-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/property/uniqueLang-001.ttl @@ -1,86 +1,86 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidInstance1 - rdf:type ex:TestShape ; - ex:testProperty "Me" ; - ex:testProperty "Me"@en ; - ex:testProperty "Moi"@fr ; - ex:testProperty "Myself"@en ; -. -ex:InvalidInstance2 - rdf:type ex:TestShape ; - ex:testProperty "I"@en ; - ex:testProperty "Ich"@de ; - ex:testProperty "Me"@en ; - ex:testProperty "Mich"@de ; - ex:testProperty "Myself"@en ; -. -ex:TestShape - rdf:type rdfs:Class ; - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:property ex:TestShape-testProperty ; -. -ex:TestShape-testProperty - sh:path ex:testProperty ; - rdfs:label "test property" ; - sh:uniqueLang "true"^^xsd:boolean ; -. -ex:ValidInstance1 - rdf:type ex:TestShape ; - ex:testProperty "Me" ; - ex:testProperty "Me"@en ; - ex:testProperty "Moi"@fr ; - ex:testProperty "Myself" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:uniqueLang at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance1 ; - sh:resultPath ex:testProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:UniqueLangConstraintComponent ; - sh:sourceShape ex:TestShape-testProperty ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance2 ; - sh:resultPath ex:testProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:UniqueLangConstraintComponent ; - sh:sourceShape ex:TestShape-testProperty ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance2 ; - sh:resultPath ex:testProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:UniqueLangConstraintComponent ; - sh:sourceShape ex:TestShape-testProperty ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidInstance1 + rdf:type ex:TestShape ; + ex:testProperty "Me" ; + ex:testProperty "Me"@en ; + ex:testProperty "Moi"@fr ; + ex:testProperty "Myself"@en ; +. +ex:InvalidInstance2 + rdf:type ex:TestShape ; + ex:testProperty "I"@en ; + ex:testProperty "Ich"@de ; + ex:testProperty "Me"@en ; + ex:testProperty "Mich"@de ; + ex:testProperty "Myself"@en ; +. +ex:TestShape + rdf:type rdfs:Class ; + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:property ex:TestShape-testProperty ; +. +ex:TestShape-testProperty + sh:path ex:testProperty ; + rdfs:label "test property" ; + sh:uniqueLang "true"^^xsd:boolean ; +. +ex:ValidInstance1 + rdf:type ex:TestShape ; + ex:testProperty "Me" ; + ex:testProperty "Me"@en ; + ex:testProperty "Moi"@fr ; + ex:testProperty "Myself" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:uniqueLang at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance1 ; + sh:resultPath ex:testProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:UniqueLangConstraintComponent ; + sh:sourceShape ex:TestShape-testProperty ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance2 ; + sh:resultPath ex:testProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:UniqueLangConstraintComponent ; + sh:sourceShape ex:TestShape-testProperty ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance2 ; + sh:resultPath ex:testProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:UniqueLangConstraintComponent ; + sh:sourceShape ex:TestShape-testProperty ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/property/uniqueLang-002-shapes.ttl b/modules/shacl/src/test/resources/tests/core/property/uniqueLang-002-shapes.ttl index 08526271d..648d4821c 100644 --- a/modules/shacl/src/test/resources/tests/core/property/uniqueLang-002-shapes.ttl +++ b/modules/shacl/src/test/resources/tests/core/property/uniqueLang-002-shapes.ttl @@ -6,3 +6,7 @@ ex:s1 a sh:PropertyShape ; sh:targetNode ex:i ; sh:path ex:message ; sh:uniqueLang "1"^^xsd:boolean . + +# Note that the value above is "1"^^xsd:boolean, which is distinct from "true"^^xsd:boolean. +# Only true is mentioned in the spec, meaning that "1" will not activate the constraint +# and the constraint is being ignored. diff --git a/modules/shacl/src/test/resources/tests/core/targets/multipleTargets-001.ttl b/modules/shacl/src/test/resources/tests/core/targets/multipleTargets-001.ttl index 02318492a..81a99e810 100644 --- a/modules/shacl/src/test/resources/tests/core/targets/multipleTargets-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/targets/multipleTargets-001.ttl @@ -1,56 +1,56 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidResource1 - ex:property1 "Also a value" ; -. -ex:TestShape - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:in ( - ex:ValidResource1 - ex:ValidResource2 - ) ; - sh:targetSubjectsOf ex:property1 ; - sh:targetSubjectsOf ex:property2 ; -. -ex:ValidResource1 - ex:property1 "Some value" ; -. -ex:ValidResource2 - ex:property2 "Other value" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of multiple targets 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:InConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:InvalidResource1 ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidResource1 + ex:property1 "Also a value" ; +. +ex:TestShape + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:in ( + ex:ValidResource1 + ex:ValidResource2 + ) ; + sh:targetSubjectsOf ex:property1 ; + sh:targetSubjectsOf ex:property2 ; +. +ex:ValidResource1 + ex:property1 "Some value" ; +. +ex:ValidResource2 + ex:property2 "Other value" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of multiple targets 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:InConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:InvalidResource1 ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/targets/targetClass-001.ttl b/modules/shacl/src/test/resources/tests/core/targets/targetClass-001.ttl index 99ccc3002..e1d5a55cb 100644 --- a/modules/shacl/src/test/resources/tests/core/targets/targetClass-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/targets/targetClass-001.ttl @@ -1,62 +1,62 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidInstance1 - rdf:type ex:MyClass ; - ex:myProperty "A" ; - ex:myProperty "B" ; -. -ex:MyClass - rdf:type rdfs:Class ; -. -ex:MyShape - rdf:type sh:NodeShape ; - sh:property ex:MyShape-myProperty ; - sh:targetClass ex:MyClass ; -. -ex:MyShape-myProperty - sh:path ex:myProperty ; - sh:maxCount 1 ; -. -ex:ValidInstance1 - rdf:type ex:MyClass ; - ex:myProperty "A" ; -. -ex:ValidInstance2 - ex:myProperty "A" ; - ex:myProperty "B" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:targetClass 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance1 ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxCountConstraintComponent ; - sh:sourceShape ex:MyShape-myProperty ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidInstance1 + rdf:type ex:MyClass ; + ex:myProperty "A" ; + ex:myProperty "B" ; +. +ex:MyClass + rdf:type rdfs:Class ; +. +ex:MyShape + rdf:type sh:NodeShape ; + sh:property ex:MyShape-myProperty ; + sh:targetClass ex:MyClass ; +. +ex:MyShape-myProperty + sh:path ex:myProperty ; + sh:maxCount 1 ; +. +ex:ValidInstance1 + rdf:type ex:MyClass ; + ex:myProperty "A" ; +. +ex:ValidInstance2 + ex:myProperty "A" ; + ex:myProperty "B" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:targetClass 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance1 ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxCountConstraintComponent ; + sh:sourceShape ex:MyShape-myProperty ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/targets/targetNode-001.ttl b/modules/shacl/src/test/resources/tests/core/targets/targetNode-001.ttl index 0cb1e22a7..195e3ffcf 100644 --- a/modules/shacl/src/test/resources/tests/core/targets/targetNode-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/targets/targetNode-001.ttl @@ -1,57 +1,57 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidResource1 - rdf:type rdfs:Resource ; - rdfs:label "Invalid resource 1" ; -. -ex:TestShape - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:property ex:TestShape-label ; - sh:targetNode ex:InvalidResource1 ; - sh:targetNode ex:ValidResource1 ; -. -ex:TestShape-label - sh:path rdfs:label ; - rdfs:label "label" ; - sh:datatype xsd:string ; - sh:maxCount 0 ; -. -ex:ValidResource1 - rdf:type rdfs:Resource ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:targetNode 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultPath rdfs:label ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxCountConstraintComponent ; - sh:sourceShape ex:TestShape-label ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidResource1 + rdf:type rdfs:Resource ; + rdfs:label "Invalid resource 1" ; +. +ex:TestShape + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:property ex:TestShape-label ; + sh:targetNode ex:InvalidResource1 ; + sh:targetNode ex:ValidResource1 ; +. +ex:TestShape-label + sh:path rdfs:label ; + rdfs:label "label" ; + sh:datatype xsd:string ; + sh:maxCount 0 ; +. +ex:ValidResource1 + rdf:type rdfs:Resource ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:targetNode 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultPath rdfs:label ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxCountConstraintComponent ; + sh:sourceShape ex:TestShape-label ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/targets/targetObjectsOf-001.ttl b/modules/shacl/src/test/resources/tests/core/targets/targetObjectsOf-001.ttl index 4cd3d7080..09eeea655 100644 --- a/modules/shacl/src/test/resources/tests/core/targets/targetObjectsOf-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/targets/targetObjectsOf-001.ttl @@ -1,65 +1,65 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidResource1 - ex:testProperty "String" ; -. -ex:InvalidResource2 - ex:testProperty rdfs:Resource ; -. -ex:TestShape - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:datatype xsd:integer ; - sh:targetObjectsOf ex:testProperty ; -. -ex:ValidResource1 - ex:testProperty 100 ; - ex:testProperty 42 ; -. -ex:testProperty - rdf:type rdf:Property ; - rdfs:label "test property" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:targetObjectsOf 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode rdfs:Resource ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value rdfs:Resource ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode "String" ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value "String" ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidResource1 + ex:testProperty "String" ; +. +ex:InvalidResource2 + ex:testProperty rdfs:Resource ; +. +ex:TestShape + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:datatype xsd:integer ; + sh:targetObjectsOf ex:testProperty ; +. +ex:ValidResource1 + ex:testProperty 100 ; + ex:testProperty 42 ; +. +ex:testProperty + rdf:type rdf:Property ; + rdfs:label "test property" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:targetObjectsOf 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode rdfs:Resource ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value rdfs:Resource ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode "String" ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value "String" ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/targets/targetSubjectsOf-001.ttl b/modules/shacl/src/test/resources/tests/core/targets/targetSubjectsOf-001.ttl index 1f4637b22..9069f17b0 100644 --- a/modules/shacl/src/test/resources/tests/core/targets/targetSubjectsOf-001.ttl +++ b/modules/shacl/src/test/resources/tests/core/targets/targetSubjectsOf-001.ttl @@ -1,57 +1,57 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidInstance1 - ex:myProperty "A" ; - ex:myProperty "B" ; -. -ex:MyClass - rdf:type rdfs:Class ; -. -ex:TestShape - rdf:type sh:NodeShape ; - sh:property ex:TestShape-myProperty ; - sh:targetSubjectsOf ex:myProperty ; -. -ex:TestShape-myProperty - rdf:type sh:PropertyShape ; - sh:path ex:myProperty ; - sh:maxCount 1 ; -. -ex:ValidInstance1 - ex:myProperty "A" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:targetSubjectsOf 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance1 ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxCountConstraintComponent ; - sh:sourceShape ex:TestShape-myProperty ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidInstance1 + ex:myProperty "A" ; + ex:myProperty "B" ; +. +ex:MyClass + rdf:type rdfs:Class ; +. +ex:TestShape + rdf:type sh:NodeShape ; + sh:property ex:TestShape-myProperty ; + sh:targetSubjectsOf ex:myProperty ; +. +ex:TestShape-myProperty + rdf:type sh:PropertyShape ; + sh:path ex:myProperty ; + sh:maxCount 1 ; +. +ex:ValidInstance1 + ex:myProperty "A" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:targetSubjectsOf 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance1 ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxCountConstraintComponent ; + sh:sourceShape ex:TestShape-myProperty ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/core/targets/targetSubjectsOf-002.ttl b/modules/shacl/src/test/resources/tests/core/targets/targetSubjectsOf-002.ttl index 896dd9970..e4adacdc2 100644 --- a/modules/shacl/src/test/resources/tests/core/targets/targetSubjectsOf-002.ttl +++ b/modules/shacl/src/test/resources/tests/core/targets/targetSubjectsOf-002.ttl @@ -1,74 +1,74 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidInstance1 - rdf:type ex:MyClass ; - ex:myProperty "A" ; - ex:myProperty "B" ; -. -ex:InvalidInstance2 - ex:myProperty "A" ; - ex:myProperty "B" ; -. -ex:MyClass - rdf:type rdfs:Class ; -. -ex:TestShape - rdf:type sh:NodeShape ; - sh:property ex:TestShape-myProperty ; - sh:targetClass ex:MyClass ; - sh:targetSubjectsOf ex:myProperty ; -. -ex:TestShape-myProperty - sh:path ex:myProperty ; - sh:maxCount 1 ; -. -ex:ValidInstance1 - rdf:type ex:MyClass ; - ex:myProperty "A" ; -. -ex:ValidInstance2 - ex:myProperty "A" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:targetSubjectsOf 002" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance1 ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxCountConstraintComponent ; - sh:sourceShape ex:TestShape-myProperty ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance2 ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxCountConstraintComponent ; - sh:sourceShape ex:TestShape-myProperty ; - ] ; - ] ; - mf:status sht:approved ; -. +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidInstance1 + rdf:type ex:MyClass ; + ex:myProperty "A" ; + ex:myProperty "B" ; +. +ex:InvalidInstance2 + ex:myProperty "A" ; + ex:myProperty "B" ; +. +ex:MyClass + rdf:type rdfs:Class ; +. +ex:TestShape + rdf:type sh:NodeShape ; + sh:property ex:TestShape-myProperty ; + sh:targetClass ex:MyClass ; + sh:targetSubjectsOf ex:myProperty ; +. +ex:TestShape-myProperty + sh:path ex:myProperty ; + sh:maxCount 1 ; +. +ex:ValidInstance1 + rdf:type ex:MyClass ; + ex:myProperty "A" ; +. +ex:ValidInstance2 + ex:myProperty "A" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:targetSubjectsOf 002" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance1 ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxCountConstraintComponent ; + sh:sourceShape ex:TestShape-myProperty ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance2 ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxCountConstraintComponent ; + sh:sourceShape ex:TestShape-myProperty ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/sparql/component/nodeValidator-001.ttl b/modules/shacl/src/test/resources/tests/sparql/component/nodeValidator-001.ttl index 62d0fbf83..1bcabc45c 100644 --- a/modules/shacl/src/test/resources/tests/sparql/component/nodeValidator-001.ttl +++ b/modules/shacl/src/test/resources/tests/sparql/component/nodeValidator-001.ttl @@ -1,83 +1,83 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - - - sh:declare [ - rdf:type sh:PrefixDeclaration ; - sh:namespace "http://datashapes.org/sh/tests/sparql/component/nodeValidator-001.test#"^^xsd:anyURI ; - sh:prefix "ex" ; - ] ; -. -ex:InvalidResource1 - ex:property "Other" ; -. -ex:TestConstraintComponent - rdf:type sh:ConstraintComponent ; - rdfs:label "Test constraint component" ; - sh:nodeValidator [ - rdf:type sh:SPARQLSelectValidator ; - sh:select """ - SELECT DISTINCT $this - WHERE { - $this ?p ?o . - FILTER NOT EXISTS { - $this ex:property ?requiredParam . - }}""" ; - sh:prefixes ; - ] ; - sh:parameter [ - sh:path ex:optionalParam ; - sh:datatype xsd:integer ; - sh:name "optional param" ; - sh:optional "true"^^xsd:boolean ; - ] ; - sh:parameter [ - sh:path ex:requiredParam ; - sh:datatype xsd:string ; - sh:name "required param" ; - ] ; -. -ex:TestShape - rdf:type sh:NodeShape ; - ex:requiredParam "Value" ; - rdfs:label "Test shape" ; - sh:targetNode ex:InvalidResource1 ; - sh:targetNode ex:ValidResource1 ; -. -ex:ValidResource1 - ex:property "Value" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:nodeValidator 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent ex:TestConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:InvalidResource1 ; - ] ; - ] ; - mf:status sht:proposed ; +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + + + sh:declare [ + rdf:type sh:PrefixDeclaration ; + sh:namespace "http://datashapes.org/sh/tests/sparql/component/nodeValidator-001.test#"^^xsd:anyURI ; + sh:prefix "ex" ; + ] ; +. +ex:InvalidResource1 + ex:property "Other" ; +. +ex:TestConstraintComponent + rdf:type sh:ConstraintComponent ; + rdfs:label "Test constraint component" ; + sh:nodeValidator [ + rdf:type sh:SPARQLSelectValidator ; + sh:select """ + SELECT DISTINCT $this + WHERE { + $this ?p ?o . + FILTER NOT EXISTS { + $this ex:property ?requiredParam . + }}""" ; + sh:prefixes ; + ] ; + sh:parameter [ + sh:path ex:optionalParam ; + sh:datatype xsd:integer ; + sh:name "optional param" ; + sh:optional "true"^^xsd:boolean ; + ] ; + sh:parameter [ + sh:path ex:requiredParam ; + sh:datatype xsd:string ; + sh:name "required param" ; + ] ; +. +ex:TestShape + rdf:type sh:NodeShape ; + ex:requiredParam "Value" ; + rdfs:label "Test shape" ; + sh:targetNode ex:InvalidResource1 ; + sh:targetNode ex:ValidResource1 ; +. +ex:ValidResource1 + ex:property "Value" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:nodeValidator 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent ex:TestConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:InvalidResource1 ; + ] ; + ] ; + mf:status sht:proposed ; . \ No newline at end of file diff --git a/modules/shacl/src/test/resources/tests/sparql/node/sparql-001.ttl b/modules/shacl/src/test/resources/tests/sparql/node/sparql-001.ttl index 1c2b7f237..eae95ebcd 100644 --- a/modules/shacl/src/test/resources/tests/sparql/node/sparql-001.ttl +++ b/modules/shacl/src/test/resources/tests/sparql/node/sparql-001.ttl @@ -1,89 +1,89 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidResource1 - rdf:type rdfs:Resource ; - rdfs:label "Invalid resource 1" ; -. -ex:InvalidResource2 - rdf:type rdfs:Resource ; - rdfs:label "Invalid label 1" ; - rdfs:label "Invalid label 2" ; -. -ex:TestShape - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:sparql ex:TestShape-sparql ; - sh:targetNode ex:InvalidResource1 ; - sh:targetNode ex:InvalidResource2 ; - sh:targetNode ex:ValidResource1 ; -. -ex:TestShape-sparql - sh:message "Cannot have a label" ; - sh:prefixes ; +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidResource1 + rdf:type rdfs:Resource ; + rdfs:label "Invalid resource 1" ; +. +ex:InvalidResource2 + rdf:type rdfs:Resource ; + rdfs:label "Invalid label 1" ; + rdfs:label "Invalid label 2" ; +. +ex:TestShape + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:sparql ex:TestShape-sparql ; + sh:targetNode ex:InvalidResource1 ; + sh:targetNode ex:InvalidResource2 ; + sh:targetNode ex:ValidResource1 ; +. +ex:TestShape-sparql + sh:message "Cannot have a label" ; + sh:prefixes ; sh:select """ SELECT $this ?path ?value WHERE { $this ?path ?value . FILTER (?path = ) . - }""" ; -. -ex:ValidResource1 - rdf:type rdfs:Resource ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:sparql at node shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultPath rdfs:label ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraint ex:TestShape-sparql ; - sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value "Invalid resource 1" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource2 ; - sh:resultPath rdfs:label ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraint ex:TestShape-sparql ; - sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value "Invalid label 1" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource2 ; - sh:resultPath rdfs:label ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraint ex:TestShape-sparql ; - sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value "Invalid label 2" ; - ] ; - ] ; - mf:status sht:approved ; -. + }""" ; +. +ex:ValidResource1 + rdf:type rdfs:Resource ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:sparql at node shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultPath rdfs:label ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraint ex:TestShape-sparql ; + sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value "Invalid resource 1" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource2 ; + sh:resultPath rdfs:label ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraint ex:TestShape-sparql ; + sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value "Invalid label 1" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource2 ; + sh:resultPath rdfs:label ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraint ex:TestShape-sparql ; + sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value "Invalid label 2" ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/sparql/node/sparql-003.ttl b/modules/shacl/src/test/resources/tests/sparql/node/sparql-003.ttl index 4dffc9132..2c603e1a6 100644 --- a/modules/shacl/src/test/resources/tests/sparql/node/sparql-003.ttl +++ b/modules/shacl/src/test/resources/tests/sparql/node/sparql-003.ttl @@ -1,70 +1,70 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - - - sh:declare [ - rdf:type sh:PrefixDeclaration ; - sh:namespace "http://datashapes.org/sh/tests/sparql/node/sparql-003.test#"^^xsd:anyURI ; - sh:prefix "ex" ; - ] ; -. -ex:InvalidCountry - rdf:type ex:Country ; - ex:germanLabel "Spain"@en ; -. -ex:LanguageExampleShape - rdf:type sh:NodeShape ; - rdf:type sh:SPARQLConstraint ; - sh:message "Values are literals with German language tag." ; - sh:prefixes ; +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + + + sh:declare [ + rdf:type sh:PrefixDeclaration ; + sh:namespace "http://datashapes.org/sh/tests/sparql/node/sparql-003.test#"^^xsd:anyURI ; + sh:prefix "ex" ; + ] ; +. +ex:InvalidCountry + rdf:type ex:Country ; + ex:germanLabel "Spain"@en ; +. +ex:LanguageExampleShape + rdf:type sh:NodeShape ; + rdf:type sh:SPARQLConstraint ; + sh:message "Values are literals with German language tag." ; + sh:prefixes ; sh:select """ SELECT $this (ex:germanLabel AS ?path) WHERE { $this ex:germanLabel ?value . FILTER (!isLiteral(?value) || !langMatches(lang(?value), \"de\")) } - """ ; - sh:severity sh:Warning ; - sh:sparql ex:LanguageExampleShape ; - sh:targetClass ex:Country ; -. -ex:ValidCountry - rdf:type ex:Country ; - ex:germanLabel "Spanien"@de ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:sparql at node shape 003" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidCountry ; - sh:resultPath ex:germanLabel ; - sh:resultSeverity sh:Warning ; - sh:sourceConstraint ex:LanguageExampleShape ; - sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; - sh:sourceShape ex:LanguageExampleShape ; - sh:value ex:InvalidCountry ; - ] ; - ] ; - mf:status sht:approved ; -. + """ ; + sh:severity sh:Warning ; + sh:sparql ex:LanguageExampleShape ; + sh:targetClass ex:Country ; +. +ex:ValidCountry + rdf:type ex:Country ; + ex:germanLabel "Spanien"@de ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:sparql at node shape 003" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidCountry ; + sh:resultPath ex:germanLabel ; + sh:resultSeverity sh:Warning ; + sh:sourceConstraint ex:LanguageExampleShape ; + sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; + sh:sourceShape ex:LanguageExampleShape ; + sh:value ex:InvalidCountry ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/sparql/pre-binding/pre-binding-001.ttl b/modules/shacl/src/test/resources/tests/sparql/pre-binding/pre-binding-001.ttl index 2babf66f1..cf9027541 100644 --- a/modules/shacl/src/test/resources/tests/sparql/pre-binding/pre-binding-001.ttl +++ b/modules/shacl/src/test/resources/tests/sparql/pre-binding/pre-binding-001.ttl @@ -1,63 +1,63 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex: - sh:declare [ - sh:prefix "ex" ; - sh:namespace "http://datashapes.org/sh/tests/sparql/pre-binding/pre-binding-001.test#"^^xsd:anyURI ; - ] . - -ex:TestShape - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:sparql ex:TestShape-sparql ; - sh:targetNode ex:InvalidResource ; -. -ex:TestShape-sparql - sh:message "Test message" ; - sh:prefixes ex: ; +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex: + sh:declare [ + sh:prefix "ex" ; + sh:namespace "http://datashapes.org/sh/tests/sparql/pre-binding/pre-binding-001.test#"^^xsd:anyURI ; + ] . + +ex:TestShape + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:sparql ex:TestShape-sparql ; + sh:targetNode ex:InvalidResource ; +. +ex:TestShape-sparql + sh:message "Test message" ; + sh:prefixes ex: ; sh:select """ SELECT $this WHERE { FILTER ($this = ex:InvalidResource) . - }""" ; -. -ex:ValidResource1 - rdf:type rdfs:Resource ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of pre-binding in FILTER" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource ; - sh:resultMessage "Test message" ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraint ex:TestShape-sparql ; - sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:InvalidResource ; - ] ; - ] ; - mf:status sht:approved ; -. + }""" ; +. +ex:ValidResource1 + rdf:type rdfs:Resource ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of pre-binding in FILTER" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource ; + sh:resultMessage "Test message" ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraint ex:TestShape-sparql ; + sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:InvalidResource ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/sparql/pre-binding/pre-binding-002.ttl b/modules/shacl/src/test/resources/tests/sparql/pre-binding/pre-binding-002.ttl index 5b40e2c11..819b6816a 100644 --- a/modules/shacl/src/test/resources/tests/sparql/pre-binding/pre-binding-002.ttl +++ b/modules/shacl/src/test/resources/tests/sparql/pre-binding/pre-binding-002.ttl @@ -1,67 +1,67 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex: - sh:declare [ - sh:prefix "ex" ; - sh:namespace "http://datashapes.org/sh/tests/sparql/pre-binding/pre-binding-002.test#"^^xsd:anyURI ; - ] . - -ex:TestShape - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:sparql ex:TestShape-sparql ; - sh:targetNode ex:InvalidResource ; -. -ex:TestShape-sparql - sh:prefixes ex: ; +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex: + sh:declare [ + sh:prefix "ex" ; + sh:namespace "http://datashapes.org/sh/tests/sparql/pre-binding/pre-binding-002.test#"^^xsd:anyURI ; + ] . + +ex:TestShape + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:sparql ex:TestShape-sparql ; + sh:targetNode ex:InvalidResource ; +. +ex:TestShape-sparql + sh:prefixes ex: ; sh:select """ SELECT $this - WHERE { + WHERE { + { + FILTER (false) . + } + UNION { - FILTER (false) . + FILTER ($this = ex:InvalidResource) . } - UNION - { - FILTER ($this = ex:InvalidResource) . - } - }""" ; -. -ex:ValidResource1 - rdf:type rdfs:Resource ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of pre-binding in UNION" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraint ex:TestShape-sparql ; - sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:InvalidResource ; - ] ; - ] ; - mf:status sht:approved ; -. + }""" ; +. +ex:ValidResource1 + rdf:type rdfs:Resource ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of pre-binding in UNION" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraint ex:TestShape-sparql ; + sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:InvalidResource ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/sparql/pre-binding/pre-binding-003.ttl b/modules/shacl/src/test/resources/tests/sparql/pre-binding/pre-binding-003.ttl index 3dcf2e9e0..2cc510c48 100644 --- a/modules/shacl/src/test/resources/tests/sparql/pre-binding/pre-binding-003.ttl +++ b/modules/shacl/src/test/resources/tests/sparql/pre-binding/pre-binding-003.ttl @@ -1,67 +1,67 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex: - sh:declare [ - sh:prefix "ex" ; - sh:namespace "http://datashapes.org/sh/tests/sparql/pre-binding/pre-binding-003.test#"^^xsd:anyURI ; - ] . - -ex:TestShape - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:sparql ex:TestShape-sparql ; - sh:targetNode ex:InvalidResource ; -. -ex:TestShape-sparql - sh:prefixes ex: ; +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex: + sh:declare [ + sh:prefix "ex" ; + sh:namespace "http://datashapes.org/sh/tests/sparql/pre-binding/pre-binding-003.test#"^^xsd:anyURI ; + ] . + +ex:TestShape + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:sparql ex:TestShape-sparql ; + sh:targetNode ex:InvalidResource ; +. +ex:TestShape-sparql + sh:prefixes ex: ; sh:select """ SELECT $this - WHERE { - { - { - FILTER ($this = ex:InvalidResource) . - } - FILTER bound($this) . - } + WHERE { + { + { + FILTER ($this = ex:InvalidResource) . + } + FILTER bound($this) . + } FILTER (true) . - }""" ; -. -ex:ValidResource1 - rdf:type rdfs:Resource ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of pre-binding in inner {...} blocks" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraint ex:TestShape-sparql ; - sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:InvalidResource ; - ] ; - ] ; - mf:status sht:approved ; -. + }""" ; +. +ex:ValidResource1 + rdf:type rdfs:Resource ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of pre-binding in inner {...} blocks" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraint ex:TestShape-sparql ; + sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:InvalidResource ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/sparql/pre-binding/pre-binding-004.ttl b/modules/shacl/src/test/resources/tests/sparql/pre-binding/pre-binding-004.ttl index 7250de036..e19c2e0d0 100644 --- a/modules/shacl/src/test/resources/tests/sparql/pre-binding/pre-binding-004.ttl +++ b/modules/shacl/src/test/resources/tests/sparql/pre-binding/pre-binding-004.ttl @@ -1,62 +1,62 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex: - sh:declare [ - sh:prefix "ex" ; - sh:namespace "http://datashapes.org/sh/tests/sparql/pre-binding/pre-binding-004.test#"^^xsd:anyURI ; - ] . - -ex:TestShape - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:sparql ex:TestShape-sparql ; - sh:targetNode ex:InvalidResource ; -. -ex:TestShape-sparql - sh:prefixes ex: ; +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex: + sh:declare [ + sh:prefix "ex" ; + sh:namespace "http://datashapes.org/sh/tests/sparql/pre-binding/pre-binding-004.test#"^^xsd:anyURI ; + ] . + +ex:TestShape + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:sparql ex:TestShape-sparql ; + sh:targetNode ex:InvalidResource ; +. +ex:TestShape-sparql + sh:prefixes ex: ; sh:select """ SELECT $this - WHERE { - BIND ($this AS ?that) . - FILTER (?that = ex:InvalidResource) . - }""" ; -. -ex:ValidResource1 - rdf:type rdfs:Resource ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of pre-binding in BIND expressions" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraint ex:TestShape-sparql ; - sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:InvalidResource ; - ] ; - ] ; - mf:status sht:approved ; -. + WHERE { + BIND ($this AS ?that) . + FILTER (?that = ex:InvalidResource) . + }""" ; +. +ex:ValidResource1 + rdf:type rdfs:Resource ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of pre-binding in BIND expressions" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraint ex:TestShape-sparql ; + sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:InvalidResource ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/sparql/pre-binding/pre-binding-005.ttl b/modules/shacl/src/test/resources/tests/sparql/pre-binding/pre-binding-005.ttl index 140367447..83790bb3c 100644 --- a/modules/shacl/src/test/resources/tests/sparql/pre-binding/pre-binding-005.ttl +++ b/modules/shacl/src/test/resources/tests/sparql/pre-binding/pre-binding-005.ttl @@ -1,68 +1,68 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex: - sh:declare [ - sh:prefix "ex" ; - sh:namespace "http://datashapes.org/sh/tests/sparql/pre-binding/pre-binding-005.test#"^^xsd:anyURI ; - ] . - -ex:InvalidResource - ex:property "Label" . - -ex:TestShape - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:sparql ex:TestShape-sparql ; - sh:targetNode ex:InvalidResource ; -. -ex:TestShape-sparql - sh:prefixes ex: ; +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex: + sh:declare [ + sh:prefix "ex" ; + sh:namespace "http://datashapes.org/sh/tests/sparql/pre-binding/pre-binding-005.test#"^^xsd:anyURI ; + ] . + +ex:InvalidResource + ex:property "Label" . + +ex:TestShape + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:sparql ex:TestShape-sparql ; + sh:targetNode ex:InvalidResource ; +. +ex:TestShape-sparql + sh:prefixes ex: ; sh:select """ SELECT $this - WHERE { - { - FILTER (bound($this)) - } - $this ex:property "Label" . - FILTER (bound($this)) . - }""" ; -. -ex:ValidResource1 - rdf:type rdfs:Resource ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of pre-binding in BGP and FILTER" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraint ex:TestShape-sparql ; - sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:InvalidResource ; - ] ; - ] ; - mf:status sht:approved ; -. + WHERE { + { + FILTER (bound($this)) + } + $this ex:property "Label" . + FILTER (bound($this)) . + }""" ; +. +ex:ValidResource1 + rdf:type rdfs:Resource ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of pre-binding in BGP and FILTER" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraint ex:TestShape-sparql ; + sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:InvalidResource ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/sparql/pre-binding/pre-binding-006.ttl b/modules/shacl/src/test/resources/tests/sparql/pre-binding/pre-binding-006.ttl index b86cf00f7..5e8062b63 100644 --- a/modules/shacl/src/test/resources/tests/sparql/pre-binding/pre-binding-006.ttl +++ b/modules/shacl/src/test/resources/tests/sparql/pre-binding/pre-binding-006.ttl @@ -1,54 +1,54 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex: - sh:declare [ - sh:prefix "ex" ; - sh:namespace "http://datashapes.org/sh/tests/sparql/pre-binding/pre-binding-006.test#"^^xsd:anyURI ; - ] . - -ex:TestShape - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:sparql ex:TestShape-sparql ; - sh:targetNode ex:InvalidResource ; -. -ex:TestShape-sparql - sh:prefixes ex: ; +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex: + sh:declare [ + sh:prefix "ex" ; + sh:namespace "http://datashapes.org/sh/tests/sparql/pre-binding/pre-binding-006.test#"^^xsd:anyURI ; + ] . + +ex:TestShape + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:sparql ex:TestShape-sparql ; + sh:targetNode ex:InvalidResource ; +. +ex:TestShape-sparql + sh:prefixes ex: ; sh:select """ SELECT $this - WHERE { - { - SELECT * - WHERE { - FILTER ($this = ex:InvalidResource) . - } - } - }""" ; -. -ex:ValidResource1 - rdf:type rdfs:Resource ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of pre-binding in nested SELECT" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result sht:Failure ; - mf:status sht:approved ; -. + WHERE { + { + SELECT * + WHERE { + FILTER ($this = ex:InvalidResource) . + } + } + }""" ; +. +ex:ValidResource1 + rdf:type rdfs:Resource ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of pre-binding in nested SELECT" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result sht:Failure ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/resources/tests/sparql/pre-binding/shapesGraph-001.ttl b/modules/shacl/src/test/resources/tests/sparql/pre-binding/shapesGraph-001.ttl index f15b91e8f..c80585126 100644 --- a/modules/shacl/src/test/resources/tests/sparql/pre-binding/shapesGraph-001.ttl +++ b/modules/shacl/src/test/resources/tests/sparql/pre-binding/shapesGraph-001.ttl @@ -1,64 +1,64 @@ -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex: - sh:declare [ - sh:prefix "ex" ; - sh:namespace "http://datashapes.org/sh/tests/sparql/pre-binding/shapesGraph-001.test#"^^xsd:anyURI ; - ] . - -ex:TestShape - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:sparql ex:TestShape-sparql ; - sh:targetNode ex:InvalidResource ; - ex:property 42 ; -. -ex:TestShape-sparql - sh:message "Test message" ; - sh:prefixes ex: ; +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex: + sh:declare [ + sh:prefix "ex" ; + sh:namespace "http://datashapes.org/sh/tests/sparql/pre-binding/shapesGraph-001.test#"^^xsd:anyURI ; + ] . + +ex:TestShape + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:sparql ex:TestShape-sparql ; + sh:targetNode ex:InvalidResource ; + ex:property 42 ; +. +ex:TestShape-sparql + sh:message "Test message" ; + sh:prefixes ex: ; sh:select """ SELECT $this - WHERE { - FILTER bound($shapesGraph) . - GRAPH $shapesGraph { - FILTER bound($currentShape) . - $currentShape ex:property 42 . + WHERE { + FILTER bound($shapesGraph) . + GRAPH $shapesGraph { + FILTER bound($currentShape) . + $currentShape ex:property 42 . } - }""" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of $shapesGraph and $currentShape" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource ; - sh:resultMessage "Test message" ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraint ex:TestShape-sparql ; - sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:InvalidResource ; - ] ; - ] ; - mf:status sht:approved ; -. + }""" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of $shapesGraph and $currentShape" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource ; + sh:resultMessage "Test message" ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraint ex:TestShape-sparql ; + sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:InvalidResource ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/modules/shacl/src/test/scala/es/weso/shacl/TypingTest.scala b/modules/shacl/src/test/scala/es/weso/shacl/TypingTest.scala index 32df1988b..e3eb1b699 100644 --- a/modules/shacl/src/test/scala/es/weso/shacl/TypingTest.scala +++ b/modules/shacl/src/test/scala/es/weso/shacl/TypingTest.scala @@ -1,12 +1,6 @@ package es.weso.shacl import org.scalatest._ -import es.weso.rdf.nodes._ -import es.weso.rdf.jena.RDFAsJenaModel -import es.weso.rdf._ -import util._ -import es.weso.shacl.validator.Validator._ -import showShacl._ import es.weso.typing._ class TypingTest extends FunSpec with Matchers with TryValues with OptionValues { @@ -26,7 +20,6 @@ class TypingTest extends FunSpec with Matchers with TryValues with OptionValues addEvidence("x", "T", "x-T2"). addEvidence("y", "S", "y-S1") val oksX = r.getOkValues("x") - println(s"r: $r") oksX should contain only ("S", "T") val es = r.getEvidences("x", "S") es.value should contain only ("x-S1", "x-S2") diff --git a/modules/shacl/src/test/scala/es/weso/shacl/ValidateFolder.scala b/modules/shacl/src/test/scala/es/weso/shacl/ValidateFolder.scala index 70954e564..4abb81f69 100644 --- a/modules/shacl/src/test/scala/es/weso/shacl/ValidateFolder.scala +++ b/modules/shacl/src/test/scala/es/weso/shacl/ValidateFolder.scala @@ -4,13 +4,10 @@ import com.typesafe.config.{Config, ConfigFactory} import java.io.File import org.scalatest._ -import es.weso.rdf.nodes._ import es.weso.rdf.jena.RDFAsJenaModel -import es.weso.rdf._ import scala.io.Source import util._ -import es.weso.shacl.validator.Validator._ import es.weso.shacl.converter.RDF2Shacl import es.weso.shacl.validator.Validator import es.weso.utils.FileUtils._ @@ -19,7 +16,7 @@ class ValidateFolder extends FunSpec with Matchers with TryValues with OptionVal with SchemaMatchers { val conf: Config = ConfigFactory.load() - val shaclFolder = conf.getString("shaclFolder") + val shaclFolder = conf.getString("shaclTests") lazy val ignoreFiles: List[String] = List() diff --git a/modules/shacl/src/test/scala/es/weso/shacl/ValidateSingle.scala b/modules/shacl/src/test/scala/es/weso/shacl/ValidateSingle.scala index b5cfb06af..b98d043da 100644 --- a/modules/shacl/src/test/scala/es/weso/shacl/ValidateSingle.scala +++ b/modules/shacl/src/test/scala/es/weso/shacl/ValidateSingle.scala @@ -1,14 +1,11 @@ package es.weso.shacl -import java.io.File - import com.typesafe.config.{Config, ConfigFactory} import es.weso.rdf.jena.RDFAsJenaModel import es.weso.shacl.converter.RDF2Shacl import es.weso.shacl.validator.Validator import es.weso.utils.FileUtils._ import org.scalatest._ - import scala.io.Source import scala.util._ @@ -18,7 +15,7 @@ class ValidateSingle extends FunSpec with Matchers with TryValues with OptionVal val name = "uniqueLang" val conf: Config = ConfigFactory.load() - val shaclFolder = conf.getString("shaclFolder") + val shaclFolder = conf.getString("shaclTests") lazy val ignoreFiles: List[String] = List() diff --git a/modules/shacl/src/test/scala/es/weso/shacl/shaclCore.scala b/modules/shacl/src/test/scala/es/weso/shacl/shaclCore.scala index c08fc2b2a..82dde3eb3 100644 --- a/modules/shacl/src/test/scala/es/weso/shacl/shaclCore.scala +++ b/modules/shacl/src/test/scala/es/weso/shacl/shaclCore.scala @@ -24,12 +24,12 @@ class ShaclCore with SchemaMatchers { val conf: Config = ConfigFactory.load() - val shaclFolder = conf.getString("shaclCore") + val shaclFolder = conf.getString("shaclTests") val fileName = shaclFolder + "/manifest.ttl" val shaclFolderURI = Paths.get(shaclFolder).normalize.toUri.toString describe(s"Validate shacl Core from manifest file located at $fileName") { - RDF2Manifest.read(fileName, "TURTLE", Some(shaclFolderURI)) match { + RDF2Manifest.read(fileName, "TURTLE", Some(shaclFolderURI), true) match { case Left(e) => { println(s"Error reading manifest file:$e") } @@ -69,7 +69,7 @@ class ShaclCore val validator = Validator(schema) val result = validator.validateAll(rdf) expectedResult match { - case NotValidResult(report, pairs) => { + case ReportResult(report) => { if (result.isOK) fail(s"Valid when expected to be not valid\n${result.show}\nExpected result: $report") else { diff --git a/modules/srdf/src/main/scala/es/weso/rdf/parser/RDFParser.scala b/modules/srdf/src/main/scala/es/weso/rdf/parser/RDFParser.scala index bd97b2b9c..eda27bcf6 100644 --- a/modules/srdf/src/main/scala/es/weso/rdf/parser/RDFParser.scala +++ b/modules/srdf/src/main/scala/es/weso/rdf/parser/RDFParser.scala @@ -161,6 +161,22 @@ trait RDFParser { } yield ls } + /** + * Obtains the RDF list associated with a predicate for the current node + * If there is no value, returns the empty list + * + * @param p predicate + */ + def rdfListForPredicateAllowingNone(p: IRI): RDFParser[List[RDFNode]] = { (n, rdf) => + for { + maybeValue <- objectFromPredicateOptional(p)(n,rdf) + ls <- maybeValue match { + case None => parseOk(List()) + case Some(value) => rdfList(value,rdf) + } + } yield ls + } + /** * Obtains an integer literal associated with a predicate in the current node * @@ -434,6 +450,11 @@ trait RDFParser { } } + def iriFromPredicateOptional(p: IRI): RDFParser[Option[IRI]] = { (n, rdf) => + optional(iriFromPredicate(p))(n, rdf) + } + + def opt[A](pred: IRI, parser: RDFParser[A]): RDFParser[Option[A]] = (n, rdf) => { objectsFromPredicate(pred)(n, rdf) match { case Right(os) => os.size match { diff --git a/modules/utils/src/main/scala/es/weso/utils/FileUtils.scala b/modules/utils/src/main/scala/es/weso/utils/FileUtils.scala index 3383fcffb..f7f235b9e 100644 --- a/modules/utils/src/main/scala/es/weso/utils/FileUtils.scala +++ b/modules/utils/src/main/scala/es/weso/utils/FileUtils.scala @@ -48,6 +48,7 @@ object FileUtils { } } + /** * Gets the contents of a file * diff --git a/modules/utils/src/main/scala/es/weso/utils/RegexUtils.scala b/modules/utils/src/main/scala/es/weso/utils/RegexUtils.scala index 69f52bdab..fcf217f21 100644 --- a/modules/utils/src/main/scala/es/weso/utils/RegexUtils.scala +++ b/modules/utils/src/main/scala/es/weso/utils/RegexUtils.scala @@ -8,14 +8,12 @@ case class RegEx(pattern: String, maybeFlags: Option[String]) { str.replaceAllLiterally("\\\\", "\\") } def matches(str: String): Either[String, Boolean] = { - println(s"Trying to match /$cleanPattern/${maybeFlags.getOrElse("")} with $str") try { val regex = new RegularExpression(cleanPattern, maybeFlags.getOrElse("")) - val result = regex.matches(str) - println(s"Result of match /$cleanPattern/${maybeFlags.getOrElse("")} with $str = $result") - Right(result) + Right(regex.matches(str)) } catch { - case e: Exception => Left(s"Error: $e, matching $str with /$cleanPattern/${maybeFlags.getOrElse("")}") + case e: Exception => + Left(s"Error: $e, matching $str with /$cleanPattern/${maybeFlags.getOrElse("")}") } } } diff --git a/modules/utils/src/main/scala/es/weso/utils/UriUtils.scala b/modules/utils/src/main/scala/es/weso/utils/UriUtils.scala new file mode 100644 index 000000000..da4335461 --- /dev/null +++ b/modules/utils/src/main/scala/es/weso/utils/UriUtils.scala @@ -0,0 +1,18 @@ +package es.weso.utils + +import scala.io.Source +import scala.util.Try +import cats._ +import cats.implicits._ + +object UriUtils { + /** + * Dereferentiate an URI + * @param uri + * @return Contents + */ + def derefUri(uri: String): Either[String,String] = { + Either.fromTry(Try(Source.fromURL(uri).mkString)).leftMap(_.getMessage) + } + +} \ No newline at end of file diff --git a/src/test/resources/shacl/core/example-002.ttl b/src/test/resources/shacl/core/example-002.ttl deleted file mode 100644 index b50314643..000000000 --- a/src/test/resources/shacl/core/example-002.ttl +++ /dev/null @@ -1,24 +0,0 @@ -@prefix ex: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . -@prefix dash: . - -ex:TestShape - rdf:type rdfs:Class ; - rdf:type sh:Shape ; - rdfs:label "Test shape" ; - sh:property [ - sh:predicate ex:dateProperty ; - rdfs:label "date property" ; - sh:datatype xsd:date ; - ]; -. -ex:ValidResource - rdf:type ex:TestShape ; - ex:dateProperty "2014-09-01"^^xsd:date ; - ex:integerProperty 0 ; - ex:integerProperty 1234 ; - rdfs:label "Valid resource" ; -. diff --git a/src/test/resources/shacl/core/example1.ttl b/src/test/resources/shacl/core/example1.ttl deleted file mode 100644 index 562d3cea1..000000000 --- a/src/test/resources/shacl/core/example1.ttl +++ /dev/null @@ -1,53 +0,0 @@ -@prefix ex: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . -@prefix dash: . - -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:path ex:dateProperty ; - sh:severity sh:Violation ; - sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; - sh:value "2011-01-01"^^xsd:dateTime ; - ] ; - dash:expectedResult [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:path ex:integerProperty ; - sh:severity sh:Violation ; - sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; - sh:value 11.1 ; - ] ; -. -ex:InvalidResource1 - rdf:type ex:TestShape ; - ex:dateProperty "2011-01-01"^^xsd:dateTime ; - ex:integerProperty 11.1 ; -. -ex:TestShape - rdf:type rdfs:Class ; - rdf:type sh:Shape ; - rdfs:label "Test shape" ; - sh:property [ - sh:predicate ex:dateProperty ; - rdfs:label "date property" ; - sh:datatype xsd:date ; - ] ; - sh:property [ - sh:predicate ex:integerProperty ; - rdfs:label "integer property" ; - sh:datatype xsd:integer ; - ] ; -. -ex:ValidResource - rdf:type ex:TestShape ; - ex:dateProperty "2014-09-01"^^xsd:date ; - ex:integerProperty 0 ; - ex:integerProperty 1234 ; - rdfs:label "Valid resource" ; -. diff --git a/src/test/resources/shacl/core/manifest.ttl b/src/test/resources/shacl/core/manifest.ttl deleted file mode 100644 index 1d5758aef..000000000 --- a/src/test/resources/shacl/core/manifest.ttl +++ /dev/null @@ -1,66 +0,0 @@ -@prefix dc: . -@prefix foaf: . -@prefix mf: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . -@prefix ex: . - -<> - a mf:Manifest ; - rdfs:comment "Tests of Core features" ; - rdfs:label "Core Features tests" ; - mf:entries ( - - - ) -. - - - a sht:Validate ; - mf:name "Example with two violations of datatype" ; - mf:action [ - sht:data ; - ] ; - mf:result [ - rdf:type sht:NotValid ; - sht:details [ - sht:validationReport [ - a sh:ValidationReport ; - sh:result [ - a sh:ValidationResult; - sh:focusNode ex:InvalidResource1 ; - sh:path ex:dateProperty ; - sh:severity sh:Violation ; - sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; - sh:sourceShape ex:TestShape; - sh:value "2011-01-01"^^xsd:dateTime ; - ] ; - sh:result [ - a sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:path ex:integerProperty ; - sh:severity sh:Violation ; - sh:sourceShape ex:TestShape ; - sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; - sh:value 11.1 ; - ] ; - ]; - sht:validatedPairs [ - sht:pair [ - sht:node ex:ValidResource ; - sht:shape ex:TestShape - ]; - ]; - ]; - ]; - mf:status sht:proposed. - - - a sht:Validate ; - mf:name "Example with datatype and valid resource" ; - mf:action [ sht:data ; ] ; - mf:result true; - mf:status sht:proposed. diff --git a/src/test/resources/shacl/tests/core/complex/manifest.ttl b/src/test/resources/shacl/tests/core/complex/manifest.ttl new file mode 100644 index 000000000..6e921e565 --- /dev/null +++ b/src/test/resources/shacl/tests/core/complex/manifest.ttl @@ -0,0 +1,10 @@ +@prefix mf: . +@prefix rdfs: . +@prefix sht: . + +<> + a mf:Manifest ; + rdfs:label "Tests converted from http://datashapes.org/sh/tests/tests/core/complex" ; + mf:include ; + mf:include ; + . \ No newline at end of file diff --git a/src/test/resources/shacl/tests/core/complex/personexample.ttl b/src/test/resources/shacl/tests/core/complex/personexample.ttl new file mode 100644 index 000000000..0a249cf89 --- /dev/null +++ b/src/test/resources/shacl/tests/core/complex/personexample.ttl @@ -0,0 +1,103 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:Alice + rdf:type ex:Person ; + ex:ssn "987-65-432A" ; +. +ex:Bob + rdf:type ex:Person ; + ex:ssn "123-45-6789" ; + ex:ssn "124-35-6789" ; +. +ex:Calvin + rdf:type ex:Person ; + ex:birthDate "1999-09-09"^^xsd:date ; + ex:worksFor ex:UntypedCompany ; +. +ex:PersonShape + rdf:type sh:NodeShape ; + sh:closed "true"^^xsd:boolean ; + sh:ignoredProperties ( + rdf:type + ) ; + sh:property [ + sh:path ex:ssn ; + sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:pattern "^\\d{3}-\\d{2}-\\d{4}$" ; + ] ; + sh:property [ + sh:path ex:worksFor ; + sh:class ex:Company ; + sh:nodeKind sh:IRI ; + ] ; + sh:property [ + sh:path [ + sh:inversePath ex:worksFor ; + ] ; + sh:name "employee" ; + ] ; + sh:targetClass ex:Person ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of personexample" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:Alice ; + sh:resultPath ex:ssn ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:PatternConstraintComponent ; + sh:sourceShape _:b61064 ; + sh:value "987-65-432A" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:Bob ; + sh:resultPath ex:ssn ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxCountConstraintComponent ; + sh:sourceShape _:b61064 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:Calvin ; + sh:resultPath ex:birthDate ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:ClosedConstraintComponent ; + sh:sourceShape ex:PersonShape ; + sh:value "1999-09-09"^^xsd:date ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:Calvin ; + sh:resultPath ex:worksFor ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:ClassConstraintComponent ; + sh:sourceShape [] ; + sh:value ex:UntypedCompany ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/complex/shacl-shacl-data-shapes.ttl b/src/test/resources/shacl/tests/core/complex/shacl-shacl-data-shapes.ttl new file mode 100644 index 000000000..c6b751a77 --- /dev/null +++ b/src/test/resources/shacl/tests/core/complex/shacl-shacl-data-shapes.ttl @@ -0,0 +1,410 @@ +# baseURI: http://www.w3.org/ns/shacl-shacl# + +# A SHACL shapes graph to validate SHACL shapes graphs +# Draft last edited 2017-04-04 + +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix xsd: . + +@prefix shsh: . + +shsh: + rdfs:label "SHACL for SHACL"@en ; + rdfs:comment "This shapes graph can be used to validate SHACL shapes graphs against a subset of the syntax rules."@en ; + sh:declare [ + sh:prefix "shsh" ; + sh:namespace "http://www.w3.org/ns/shacl-shacl#" ; + ] . + + +shsh:ListShape + a sh:NodeShape ; + rdfs:label "List shape"@en ; + rdfs:comment "A shape describing well-formed RDF lists. Currently does not check for non-recursion. This could be expressed using SHACL-SPARQL."@en ; + rdfs:seeAlso ; + sh:property [ + sh:path [ sh:zeroOrMorePath rdf:rest ] ; + rdfs:comment "Each list member (including this node) must be have the shape shsh:ListNodeShape."@en ; + sh:hasValue rdf:nil ; + sh:node shsh:ListNodeShape ; + ] . + +shsh:ListNodeShape + a sh:NodeShape ; + rdfs:label "List node shape"@en ; + rdfs:comment "Defines constraints on what it means for a node to be a node within a well-formed RDF list. Note that this does not check whether the rdf:rest items are also well-formed lists as this would lead to unsupported recursion."@en ; + sh:or ( [ + sh:hasValue rdf:nil ; + sh:property [ + sh:path rdf:first ; + sh:maxCount 0 ; + ] ; + sh:property [ + sh:path rdf:rest ; + sh:maxCount 0 ; + ] ; + ] + [ + sh:not [ sh:hasValue rdf:nil ] ; + sh:property [ + sh:path rdf:first ; + sh:maxCount 1 ; + sh:minCount 1 ; + ] ; + sh:property [ + sh:path rdf:rest ; + sh:maxCount 1 ; + sh:minCount 1 ; + ] ; + ] ) . + +shsh:ShapeShape + a sh:NodeShape ; + rdfs:label "Shape shape"@en ; + rdfs:comment "A shape that can be used to validate syntax rules for other shapes."@en ; + + # See https://www.w3.org/TR/shacl/#shapes for what counts as a shape + sh:targetClass sh:NodeShape ; + sh:targetClass sh:PropertyShape ; + sh:targetSubjectsOf sh:targetClass, sh:targetNode, sh:targetObjectsOf, sh:targetSubjectsOf ; + sh:targetSubjectsOf sh:and, sh:class, sh:closed, sh:datatype, sh:disjoint, sh:equals, sh:flags, sh:hasValue, + sh:ignoredProperties, sh:in, sh:languageIn, sh:lessThan, sh:lessThanOrEquals, sh:maxCount, sh:maxExclusive, + sh:maxInclusive, sh:maxLength, sh:minCount, sh:minExclusive, sh:minInclusive, sh:minLength, sh:node, sh:nodeKind, + sh:not, sh:or, sh:pattern, sh:property, sh:qualifiedMaxCount, sh:qualifiedMinCount, sh:qualifiedValueShape, + sh:qualifiedValueShape, sh:qualifiedValueShapesDisjoint, sh:qualifiedValueShapesDisjoint, sh:sparql, sh:uniqueLang, sh:xone ; + + sh:targetObjectsOf sh:node ; # node-node + sh:targetObjectsOf sh:not ; # not-node + sh:targetObjectsOf sh:property ; # property-node + sh:targetObjectsOf sh:qualifiedValueShape ; # qualifiedValueShape-node + + # Shapes are either node shapes or property shapes + sh:xone ( shsh:NodeShapeShape shsh:PropertyShapeShape ) ; + + sh:property [ + sh:path sh:targetNode ; + sh:nodeKind sh:IRIOrLiteral ; # targetNode-nodeKind + ] ; + sh:property [ + sh:path sh:targetClass ; + sh:nodeKind sh:IRI ; # targetClass-nodeKind + ] ; + sh:property [ + sh:path sh:targetSubjectsOf ; + sh:nodeKind sh:IRI ; # targetSubjectsOf-nodeKind + ] ; + sh:property [ + sh:path sh:targetObjectsOf ; + sh:nodeKind sh:IRI ; # targetObjectsOf-nodeKind + ] ; + sh:or ( [ sh:not [ + sh:class rdfs:Class ; + sh:or ( [ sh:class sh:NodeShape ] [ sh:class sh:PropertyShape ] ) + ] ] + [ sh:nodeKind sh:IRI ] + ) ; # implicit-targetClass-nodeKind + + sh:property [ + sh:path sh:severity ; + sh:maxCount 1 ; # severity-maxCount + sh:nodeKind sh:IRI ; # severity-nodeKind + ] ; + sh:property [ + sh:path sh:message ; + sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; # message-datatype + ] ; + sh:property [ + sh:path sh:deactivated ; + sh:maxCount 1 ; # deactivated-maxCount + sh:in ( true false ) ; # deactivated-datatype + ] ; + + sh:property [ + sh:path sh:and ; + sh:node shsh:ListShape ; # and-node + ] ; + sh:property [ + sh:path sh:class ; + sh:nodeKind sh:IRI ; # class-nodeKind + ] ; + sh:property [ + sh:path sh:closed ; + sh:datatype xsd:boolean ; # closed-datatype + sh:maxCount 1 ; # multiple-parameters + ] ; + sh:property [ + sh:path sh:ignoredProperties ; + sh:node shsh:ListShape ; # ignoredProperties-node + sh:maxCount 1 ; # multiple-parameters + ] ; + sh:property [ + sh:path ( sh:ignoredProperties [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ; + sh:nodeKind sh:IRI ; # ignoredProperties-members-nodeKind + ] ; + sh:property [ + sh:path sh:datatype ; + sh:nodeKind sh:IRI ; # datatype-nodeKind + sh:maxCount 1 ; # datatype-maxCount + ] ; + sh:property [ + sh:path sh:disjoint ; + sh:nodeKind sh:IRI ; # disjoint-nodeKind + ] ; + sh:property [ + sh:path sh:equals ; + sh:nodeKind sh:IRI ; # equals-nodeKind + ] ; + sh:property [ + sh:path sh:in ; + sh:maxCount 1 ; # in-maxCount + sh:node shsh:ListShape ; # in-node + ] ; + sh:property [ + sh:path sh:languageIn ; + sh:maxCount 1 ; # languageIn-maxCount + sh:node shsh:ListShape ; # languageIn-node + ] ; + sh:property [ + sh:path ( sh:languageIn [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ; + sh:datatype xsd:string ; # languageIn-members-datatype + ] ; + sh:property [ + sh:path sh:lessThan ; + sh:nodeKind sh:IRI ; # lessThan-nodeKind + ] ; + sh:property [ + sh:path sh:lessThanOrEquals ; + sh:nodeKind sh:IRI ; # lessThanOrEquals-nodeKind + ] ; + sh:property [ + sh:path sh:maxCount ; + sh:datatype xsd:integer ; # maxCount-datatype + sh:maxCount 1 ; # maxCount-maxCount + ] ; + sh:property [ + sh:path sh:maxExclusive ; + sh:maxCount 1 ; # maxExclusive-maxCount + sh:nodeKind sh:Literal ; # maxExclusive-nodeKind + ] ; + sh:property [ + sh:path sh:maxInclusive ; + sh:maxCount 1 ; # maxInclusive-maxCount + sh:nodeKind sh:Literal ; # maxInclusive-nodeKind + ] ; + sh:property [ + sh:path sh:maxLength ; + sh:datatype xsd:integer ; # maxLength-datatype + sh:maxCount 1 ; # maxLength-maxCount + ] ; + sh:property [ + sh:path sh:minCount ; + sh:datatype xsd:integer ; # minCount-datatype + sh:maxCount 1 ; # minCount-maxCount + ] ; + sh:property [ + sh:path sh:minExclusive ; + sh:maxCount 1 ; # minExclusive-maxCount + sh:nodeKind sh:Literal ; # minExclusive-nodeKind + ] ; + sh:property [ + sh:path sh:minInclusive ; + sh:maxCount 1 ; # minInclusive-maxCount + sh:nodeKind sh:Literal ; # minInclusive-nodeKind + ] ; + sh:property [ + sh:path sh:minLength ; + sh:datatype xsd:integer ; # minLength-datatype + sh:maxCount 1 ; # minLength-maxCount + ] ; + sh:property [ + sh:path sh:nodeKind ; + sh:in ( sh:BlankNode sh:IRI sh:Literal sh:BlankNodeOrIRI sh:BlankNodeOrLiteral sh:IRIOrLiteral ) ; # nodeKind-in + sh:maxCount 1 ; # nodeKind-maxCount + ] ; + sh:property [ + sh:path sh:or ; + sh:node shsh:ListShape ; # or-node + ] ; + sh:property [ + sh:path sh:pattern ; + sh:datatype xsd:string ; # pattern-datatype + sh:maxCount 1 ; # multiple-parameters + # Not implemented: syntax rule pattern-regex + ] ; + sh:property [ + sh:path sh:flags ; + sh:datatype xsd:string ; # flags-datatype + sh:maxCount 1 ; # multiple-parameters + ] ; + sh:property [ + sh:path sh:qualifiedMaxCount ; + sh:datatype xsd:integer ; # qualifiedMaxCount-datatype + sh:maxCount 1 ; # multiple-parameters + ] ; + sh:property [ + sh:path sh:qualifiedMinCount ; + sh:datatype xsd:integer ; # qualifiedMinCount-datatype + sh:maxCount 1 ; # multiple-parameters + ] ; + sh:property [ + sh:path sh:qualifiedValueShape ; + sh:maxCount 1 ; # multiple-parameters + ] ; + sh:property [ + sh:path sh:qualifiedValueShapesDisjoint ; + sh:datatype xsd:boolean ; # qualifiedValueShapesDisjoint-datatype + sh:maxCount 1 ; # multiple-parameters + ] ; + sh:property [ + sh:path sh:uniqueLang ; + sh:datatype xsd:boolean ; # uniqueLang-datatype + sh:maxCount 1 ; # uniqueLang-maxCount + ] ; + sh:property [ + sh:path sh:xone ; + sh:node shsh:ListShape ; # xone-node + ] . + +shsh:NodeShapeShape + a sh:NodeShape ; + sh:targetObjectsOf sh:node ; # node-node + sh:property [ + sh:path sh:path ; + sh:maxCount 0 ; # NodeShape-path-maxCount + ] ; + sh:property [ + sh:path sh:lessThan ; + sh:maxCount 0 ; # lessThan-scope + ] ; + sh:property [ + sh:path sh:lessThanOrEquals ; + sh:maxCount 0 ; # lessThanOrEquals-scope + ] ; + sh:property [ + sh:path sh:maxCount ; + sh:maxCount 0 ; # maxCount-scope + ] ; + sh:property [ + sh:path sh:minCount ; + sh:maxCount 0 ; # minCount-scope + ] ; + sh:property [ + sh:path sh:qualifiedValueShape ; + sh:maxCount 0 ; # qualifiedValueShape-scope + ] ; + sh:property [ + sh:path sh:uniqueLang ; + sh:maxCount 0 ; # uniqueLang-scope + ] . + +shsh:PropertyShapeShape + a sh:NodeShape ; + sh:targetObjectsOf sh:property ; # property-node + sh:property [ + sh:path sh:path ; + sh:maxCount 1 ; # path-maxCount + sh:minCount 1 ; # PropertyShape-path-minCount + sh:node shsh:PathShape ; # path-node + ] . + +# Values of sh:and, sh:or and sh:xone must be lists of shapes +shsh:ShapesListShape + a sh:NodeShape ; + sh:targetObjectsOf sh:and ; # and-members-node + sh:targetObjectsOf sh:or ; # or-members-node + sh:targetObjectsOf sh:xone ; # xone-members-node + sh:property [ + sh:path ( [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ; + sh:node shsh:ShapeShape ; + ] . + + +# A path of blank node path syntax, used to simulate recursion +_:PathPath + sh:alternativePath ( + ( [ sh:zeroOrMorePath rdf:rest ] rdf:first ) + ( sh:alternativePath [ sh:zeroOrMorePath rdf:rest ] rdf:first ) + sh:inversePath + sh:zeroOrMorePath + sh:oneOrMorePath + sh:zeroOrOnePath + ) . + +shsh:PathShape + a sh:NodeShape ; + rdfs:label "Path shape"@en ; + rdfs:comment "A shape that can be used to validate the syntax rules of well-formed SHACL paths."@en ; + rdfs:seeAlso ; + sh:property [ + sh:path [ sh:zeroOrMorePath _:PathPath ] ; + sh:node shsh:PathNodeShape ; + ] . + +shsh:PathNodeShape + sh:xone ( # path-metarule + [ sh:nodeKind sh:IRI ] # 2.3.1.1: Predicate path + [ sh:nodeKind sh:BlankNode ; # 2.3.1.2: Sequence path + sh:node shsh:PathListWithAtLeast2Members ; + ] + [ sh:nodeKind sh:BlankNode ; # 2.3.1.3: Alternative path + sh:closed true ; + sh:property [ + sh:path sh:alternativePath ; + sh:node shsh:PathListWithAtLeast2Members ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] + ] + [ sh:nodeKind sh:BlankNode ; # 2.3.1.4: Inverse path + sh:closed true ; + sh:property [ + sh:path sh:inversePath ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] + ] + [ sh:nodeKind sh:BlankNode ; # 2.3.1.5: Zero-or-more path + sh:closed true ; + sh:property [ + sh:path sh:zeroOrMorePath ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] + ] + [ sh:nodeKind sh:BlankNode ; # 2.3.1.6: One-or-more path + sh:closed true ; + sh:property [ + sh:path sh:oneOrMorePath ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] + ] + [ sh:nodeKind sh:BlankNode ; # 2.3.1.7: Zero-or-one path + sh:closed true ; + sh:property [ + sh:path sh:zeroOrOnePath ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] + ] + ) . + +shsh:PathListWithAtLeast2Members + a sh:NodeShape ; + sh:node shsh:ListShape ; + sh:property [ + sh:path [ sh:oneOrMorePath rdf:rest ] ; + sh:minCount 2 ; # 1 other list node plus rdf:nil + ] . + +shsh:ShapesGraphShape + a sh:NodeShape ; + sh:targetObjectsOf sh:shapesGraph ; + sh:nodeKind sh:IRI . # shapesGraph-nodeKind + +shsh:EntailmentShape + a sh:NodeShape ; + sh:targetObjectsOf sh:entailment ; + sh:nodeKind sh:IRI . # entailment-nodeKind diff --git a/src/test/resources/shacl/tests/core/complex/shacl-shacl.ttl b/src/test/resources/shacl/tests/core/complex/shacl-shacl.ttl new file mode 100644 index 000000000..889071471 --- /dev/null +++ b/src/test/resources/shacl/tests/core/complex/shacl-shacl.ttl @@ -0,0 +1,19 @@ +@prefix mf: . +@prefix rdfs: . +@prefix xsd: . +@prefix sh: . +@prefix sht: . + +<> a mf:Manifest ; + mf:entries ( + + ) . + + a sht:Validate ; + rdfs:label "frozen eat your own ( eat your own frozen dogfood )" ; + mf:action [ + sht:dataGraph ; + sht:shapesGraph ] ; + mf:result [a sh:ValidationReport ; + sh:conforms "true"^^xsd:boolean ] ; + mf:status sht:approved . diff --git a/src/test/resources/shacl/tests/core/manifest.ttl b/src/test/resources/shacl/tests/core/manifest.ttl new file mode 100644 index 000000000..ffd61b640 --- /dev/null +++ b/src/test/resources/shacl/tests/core/manifest.ttl @@ -0,0 +1,14 @@ +@prefix mf: . +@prefix rdfs: . +@prefix sht: . + +<> + a mf:Manifest ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + . \ No newline at end of file diff --git a/src/test/resources/shacl/tests/core/misc/deactivated-001.ttl b/src/test/resources/shacl/tests/core/misc/deactivated-001.ttl new file mode 100644 index 000000000..809acde92 --- /dev/null +++ b/src/test/resources/shacl/tests/core/misc/deactivated-001.ttl @@ -0,0 +1,44 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidResource + rdf:type rdfs:Resource ; +. +ex:TestShape + rdf:type sh:NodeShape ; + sh:datatype xsd:boolean ; + sh:deactivated "true"^^xsd:boolean ; + sh:property ex:TestShape2 ; + sh:targetNode ex:InvalidResource ; +. +ex:TestShape2 + rdf:type sh:PropertyShape ; + sh:path ex:property ; + sh:minCount 1 ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:deactivated 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "true"^^xsd:boolean ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/misc/deactivated-002.ttl b/src/test/resources/shacl/tests/core/misc/deactivated-002.ttl new file mode 100644 index 000000000..0498150f2 --- /dev/null +++ b/src/test/resources/shacl/tests/core/misc/deactivated-002.ttl @@ -0,0 +1,43 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:TestShape + rdf:type sh:NodeShape ; + sh:datatype xsd:boolean ; + sh:deactivated "false"^^xsd:boolean ; + sh:targetNode 32 ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:deactivated 002" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode 32 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value 32 ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/misc/manifest.ttl b/src/test/resources/shacl/tests/core/misc/manifest.ttl new file mode 100644 index 000000000..fffc439ce --- /dev/null +++ b/src/test/resources/shacl/tests/core/misc/manifest.ttl @@ -0,0 +1,13 @@ +@prefix mf: . +@prefix rdfs: . +@prefix sht: . + +<> + a mf:Manifest ; + rdfs:label "Tests converted from http://datashapes.org/sh/tests/tests/core/misc" ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + . \ No newline at end of file diff --git a/src/test/resources/shacl/tests/core/misc/message-001.ttl b/src/test/resources/shacl/tests/core/misc/message-001.ttl new file mode 100644 index 000000000..2d3fb135d --- /dev/null +++ b/src/test/resources/shacl/tests/core/misc/message-001.ttl @@ -0,0 +1,48 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:TestShape + rdf:type sh:NodeShape ; + sh:datatype xsd:integer ; + sh:message "Test message"@en ; + sh:targetNode ex:InvalidNode ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of custom sh:message 001" ; + rdfs:comment """ + Note: This test verifies that the sh:message is copied into sh:resultMessage. + To pass this test, the test harness needs to preserve all sh:resultMessage triples + that are mentioned in the 'expected' results graph.""" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidNode ; + sh:resultMessage "Test message"@en ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:InvalidNode ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/misc/severity-001.ttl b/src/test/resources/shacl/tests/core/misc/severity-001.ttl new file mode 100644 index 000000000..5b3e6b8c9 --- /dev/null +++ b/src/test/resources/shacl/tests/core/misc/severity-001.ttl @@ -0,0 +1,43 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:TestShape + rdf:type sh:NodeShape ; + sh:datatype xsd:integer ; + sh:severity sh:Warning ; + sh:targetNode "Hello" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:severity 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode "Hello" ; + sh:resultSeverity sh:Warning ; + sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value "Hello" ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/misc/severity-002.ttl b/src/test/resources/shacl/tests/core/misc/severity-002.ttl new file mode 100644 index 000000000..87b2aed77 --- /dev/null +++ b/src/test/resources/shacl/tests/core/misc/severity-002.ttl @@ -0,0 +1,60 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidResource1 + ex:property "true"^^xsd:boolean ; +. +ex:TestShape1 + sh:nodeKind sh:BlankNode ; + sh:property ex:TestShape2 ; + sh:severity ex:MySeverity ; + sh:targetNode ex:InvalidResource1 ; +. +ex:TestShape2 + sh:path ex:property ; + sh:datatype xsd:integer ; + sh:severity sh:Info ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:severity 002" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultPath ex:property ; + sh:resultSeverity sh:Info ; + sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; + sh:sourceShape ex:TestShape2 ; + sh:value "true"^^xsd:boolean ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultSeverity ex:MySeverity ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape ex:TestShape1 ; + sh:value ex:InvalidResource1 ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/node/and-001.ttl b/src/test/resources/shacl/tests/core/node/and-001.ttl new file mode 100644 index 000000000..d0d867680 --- /dev/null +++ b/src/test/resources/shacl/tests/core/node/and-001.ttl @@ -0,0 +1,77 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidRectangle1 + rdf:type ex:Rectangle ; + ex:height 3 ; +. +ex:InvalidRectangle2 + rdf:type ex:Rectangle ; + ex:width 2 ; +. +ex:Rectangle + rdf:type rdfs:Class ; + rdf:type sh:NodeShape ; + rdfs:subClassOf rdfs:Resource ; + sh:and ( + [ + sh:property [ + sh:path ex:width ; + sh:minCount 1 ; + ] ; + ] + [ + sh:property [ + sh:path ex:height ; + sh:minCount 1 ; + ] ; + ] + ) ; +. +ex:ValidRectangle1 + rdf:type ex:Rectangle ; + ex:height 3 ; + ex:width 2 ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:and at node shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidRectangle1 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:AndConstraintComponent ; + sh:sourceShape ex:Rectangle ; + sh:value ex:InvalidRectangle1 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidRectangle2 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:AndConstraintComponent ; + sh:sourceShape ex:Rectangle ; + sh:value ex:InvalidRectangle2 ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/node/and-002.ttl b/src/test/resources/shacl/tests/core/node/and-002.ttl new file mode 100644 index 000000000..f4b018db1 --- /dev/null +++ b/src/test/resources/shacl/tests/core/node/and-002.ttl @@ -0,0 +1,74 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:AndShape + rdf:type sh:NodeShape ; + sh:and ( + ex:SuperShape + [ + sh:property [ + sh:path ex:property ; + sh:maxCount 1 ; + ] ; + ] + ) ; + sh:targetNode ex:InvalidInstance1 ; + sh:targetNode ex:InvalidInstance2 ; + sh:targetNode ex:ValidInstance1 ; +. +ex:InvalidInstance2 + ex:property "One" ; + ex:property "Two" ; +. +ex:SuperShape + rdf:type sh:NodeShape ; + sh:property [ + sh:path ex:property ; + sh:minCount 1 ; + ] ; +. +ex:ValidInstance1 + ex:property "One" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:and at node shape 002" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance1 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:AndConstraintComponent ; + sh:sourceShape ex:AndShape ; + sh:value ex:InvalidInstance1 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance2 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:AndConstraintComponent ; + sh:sourceShape ex:AndShape ; + sh:value ex:InvalidInstance2 ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/node/class-001.ttl b/src/test/resources/shacl/tests/core/node/class-001.ttl new file mode 100644 index 000000000..ab9797744 --- /dev/null +++ b/src/test/resources/shacl/tests/core/node/class-001.ttl @@ -0,0 +1,70 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:John + rdf:type ex:MalePerson ; +. +ex:MalePerson + rdf:type rdfs:Class ; + rdfs:subClassOf ex:Person ; +. +ex:Person + rdf:type rdfs:Class ; + rdfs:subClassOf rdfs:Resource ; +. +ex:Quokki + rdf:type ex:Animal ; +. +ex:Someone + rdf:type ex:Person ; +. +ex:TestShape + rdf:type sh:NodeShape ; + sh:class ex:Person ; + sh:targetNode ex:John ; + sh:targetNode ex:Quokki ; + sh:targetNode ex:Someone ; + sh:targetNode ex:Typeless ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:class at node shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:Quokki ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:ClassConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:Quokki ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:Typeless ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:ClassConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:Typeless ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/node/class-002.ttl b/src/test/resources/shacl/tests/core/node/class-002.ttl new file mode 100644 index 000000000..71ed5e0d5 --- /dev/null +++ b/src/test/resources/shacl/tests/core/node/class-002.ttl @@ -0,0 +1,62 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:NamedInstance + rdf:type ex:TestClass ; +. +ex:TestShape + rdf:type sh:NodeShape ; + sh:class ex:TestClass ; + sh:targetClass ex:BNodeClass ; + sh:targetNode ex:NamedInstance ; + sh:targetNode "String" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:class at node shape 002" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode "String" ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:ClassConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value "String" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode _:b9751 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:ClassConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value _:b9751 ; + ] ; + ] ; + mf:status sht:approved ; +. +_:b9751 + rdf:type ex:BNodeClass ; +. +[ + rdf:type ex:BNodeClass ; + rdf:type ex:TestClass ; +]. diff --git a/src/test/resources/shacl/tests/core/node/class-003.ttl b/src/test/resources/shacl/tests/core/node/class-003.ttl new file mode 100644 index 000000000..16b37be4d --- /dev/null +++ b/src/test/resources/shacl/tests/core/node/class-003.ttl @@ -0,0 +1,105 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:John # not Animal + rdf:type ex:MalePerson ; +. +ex:Joe # OK + rdf:type ex:MalePerson ; + rdf:type ex:Animal ; +. +ex:MalePerson + rdf:type rdfs:Class ; + rdfs:subClassOf ex:Person ; +. +ex:Person + rdf:type rdfs:Class ; + rdfs:subClassOf rdfs:Resource ; +. +ex:Quokki # not Person + rdf:type ex:Animal ; +. +ex:Quokkip # not Animal + rdf:type ex:Person ; +. +ex:Someone # OK + rdf:type ex:Person ; + rdf:type ex:Animal ; +. +ex:TestShape + rdf:type sh:NodeShape ; + sh:class ex:Person ; + sh:class ex:Animal ; + sh:targetClass ex:MalePerson ; + sh:targetNode ex:John ; + sh:targetNode ex:Quokki ; + sh:targetNode ex:Quokkip ; + sh:targetNode ex:Someone ; + sh:targetNode ex:Typeless ; # not Animal, not Person +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:class at node shape 003 multiple classes, overlapping target sets" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:Typeless ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:ClassConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:Typeless ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:Typeless ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:ClassConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:Typeless ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:Quokki ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:ClassConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:Quokki ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:John ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:ClassConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:John ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:Quokkip ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:ClassConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:Quokkip ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/node/closed-001.ttl b/src/test/resources/shacl/tests/core/node/closed-001.ttl new file mode 100644 index 000000000..6bae9de8c --- /dev/null +++ b/src/test/resources/shacl/tests/core/node/closed-001.ttl @@ -0,0 +1,64 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidInstance1 + rdf:type ex:SomeClass ; + ex:otherProperty 4 ; + ex:someProperty 3 ; +. +ex:MyShape + rdf:type sh:NodeShape ; + sh:closed "true"^^xsd:boolean ; + sh:property [ + sh:path ex:someProperty ; + ] ; + sh:targetNode ex:InvalidInstance1 ; + sh:targetNode ex:ValidInstance1 ; +. +ex:ValidInstance1 + ex:someProperty 3 ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:closed at node shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance1 ; + sh:resultPath rdf:type ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:ClosedConstraintComponent ; + sh:sourceShape ex:MyShape ; + sh:value ex:SomeClass ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance1 ; + sh:resultPath ex:otherProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:ClosedConstraintComponent ; + sh:sourceShape ex:MyShape ; + sh:value 4 ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/node/closed-002.ttl b/src/test/resources/shacl/tests/core/node/closed-002.ttl new file mode 100644 index 000000000..d72eebb49 --- /dev/null +++ b/src/test/resources/shacl/tests/core/node/closed-002.ttl @@ -0,0 +1,58 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidInstance1 + ex:otherProperty 4 ; + ex:someProperty 3 ; +. +ex:MyShape + rdf:type sh:NodeShape ; + sh:closed "true"^^xsd:boolean ; + sh:ignoredProperties ( + rdf:type + ) ; + sh:property [ + sh:path ex:someProperty ; + ] ; + sh:targetNode ex:InvalidInstance1 ; + sh:targetNode ex:ValidInstance1 ; +. +ex:ValidInstance1 + rdf:type ex:SomeClass ; + ex:someProperty 3 ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:closed at node shape 002" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance1 ; + sh:resultPath ex:otherProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:ClosedConstraintComponent ; + sh:sourceShape ex:MyShape ; + sh:value 4 ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/node/datatype-001.ttl b/src/test/resources/shacl/tests/core/node/datatype-001.ttl new file mode 100644 index 000000000..427572d45 --- /dev/null +++ b/src/test/resources/shacl/tests/core/node/datatype-001.ttl @@ -0,0 +1,64 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:TestShape + rdf:type sh:NodeShape ; + sh:datatype xsd:integer ; + sh:targetClass ex:TestClass ; + sh:targetNode xsd:integer ; + sh:targetNode 42 ; + sh:targetNode "aldi"^^xsd:integer ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:datatype at node shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode xsd:integer ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value xsd:integer ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode "aldi"^^xsd:integer ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value "aldi"^^xsd:integer ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode _:b30507 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value _:b30507 ; + ] ; + ] ; + mf:status sht:approved ; +. +_:b30507 + rdf:type ex:TestClass ; +. diff --git a/src/test/resources/shacl/tests/core/node/datatype-002.ttl b/src/test/resources/shacl/tests/core/node/datatype-002.ttl new file mode 100644 index 000000000..6e9e0121f --- /dev/null +++ b/src/test/resources/shacl/tests/core/node/datatype-002.ttl @@ -0,0 +1,53 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:TestShape + rdf:type sh:NodeShape ; + sh:datatype rdf:langString ; + sh:targetNode "Hello"^^rdf:HTML ; + sh:targetNode "G'day"@en-AU ; + sh:targetNode "Hallo"@de ; + sh:targetNode "Hello" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:datatype at node shape 002" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode "Hello"^^rdf:HTML ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value "Hello"^^rdf:HTML ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode "Hello" ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value "Hello" ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/node/disjoint-001.ttl b/src/test/resources/shacl/tests/core/node/disjoint-001.ttl new file mode 100644 index 000000000..d98158ad9 --- /dev/null +++ b/src/test/resources/shacl/tests/core/node/disjoint-001.ttl @@ -0,0 +1,51 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidResource1 + ex:property ex:InvalidResource1 ; + ex:property ex:ValidResource1 ; +. +ex:TestShape + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:disjoint ex:property ; + sh:targetNode ex:InvalidResource1 ; + sh:targetNode ex:ValidResource1 ; +. +ex:ValidResource1 + ex:property ex:InvalidResource1 ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:disjoint at node shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:DisjointConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:InvalidResource1 ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/node/equals-001.ttl b/src/test/resources/shacl/tests/core/node/equals-001.ttl new file mode 100644 index 000000000..8f23966b8 --- /dev/null +++ b/src/test/resources/shacl/tests/core/node/equals-001.ttl @@ -0,0 +1,59 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidResource1 + ex:property ex:InvalidResource1 ; + ex:property ex:SomeValue ; +. +ex:TestShape + rdf:type sh:NodeShape ; + sh:equals ex:property ; + sh:targetNode ex:InvalidResource1 ; + sh:targetNode ex:InvalidResource2 ; + sh:targetNode ex:ValidResource1 ; +. +ex:ValidResource1 + ex:property ex:ValidResource1 ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:equals at node shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:EqualsConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:SomeValue ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource2 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:EqualsConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:InvalidResource2 ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/node/hasValue-001.ttl b/src/test/resources/shacl/tests/core/node/hasValue-001.ttl new file mode 100644 index 000000000..139b4ddd9 --- /dev/null +++ b/src/test/resources/shacl/tests/core/node/hasValue-001.ttl @@ -0,0 +1,44 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:TestShape + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:hasValue "Test" ; + sh:targetNode "Invalid String" ; + sh:targetNode "Test" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:hasValue at node shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode "Invalid String" ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:HasValueConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value "Invalid String" ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/node/in-001.ttl b/src/test/resources/shacl/tests/core/node/in-001.ttl new file mode 100644 index 000000000..8fb4c0852 --- /dev/null +++ b/src/test/resources/shacl/tests/core/node/in-001.ttl @@ -0,0 +1,63 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:Green + rdf:type ex:TestShape ; + rdfs:label "Green" ; +. +ex:InvalidInstance + rdf:type ex:TestShape ; + rdfs:label "Invalid instance" ; +. +ex:Red + rdf:type ex:TestShape ; + rdfs:label "Red" ; +. +ex:TestShape + rdf:type rdfs:Class ; + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:in ( + ex:Green + ex:Red + ex:Yellow + ) ; +. +ex:Yellow + rdf:type ex:TestShape ; + rdfs:label "Yellow" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:in at node shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:InConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:InvalidInstance ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/node/languageIn-001.ttl b/src/test/resources/shacl/tests/core/node/languageIn-001.ttl new file mode 100644 index 000000000..b8365d258 --- /dev/null +++ b/src/test/resources/shacl/tests/core/node/languageIn-001.ttl @@ -0,0 +1,66 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:TestShape + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:languageIn ( + "en" + "fr" + ) ; + sh:targetNode rdfs:Resource ; + sh:targetNode "Deutsch"@de ; + sh:targetNode "English"@en ; + sh:targetNode "Francais"@fr ; + sh:targetNode "Plain String" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:languageIn at node shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode rdfs:Resource ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:LanguageInConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value rdfs:Resource ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode "Deutsch"@de ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:LanguageInConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value "Deutsch"@de ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode "Plain String" ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:LanguageInConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value "Plain String" ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/node/manifest.ttl b/src/test/resources/shacl/tests/core/node/manifest.ttl new file mode 100644 index 000000000..50fd31677 --- /dev/null +++ b/src/test/resources/shacl/tests/core/node/manifest.ttl @@ -0,0 +1,40 @@ +@prefix mf: . +@prefix rdfs: . +@prefix sht: . + +<> + a mf:Manifest ; + rdfs:label "Tests converted from http://datashapes.org/sh/tests/tests/core/node" ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + . \ No newline at end of file diff --git a/src/test/resources/shacl/tests/core/node/maxExclusive-001.ttl b/src/test/resources/shacl/tests/core/node/maxExclusive-001.ttl new file mode 100644 index 000000000..7c2b17718 --- /dev/null +++ b/src/test/resources/shacl/tests/core/node/maxExclusive-001.ttl @@ -0,0 +1,91 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:TestShape + rdf:type sh:NodeShape ; + sh:maxExclusive 4 ; + sh:targetClass ex:TestClass ; + sh:targetNode ex:John ; + sh:targetNode 3.9 ; + sh:targetNode 4 ; + sh:targetNode 4.0 ; + sh:targetNode 4.1 ; + sh:targetNode "Hello" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:maxExclusive at node shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:John ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxExclusiveConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:John ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode 4 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxExclusiveConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value 4 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode 4.0 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxExclusiveConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value 4.0 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode 4.1 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxExclusiveConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value 4.1 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode "Hello" ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxExclusiveConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value "Hello" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode _:b11982 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxExclusiveConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value _:b11982 ; + ] ; + ] ; + mf:status sht:approved ; +. +_:b11982 + rdf:type ex:TestClass ; +. diff --git a/src/test/resources/shacl/tests/core/node/maxInclusive-001.ttl b/src/test/resources/shacl/tests/core/node/maxInclusive-001.ttl new file mode 100644 index 000000000..f30c9425d --- /dev/null +++ b/src/test/resources/shacl/tests/core/node/maxInclusive-001.ttl @@ -0,0 +1,75 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:TestShape + rdf:type sh:NodeShape ; + sh:maxInclusive 4 ; + sh:targetClass ex:TestClass ; + sh:targetNode ex:John ; + sh:targetNode 3.9 ; + sh:targetNode 4 ; + sh:targetNode 4.0 ; + sh:targetNode 4.1 ; + sh:targetNode "Hello" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:maxInclusive at node shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:John ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxInclusiveConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:John ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode 4.1 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxInclusiveConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value 4.1 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode "Hello" ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxInclusiveConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value "Hello" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode _:b22005 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxInclusiveConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value _:b22005 ; + ] ; + ] ; + mf:status sht:approved ; +. +_:b22005 + rdf:type ex:TestClass ; +. diff --git a/src/test/resources/shacl/tests/core/node/maxLength-001.ttl b/src/test/resources/shacl/tests/core/node/maxLength-001.ttl new file mode 100644 index 000000000..bd197e257 --- /dev/null +++ b/src/test/resources/shacl/tests/core/node/maxLength-001.ttl @@ -0,0 +1,87 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:TestShape + rdf:type sh:NodeShape ; + sh:maxLength 4 ; + sh:targetClass ex:TestClass ; + sh:targetNode ; + sh:targetNode ex:John ; + sh:targetNode 123 ; + sh:targetNode 1234 ; + sh:targetNode 12345 ; + sh:targetNode "2017-03-29"^^xsd:date ; + sh:targetNode "Hel" ; + sh:targetNode "Hell" ; + sh:targetNode "Hell"@en ; + sh:targetNode "Hello" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:maxLength at node shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:John ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxLengthConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:John ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode 12345 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxLengthConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value 12345 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode "2017-03-29"^^xsd:date ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxLengthConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value "2017-03-29"^^xsd:date ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode "Hello" ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxLengthConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value "Hello" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode _:b34236 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxLengthConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value _:b34236 ; + ] ; + ] ; + mf:status sht:approved ; +. +_:b34236 + rdf:type ex:TestClass ; +. diff --git a/src/test/resources/shacl/tests/core/node/minExclusive-001.ttl b/src/test/resources/shacl/tests/core/node/minExclusive-001.ttl new file mode 100644 index 000000000..721915043 --- /dev/null +++ b/src/test/resources/shacl/tests/core/node/minExclusive-001.ttl @@ -0,0 +1,91 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:TestShape + rdf:type sh:NodeShape ; + sh:minExclusive 4 ; + sh:targetClass ex:TestClass ; + sh:targetNode ex:John ; + sh:targetNode 3.9 ; + sh:targetNode 4 ; + sh:targetNode 4.0 ; + sh:targetNode 4.1 ; + sh:targetNode "Hello" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:minExclusive at node shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:John ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinExclusiveConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:John ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode 3.9 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinExclusiveConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value 3.9 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode 4 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinExclusiveConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value 4 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode 4.0 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinExclusiveConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value 4.0 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode "Hello" ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinExclusiveConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value "Hello" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode _:b33079 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinExclusiveConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value _:b33079 ; + ] ; + ] ; + mf:status sht:approved ; +. +_:b33079 + rdf:type ex:TestClass ; +. diff --git a/src/test/resources/shacl/tests/core/node/minInclusive-001.ttl b/src/test/resources/shacl/tests/core/node/minInclusive-001.ttl new file mode 100644 index 000000000..e2113bf04 --- /dev/null +++ b/src/test/resources/shacl/tests/core/node/minInclusive-001.ttl @@ -0,0 +1,44 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:TestShape + rdf:type sh:NodeShape ; + sh:minInclusive 8 ; + sh:targetNode 7 ; + sh:targetNode 8 ; + sh:targetNode 9 ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:minInclusive at node shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode 7 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinInclusiveConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value 7 ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/node/minInclusive-002.ttl b/src/test/resources/shacl/tests/core/node/minInclusive-002.ttl new file mode 100644 index 000000000..e9a8d5ee0 --- /dev/null +++ b/src/test/resources/shacl/tests/core/node/minInclusive-002.ttl @@ -0,0 +1,61 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:TestShape a sh:NodeShape ; + sh:minInclusive "2002-10-10T12:00:00-05:00"^^xsd:dateTime ; + sh:targetNode "2002-10-10T12:00:00-05:00"^^xsd:dateTime ; + sh:targetNode "2002-10-10T12:00:01-05:00"^^xsd:dateTime ; + sh:targetNode "2002-10-09T12:00:00-05:00"^^xsd:dateTime ; + sh:targetNode "2002-10-10T12:00:00"^^xsd:dateTime ; + sh:targetNode ex:TestShape ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:minInclusive at node shape 002 - dateTime with timezone" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode "2002-10-10T12:00:00"^^xsd:dateTime ; + sh:value "2002-10-10T12:00:00"^^xsd:dateTime ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinInclusiveConstraintComponent ; + sh:sourceShape ex:TestShape ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode "2002-10-09T12:00:00-05:00"^^xsd:dateTime ; + sh:value "2002-10-09T12:00:00-05:00"^^xsd:dateTime ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinInclusiveConstraintComponent ; + sh:sourceShape ex:TestShape ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:TestShape ; + sh:value ex:TestShape ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinInclusiveConstraintComponent ; + sh:sourceShape ex:TestShape ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/node/minInclusive-003.ttl b/src/test/resources/shacl/tests/core/node/minInclusive-003.ttl new file mode 100644 index 000000000..306ca78be --- /dev/null +++ b/src/test/resources/shacl/tests/core/node/minInclusive-003.ttl @@ -0,0 +1,70 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:TestShape + rdf:type sh:NodeShape ; + sh:minInclusive "2002-10-10T12:00:00"^^xsd:dateTime ; + sh:targetNode "2002-10-10T12:00:00-05:00"^^xsd:dateTime ; + sh:targetNode "2002-10-10T12:00:01-05:00"^^xsd:dateTime ; + sh:targetNode "2002-10-09T12:00:00-05:00"^^xsd:dateTime ; + sh:targetNode "2002-10-10T12:00:00"^^xsd:dateTime ; + sh:targetNode ex:TestShape ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:minInclusive at node shape 003 - dateTime without timezone" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode "2002-10-10T12:00:00-05:00"^^xsd:dateTime ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinInclusiveConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value "2002-10-10T12:00:00-05:00"^^xsd:dateTime ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode "2002-10-10T12:00:01-05:00"^^xsd:dateTime ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinInclusiveConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value "2002-10-10T12:00:01-05:00"^^xsd:dateTime ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode "2002-10-09T12:00:00-05:00"^^xsd:dateTime ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinInclusiveConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value "2002-10-09T12:00:00-05:00"^^xsd:dateTime ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:TestShape ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinInclusiveConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:TestShape ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/node/minLength-001.ttl b/src/test/resources/shacl/tests/core/node/minLength-001.ttl new file mode 100644 index 000000000..75151fe7f --- /dev/null +++ b/src/test/resources/shacl/tests/core/node/minLength-001.ttl @@ -0,0 +1,79 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:TestShape + rdf:type sh:NodeShape ; + sh:minLength 4 ; + sh:targetClass ex:TestClass ; + sh:targetNode ; + sh:targetNode ex:John ; + sh:targetNode 123 ; + sh:targetNode 1234 ; + sh:targetNode 12345 ; + sh:targetNode "2017-03-29"^^xsd:date ; + sh:targetNode "Hel" ; + sh:targetNode "Hell" ; + sh:targetNode "Hell"@en ; + sh:targetNode "Hello" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:minLength at node shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinLengthConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode 123 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinLengthConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value 123 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode "Hel" ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinLengthConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value "Hel" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode _:b19019 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinLengthConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value _:b19019 ; + ] ; + ] ; + mf:status sht:approved ; +. +_:b19019 + rdf:type ex:TestClass ; +. diff --git a/src/test/resources/shacl/tests/core/node/node-001.ttl b/src/test/resources/shacl/tests/core/node/node-001.ttl new file mode 100644 index 000000000..b6d717085 --- /dev/null +++ b/src/test/resources/shacl/tests/core/node/node-001.ttl @@ -0,0 +1,55 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidInstance + rdf:type ex:TestClass ; + rdfs:label "Invalid instance" ; +. +ex:TestClass + rdf:type rdfs:Class ; + rdf:type sh:NodeShape ; + rdfs:label "Test class" ; + rdfs:subClassOf rdfs:Resource ; + sh:node [ + sh:class ex:OtherClass ; + ] ; +. +ex:ValidInstance + rdf:type ex:OtherClass ; + rdf:type ex:TestClass ; + rdfs:label "Valid instance" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:node at node shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeConstraintComponent ; + sh:sourceShape ex:TestClass ; + sh:value ex:InvalidInstance ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/node/nodeKind-001.ttl b/src/test/resources/shacl/tests/core/node/nodeKind-001.ttl new file mode 100644 index 000000000..004f8fa25 --- /dev/null +++ b/src/test/resources/shacl/tests/core/node/nodeKind-001.ttl @@ -0,0 +1,43 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:IRITestShape + rdf:type sh:NodeShape ; + sh:nodeKind sh:IRI ; + sh:targetNode ex:John ; + sh:targetNode "true"^^xsd:boolean ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:nodeKind at node shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode "true"^^xsd:boolean ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape ex:IRITestShape ; + sh:value "true"^^xsd:boolean ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/node/not-001.ttl b/src/test/resources/shacl/tests/core/node/not-001.ttl new file mode 100644 index 000000000..588436cf0 --- /dev/null +++ b/src/test/resources/shacl/tests/core/node/not-001.ttl @@ -0,0 +1,59 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidResource1 + rdf:type rdfs:Resource ; + ex:property "some value" ; +. +ex:TestShape + rdf:type rdfs:Class ; + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + rdfs:subClassOf rdfs:Resource ; + sh:not [ + rdf:type sh:NodeShape ; + sh:property [ + sh:path ex:property ; + sh:minCount 1 ; + ] ; + ] ; + sh:targetNode ex:InvalidResource1 ; + sh:targetNode ex:ValidResource1 ; +. +ex:ValidResource1 + rdf:type rdfs:Resource ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:not at node shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NotConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:InvalidResource1 ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/node/not-002.ttl b/src/test/resources/shacl/tests/core/node/not-002.ttl new file mode 100644 index 000000000..cf43632de --- /dev/null +++ b/src/test/resources/shacl/tests/core/node/not-002.ttl @@ -0,0 +1,52 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidInstance1 + ex:property "Some value" ; +. +ex:NotExampleShape + rdf:type sh:NodeShape ; + sh:not [ + rdf:type sh:NodeShape ; + sh:property [ + sh:path ex:property ; + sh:minCount 1 ; + ] ; + ] ; + sh:targetNode ex:InvalidInstance1 ; + sh:targetNode ex:ValidInstance1 ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:not at node shape 002" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance1 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NotConstraintComponent ; + sh:sourceShape ex:NotExampleShape ; + sh:value ex:InvalidInstance1 ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/node/or-001.ttl b/src/test/resources/shacl/tests/core/node/or-001.ttl new file mode 100644 index 000000000..455c8c641 --- /dev/null +++ b/src/test/resources/shacl/tests/core/node/or-001.ttl @@ -0,0 +1,91 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidRectangle1 + rdf:type ex:RectangleWithArea ; + ex:height 3 ; +. +ex:InvalidRectangle2 + rdf:type ex:RectangleWithArea ; +. +ex:RectangleWithArea + rdf:type rdfs:Class ; + rdf:type sh:NodeShape ; + rdfs:subClassOf rdfs:Resource ; + sh:or ( + [ + sh:property [ + sh:path ex:height ; + sh:minCount 1 ; + ] ; + sh:property [ + sh:path ex:width ; + sh:minCount 1 ; + ] ; + ] + [ + sh:property [ + sh:path ex:area ; + sh:minCount 1 ; + ] ; + ] + ) ; +. +ex:ValidRectangle1 + rdf:type ex:RectangleWithArea ; + ex:height 3 ; + ex:width 2 ; +. +ex:ValidRectangle2 + rdf:type ex:RectangleWithArea ; + ex:area 6 ; + ex:height 3 ; + ex:width 2 ; +. +ex:ValidRectangle3 + rdf:type ex:RectangleWithArea ; + ex:area 6 ; + ex:height 3 ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:or at node shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidRectangle1 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:OrConstraintComponent ; + sh:sourceShape ex:RectangleWithArea ; + sh:value ex:InvalidRectangle1 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidRectangle2 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:OrConstraintComponent ; + sh:sourceShape ex:RectangleWithArea ; + sh:value ex:InvalidRectangle2 ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/node/pattern-001.ttl b/src/test/resources/shacl/tests/core/node/pattern-001.ttl new file mode 100644 index 000000000..31d77efc6 --- /dev/null +++ b/src/test/resources/shacl/tests/core/node/pattern-001.ttl @@ -0,0 +1,76 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:TestShape + rdf:type sh:NodeShape ; + sh:pattern "^[2-8][0-9]*$" ; + sh:targetClass ex:TestClass ; + sh:targetNode ex:Test ; + sh:targetNode 20000123 ; + sh:targetNode "3456" ; + sh:targetNode 39 ; + sh:targetNode "777777"@mi ; + sh:targetNode 9 ; + sh:targetNode "John" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:pattern at node shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:Test ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:PatternConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:Test ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode 9 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:PatternConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value 9 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode "John" ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:PatternConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value "John" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode _:b22415 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:PatternConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value _:b22415 ; + ] ; + ] ; + mf:status sht:approved ; +. +_:b22415 + rdf:type ex:TestClass ; +. diff --git a/src/test/resources/shacl/tests/core/node/pattern-002.ttl b/src/test/resources/shacl/tests/core/node/pattern-002.ttl new file mode 100644 index 000000000..fadc4d9a5 --- /dev/null +++ b/src/test/resources/shacl/tests/core/node/pattern-002.ttl @@ -0,0 +1,45 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:TestShape + rdf:type sh:NodeShape ; + sh:flags "i" ; + sh:pattern "Aldi" ; + sh:targetNode "Aldi" ; + sh:targetNode "Alti" ; + sh:targetNode "aLdI" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:pattern at node shape 002" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode "Alti" ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:PatternConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value "Alti" ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/node/qualified-001-data.ttl b/src/test/resources/shacl/tests/core/node/qualified-001-data.ttl new file mode 100644 index 000000000..e495305da --- /dev/null +++ b/src/test/resources/shacl/tests/core/node/qualified-001-data.ttl @@ -0,0 +1,4 @@ +@prefix ex: . + +ex:i a ex:C1 . +ex:j a ex:C1 , ex:C2 . diff --git a/src/test/resources/shacl/tests/core/node/qualified-001-shapes.ttl b/src/test/resources/shacl/tests/core/node/qualified-001-shapes.ttl new file mode 100644 index 000000000..f430a7e02 --- /dev/null +++ b/src/test/resources/shacl/tests/core/node/qualified-001-shapes.ttl @@ -0,0 +1,10 @@ +@prefix xsd: . +@prefix sh: . +@prefix ex: . + +ex:s1 a sh:NodeShape ; + sh:targetClass ex:C1 ; + sh:class ex:C2 ; + sh:qualifiedValueShapesDisjoint "1"^^xsd:boolean ; + sh:qualifiedMinCount 5 ; + sh:qualifiedMaxCount 2 . diff --git a/src/test/resources/shacl/tests/core/node/qualified-001.ttl b/src/test/resources/shacl/tests/core/node/qualified-001.ttl new file mode 100644 index 000000000..6a89c0999 --- /dev/null +++ b/src/test/resources/shacl/tests/core/node/qualified-001.ttl @@ -0,0 +1,28 @@ +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +@prefix ex: . + +<> a mf:Manifest ; + mf:entries ( + + ) . + + a sht:Validate; + rdfs:label "Test of qualified parameters allowed in node shapes" ; + mf:action [ sht:dataGraph ; + sht:shapesGraph ] ; + mf:result [ rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ rdf:type sh:ValidationResult ; + sh:resultSeverity sh:Violation ; + sh:focusNode ex:i ; + sh:value ex:i ; + sh:sourceShape ex:s1 ; + sh:sourceConstraintComponent sh:ClassConstraintComponent ] ] ; + mf:status sht:approved . diff --git a/src/test/resources/shacl/tests/core/node/xone-001.ttl b/src/test/resources/shacl/tests/core/node/xone-001.ttl new file mode 100644 index 000000000..79011d8bf --- /dev/null +++ b/src/test/resources/shacl/tests/core/node/xone-001.ttl @@ -0,0 +1,74 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:Bob + rdf:type ex:Person ; + ex:firstName "Robert" ; + ex:lastName "Coin" ; +. +ex:Carla + rdf:type ex:Person ; + ex:fullName "Carla Miller" ; +. +ex:Dory + rdf:type ex:Person ; + ex:firstName "Dory" ; + ex:fullName "Dory Dunce" ; + ex:lastName "Dunce" ; +. +ex:XoneConstraintExampleShape + rdf:type sh:NodeShape ; + sh:targetClass ex:Person ; + sh:xone ( + [ + sh:property [ + sh:path ex:fullName ; + sh:minCount 1 ; + ] ; + ] + [ + sh:property [ + sh:path ex:firstName ; + sh:minCount 1 ; + ] ; + sh:property [ + sh:path ex:lastName ; + sh:minCount 1 ; + ] ; + ] + ) ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:xone at node shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:Dory ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:XoneConstraintComponent ; + sh:sourceShape ex:XoneConstraintExampleShape ; + sh:value ex:Dory ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/node/xone-duplicate-data.ttl b/src/test/resources/shacl/tests/core/node/xone-duplicate-data.ttl new file mode 100644 index 000000000..e495305da --- /dev/null +++ b/src/test/resources/shacl/tests/core/node/xone-duplicate-data.ttl @@ -0,0 +1,4 @@ +@prefix ex: . + +ex:i a ex:C1 . +ex:j a ex:C1 , ex:C2 . diff --git a/src/test/resources/shacl/tests/core/node/xone-duplicate-shapes.ttl b/src/test/resources/shacl/tests/core/node/xone-duplicate-shapes.ttl new file mode 100644 index 000000000..eecb657d6 --- /dev/null +++ b/src/test/resources/shacl/tests/core/node/xone-duplicate-shapes.ttl @@ -0,0 +1,7 @@ +@prefix sh: . +@prefix ex: . + +ex:s1 a sh:NodeShape ; + sh:targetClass ex:C1 ; + sh:xone ( ex:s2 ex:s2 ) . +ex:s2 sh:class ex:C2 . diff --git a/src/test/resources/shacl/tests/core/node/xone-duplicate.ttl b/src/test/resources/shacl/tests/core/node/xone-duplicate.ttl new file mode 100644 index 000000000..0999905f1 --- /dev/null +++ b/src/test/resources/shacl/tests/core/node/xone-duplicate.ttl @@ -0,0 +1,34 @@ +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +@prefix ex: . + +<> a mf:Manifest ; + mf:entries ( + + ) . + + a sht:Validate; + rdfs:label "Test of validation report for shape xone-duplicate by property constraints" ; + mf:action [ sht:dataGraph ; + sht:shapesGraph ] ; + mf:result [ rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ rdf:type sh:ValidationResult ; + sh:resultSeverity sh:Violation ; + sh:focusNode ex:i ; + sh:value ex:i ; + sh:sourceShape ex:s1 ; + sh:sourceConstraintComponent sh:XoneConstraintComponent ] ; + sh:result [ rdf:type sh:ValidationResult ; + sh:resultSeverity sh:Violation ; + sh:focusNode ex:j ; + sh:value ex:j ; + sh:sourceShape ex:s1 ; + sh:sourceConstraintComponent sh:XoneConstraintComponent ] ] ; + mf:status sht:approved . diff --git a/src/test/resources/shacl/tests/core/path/manifest.ttl b/src/test/resources/shacl/tests/core/path/manifest.ttl new file mode 100644 index 000000000..3c355e87e --- /dev/null +++ b/src/test/resources/shacl/tests/core/path/manifest.ttl @@ -0,0 +1,21 @@ +@prefix mf: . +@prefix rdfs: . +@prefix sht: . + +<> + a mf:Manifest ; + rdfs:label "Tests converted from http://datashapes.org/sh/tests/tests/core/path" ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + . \ No newline at end of file diff --git a/src/test/resources/shacl/tests/core/path/path-alternative-001.ttl b/src/test/resources/shacl/tests/core/path/path-alternative-001.ttl new file mode 100644 index 000000000..ea2676478 --- /dev/null +++ b/src/test/resources/shacl/tests/core/path/path-alternative-001.ttl @@ -0,0 +1,86 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidResource1 + ex:property1 "One" ; + ex:property3 "Three" ; +. +ex:TestShape + rdf:type sh:PropertyShape ; + sh:path [ + sh:alternativePath ( + ex:property1 + ex:property2 + ) ; + ] ; + sh:minCount 2 ; + sh:targetNode ex:InvalidResource1 ; + sh:targetNode ex:InvalidResource2 ; + sh:targetNode ex:ValidResource1 ; + sh:targetNode ex:ValidResource2 ; + sh:targetNode ex:ValidResource3 ; +. +ex:ValidResource1 + ex:property1 "One" ; + ex:property1 "Two" ; +. +ex:ValidResource2 + ex:property1 "One" ; + ex:property2 "Two" ; +. +ex:ValidResource3 + ex:property2 "One" ; + ex:property2 "Two" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of path sh:alternativePath 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultPath [ + sh:alternativePath ( + ex:property1 + ex:property2 + ) ; + ] ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinCountConstraintComponent ; + sh:sourceShape ex:TestShape ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource2 ; + sh:resultPath [ + sh:alternativePath ( + ex:property1 + ex:property2 + ) ; + ] ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinCountConstraintComponent ; + sh:sourceShape ex:TestShape ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/path/path-complex-001.ttl b/src/test/resources/shacl/tests/core/path/path-complex-001.ttl new file mode 100644 index 000000000..c5e20737b --- /dev/null +++ b/src/test/resources/shacl/tests/core/path/path-complex-001.ttl @@ -0,0 +1,91 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidResource + rdf:type ex:Animal ; + rdfs:label "Invalid" ; +. +ex:MalePerson + rdf:type rdfs:Class ; + rdfs:subClassOf ex:Person ; +. +ex:Person + rdf:type rdfs:Class ; +. +ex:TestShape + rdf:type sh:PropertyShape ; + sh:path ( + rdf:type + [ + sh:zeroOrMorePath rdfs:subClassOf ; + ] + ) ; + sh:hasValue ex:Person ; + sh:targetNode ex:InvalidResource1 ; + sh:targetNode ex:InvalidResource2 ; + sh:targetNode ex:ValidResource1 ; + sh:targetNode ex:ValidResource2 ; + sh:targetNode ex:ValidResource3 ; +. +ex:ValidResource1 + rdf:type ex:Person ; +. +ex:ValidResource2 + rdf:type ex:MalePerson ; +. +ex:ValidResource3 + rdf:type ex:Animal ; + rdf:type ex:MalePerson ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of path complex (rdf:type/rdfs:subClassOf*) 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultPath ( + rdf:type + [ + sh:zeroOrMorePath rdfs:subClassOf ; + ] + ) ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:HasValueConstraintComponent ; + sh:sourceShape ex:TestShape ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource2 ; + sh:resultPath ( + rdf:type + [ + sh:zeroOrMorePath rdfs:subClassOf ; + ] + ) ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:HasValueConstraintComponent ; + sh:sourceShape ex:TestShape ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/path/path-complex-002-data.ttl b/src/test/resources/shacl/tests/core/path/path-complex-002-data.ttl new file mode 100644 index 000000000..fdec8c78e --- /dev/null +++ b/src/test/resources/shacl/tests/core/path/path-complex-002-data.ttl @@ -0,0 +1,7 @@ +@prefix ex: . + +ex:j ex:p ex:i . + +ex:k ex:p ex:j . + +ex:l ex:p ex:j . diff --git a/src/test/resources/shacl/tests/core/path/path-complex-002-shapes.ttl b/src/test/resources/shacl/tests/core/path/path-complex-002-shapes.ttl new file mode 100644 index 000000000..f9e8a73bd --- /dev/null +++ b/src/test/resources/shacl/tests/core/path/path-complex-002-shapes.ttl @@ -0,0 +1,14 @@ +@prefix sh: . +@prefix ex: . + +ex:s1 a sh:PropertyShape ; + sh:targetNode ex:i ; + sh:path ( _:pinv _:pinv ) ; + sh:class ex:C . + +_:pinv sh:inversePath ex:p . + +ex:s2 a sh:PropertyShape ; + sh:targetNode ex:i ; + sh:path ( [ sh:inversePath ex:p ] [ sh:inversePath ex:p ] ) ; + sh:class ex:C . diff --git a/src/test/resources/shacl/tests/core/path/path-complex-002.ttl b/src/test/resources/shacl/tests/core/path/path-complex-002.ttl new file mode 100644 index 000000000..fdfcfe5c0 --- /dev/null +++ b/src/test/resources/shacl/tests/core/path/path-complex-002.ttl @@ -0,0 +1,51 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +<> a mf:Manifest ; + mf:entries ( + + ) . + + a sht:Validate ; + rdfs:label "Test of complex path validation results" ; + mf:action [ + sht:dataGraph ; + sht:shapesGraph ] ; + mf:result [ a sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ a sh:ValidationResult ; + sh:focusNode ex:i ; + sh:value ex:k ; + sh:resultPath ( [ sh:inversePath ex:p ] [ sh:inversePath ex:p ] ) ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:ClassConstraintComponent ; + sh:sourceShape ex:s1 ] ; + sh:result [ a sh:ValidationResult ; + sh:focusNode ex:i ; + sh:value ex:l ; + sh:resultPath ( [ sh:inversePath ex:p ] [ sh:inversePath ex:p ] ) ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:ClassConstraintComponent ; + sh:sourceShape ex:s1 ] ; + sh:result [ a sh:ValidationResult ; + sh:focusNode ex:i ; + sh:value ex:l ; + sh:resultPath ( [ sh:inversePath ex:p ] [ sh:inversePath ex:p ] ) ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:ClassConstraintComponent ; + sh:sourceShape ex:s2 ] ; + sh:result [ a sh:ValidationResult ; + sh:focusNode ex:i ; + sh:value ex:k ; + sh:resultPath( [ sh:inversePath ex:p ] [ sh:inversePath ex:p ] ) ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:ClassConstraintComponent ; + sh:sourceShape ex:s2 ] ] ; + mf:status sht:approved . diff --git a/src/test/resources/shacl/tests/core/path/path-inverse-001.ttl b/src/test/resources/shacl/tests/core/path/path-inverse-001.ttl new file mode 100644 index 000000000..a4c4ac4d1 --- /dev/null +++ b/src/test/resources/shacl/tests/core/path/path-inverse-001.ttl @@ -0,0 +1,90 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidResource1 + rdf:type ex:Person ; +. +ex:InvalidResource2 + rdf:type ex:Person ; +. +ex:Parent1 + ex:child ex:InvalidResource1 ; + ex:child ex:InvalidResource2 ; + ex:child ex:ValidResource1 ; +. +ex:Parent2 + ex:child ex:InvalidResource2 ; + ex:child ex:ValidResource1 ; +. +ex:Parent3 + ex:child ex:InvalidResource2 ; +. +ex:Person + rdf:type rdfs:Class ; + rdf:type sh:NodeShape ; + rdfs:label "Person" ; + rdfs:subClassOf rdfs:Resource ; +. +ex:TestShape + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:property ex:TestShape-P ; + sh:targetClass ex:Person ; +. +ex:TestShape-P + rdf:type sh:PropertyShape ; + sh:path [ + sh:inversePath ex:child ; + ] ; + sh:maxCount 2 ; + sh:minCount 2 ; +. +ex:ValidResource1 + rdf:type ex:Person ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of path sh:inversePath 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultPath [ + sh:inversePath ex:child ; + ] ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinCountConstraintComponent ; + sh:sourceShape ex:TestShape-P ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource2 ; + sh:resultPath [ + sh:inversePath ex:child ; + ] ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxCountConstraintComponent ; + sh:sourceShape ex:TestShape-P ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/path/path-oneOrMore-001.ttl b/src/test/resources/shacl/tests/core/path/path-oneOrMore-001.ttl new file mode 100644 index 000000000..97d4e0301 --- /dev/null +++ b/src/test/resources/shacl/tests/core/path/path-oneOrMore-001.ttl @@ -0,0 +1,71 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidResource1 + rdf:type rdfs:Resource ; +. +ex:InvalidResource2 + ex:child ex:Person2 ; +. +ex:Person1 + ex:child ex:Person2 ; +. +ex:TestShape + rdf:type sh:PropertyShape ; + sh:path [ + sh:oneOrMorePath ex:child ; + ] ; + sh:minCount 2 ; + sh:targetNode ex:InvalidResource1 ; + sh:targetNode ex:InvalidResource2 ; + sh:targetNode ex:ValidResource1 ; +. +ex:ValidResource1 + ex:child ex:Person1 ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of path sh:oneOrMorePath 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultPath [ + sh:oneOrMorePath ex:child ; + ] ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinCountConstraintComponent ; + sh:sourceShape ex:TestShape ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource2 ; + sh:resultPath [ + sh:oneOrMorePath ex:child ; + ] ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinCountConstraintComponent ; + sh:sourceShape ex:TestShape ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/path/path-sequence-001.ttl b/src/test/resources/shacl/tests/core/path/path-sequence-001.ttl new file mode 100644 index 000000000..65ec52922 --- /dev/null +++ b/src/test/resources/shacl/tests/core/path/path-sequence-001.ttl @@ -0,0 +1,80 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidResource1 + ex:property1 ex:Node3 ; + ex:property2 ex:Node4 ; +. +ex:Node1 + ex:property2 "One" ; +. +ex:Node2 + ex:property2 "Two" ; +. +ex:TestShape + rdf:type sh:PropertyShape ; + sh:path ( + ex:property1 + ex:property2 + ) ; + sh:minCount 1 ; + sh:targetNode ex:InvalidResource1 ; + sh:targetNode ex:InvalidResource2 ; + sh:targetNode ex:ValidResource1 ; + sh:targetNode ex:ValidResource2 ; +. +ex:ValidResource1 + ex:property1 ex:Node1 ; +. +ex:ValidResource2 + ex:property1 ex:Node1 ; + ex:property1 ex:Node2 ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of path sequence 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultPath ( + ex:property1 + ex:property2 + ) ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinCountConstraintComponent ; + sh:sourceShape ex:TestShape ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource2 ; + sh:resultPath ( + ex:property1 + ex:property2 + ) ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinCountConstraintComponent ; + sh:sourceShape ex:TestShape ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/path/path-sequence-002.ttl b/src/test/resources/shacl/tests/core/path/path-sequence-002.ttl new file mode 100644 index 000000000..4ae6698bd --- /dev/null +++ b/src/test/resources/shacl/tests/core/path/path-sequence-002.ttl @@ -0,0 +1,83 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidResource1 + ex:property1 ex:Node3 ; + ex:property2 ex:Node4 ; +. +ex:Node1 + ex:property2 ex:Node2 ; +. +ex:Node2 + ex:property3 "Value" ; +. +ex:TestShape + rdf:type sh:PropertyShape ; + sh:path ( + ex:property1 + ex:property2 + ex:property3 + ) ; + sh:minCount 1 ; + sh:targetNode ex:InvalidResource1 ; + sh:targetNode ex:InvalidResource2 ; + sh:targetNode ex:ValidResource1 ; + sh:targetNode ex:ValidResource2 ; +. +ex:ValidResource1 + ex:property1 ex:Node1 ; +. +ex:ValidResource2 + ex:property1 ex:Node1 ; + ex:property1 ex:Node2 ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of path sequence 002" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultPath ( + ex:property1 + ex:property2 + ex:property3 + ) ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinCountConstraintComponent ; + sh:sourceShape ex:TestShape ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource2 ; + sh:resultPath ( + ex:property1 + ex:property2 + ex:property3 + ) ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinCountConstraintComponent ; + sh:sourceShape ex:TestShape ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/path/path-sequence-duplicate-001.ttl b/src/test/resources/shacl/tests/core/path/path-sequence-duplicate-001.ttl new file mode 100644 index 000000000..81264c57c --- /dev/null +++ b/src/test/resources/shacl/tests/core/path/path-sequence-duplicate-001.ttl @@ -0,0 +1,63 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:A + ex:p1 [ + ex:p2 "value" ; + ] ; + ex:p1 [ + ex:p2 "value" ; + ] ; +. +ex:S + rdf:type sh:NodeShape ; + sh:property ex:SP ; + sh:targetNode ex:A ; +. +ex:SP + rdf:type sh:PropertyShape ; + sh:path ( + ex:p1 + ex:p2 + ) ; + sh:maxCount 1 ; + sh:nodeKind sh:IRI ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of path sequence with duplicate 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:A ; + sh:resultPath ( + ex:p1 + ex:p2 + ) ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape ex:SP ; + sh:value "value" ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/path/path-strange-001.ttl b/src/test/resources/shacl/tests/core/path/path-strange-001.ttl new file mode 100644 index 000000000..2409cb407 --- /dev/null +++ b/src/test/resources/shacl/tests/core/path/path-strange-001.ttl @@ -0,0 +1,52 @@ +@prefix ex: . +@prefix mf: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:i a ex:C ; + ex:p ex:ip . +ex:ip ex:q ex:ipq . +ex:ipq a ex:C . +ex:pi ex:p ex:i . + +ex:j a ex:C ; + ex:p ex:jp . +ex:jp ex:q ex:jpq . + +ex:s1 a sh:PropertyShape ; + sh:targetClass ex:C ; + sh:path [ rdf:first ex:p ; rdf:rest [ rdf:first ex:q ; rdf:rest rdf:nil ] ; + sh:inversePath ex:p ] ; + sh:class ex:C . + +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + + rdf:type sht:Validate ; + rdfs:label "Test of strange path 001 two valid paths together" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ a sh:ValidationResult ; + sh:focusNode ex:j ; + sh:value ex:jpq ; + sh:resultPath ( ex:p ex:q ) ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:ClassConstraintComponent ; + sh:sourceShape ex:s1 ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/path/path-strange-002.ttl b/src/test/resources/shacl/tests/core/path/path-strange-002.ttl new file mode 100644 index 000000000..4290f9f1a --- /dev/null +++ b/src/test/resources/shacl/tests/core/path/path-strange-002.ttl @@ -0,0 +1,52 @@ +@prefix ex: . +@prefix mf: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:i a ex:C ; + ex:p ex:ip . +ex:ip ex:q ex:ipq . +ex:ipq a ex:C . +ex:pi ex:p ex:i . + +ex:j a ex:C ; + ex:p ex:jp . +ex:jp ex:q ex:jpq . + +ex:s1 a sh:PropertyShape ; + sh:targetClass ex:C ; + sh:path [ rdf:first ex:p ; rdf:rest [ rdf:first ex:q ; rdf:rest rdf:nil ] ; + sh:inversePath ( ex:p ) ] ; + sh:class ex:C . + +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + + rdf:type sht:Validate ; + rdfs:label "Test of strange path 002 valid and invalid paths together" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ a sh:ValidationResult ; + sh:focusNode ex:j ; + sh:value ex:jpq ; + sh:resultPath ( ex:p ex:q ) ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:ClassConstraintComponent ; + sh:sourceShape ex:s1 ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/path/path-unused-001-data.ttl b/src/test/resources/shacl/tests/core/path/path-unused-001-data.ttl new file mode 100644 index 000000000..ea38c1bbd --- /dev/null +++ b/src/test/resources/shacl/tests/core/path/path-unused-001-data.ttl @@ -0,0 +1,5 @@ +@prefix ex: . + +ex:i a ex:C . + +ex:j a ex:D . diff --git a/src/test/resources/shacl/tests/core/path/path-unused-001-shapes.ttl b/src/test/resources/shacl/tests/core/path/path-unused-001-shapes.ttl new file mode 100644 index 000000000..06838876f --- /dev/null +++ b/src/test/resources/shacl/tests/core/path/path-unused-001-shapes.ttl @@ -0,0 +1,18 @@ +@prefix sh: . +@prefix ex: . +@prefix rdf: . +@prefix rdfs: . + +ex:s1 a sh:NodeShape ; + sh:targetNode ex:j, ex:i ; + sh:class ex:C . + +_:p1 sh:inversePath _:p2 . + +_:p2 sh:zeroOrMorePath ( _:p2 ) . + +_:p2 sh:zeroOrOnePath [ rdf:rest rdf:nil ] . + +_:p3 sh:alternativePath ( ex:p ) ; + rdfs:comment "invalid path" . + diff --git a/src/test/resources/shacl/tests/core/path/path-unused-001.ttl b/src/test/resources/shacl/tests/core/path/path-unused-001.ttl new file mode 100644 index 000000000..4ae290913 --- /dev/null +++ b/src/test/resources/shacl/tests/core/path/path-unused-001.ttl @@ -0,0 +1,29 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +<> a mf:Manifest ; + mf:entries ( + + ) . + + a sht:Validate ; + rdfs:label "Test with unused ill-formed path" ; + mf:action [ + sht:dataGraph ; + sht:shapesGraph ] ; + mf:result [ a sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ a sh:ValidationResult ; + sh:focusNode ex:j ; + sh:value ex:j ; + sh:resultSeverity sh:Violation ; + sh:sourceShape ex:s1 ; + sh:sourceConstraintComponent sh:ClassConstraintComponent ] ] ; + mf:status sht:approved . diff --git a/src/test/resources/shacl/tests/core/path/path-zeroOrMore-001.ttl b/src/test/resources/shacl/tests/core/path/path-zeroOrMore-001.ttl new file mode 100644 index 000000000..834ab9f13 --- /dev/null +++ b/src/test/resources/shacl/tests/core/path/path-zeroOrMore-001.ttl @@ -0,0 +1,61 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidResource1 + rdf:type rdfs:Resource ; +. +ex:Person2 + ex:child ex:Person3 ; +. +ex:TestShape + rdf:type sh:PropertyShape ; + sh:path [ + sh:zeroOrMorePath ex:child ; + ] ; + sh:minCount 2 ; + sh:targetNode ex:InvalidResource1 ; + sh:targetNode ex:ValidResource1 ; + sh:targetNode ex:ValidResource2 ; +. +ex:ValidResource1 + ex:child ex:Person1 ; +. +ex:ValidResource2 + ex:child ex:Person2 ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of path sh:zeroOrMorePath 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultPath [ + sh:zeroOrMorePath ex:child ; + ] ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinCountConstraintComponent ; + sh:sourceShape ex:TestShape ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/path/path-zeroOrOne-001.ttl b/src/test/resources/shacl/tests/core/path/path-zeroOrOne-001.ttl new file mode 100644 index 000000000..2e4e34f51 --- /dev/null +++ b/src/test/resources/shacl/tests/core/path/path-zeroOrOne-001.ttl @@ -0,0 +1,61 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidResource1 + rdf:type rdfs:Resource ; +. +ex:Person2 + ex:child ex:Person3 ; +. +ex:TestShape + rdf:type sh:PropertyShape ; + sh:path [ + sh:zeroOrOnePath ex:child ; + ] ; + sh:minCount 2 ; + sh:targetNode ex:InvalidResource1 ; + sh:targetNode ex:ValidResource1 ; + sh:targetNode ex:ValidResource2 ; +. +ex:ValidResource1 + ex:child ex:Person1 ; +. +ex:ValidResource2 + ex:child ex:Person2 ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of path sh:zeroOrOnePath 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultPath [ + sh:zeroOrOnePath ex:child ; + ] ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinCountConstraintComponent ; + sh:sourceShape ex:TestShape ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/property/and-001.ttl b/src/test/resources/shacl/tests/core/property/and-001.ttl new file mode 100644 index 000000000..57eeaf456 --- /dev/null +++ b/src/test/resources/shacl/tests/core/property/and-001.ttl @@ -0,0 +1,107 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:AddressShape + rdf:type sh:NodeShape ; + rdfs:label "Address shape" ; + sh:property ex:AddressShape-address ; + sh:targetNode ex:InvalidResource1 ; + sh:targetNode ex:InvalidResource2 ; + sh:targetNode ex:InvalidResource3 ; + sh:targetNode ex:ValidResource1 ; +. +ex:AddressShape-address + sh:path ex:address ; + sh:and ( + [ + sh:property [ + sh:path ex:suburb ; + sh:minCount 1 ; + ] ; + ] + [ + sh:property [ + sh:path ex:postalCode ; + sh:minCount 1 ; + ] ; + ] + ) ; +. +ex:InvalidResource1 + rdf:type rdfs:Resource ; + ex:address _:b61065 ; +. +ex:InvalidResource2 + rdf:type rdfs:Resource ; + ex:address _:b31477 ; +. +ex:InvalidResource3 + rdf:type rdfs:Resource ; + ex:address _:b94057 ; +. +ex:ValidResource1 + rdf:type rdfs:Resource ; + ex:address [ + ex:postalCode 4879 ; + ex:suburb ex:KewarraBeach ; + ] ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:and at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultPath ex:address ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:AndConstraintComponent ; + sh:sourceShape ex:AddressShape-address ; + sh:value _:b61065 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource2 ; + sh:resultPath ex:address ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:AndConstraintComponent ; + sh:sourceShape ex:AddressShape-address ; + sh:value _:b31477 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource3 ; + sh:resultPath ex:address ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:AndConstraintComponent ; + sh:sourceShape ex:AddressShape-address ; + sh:value _:b94057 ; + ] ; + ] ; + mf:status sht:approved ; +. +_:b31477 + ex:suburb ex:KewarraBeach ; +. +_:b61065 + ex:postalCode 4879 ; +. diff --git a/src/test/resources/shacl/tests/core/property/class-001.ttl b/src/test/resources/shacl/tests/core/property/class-001.ttl new file mode 100644 index 000000000..2b97bf823 --- /dev/null +++ b/src/test/resources/shacl/tests/core/property/class-001.ttl @@ -0,0 +1,91 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidResource1 + rdf:type rdfs:Resource ; + ex:testProperty ex:InvalidResource1 ; + ex:testProperty "A string" ; +. +ex:SubClass + rdf:type rdfs:Class ; + rdfs:subClassOf ex:SuperClass ; +. +ex:SubClassInstance + rdf:type ex:SubClass ; +. +ex:SuperClass + rdf:type rdfs:Class ; +. +ex:SuperClassInstance + rdf:type ex:SuperClass ; +. +ex:TestShape + rdf:type sh:NodeShape ; + sh:property ex:TestShape-testProperty ; + sh:targetNode ex:InvalidResource1 ; + sh:targetNode ex:ValidResource1 ; + sh:targetNode ex:ValidResource2 ; +. +ex:TestShape-testProperty + sh:path ex:testProperty ; + rdfs:label "test property" ; + sh:class ex:SuperClass ; +. +ex:ValidResource1 + rdf:type rdfs:Resource ; + ex:testProperty ex:SubClassInstance ; + ex:testProperty ex:SuperClassInstance ; +. +ex:ValidResource2 + rdf:type rdfs:Resource ; + ex:testProperty [ + rdf:type ex:SubClass ; + ] ; + ex:testProperty [ + rdf:type ex:SuperClass ; + ] ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:class at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultPath ex:testProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:ClassConstraintComponent ; + sh:sourceShape ex:TestShape-testProperty ; + sh:value ex:InvalidResource1 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultPath ex:testProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:ClassConstraintComponent ; + sh:sourceShape ex:TestShape-testProperty ; + sh:value "A string" ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/property/datatype-001.ttl b/src/test/resources/shacl/tests/core/property/datatype-001.ttl new file mode 100644 index 000000000..f1b1b814f --- /dev/null +++ b/src/test/resources/shacl/tests/core/property/datatype-001.ttl @@ -0,0 +1,76 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidResource1 + rdf:type ex:TestShape ; + ex:dateProperty "2011-01-01"^^xsd:dateTime ; + ex:integerProperty 11.1 ; +. +ex:TestShape + rdf:type rdfs:Class ; + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:property ex:TestShape-dateProperty ; + sh:property ex:TestShape-integerProperty ; +. +ex:TestShape-dateProperty + sh:path ex:dateProperty ; + rdfs:label "date property" ; + sh:datatype xsd:date ; +. +ex:TestShape-integerProperty + sh:path ex:integerProperty ; + rdfs:label "integer property" ; + sh:datatype xsd:integer ; +. +ex:ValidResource + rdf:type ex:TestShape ; + ex:dateProperty "2014-09-01"^^xsd:date ; + ex:integerProperty 0 ; + ex:integerProperty 1234 ; + rdfs:label "Valid resource" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:datatype at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultPath ex:dateProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; + sh:sourceShape ex:TestShape-dateProperty ; + sh:value "2011-01-01"^^xsd:dateTime ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultPath ex:integerProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; + sh:sourceShape ex:TestShape-integerProperty ; + sh:value 11.1 ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/property/datatype-002.ttl b/src/test/resources/shacl/tests/core/property/datatype-002.ttl new file mode 100644 index 000000000..fc563774c --- /dev/null +++ b/src/test/resources/shacl/tests/core/property/datatype-002.ttl @@ -0,0 +1,71 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidInstance1 + ex:value "A"@en ; +. +ex:InvalidInstance2 + ex:value 42 ; +. +ex:TestShape + rdf:type sh:NodeShape ; + sh:property ex:TestShape-value ; + sh:targetNode ex:InvalidInstance1 ; + sh:targetNode ex:InvalidInstance2 ; + sh:targetNode ex:ValidInstance1 ; + sh:targetNode ex:ValidInstance2 ; +. +ex:TestShape-value + sh:path ex:value ; + sh:datatype xsd:string ; +. +ex:ValidInstance1 + ex:value "A" ; +. +ex:ValidInstance2 + ex:value "A" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:datatype at property shape 002" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance1 ; + sh:resultPath ex:value ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; + sh:sourceShape ex:TestShape-value ; + sh:value "A"@en ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance2 ; + sh:resultPath ex:value ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; + sh:sourceShape ex:TestShape-value ; + sh:value 42 ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/property/datatype-003.ttl b/src/test/resources/shacl/tests/core/property/datatype-003.ttl new file mode 100644 index 000000000..529685073 --- /dev/null +++ b/src/test/resources/shacl/tests/core/property/datatype-003.ttl @@ -0,0 +1,69 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidInstance1 + ex:value 42 ; +. +ex:TestShape + rdf:type sh:NodeShape ; + sh:property ex:TestShape-value ; + sh:targetNode ex:InvalidInstance1 ; + sh:targetNode ex:ValidInstance1 ; + sh:targetNode ex:ValidInstance2 ; + sh:targetNode ex:ValidInstance3 ; +. +ex:TestShape-value + sh:path ex:value ; + sh:or ( + [ + sh:datatype xsd:string ; + ] + [ + sh:datatype rdf:langString ; + ] + ) ; +. +ex:ValidInstance1 + ex:value "A" ; +. +ex:ValidInstance2 + ex:value "A" ; +. +ex:ValidInstance3 + ex:value "A"@en ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:datatype at property shape 003" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance1 ; + sh:resultPath ex:value ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:OrConstraintComponent ; + sh:sourceShape ex:TestShape-value ; + sh:value 42 ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/property/datatype-ill-formed-data.ttl b/src/test/resources/shacl/tests/core/property/datatype-ill-formed-data.ttl new file mode 100644 index 000000000..e5338afa8 --- /dev/null +++ b/src/test/resources/shacl/tests/core/property/datatype-ill-formed-data.ttl @@ -0,0 +1,6 @@ +@prefix xsd: . +@prefix ex: . + +ex:i ex:p "300"^^xsd:byte . +ex:i ex:p "55"^^xsd:integer . +ex:i ex:p "c"^^xsd:byte . diff --git a/src/test/resources/shacl/tests/core/property/datatype-ill-formed-shapes.ttl b/src/test/resources/shacl/tests/core/property/datatype-ill-formed-shapes.ttl new file mode 100644 index 000000000..203663264 --- /dev/null +++ b/src/test/resources/shacl/tests/core/property/datatype-ill-formed-shapes.ttl @@ -0,0 +1,8 @@ +@prefix sh: . +@prefix xsd: . +@prefix ex: . + +ex:s a sh:PropertyShape ; + sh:targetNode ex:i ; + sh:path ex:p ; + sh:datatype xsd:byte . diff --git a/src/test/resources/shacl/tests/core/property/datatype-ill-formed.ttl b/src/test/resources/shacl/tests/core/property/datatype-ill-formed.ttl new file mode 100644 index 000000000..08611e498 --- /dev/null +++ b/src/test/resources/shacl/tests/core/property/datatype-ill-formed.ttl @@ -0,0 +1,43 @@ +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +@prefix ex: . + +<> rdf:type mf:Manifest ; + mf:entries ( + + ) . + + rdf:type sht:Validate; + rdfs:label "Test of validation report for ill-formed literals" ; + mf:action [ sht:dataGraph ; + sht:shapesGraph ] ; + mf:result [ rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ rdf:type sh:ValidationResult ; + sh:resultSeverity sh:Violation ; + sh:focusNode ex:i ; + sh:value "300"^^xsd:byte ; + sh:resultPath ex:p ; + sh:sourceShape ex:s ; + sh:sourceConstraintComponent sh:DatatypeConstraintComponent ] ; + sh:result [ rdf:type sh:ValidationResult ; + sh:resultSeverity sh:Violation ; + sh:focusNode ex:i ; + sh:value "c"^^xsd:byte ; + sh:resultPath ex:p ; + sh:sourceShape ex:s ; + sh:sourceConstraintComponent sh:DatatypeConstraintComponent ] ; + sh:result [ rdf:type sh:ValidationResult ; + sh:resultSeverity sh:Violation ; + sh:focusNode ex:i ; + sh:value "55"^^xsd:integer ; + sh:resultPath ex:p ; + sh:sourceShape ex:s ; + sh:sourceConstraintComponent sh:DatatypeConstraintComponent ] ] ; + mf:status sht:approved . diff --git a/src/test/resources/shacl/tests/core/property/disjoint-001.ttl b/src/test/resources/shacl/tests/core/property/disjoint-001.ttl new file mode 100644 index 000000000..8bfc6852d --- /dev/null +++ b/src/test/resources/shacl/tests/core/property/disjoint-001.ttl @@ -0,0 +1,84 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidResource1 + ex:property1 "A" ; + ex:property2 "A" ; +. +ex:InvalidResource2 + ex:property1 "A" ; + ex:property1 "B" ; + ex:property2 "A" ; +. +ex:TestShape + rdf:type sh:NodeShape ; + sh:property ex:TestShape-property1 ; + sh:targetNode ex:InvalidResource1 ; + sh:targetNode ex:InvalidResource2 ; + sh:targetNode ex:ValidResource1 ; + sh:targetNode ex:ValidResource2 ; +. +ex:TestShape-property1 + sh:path ex:property1 ; + sh:disjoint ex:property2 ; +. +ex:ValidResource1 + ex:property1 "A" ; + ex:property2 "B" ; +. +ex:ValidResource2 + ex:property1 "A" ; + ex:property1 "B" ; + ex:property2 "C" ; + ex:property2 "D" ; +. +ex:property1 + rdf:type rdf:Property ; +. +ex:property2 + rdf:type rdf:Property ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:disjoint at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultPath ex:property1 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:DisjointConstraintComponent ; + sh:sourceShape ex:TestShape-property1 ; + sh:value "A" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource2 ; + sh:resultPath ex:property1 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:DisjointConstraintComponent ; + sh:sourceShape ex:TestShape-property1 ; + sh:value "A" ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/property/equals-001.ttl b/src/test/resources/shacl/tests/core/property/equals-001.ttl new file mode 100644 index 000000000..64024cd40 --- /dev/null +++ b/src/test/resources/shacl/tests/core/property/equals-001.ttl @@ -0,0 +1,119 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidResource1 + ex:property1 "A" ; + ex:property2 "B" ; +. +ex:InvalidResource2 + ex:property1 "A" ; +. +ex:InvalidResource3 + ex:property2 "A" ; +. +ex:InvalidResource4 + ex:property1 "A" ; + ex:property1 "B" ; + ex:property2 "A" ; +. +ex:TestShape + rdf:type sh:NodeShape ; + sh:property ex:TestShape-property1 ; + sh:targetNode ex:InvalidResource1 ; + sh:targetNode ex:InvalidResource2 ; + sh:targetNode ex:InvalidResource3 ; + sh:targetNode ex:InvalidResource4 ; + sh:targetNode ex:ValidResource1 ; + sh:targetNode ex:ValidResource2 ; +. +ex:TestShape-property1 + sh:path ex:property1 ; + sh:equals ex:property2 ; +. +ex:ValidResource1 + ex:property1 "A" ; + ex:property2 "A" ; +. +ex:ValidResource2 + ex:property1 "A" ; + ex:property1 "B" ; + ex:property2 "A" ; + ex:property2 "B" ; +. +ex:property1 + rdf:type rdf:Property ; +. +ex:property2 + rdf:type rdf:Property ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:equals at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultPath ex:property1 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:EqualsConstraintComponent ; + sh:sourceShape ex:TestShape-property1 ; + sh:value "A" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultPath ex:property1 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:EqualsConstraintComponent ; + sh:sourceShape ex:TestShape-property1 ; + sh:value "B" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource2 ; + sh:resultPath ex:property1 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:EqualsConstraintComponent ; + sh:sourceShape ex:TestShape-property1 ; + sh:value "A" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource3 ; + sh:resultPath ex:property1 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:EqualsConstraintComponent ; + sh:sourceShape ex:TestShape-property1 ; + sh:value "A" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource4 ; + sh:resultPath ex:property1 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:EqualsConstraintComponent ; + sh:sourceShape ex:TestShape-property1 ; + sh:value "B" ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/property/hasValue-001.ttl b/src/test/resources/shacl/tests/core/property/hasValue-001.ttl new file mode 100644 index 000000000..ffaa0ebbf --- /dev/null +++ b/src/test/resources/shacl/tests/core/property/hasValue-001.ttl @@ -0,0 +1,68 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidMalePerson + rdf:type ex:MalePerson ; + ex:gender "female" ; + rdfs:label "Invalid male person" ; +. +ex:MalePerson + rdf:type rdfs:Class ; + rdfs:label "Male person" ; + rdfs:subClassOf rdfs:Resource ; +. +ex:PersonShape + rdf:type sh:NodeShape ; + rdfs:label "Person shape" ; + sh:property ex:PersonShape-gender ; + sh:targetClass ex:MalePerson ; +. +ex:PersonShape-gender + sh:path ex:gender ; + rdfs:label "gender" ; + sh:datatype xsd:string ; + sh:hasValue "male" ; +. +ex:ValidMalePerson1 + rdf:type ex:MalePerson ; + ex:gender "male" ; +. +ex:ValidMalePerson2 + rdf:type ex:MalePerson ; + ex:gender "female" ; + ex:gender "male" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:hasValue at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidMalePerson ; + sh:resultPath ex:gender ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:HasValueConstraintComponent ; + sh:sourceShape ex:PersonShape-gender ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/property/in-001.ttl b/src/test/resources/shacl/tests/core/property/in-001.ttl new file mode 100644 index 000000000..cfd37cfb7 --- /dev/null +++ b/src/test/resources/shacl/tests/core/property/in-001.ttl @@ -0,0 +1,69 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidInstance1 + rdf:type ex:ShapeClass ; + ex:property "D" ; + rdfs:label "Invalid instance1" ; +. +ex:ShapeClass + rdf:type rdfs:Class ; + rdf:type sh:NodeShape ; + sh:property ex:ShapeClass-property ; +. +ex:ShapeClass-property + sh:path ex:property ; + sh:datatype xsd:string ; + sh:in ( + "A" + "B" + "C" + ) ; +. +ex:ValidInstance1 + rdf:type ex:ShapeClass ; + ex:property "A" ; + rdfs:label "Valid instance1" ; +. +ex:ValidInstance2 + rdf:type ex:ShapeClass ; + ex:property "A" ; + ex:property "B" ; + ex:property "C" ; + rdfs:label "Valid instance2" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:in at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance1 ; + sh:resultPath ex:property ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:InConstraintComponent ; + sh:sourceShape ex:ShapeClass-property ; + sh:value "D" ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/property/languageIn-001.ttl b/src/test/resources/shacl/tests/core/property/languageIn-001.ttl new file mode 100644 index 000000000..00e9d98b8 --- /dev/null +++ b/src/test/resources/shacl/tests/core/property/languageIn-001.ttl @@ -0,0 +1,79 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:Berg + ex:prefLabel ex:BergLabel ; + ex:prefLabel "Berg" ; + ex:prefLabel "Berg"@de ; +. +ex:Mountain + ex:prefLabel "Hill"@en-NZ ; + ex:prefLabel "Maunga"@mi ; + ex:prefLabel "Mountain"@en ; +. +ex:NewZealandLanguagesShape + rdf:type sh:NodeShape ; + sh:property ex:NewZealandLanguagesShape-prefLabel ; + sh:targetNode ex:Berg ; + sh:targetNode ex:Mountain ; +. +ex:NewZealandLanguagesShape-prefLabel + sh:path ex:prefLabel ; + sh:languageIn ( + "en" + "mi" + ) ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:languageIn at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:Berg ; + sh:resultPath ex:prefLabel ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:LanguageInConstraintComponent ; + sh:sourceShape ex:NewZealandLanguagesShape-prefLabel ; + sh:value ex:BergLabel ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:Berg ; + sh:resultPath ex:prefLabel ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:LanguageInConstraintComponent ; + sh:sourceShape ex:NewZealandLanguagesShape-prefLabel ; + sh:value "Berg" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:Berg ; + sh:resultPath ex:prefLabel ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:LanguageInConstraintComponent ; + sh:sourceShape ex:NewZealandLanguagesShape-prefLabel ; + sh:value "Berg"@de ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/property/lessThan-001.ttl b/src/test/resources/shacl/tests/core/property/lessThan-001.ttl new file mode 100644 index 000000000..d76b37dab --- /dev/null +++ b/src/test/resources/shacl/tests/core/property/lessThan-001.ttl @@ -0,0 +1,96 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidResource1 + ex:property1 4 ; + ex:property2 4 ; +. +ex:InvalidResource2 + ex:property1 4 ; + ex:property1 6 ; + ex:property2 5 ; +. +ex:InvalidResource3 + ex:property1 5 ; + ex:property2 4 ; +. +ex:TestShape + rdf:type sh:NodeShape ; + sh:property ex:TestShape-property1 ; + sh:targetNode ex:InvalidResource1 ; + sh:targetNode ex:InvalidResource2 ; + sh:targetNode ex:InvalidResource3 ; + sh:targetNode ex:ValidResource1 ; + sh:targetNode ex:ValidResource2 ; +. +ex:TestShape-property1 + sh:path ex:property1 ; + sh:lessThan ex:property2 ; +. +ex:ValidResource1 + ex:property1 4 ; + ex:property2 6 ; +. +ex:ValidResource2 + ex:property1 3.1 ; + ex:property1 3.2 ; +. +ex:property1 + rdf:type rdf:Property ; +. +ex:property2 + rdf:type rdf:Property ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:lessThan at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultPath ex:property1 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:LessThanConstraintComponent ; + sh:sourceShape ex:TestShape-property1 ; + sh:value 4 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource2 ; + sh:resultPath ex:property1 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:LessThanConstraintComponent ; + sh:sourceShape ex:TestShape-property1 ; + sh:value 6 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource3 ; + sh:resultPath ex:property1 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:LessThanConstraintComponent ; + sh:sourceShape ex:TestShape-property1 ; + sh:value 5 ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/property/lessThan-002.ttl b/src/test/resources/shacl/tests/core/property/lessThan-002.ttl new file mode 100644 index 000000000..9f352ef38 --- /dev/null +++ b/src/test/resources/shacl/tests/core/property/lessThan-002.ttl @@ -0,0 +1,81 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidInstance1 + ex:first 1 ; + ex:first 2 ; + ex:second "a" ; + ex:second "b" ; +. +ex:TestShape + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:property ex:TestShape-first ; + sh:targetNode ex:InvalidInstance1 ; +. +ex:TestShape-first + sh:path ex:first ; + sh:lessThan ex:second ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:lessThan at property shape 002" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance1 ; + sh:resultPath ex:first ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:LessThanConstraintComponent ; + sh:sourceShape ex:TestShape-first ; + sh:value 1 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance1 ; + sh:resultPath ex:first ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:LessThanConstraintComponent ; + sh:sourceShape ex:TestShape-first ; + sh:value 1 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance1 ; + sh:resultPath ex:first ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:LessThanConstraintComponent ; + sh:sourceShape ex:TestShape-first ; + sh:value 2 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance1 ; + sh:resultPath ex:first ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:LessThanConstraintComponent ; + sh:sourceShape ex:TestShape-first ; + sh:value 2 ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/property/lessThanOrEquals-001.ttl b/src/test/resources/shacl/tests/core/property/lessThanOrEquals-001.ttl new file mode 100644 index 000000000..c1ac111cc --- /dev/null +++ b/src/test/resources/shacl/tests/core/property/lessThanOrEquals-001.ttl @@ -0,0 +1,87 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidResource1 + ex:property1 5 ; + ex:property2 4 ; +. +ex:InvalidResource2 + ex:property1 4 ; + ex:property1 6 ; + ex:property2 5 ; +. +ex:TestShape + rdf:type sh:NodeShape ; + sh:property ex:TestShape-property1 ; + sh:targetNode ex:InvalidResource1 ; + sh:targetNode ex:InvalidResource2 ; + sh:targetNode ex:ValidResource1 ; + sh:targetNode ex:ValidResource2 ; + sh:targetNode ex:ValidResource3 ; +. +ex:TestShape-property1 + sh:path ex:property1 ; + sh:lessThanOrEquals ex:property2 ; +. +ex:ValidResource1 + ex:property1 4 ; + ex:property2 6 ; +. +ex:ValidResource2 + ex:property1 3.1 ; + ex:property1 3.2 ; +. +ex:ValidResource3 + ex:property1 5 ; + ex:property2 5 ; +. +ex:property1 + rdf:type rdf:Property ; +. +ex:property2 + rdf:type rdf:Property ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:lessThanOrEquals at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultPath ex:property1 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:LessThanOrEqualsConstraintComponent ; + sh:sourceShape ex:TestShape-property1 ; + sh:value 5 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource2 ; + sh:resultPath ex:property1 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:LessThanOrEqualsConstraintComponent ; + sh:sourceShape ex:TestShape-property1 ; + sh:value 6 ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/property/manifest.ttl b/src/test/resources/shacl/tests/core/property/manifest.ttl new file mode 100644 index 000000000..034d25379 --- /dev/null +++ b/src/test/resources/shacl/tests/core/property/manifest.ttl @@ -0,0 +1,46 @@ +@prefix mf: . +@prefix rdfs: . +@prefix sht: . + +<> + a mf:Manifest ; + rdfs:label "Tests converted from http://datashapes.org/sh/tests/tests/core/property" ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + . \ No newline at end of file diff --git a/src/test/resources/shacl/tests/core/property/maxCount-001.ttl b/src/test/resources/shacl/tests/core/property/maxCount-001.ttl new file mode 100644 index 000000000..52653dec9 --- /dev/null +++ b/src/test/resources/shacl/tests/core/property/maxCount-001.ttl @@ -0,0 +1,64 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidPerson + rdf:type ex:Person ; + ex:firstName "George" ; + ex:firstName "John" ; + rdfs:label "Invalid person" ; +. +ex:Person + rdf:type rdfs:Class ; + rdfs:label "Person" ; + rdfs:subClassOf rdfs:Resource ; +. +ex:PersonShape + rdf:type sh:NodeShape ; + sh:property ex:PersonShape-firstName ; + sh:targetClass ex:Person ; + sh:targetNode ex:ValidResource ; +. +ex:PersonShape-firstName + sh:path ex:firstName ; + sh:datatype xsd:string ; + sh:maxCount 1 ; +. +ex:ValidResource + rdf:type ex:Person ; + ex:firstName "John" ; + rdfs:label "Valid resource" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:maxCount at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidPerson ; + sh:resultPath ex:firstName ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxCountConstraintComponent ; + sh:sourceShape ex:PersonShape-firstName ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/property/maxCount-002.ttl b/src/test/resources/shacl/tests/core/property/maxCount-002.ttl new file mode 100644 index 000000000..23d82a07a --- /dev/null +++ b/src/test/resources/shacl/tests/core/property/maxCount-002.ttl @@ -0,0 +1,57 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidResource + rdf:type rdfs:Resource ; + rdfs:label "Invalid resource" ; + owl:versionInfo "1.0" ; +. +ex:TestShape + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:property ex:TestShape-versionInfo ; + sh:targetNode ex:InvalidResource ; + sh:targetNode ex:ValidResource ; +. +ex:TestShape-versionInfo + sh:path owl:versionInfo ; + sh:maxCount 0 ; +. +ex:ValidResource + rdf:type rdfs:Resource ; + rdfs:label "Valid resource" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:maxCount at property shape 002" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource ; + sh:resultPath owl:versionInfo ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxCountConstraintComponent ; + sh:sourceShape ex:TestShape-versionInfo ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/property/maxExclusive-001.ttl b/src/test/resources/shacl/tests/core/property/maxExclusive-001.ttl new file mode 100644 index 000000000..47566a8fa --- /dev/null +++ b/src/test/resources/shacl/tests/core/property/maxExclusive-001.ttl @@ -0,0 +1,84 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidResource1 + ex:property 1 ; +. +ex:InvalidResource2 + ex:property 2 ; +. +ex:InvalidResource3 + ex:property "a" ; +. +ex:TestShape + rdf:type sh:NodeShape ; + sh:property ex:TestShape-property ; + sh:targetNode ex:InvalidResource1 ; + sh:targetNode ex:InvalidResource2 ; + sh:targetNode ex:InvalidResource3 ; + sh:targetNode ex:ValidResource1 ; + sh:targetNode ex:ValidResource2 ; +. +ex:TestShape-property + sh:path ex:property ; + sh:maxExclusive 1 ; +. +ex:ValidResource1 + ex:property 0 ; +. +ex:ValidResource2 + ex:property -1 ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:maxExclusive at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultPath ex:property ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxExclusiveConstraintComponent ; + sh:sourceShape ex:TestShape-property ; + sh:value 1 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource2 ; + sh:resultPath ex:property ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxExclusiveConstraintComponent ; + sh:sourceShape ex:TestShape-property ; + sh:value 2 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource3 ; + sh:resultPath ex:property ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxExclusiveConstraintComponent ; + sh:sourceShape ex:TestShape-property ; + sh:value "a" ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/property/maxInclusive-001.ttl b/src/test/resources/shacl/tests/core/property/maxInclusive-001.ttl new file mode 100644 index 000000000..2c5077f07 --- /dev/null +++ b/src/test/resources/shacl/tests/core/property/maxInclusive-001.ttl @@ -0,0 +1,71 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidResource1 + ex:property 2 ; +. +ex:InvalidResource2 + ex:property "a" ; +. +ex:TestShape + rdf:type sh:NodeShape ; + sh:property ex:TestShape-property ; + sh:targetNode ex:InvalidResource1 ; + sh:targetNode ex:InvalidResource2 ; + sh:targetNode ex:ValidResource1 ; + sh:targetNode ex:ValidResource2 ; +. +ex:TestShape-property + sh:path ex:property ; + sh:maxInclusive 1 ; +. +ex:ValidResource1 + ex:property 0 ; +. +ex:ValidResource2 + ex:property 1 ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:maxInclusive at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultPath ex:property ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxInclusiveConstraintComponent ; + sh:sourceShape ex:TestShape-property ; + sh:value 2 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource2 ; + sh:resultPath ex:property ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxInclusiveConstraintComponent ; + sh:sourceShape ex:TestShape-property ; + sh:value "a" ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/property/maxLength-001.ttl b/src/test/resources/shacl/tests/core/property/maxLength-001.ttl new file mode 100644 index 000000000..b6d4b48ff --- /dev/null +++ b/src/test/resources/shacl/tests/core/property/maxLength-001.ttl @@ -0,0 +1,61 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidInstance1 + rdf:type ex:TestShape ; + ex:testProperty "ABC" ; +. +ex:TestShape + rdf:type rdfs:Class ; + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:property ex:TestShape-testProperty ; +. +ex:TestShape-testProperty + sh:path ex:testProperty ; + sh:datatype xsd:string ; + sh:maxLength 2 ; +. +ex:ValidInstance1 + rdf:type ex:TestShape ; + ex:testProperty "A" ; + ex:testProperty "AB" ; +. +ex:ValidInstance2 + rdf:type ex:TestShape ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:maxLength at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance1 ; + sh:resultPath ex:testProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxLengthConstraintComponent ; + sh:sourceShape ex:TestShape-testProperty ; + sh:value "ABC" ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/property/minCount-001.ttl b/src/test/resources/shacl/tests/core/property/minCount-001.ttl new file mode 100644 index 000000000..680f9c4b8 --- /dev/null +++ b/src/test/resources/shacl/tests/core/property/minCount-001.ttl @@ -0,0 +1,62 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidPerson + rdf:type ex:Person ; + rdfs:label "Invalid person" ; +. +ex:Person + rdf:type rdfs:Class ; + rdfs:label "Person" ; + rdfs:subClassOf rdfs:Resource ; +. +ex:PersonShape + rdf:type sh:NodeShape ; + sh:property ex:PersonShape-firstName ; + sh:targetClass ex:Person ; + sh:targetNode ex:ValidResource ; +. +ex:PersonShape-firstName + sh:path ex:firstName ; + sh:datatype xsd:string ; + sh:minCount 1 ; +. +ex:ValidResource + rdf:type ex:Person ; + ex:firstName "John" ; + rdfs:label "Valid resource" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:minCount at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidPerson ; + sh:resultPath ex:firstName ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinCountConstraintComponent ; + sh:sourceShape ex:PersonShape-firstName ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/property/minCount-002.ttl b/src/test/resources/shacl/tests/core/property/minCount-002.ttl new file mode 100644 index 000000000..d4b4f13b2 --- /dev/null +++ b/src/test/resources/shacl/tests/core/property/minCount-002.ttl @@ -0,0 +1,41 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:TestShape + rdf:type sh:NodeShape ; + sh:property [ + sh:path ex:property ; + sh:minCount 0 ; + sh:name "property" ; + ] ; + sh:targetNode ex:ValidResource1 ; +. +ex:ValidResource1 + rdf:type rdfs:Resource ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:minCount at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "true"^^xsd:boolean ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/property/minExclusive-001.ttl b/src/test/resources/shacl/tests/core/property/minExclusive-001.ttl new file mode 100644 index 000000000..8c99b43b6 --- /dev/null +++ b/src/test/resources/shacl/tests/core/property/minExclusive-001.ttl @@ -0,0 +1,69 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidInstance1 + rdf:type ex:TestShape ; + ex:testProperty 40 ; +. +ex:InvalidInstance2 + rdf:type ex:TestShape ; + ex:testProperty 39 ; +. +ex:TestShape + rdf:type rdfs:Class ; + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:property ex:TestShape-testProperty ; +. +ex:TestShape-testProperty + sh:path ex:testProperty ; + sh:minExclusive 40 ; +. +ex:ValidInstance1 + rdf:type ex:TestShape ; + ex:testProperty 42 ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:minExclusive at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance1 ; + sh:resultPath ex:testProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinExclusiveConstraintComponent ; + sh:sourceShape ex:TestShape-testProperty ; + sh:value 40 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance2 ; + sh:resultPath ex:testProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinExclusiveConstraintComponent ; + sh:sourceShape ex:TestShape-testProperty ; + sh:value 39 ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/property/minExclusive-002.ttl b/src/test/resources/shacl/tests/core/property/minExclusive-002.ttl new file mode 100644 index 000000000..2612e1661 --- /dev/null +++ b/src/test/resources/shacl/tests/core/property/minExclusive-002.ttl @@ -0,0 +1,65 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidInstance1 + rdf:type ex:TestShape ; + ex:testProperty "A string" ; +. +ex:InvalidInstance2 + rdf:type ex:TestShape ; + ex:testProperty rdfs:Resource ; +. +ex:TestShape + rdf:type rdfs:Class ; + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:property ex:TestShape-testProperty ; +. +ex:TestShape-testProperty + sh:path ex:testProperty ; + sh:minExclusive 40 ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:minExclusive at property shape 002" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance1 ; + sh:resultPath ex:testProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinExclusiveConstraintComponent ; + sh:sourceShape ex:TestShape-testProperty ; + sh:value "A string" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance2 ; + sh:resultPath ex:testProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinExclusiveConstraintComponent ; + sh:sourceShape ex:TestShape-testProperty ; + sh:value rdfs:Resource ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/property/minLength-001.ttl b/src/test/resources/shacl/tests/core/property/minLength-001.ttl new file mode 100644 index 000000000..06f286e2e --- /dev/null +++ b/src/test/resources/shacl/tests/core/property/minLength-001.ttl @@ -0,0 +1,61 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidInstance1 + rdf:type ex:TestShape ; + ex:testProperty "A" ; +. +ex:TestShape + rdf:type rdfs:Class ; + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:property ex:TestShape-testProperty ; +. +ex:TestShape-testProperty + sh:path ex:testProperty ; + sh:datatype xsd:string ; + sh:minLength 2 ; +. +ex:ValidInstance1 + rdf:type ex:TestShape ; + ex:testProperty "AB" ; + ex:testProperty "ABC" ; +. +ex:ValidInstance2 + rdf:type ex:TestShape ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:minLength at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance1 ; + sh:resultPath ex:testProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinLengthConstraintComponent ; + sh:sourceShape ex:TestShape-testProperty ; + sh:value "A" ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/property/node-001.ttl b/src/test/resources/shacl/tests/core/property/node-001.ttl new file mode 100644 index 000000000..2245930ba --- /dev/null +++ b/src/test/resources/shacl/tests/core/property/node-001.ttl @@ -0,0 +1,113 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:Anon + rdf:type ex:Person ; + ex:firstName "Anon" ; +. +ex:Issue + rdf:type rdfs:Class ; + rdf:type sh:NodeShape ; + rdfs:label "Issue" ; + rdfs:subClassOf rdfs:Resource ; + sh:property ex:Issue-assignedTo ; + sh:property ex:Issue-submittedBy ; +. +ex:Issue-assignedTo + sh:path ex:assignedTo ; + sh:class ex:Person ; + sh:node [ + rdfs:comment "All assignees must have an email and a last name." ; + sh:property [ + sh:path ex:email ; + sh:maxCount 1 ; + sh:minCount 1 ; + ] ; + sh:property [ + sh:path ex:lastName ; + sh:maxCount 1 ; + sh:minCount 1 ; + ] ; + ] ; +. +ex:Issue-submittedBy + sh:path ex:submittedBy ; + sh:class ex:Person ; + sh:minCount 1 ; +. +ex:Issue_1 + rdf:type ex:Issue ; + ex:assignedTo ex:Anon ; + ex:submittedBy ex:Anon ; + rdfs:label "Issue 1" ; +. +ex:Issue_2 + rdf:type ex:Issue ; + ex:assignedTo ex:JohnDoeWithEmail ; + ex:submittedBy ex:Anon ; + rdfs:label "Issue 2" ; +. +ex:JohnDoeWithEmail + rdf:type ex:Person ; + ex:email "john@doe.com" ; + ex:firstName "John" ; + ex:lastName "Doe" ; +. +ex:Person + rdf:type rdfs:Class ; + rdf:type sh:NodeShape ; + rdfs:label "Person" ; + rdfs:subClassOf rdfs:Resource ; + sh:property [ + sh:path ex:email ; + ex:datatype xsd:string ; + rdfs:label "email" ; + ] ; + sh:property [ + sh:path ex:firstName ; + rdfs:label "first name" ; + sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:minCount 1 ; + ] ; + sh:property [ + sh:path ex:lastName ; + rdfs:label "last name" ; + sh:datatype xsd:string ; + ] ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:node at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:Issue_1 ; + sh:resultPath ex:assignedTo ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeConstraintComponent ; + sh:sourceShape ex:Issue-assignedTo ; + sh:value ex:Anon ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/property/node-002.ttl b/src/test/resources/shacl/tests/core/property/node-002.ttl new file mode 100644 index 000000000..f028f57fd --- /dev/null +++ b/src/test/resources/shacl/tests/core/property/node-002.ttl @@ -0,0 +1,75 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:AddressShape + rdf:type sh:NodeShape ; + sh:property ex:AddressShape-postalCode ; +. +ex:AddressShape-postalCode + sh:path ex:postalCode ; + sh:datatype xsd:string ; + sh:maxCount 1 ; +. +ex:Bob + rdf:type ex:Person ; + ex:address ex:BobsAddress ; +. +ex:BobsAddress + ex:postalCode "1234" ; +. +ex:Person + rdf:type rdfs:Class ; + rdfs:label "Person" ; +. +ex:PersonShape + rdf:type sh:NodeShape ; + sh:property ex:PersonShape-address ; + sh:targetClass ex:Person ; +. +ex:PersonShape-address + sh:path ex:address ; + sh:minCount 1 ; + sh:node ex:AddressShape ; +. +ex:Reto + rdf:type ex:Person ; + ex:address ex:RetosAddress ; +. +ex:RetosAddress + ex:postalCode 5678 ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:node at property shape 002" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:Reto ; + sh:resultPath ex:address ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeConstraintComponent ; + sh:sourceShape ex:PersonShape-address ; + sh:value ex:RetosAddress ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/property/nodeKind-001.ttl b/src/test/resources/shacl/tests/core/property/nodeKind-001.ttl new file mode 100644 index 000000000..d40515d0e --- /dev/null +++ b/src/test/resources/shacl/tests/core/property/nodeKind-001.ttl @@ -0,0 +1,371 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InstanceWithBlankNode + rdf:type ex:MyClass ; + ex:myProperty _:b55454 ; +. +ex:InstanceWithBlankNodeAndIRI + rdf:type ex:MyClass ; + ex:myProperty rdfs:Class ; + ex:myProperty _:b67098 ; +. +ex:InstanceWithBlankNodeAndLiteral + rdf:type ex:MyClass ; + ex:myProperty "Literal" ; + ex:myProperty _:b99026 ; +. +ex:InstanceWithIRI + rdf:type ex:MyClass ; + ex:myProperty rdfs:Class ; +. +ex:InstanceWithIRIAndLiteral + rdf:type ex:MyClass ; + ex:myProperty rdfs:Class ; + ex:myProperty "Literal" ; +. +ex:InstanceWithLiteral + rdf:type ex:MyClass ; + ex:myProperty "Literal" ; +. +ex:MyClass + rdf:type rdfs:Class ; + rdfs:label "My class" ; +. +ex:ShapeWithBlankNode + rdf:type sh:NodeShape ; + sh:property _:b38619 ; + sh:targetClass ex:MyClass ; +. +ex:ShapeWithBlankNodeOrIRI + rdf:type sh:NodeShape ; + sh:property _:b3078 ; + sh:targetClass ex:MyClass ; +. +ex:ShapeWithBlankNodeOrLiteral + rdf:type sh:NodeShape ; + sh:property _:b14975 ; + sh:targetClass ex:MyClass ; +. +ex:ShapeWithIRI + rdf:type sh:NodeShape ; + sh:property _:b97614 ; + sh:targetClass ex:MyClass ; +. +ex:ShapeWithIRIOrLiteral + rdf:type sh:NodeShape ; + sh:property _:b97860 ; + sh:targetClass ex:MyClass ; +. +ex:ShapeWithLiteral + rdf:type sh:NodeShape ; + sh:property _:b79526 ; + sh:targetClass ex:MyClass ; +. +ex:myProperty + rdf:type rdf:Property ; + rdfs:domain ex:MyClass ; + rdfs:label "my property" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:nodeKind at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithBlankNode ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b79526 ; + sh:value _:b55454 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithBlankNode ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b97614 ; + sh:value _:b55454 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithBlankNode ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b97860 ; + sh:value _:b55454 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithBlankNodeAndIRI ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b14975 ; + sh:value rdfs:Class ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithBlankNodeAndIRI ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b38619 ; + sh:value rdfs:Class ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithBlankNodeAndIRI ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b79526 ; + sh:value rdfs:Class ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithBlankNodeAndIRI ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b79526 ; + sh:value _:b67098 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithBlankNodeAndIRI ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b97614 ; + sh:value _:b67098 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithBlankNodeAndIRI ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b97860 ; + sh:value _:b67098 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithBlankNodeAndLiteral ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b3078 ; + sh:value "Literal" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithBlankNodeAndLiteral ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b38619 ; + sh:value "Literal" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithBlankNodeAndLiteral ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b79526 ; + sh:value _:b99026 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithBlankNodeAndLiteral ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b97614 ; + sh:value "Literal" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithBlankNodeAndLiteral ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b97614 ; + sh:value _:b99026 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithBlankNodeAndLiteral ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b97860 ; + sh:value _:b99026 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithIRI ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b14975 ; + sh:value rdfs:Class ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithIRI ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b38619 ; + sh:value rdfs:Class ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithIRI ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b79526 ; + sh:value rdfs:Class ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithIRIAndLiteral ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b3078 ; + sh:value "Literal" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithIRIAndLiteral ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b14975 ; + sh:value rdfs:Class ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithIRIAndLiteral ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b38619 ; + sh:value rdfs:Class ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithIRIAndLiteral ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b38619 ; + sh:value "Literal" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithIRIAndLiteral ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b79526 ; + sh:value rdfs:Class ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithIRIAndLiteral ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b97614 ; + sh:value "Literal" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithLiteral ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b3078 ; + sh:value "Literal" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithLiteral ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b38619 ; + sh:value "Literal" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InstanceWithLiteral ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; + sh:sourceShape _:b97614 ; + sh:value "Literal" ; + ] ; + ] ; + mf:status sht:approved ; +. +_:b3078 + sh:path ex:myProperty ; + sh:nodeKind sh:BlankNodeOrIRI ; +. +_:b14975 + sh:path ex:myProperty ; + sh:nodeKind sh:BlankNodeOrLiteral ; +. +_:b38619 + sh:path ex:myProperty ; + sh:nodeKind sh:BlankNode ; +. +_:b55454 + rdf:type rdfs:Resource ; +. +_:b67098 + rdf:type rdfs:Resource ; +. +_:b79526 + sh:path ex:myProperty ; + sh:nodeKind sh:Literal ; +. +_:b97614 + sh:path ex:myProperty ; + sh:nodeKind sh:IRI ; +. +_:b97860 + sh:path ex:myProperty ; + sh:nodeKind sh:IRIOrLiteral ; +. +_:b99026 + rdf:type rdfs:Resource ; +. diff --git a/src/test/resources/shacl/tests/core/property/not-001.ttl b/src/test/resources/shacl/tests/core/property/not-001.ttl new file mode 100644 index 000000000..bad0e6fb1 --- /dev/null +++ b/src/test/resources/shacl/tests/core/property/not-001.ttl @@ -0,0 +1,68 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidResource1 + rdf:type rdfs:Resource ; + ex:property 42 ; + ex:property "Test Valid" ; + rdfs:label "Invalid resource1" ; +. +ex:TestShape + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:property ex:TestShape-property ; + sh:targetNode ex:InvalidResource1 ; + sh:targetNode ex:ValidResource1 ; + sh:targetNode ex:ValidResource2 ; +. +ex:TestShape-property + sh:path ex:property ; + sh:not [ + sh:datatype xsd:integer ; + ] ; +. +ex:ValidResource1 + rdf:type rdfs:Resource ; + rdfs:label "Valid resource1" ; +. +ex:ValidResource2 + rdf:type rdfs:Resource ; + ex:property 1.5 ; + ex:property "String" ; + rdfs:label "Valid resource2" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:not at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultPath ex:property ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NotConstraintComponent ; + sh:sourceShape ex:TestShape-property ; + sh:value 42 ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/property/or-001.ttl b/src/test/resources/shacl/tests/core/property/or-001.ttl new file mode 100644 index 000000000..323ed0f57 --- /dev/null +++ b/src/test/resources/shacl/tests/core/property/or-001.ttl @@ -0,0 +1,76 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:Address + rdf:type rdfs:Class ; + rdfs:label "Address" ; + rdfs:subClassOf rdfs:Resource ; +. +ex:AddressShape + rdf:type sh:NodeShape ; + rdfs:label "Address shape" ; + sh:property ex:AddressShape-address ; + sh:targetNode ex:InvalidResource1 ; + sh:targetNode ex:ValidResource1 ; + sh:targetNode ex:ValidResource2 ; +. +ex:AddressShape-address + sh:path ex:address ; + sh:or ( + [ + sh:datatype xsd:string ; + ] + [ + sh:class ex:Address ; + ] + ) ; +. +ex:InvalidResource1 + rdf:type rdfs:Resource ; + ex:address "true"^^xsd:boolean ; +. +ex:ValidResource1 + rdf:type rdfs:Resource ; + ex:address "Home" ; +. +ex:ValidResource2 + rdf:type rdfs:Resource ; + ex:address [ + rdf:type ex:Address ; + ] ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:or at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultPath ex:address ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:OrConstraintComponent ; + sh:sourceShape ex:AddressShape-address ; + sh:value "true"^^xsd:boolean ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/property/or-datatypes-001.ttl b/src/test/resources/shacl/tests/core/property/or-datatypes-001.ttl new file mode 100644 index 000000000..dc59b4205 --- /dev/null +++ b/src/test/resources/shacl/tests/core/property/or-datatypes-001.ttl @@ -0,0 +1,95 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidResource1 + rdf:type rdfs:Resource ; + rdfs:comment owl:Thing ; + rdfs:comment 42 ; + rdfs:comment "A string" ; + rdfs:comment "none"^^xsd:boolean ; + rdfs:label "Invalid resource1" ; +. +ex:TestShape + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:property ex:TestShape-comment ; + sh:targetNode ex:InvalidResource1 ; + sh:targetNode ex:ValidResource1 ; +. +ex:TestShape-comment + sh:path rdfs:comment ; + sh:or ( + [ + sh:datatype xsd:string ; + ] + [ + sh:datatype rdf:HTML ; + ] + [ + sh:datatype rdf:langString ; + ] + [ + sh:datatype xsd:boolean ; + ] + ) ; +. +ex:ValidResource1 + rdf:type rdfs:Resource ; + rdfs:comment "
HTML
"^^rdf:HTML ; + rdfs:comment "A language string"@en ; + rdfs:comment "A string" ; + rdfs:label "Valid resource1" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:or of sh:datatypes at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultPath rdfs:comment ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:OrConstraintComponent ; + sh:sourceShape ex:TestShape-comment ; + sh:value owl:Thing ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultPath rdfs:comment ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:OrConstraintComponent ; + sh:sourceShape ex:TestShape-comment ; + sh:value 42 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultPath rdfs:comment ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:OrConstraintComponent ; + sh:sourceShape ex:TestShape-comment ; + sh:value "none"^^xsd:boolean ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/property/pattern-001.ttl b/src/test/resources/shacl/tests/core/property/pattern-001.ttl new file mode 100644 index 000000000..2c63ad801 --- /dev/null +++ b/src/test/resources/shacl/tests/core/property/pattern-001.ttl @@ -0,0 +1,74 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidInstance1 + rdf:type ex:TestShape ; + ex:property "Maria" ; + rdfs:label "Invalid instance1" ; +. +ex:InvalidInstance2 + rdf:type ex:TestShape ; + ex:property "john" ; + rdfs:label "Invalid instance2" ; +. +ex:TestShape + rdf:type rdfs:Class ; + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:property ex:TestShape-property ; +. +ex:TestShape-property + sh:path ex:property ; + sh:datatype xsd:string ; + sh:pattern "Joh" ; +. +ex:ValidInstance1 + rdf:type ex:TestShape ; + ex:property "Hi Joh" ; + ex:property "John" ; + rdfs:label "Valid instance1" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:pattern at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance1 ; + sh:resultPath ex:property ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:PatternConstraintComponent ; + sh:sourceShape ex:TestShape-property ; + sh:value "Maria" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance2 ; + sh:resultPath ex:property ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:PatternConstraintComponent ; + sh:sourceShape ex:TestShape-property ; + sh:value "john" ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/property/pattern-002.ttl b/src/test/resources/shacl/tests/core/property/pattern-002.ttl new file mode 100644 index 000000000..498c2a3a1 --- /dev/null +++ b/src/test/resources/shacl/tests/core/property/pattern-002.ttl @@ -0,0 +1,66 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidInstance1 + rdf:type ex:TestShape ; + ex:property "Maria" ; + rdfs:label "Invalid instance1" ; +. +ex:TestShape + rdf:type rdfs:Class ; + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:property ex:TestShape-property ; +. +ex:TestShape-property + sh:path ex:property ; + rdfs:label "property" ; + sh:datatype xsd:string ; + sh:flags "i" ; + sh:pattern "joh" ; +. +ex:ValidInstance1 + rdf:type ex:TestShape ; + ex:property "Hi Joh" ; + ex:property "John" ; + rdfs:label "Valid instance1" ; +. +ex:ValidInstance2 + rdf:type ex:TestShape ; + ex:property "john" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:pattern at property shape 002" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance1 ; + sh:resultPath ex:property ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:PatternConstraintComponent ; + sh:sourceShape ex:TestShape-property ; + sh:value "Maria" ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/property/property-001.ttl b/src/test/resources/shacl/tests/core/property/property-001.ttl new file mode 100644 index 000000000..cd7bfd42f --- /dev/null +++ b/src/test/resources/shacl/tests/core/property/property-001.ttl @@ -0,0 +1,100 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:Address + rdf:type rdfs:Class ; + rdfs:label "Address" ; + rdfs:subClassOf rdfs:Resource ; +. +ex:City + rdf:type rdfs:Class ; + rdfs:label "City" ; + rdfs:subClassOf rdfs:Resource ; +. +ex:InvalidAddress + rdf:type ex:Address ; + ex:city ex:InvalidCity ; +. +ex:InvalidPerson1 + rdf:type ex:Person ; + ex:address ex:InvalidAddress ; +. +ex:InvalidPerson2 + rdf:type ex:Person ; + ex:address ex:InvalidAddress ; + ex:address ex:ValidAddress ; +. +ex:Person + rdf:type rdfs:Class ; + rdfs:label "Person" ; + rdfs:subClassOf rdfs:Resource ; +. +ex:PersonShape + rdf:type sh:NodeShape ; + rdfs:label "Person shape" ; + sh:property [ + sh:path ex:address ; + sh:property ex:PersonShape-address-city ; + ] ; + sh:targetClass ex:Person ; +. +ex:PersonShape-address-city + sh:path ex:city ; + sh:class ex:City ; +. +ex:ProperCity + rdf:type ex:City ; + rdfs:label "Proper city" ; +. +ex:ValidAddress + rdf:type ex:Address ; + ex:city ex:ProperCity ; +. +ex:ValidPerson1 + rdf:type ex:Person ; + ex:address ex:ValidAddress ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:property at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidAddress ; + sh:resultPath ex:city ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:ClassConstraintComponent ; + sh:sourceShape ex:PersonShape-address-city ; + sh:value ex:InvalidCity ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidAddress ; + sh:resultPath ex:city ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:ClassConstraintComponent ; + sh:sourceShape ex:PersonShape-address-city ; + sh:value ex:InvalidCity ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/property/qualifiedMinCountDisjoint-001.ttl b/src/test/resources/shacl/tests/core/property/qualifiedMinCountDisjoint-001.ttl new file mode 100644 index 000000000..00d91c248 --- /dev/null +++ b/src/test/resources/shacl/tests/core/property/qualifiedMinCountDisjoint-001.ttl @@ -0,0 +1,116 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:Digit + rdf:type rdfs:Class ; + rdfs:label "Digit" ; +. +ex:Finger + rdf:type rdfs:Class ; + rdfs:label "Finger" ; + rdfs:subClassOf ex:Digit ; +. +ex:FingerAndThumb + rdf:type ex:Finger ; + rdf:type ex:Thumb ; + rdfs:label "Finger and thumb" ; +. +ex:FingerShape + rdf:type sh:NodeShape ; + rdfs:label "Finger shape" ; + sh:class ex:Finger ; +. +ex:Finger_1 + rdf:type ex:Finger ; + rdfs:label "Finger 1" ; +. +ex:Hand + rdf:type rdfs:Class ; + rdfs:label "Hand" ; +. +ex:HandShape + rdf:type sh:NodeShape ; + rdfs:label "Hand shape" ; + sh:property ex:HandShape-digit-maxCount4 ; + sh:property ex:HandShape-digit-minCount1 ; + sh:targetClass ex:Hand ; +. +ex:HandShape-digit-maxCount4 + rdf:type sh:PropertyShape ; + sh:path ex:digit ; + sh:qualifiedMaxCount 4 ; + sh:qualifiedValueShape ex:FingerShape ; + sh:qualifiedValueShapesDisjoint "true"^^xsd:boolean ; +. +ex:HandShape-digit-minCount1 + rdf:type sh:PropertyShape ; + sh:path ex:digit ; + sh:qualifiedMinCount 1 ; + sh:qualifiedValueShape ex:ThumbShape ; + sh:qualifiedValueShapesDisjoint "true"^^xsd:boolean ; +. +ex:InvalidHand1 + rdf:type ex:Hand ; + ex:digit ex:FingerAndThumb ; + rdfs:label "Invalid hand1" ; +. +ex:Thumb + rdf:type rdfs:Class ; + rdfs:label "Thumb" ; + rdfs:subClassOf ex:Digit ; +. +ex:ThumbShape + rdf:type sh:NodeShape ; + rdfs:label "Thumb shape" ; + sh:class ex:Thumb ; +. +ex:Thumb_1 + rdf:type ex:Thumb ; + rdfs:label "Thumb 1" ; +. +ex:ValidHand1 + rdf:type ex:Hand ; + ex:digit ex:Finger_1 ; + ex:digit ex:Thumb_1 ; + rdfs:label "Valid hand1" ; +. +ex:digit + rdf:type rdf:Property ; + rdfs:domain ex:Hand ; + rdfs:label "digit" ; + rdfs:range ex:Digit ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:qualifiedMinCount with disjoint shapes at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidHand1 ; + sh:resultPath ex:digit ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:QualifiedMinCountConstraintComponent ; + sh:sourceShape ex:HandShape-digit-minCount1 ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/property/qualifiedValueShape-001.ttl b/src/test/resources/shacl/tests/core/property/qualifiedValueShape-001.ttl new file mode 100644 index 000000000..ead8f719c --- /dev/null +++ b/src/test/resources/shacl/tests/core/property/qualifiedValueShape-001.ttl @@ -0,0 +1,80 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:APGARObservationShape + rdf:type sh:NodeShape ; + sh:property ex:APGARObservationShape-related ; + sh:targetNode ex:Observation1 ; +. +ex:APGARObservationShape-related + sh:path ex:related ; + sh:qualifiedMaxCount 3 ; + sh:qualifiedMinCount 3 ; + sh:qualifiedValueShape [ + sh:property [ + sh:path ex:related_target ; + sh:node [ + sh:property [ + sh:path ex:reference ; + sh:hasValue ex:something ; + ] ; + ] ; + ] ; + ] ; +. +ex:Observation1 + rdf:type ex:Observation ; + ex:related [ + ex:related_target [ + ex:reference ex:something ; + ] ; + ex:related_type "has-component"^^ex:code ; + ] ; + ex:related [ + ex:related_target [ + ex:reference ex:something ; + ] ; + ex:related_type "has-component"^^ex:code ; + ] ; + ex:related [ + ex:related_target [ + ex:reference ex:unrelated ; + ] ; + ex:related_type "has-component"^^ex:code ; + ] ; + sh:nodeShape ex:APGARObservationShape ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:qualifiedValueShape at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:Observation1 ; + sh:resultPath ex:related ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:QualifiedMinCountConstraintComponent ; + sh:sourceShape ex:APGARObservationShape-related ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/property/qualifiedValueShapesDisjoint-001.ttl b/src/test/resources/shacl/tests/core/property/qualifiedValueShapesDisjoint-001.ttl new file mode 100644 index 000000000..1cc8cbc1c --- /dev/null +++ b/src/test/resources/shacl/tests/core/property/qualifiedValueShapesDisjoint-001.ttl @@ -0,0 +1,128 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:Finger + rdf:type rdfs:Class ; + rdf:type sh:NodeShape ; + rdfs:label "Finger" ; + rdfs:subClassOf rdfs:Resource ; +. +ex:Finger1 + rdf:type ex:Finger ; + rdfs:label "Finger1" ; +. +ex:Finger2 + rdf:type ex:Finger ; + rdfs:label "Finger2" ; +. +ex:Finger3 + rdf:type ex:Finger ; + rdfs:label "Finger3" ; +. +ex:Finger4 + rdf:type ex:Finger ; + rdfs:label "Finger4" ; +. +ex:FingerAndThumb + rdf:type ex:Finger ; + rdf:type ex:Thumb ; + rdfs:label "Finger and thumb" ; +. +ex:Hand + rdf:type rdfs:Class ; + rdf:type sh:NodeShape ; + rdfs:label "Hand" ; + rdfs:subClassOf rdfs:Resource ; +. +ex:HandShape + rdf:type sh:NodeShape ; + sh:property ex:HandShape-digit1 ; + sh:property ex:HandShape-digit4 ; + sh:targetClass ex:Hand ; +. +ex:HandShape-digit1 + sh:path ex:digit ; + sh:qualifiedMaxCount 1 ; + sh:qualifiedMinCount 1 ; + sh:qualifiedValueShape [ + sh:class ex:Thumb ; + ] ; + sh:qualifiedValueShapesDisjoint "true"^^xsd:boolean ; +. +ex:HandShape-digit4 + sh:path ex:digit ; + sh:qualifiedMaxCount 4 ; + sh:qualifiedMinCount 4 ; + sh:qualifiedValueShape [ + sh:class ex:Finger ; + ] ; + sh:qualifiedValueShapesDisjoint "true"^^xsd:boolean ; +. +ex:InvalidHand1 + rdf:type ex:Hand ; + ex:digit ex:Finger1 ; + ex:digit ex:Finger2 ; + ex:digit ex:Finger3 ; + ex:digit ex:FingerAndThumb ; +. +ex:Thumb + rdf:type rdfs:Class ; + rdf:type sh:NodeShape ; + rdfs:label "Thumb" ; + rdfs:subClassOf rdfs:Resource ; +. +ex:Thumb1 + rdf:type ex:Thumb ; + rdfs:label "Thumb1" ; +. +ex:ValidHand + rdf:type ex:Hand ; + ex:digit ex:Finger1 ; + ex:digit ex:Finger2 ; + ex:digit ex:Finger3 ; + ex:digit ex:Finger4 ; + ex:digit ex:Thumb1 ; + rdfs:label "Valid hand" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:qualifiedValueShapesDisjoint at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidHand1 ; + sh:resultPath ex:digit ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:QualifiedMinCountConstraintComponent ; + sh:sourceShape ex:HandShape-digit1 ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidHand1 ; + sh:resultPath ex:digit ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:QualifiedMinCountConstraintComponent ; + sh:sourceShape ex:HandShape-digit4 ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/property/uniqueLang-001.ttl b/src/test/resources/shacl/tests/core/property/uniqueLang-001.ttl new file mode 100644 index 000000000..ffec0ff0f --- /dev/null +++ b/src/test/resources/shacl/tests/core/property/uniqueLang-001.ttl @@ -0,0 +1,86 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidInstance1 + rdf:type ex:TestShape ; + ex:testProperty "Me" ; + ex:testProperty "Me"@en ; + ex:testProperty "Moi"@fr ; + ex:testProperty "Myself"@en ; +. +ex:InvalidInstance2 + rdf:type ex:TestShape ; + ex:testProperty "I"@en ; + ex:testProperty "Ich"@de ; + ex:testProperty "Me"@en ; + ex:testProperty "Mich"@de ; + ex:testProperty "Myself"@en ; +. +ex:TestShape + rdf:type rdfs:Class ; + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:property ex:TestShape-testProperty ; +. +ex:TestShape-testProperty + sh:path ex:testProperty ; + rdfs:label "test property" ; + sh:uniqueLang "true"^^xsd:boolean ; +. +ex:ValidInstance1 + rdf:type ex:TestShape ; + ex:testProperty "Me" ; + ex:testProperty "Me"@en ; + ex:testProperty "Moi"@fr ; + ex:testProperty "Myself" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:uniqueLang at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance1 ; + sh:resultPath ex:testProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:UniqueLangConstraintComponent ; + sh:sourceShape ex:TestShape-testProperty ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance2 ; + sh:resultPath ex:testProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:UniqueLangConstraintComponent ; + sh:sourceShape ex:TestShape-testProperty ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance2 ; + sh:resultPath ex:testProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:UniqueLangConstraintComponent ; + sh:sourceShape ex:TestShape-testProperty ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/property/uniqueLang-002-data.ttl b/src/test/resources/shacl/tests/core/property/uniqueLang-002-data.ttl new file mode 100644 index 000000000..4db2738ec --- /dev/null +++ b/src/test/resources/shacl/tests/core/property/uniqueLang-002-data.ttl @@ -0,0 +1,3 @@ +@prefix ex: . + +ex:i ex:message "HI"@en, "Hi"@en . diff --git a/src/test/resources/shacl/tests/core/property/uniqueLang-002-shapes.ttl b/src/test/resources/shacl/tests/core/property/uniqueLang-002-shapes.ttl new file mode 100644 index 000000000..648d4821c --- /dev/null +++ b/src/test/resources/shacl/tests/core/property/uniqueLang-002-shapes.ttl @@ -0,0 +1,12 @@ +@prefix sh: . +@prefix ex: . +@prefix xsd: . + +ex:s1 a sh:PropertyShape ; + sh:targetNode ex:i ; + sh:path ex:message ; + sh:uniqueLang "1"^^xsd:boolean . + +# Note that the value above is "1"^^xsd:boolean, which is distinct from "true"^^xsd:boolean. +# Only true is mentioned in the spec, meaning that "1" will not activate the constraint +# and the constraint is being ignored. diff --git a/src/test/resources/shacl/tests/core/property/uniqueLang-002.ttl b/src/test/resources/shacl/tests/core/property/uniqueLang-002.ttl new file mode 100644 index 000000000..c1b1f3bb2 --- /dev/null +++ b/src/test/resources/shacl/tests/core/property/uniqueLang-002.ttl @@ -0,0 +1,23 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +<> a mf:Manifest ; + mf:entries ( + + ) . + + a sht:Validate ; + rdfs:label "Test uniqueLang with other boolean literal for true" ; + mf:action [ + sht:dataGraph ; + sht:shapesGraph ] ; + mf:result [ a sh:ValidationReport ; + sh:conforms "true"^^xsd:boolean ] ; + mf:status sht:approved . diff --git a/src/test/resources/shacl/tests/core/targets/manifest.ttl b/src/test/resources/shacl/tests/core/targets/manifest.ttl new file mode 100644 index 000000000..ee7699b77 --- /dev/null +++ b/src/test/resources/shacl/tests/core/targets/manifest.ttl @@ -0,0 +1,15 @@ +@prefix mf: . +@prefix rdfs: . +@prefix sht: . + +<> + a mf:Manifest ; + rdfs:label "Tests converted from http://datashapes.org/sh/tests/tests/core/targets" ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + . \ No newline at end of file diff --git a/src/test/resources/shacl/tests/core/targets/multipleTargets-001.ttl b/src/test/resources/shacl/tests/core/targets/multipleTargets-001.ttl new file mode 100644 index 000000000..81a99e810 --- /dev/null +++ b/src/test/resources/shacl/tests/core/targets/multipleTargets-001.ttl @@ -0,0 +1,56 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidResource1 + ex:property1 "Also a value" ; +. +ex:TestShape + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:in ( + ex:ValidResource1 + ex:ValidResource2 + ) ; + sh:targetSubjectsOf ex:property1 ; + sh:targetSubjectsOf ex:property2 ; +. +ex:ValidResource1 + ex:property1 "Some value" ; +. +ex:ValidResource2 + ex:property2 "Other value" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of multiple targets 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:InConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:InvalidResource1 ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/targets/targetClass-001.ttl b/src/test/resources/shacl/tests/core/targets/targetClass-001.ttl new file mode 100644 index 000000000..e1d5a55cb --- /dev/null +++ b/src/test/resources/shacl/tests/core/targets/targetClass-001.ttl @@ -0,0 +1,62 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidInstance1 + rdf:type ex:MyClass ; + ex:myProperty "A" ; + ex:myProperty "B" ; +. +ex:MyClass + rdf:type rdfs:Class ; +. +ex:MyShape + rdf:type sh:NodeShape ; + sh:property ex:MyShape-myProperty ; + sh:targetClass ex:MyClass ; +. +ex:MyShape-myProperty + sh:path ex:myProperty ; + sh:maxCount 1 ; +. +ex:ValidInstance1 + rdf:type ex:MyClass ; + ex:myProperty "A" ; +. +ex:ValidInstance2 + ex:myProperty "A" ; + ex:myProperty "B" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:targetClass 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance1 ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxCountConstraintComponent ; + sh:sourceShape ex:MyShape-myProperty ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/targets/targetClassImplicit-001.ttl b/src/test/resources/shacl/tests/core/targets/targetClassImplicit-001.ttl new file mode 100644 index 000000000..05cafccbb --- /dev/null +++ b/src/test/resources/shacl/tests/core/targets/targetClassImplicit-001.ttl @@ -0,0 +1,58 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidInstance + rdf:type ex:SubClass ; + rdfs:label "Invalid instance" ; +. +ex:SubClass + rdf:type rdfs:Class ; + rdfs:label "Sub class" ; + rdfs:subClassOf ex:SuperClass ; +. +ex:SuperClass + rdf:type rdfs:Class ; + rdf:type sh:NodeShape ; + rdfs:label "Super class" ; + sh:in ( + ex:ValidInstance + ) ; +. +ex:ValidInstance + rdf:type ex:SubClass ; + rdfs:label "Valid instance" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of implicit sh:targetClass 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:InConstraintComponent ; + sh:sourceShape ex:SuperClass ; + sh:value ex:InvalidInstance ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/targets/targetNode-001.ttl b/src/test/resources/shacl/tests/core/targets/targetNode-001.ttl new file mode 100644 index 000000000..195e3ffcf --- /dev/null +++ b/src/test/resources/shacl/tests/core/targets/targetNode-001.ttl @@ -0,0 +1,57 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidResource1 + rdf:type rdfs:Resource ; + rdfs:label "Invalid resource 1" ; +. +ex:TestShape + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:property ex:TestShape-label ; + sh:targetNode ex:InvalidResource1 ; + sh:targetNode ex:ValidResource1 ; +. +ex:TestShape-label + sh:path rdfs:label ; + rdfs:label "label" ; + sh:datatype xsd:string ; + sh:maxCount 0 ; +. +ex:ValidResource1 + rdf:type rdfs:Resource ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:targetNode 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultPath rdfs:label ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxCountConstraintComponent ; + sh:sourceShape ex:TestShape-label ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/targets/targetObjectsOf-001.ttl b/src/test/resources/shacl/tests/core/targets/targetObjectsOf-001.ttl new file mode 100644 index 000000000..09eeea655 --- /dev/null +++ b/src/test/resources/shacl/tests/core/targets/targetObjectsOf-001.ttl @@ -0,0 +1,65 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidResource1 + ex:testProperty "String" ; +. +ex:InvalidResource2 + ex:testProperty rdfs:Resource ; +. +ex:TestShape + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:datatype xsd:integer ; + sh:targetObjectsOf ex:testProperty ; +. +ex:ValidResource1 + ex:testProperty 100 ; + ex:testProperty 42 ; +. +ex:testProperty + rdf:type rdf:Property ; + rdfs:label "test property" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:targetObjectsOf 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode rdfs:Resource ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value rdfs:Resource ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode "String" ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value "String" ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/targets/targetSubjectsOf-001.ttl b/src/test/resources/shacl/tests/core/targets/targetSubjectsOf-001.ttl new file mode 100644 index 000000000..9069f17b0 --- /dev/null +++ b/src/test/resources/shacl/tests/core/targets/targetSubjectsOf-001.ttl @@ -0,0 +1,57 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidInstance1 + ex:myProperty "A" ; + ex:myProperty "B" ; +. +ex:MyClass + rdf:type rdfs:Class ; +. +ex:TestShape + rdf:type sh:NodeShape ; + sh:property ex:TestShape-myProperty ; + sh:targetSubjectsOf ex:myProperty ; +. +ex:TestShape-myProperty + rdf:type sh:PropertyShape ; + sh:path ex:myProperty ; + sh:maxCount 1 ; +. +ex:ValidInstance1 + ex:myProperty "A" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:targetSubjectsOf 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance1 ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxCountConstraintComponent ; + sh:sourceShape ex:TestShape-myProperty ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/targets/targetSubjectsOf-002.ttl b/src/test/resources/shacl/tests/core/targets/targetSubjectsOf-002.ttl new file mode 100644 index 000000000..e4adacdc2 --- /dev/null +++ b/src/test/resources/shacl/tests/core/targets/targetSubjectsOf-002.ttl @@ -0,0 +1,74 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidInstance1 + rdf:type ex:MyClass ; + ex:myProperty "A" ; + ex:myProperty "B" ; +. +ex:InvalidInstance2 + ex:myProperty "A" ; + ex:myProperty "B" ; +. +ex:MyClass + rdf:type rdfs:Class ; +. +ex:TestShape + rdf:type sh:NodeShape ; + sh:property ex:TestShape-myProperty ; + sh:targetClass ex:MyClass ; + sh:targetSubjectsOf ex:myProperty ; +. +ex:TestShape-myProperty + sh:path ex:myProperty ; + sh:maxCount 1 ; +. +ex:ValidInstance1 + rdf:type ex:MyClass ; + ex:myProperty "A" ; +. +ex:ValidInstance2 + ex:myProperty "A" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:targetSubjectsOf 002" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance1 ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxCountConstraintComponent ; + sh:sourceShape ex:TestShape-myProperty ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidInstance2 ; + sh:resultPath ex:myProperty ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxCountConstraintComponent ; + sh:sourceShape ex:TestShape-myProperty ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/core/validation-reports/manifest.ttl b/src/test/resources/shacl/tests/core/validation-reports/manifest.ttl new file mode 100644 index 000000000..b200ca17b --- /dev/null +++ b/src/test/resources/shacl/tests/core/validation-reports/manifest.ttl @@ -0,0 +1,9 @@ +@prefix mf: . +@prefix rdfs: . +@prefix sht: . + +<> + a mf:Manifest ; + rdfs:label "Tests for validation reports" ; + mf:include ; +. diff --git a/src/test/resources/shacl/tests/core/validation-reports/shared-data.ttl b/src/test/resources/shacl/tests/core/validation-reports/shared-data.ttl new file mode 100644 index 000000000..5263a71cc --- /dev/null +++ b/src/test/resources/shacl/tests/core/validation-reports/shared-data.ttl @@ -0,0 +1,4 @@ +@prefix ex: . +ex:i ex:p ex:j . +ex:i ex:q ex:j . +ex:j ex:r ex:k . diff --git a/src/test/resources/shacl/tests/core/validation-reports/shared-shapes.ttl b/src/test/resources/shacl/tests/core/validation-reports/shared-shapes.ttl new file mode 100644 index 000000000..26f4b7314 --- /dev/null +++ b/src/test/resources/shacl/tests/core/validation-reports/shared-shapes.ttl @@ -0,0 +1,16 @@ +@prefix sh: . +@prefix ex: . + +ex:s1 a sh:NodeShape ; + sh:targetNode ex:i ; + sh:property ex:s2 ; + sh:property ex:s3 . + +ex:s2 sh:path ex:p ; + sh:property ex:s4 . + +ex:s3 sh:path ex:q ; + sh:property ex:s4 . + +ex:s4 sh:path ex:r ; + sh:class ex:C . diff --git a/src/test/resources/shacl/tests/core/validation-reports/shared.ttl b/src/test/resources/shacl/tests/core/validation-reports/shared.ttl new file mode 100644 index 000000000..ae4b01ca1 --- /dev/null +++ b/src/test/resources/shacl/tests/core/validation-reports/shared.ttl @@ -0,0 +1,52 @@ +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +@prefix ex: . + +# This test case is under discussion, as there are different interpretations +# on whether the nested sh:property constraint that is reached twice should +# also be reported twice. + +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + + rdf:type sht:Validate; + rdfs:label "Test of validation report for shape shared by property constraints" ; + mf:action [ + sht:dataGraph ; + sht:shapesGraph + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:resultSeverity sh:Violation ; + sh:focusNode ex:j ; + sh:value ex:k ; + sh:resultPath ex:r ; + sh:sourceShape ex:s4 ; + sh:sourceConstraintComponent sh:ClassConstraintComponent + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:resultSeverity sh:Violation ; + sh:focusNode ex:j ; + sh:value ex:k ; + sh:resultPath ex:r ; + sh:sourceShape ex:s4 ; + sh:sourceConstraintComponent sh:ClassConstraintComponent + ] + ] ; + mf:status sht:approved . + \ No newline at end of file diff --git a/src/test/resources/shacl/tests/manifest.ttl b/src/test/resources/shacl/tests/manifest.ttl new file mode 100644 index 000000000..08a5a1b9c --- /dev/null +++ b/src/test/resources/shacl/tests/manifest.ttl @@ -0,0 +1,9 @@ +@prefix mf: . +@prefix rdfs: . +@prefix sht: . + +<> + a mf:Manifest ; + mf:include ; + mf:include ; + . \ No newline at end of file diff --git a/src/test/resources/shacl/tests/sparql/component/manifest.ttl b/src/test/resources/shacl/tests/sparql/component/manifest.ttl new file mode 100644 index 000000000..631566a2f --- /dev/null +++ b/src/test/resources/shacl/tests/sparql/component/manifest.ttl @@ -0,0 +1,11 @@ +@prefix mf: . +@prefix rdfs: . +@prefix sht: . + +<> + a mf:Manifest ; + rdfs:label "Tests converted from http://datashapes.org/sh/tests/tests/sparql/component" ; + mf:include ; + mf:include ; + mf:include ; + . \ No newline at end of file diff --git a/src/test/resources/shacl/tests/sparql/component/nodeValidator-001.ttl b/src/test/resources/shacl/tests/sparql/component/nodeValidator-001.ttl new file mode 100644 index 000000000..1bcabc45c --- /dev/null +++ b/src/test/resources/shacl/tests/sparql/component/nodeValidator-001.ttl @@ -0,0 +1,83 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + + + sh:declare [ + rdf:type sh:PrefixDeclaration ; + sh:namespace "http://datashapes.org/sh/tests/sparql/component/nodeValidator-001.test#"^^xsd:anyURI ; + sh:prefix "ex" ; + ] ; +. +ex:InvalidResource1 + ex:property "Other" ; +. +ex:TestConstraintComponent + rdf:type sh:ConstraintComponent ; + rdfs:label "Test constraint component" ; + sh:nodeValidator [ + rdf:type sh:SPARQLSelectValidator ; + sh:select """ + SELECT DISTINCT $this + WHERE { + $this ?p ?o . + FILTER NOT EXISTS { + $this ex:property ?requiredParam . + }}""" ; + sh:prefixes ; + ] ; + sh:parameter [ + sh:path ex:optionalParam ; + sh:datatype xsd:integer ; + sh:name "optional param" ; + sh:optional "true"^^xsd:boolean ; + ] ; + sh:parameter [ + sh:path ex:requiredParam ; + sh:datatype xsd:string ; + sh:name "required param" ; + ] ; +. +ex:TestShape + rdf:type sh:NodeShape ; + ex:requiredParam "Value" ; + rdfs:label "Test shape" ; + sh:targetNode ex:InvalidResource1 ; + sh:targetNode ex:ValidResource1 ; +. +ex:ValidResource1 + ex:property "Value" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:nodeValidator 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent ex:TestConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:InvalidResource1 ; + ] ; + ] ; + mf:status sht:proposed ; +. \ No newline at end of file diff --git a/src/test/resources/shacl/tests/sparql/component/optional-001.ttl b/src/test/resources/shacl/tests/sparql/component/optional-001.ttl new file mode 100644 index 000000000..0f3ba1f89 --- /dev/null +++ b/src/test/resources/shacl/tests/sparql/component/optional-001.ttl @@ -0,0 +1,113 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + + + sh:declare [ + rdf:type sh:PrefixDeclaration ; + sh:namespace "http://datashapes.org/sh/tests/sparql/component/optional-001.test#"^^xsd:anyURI ; + sh:prefix "ex" ; + ] ; +. +ex:IncompleteShape + rdf:type sh:NodeShape ; + ex:optionalParam "Some" ; + rdfs:label "Incomplete shape" ; + sh:targetNode "One" ; + sh:targetNode "Three" ; + sh:targetNode "Two" ; +. +ex:TestConstraintComponent + rdf:type sh:ConstraintComponent ; + rdfs:label "Test constraint component" ; + sh:parameter [ + sh:path ex:optionalParam ; + sh:name "optional param" ; + sh:optional "true"^^xsd:boolean ; + ] ; + sh:parameter [ + sh:path ex:requiredParam ; + sh:name "required param" ; + ] ; + sh:validator [ + rdf:type sh:SPARQLAskValidator ; + sh:ask """ASK { + FILTER ($value != $requiredParam && $value != COALESCE(?optionalParam, \"Three\")) . +}""" ; + sh:prefixes ; + ] ; +. +ex:TestShape1 + rdf:type sh:NodeShape ; + ex:requiredParam "One" ; + rdfs:label "Test shape 1" ; + sh:targetNode "One" ; + sh:targetNode "Three" ; + sh:targetNode "Two" ; +. +ex:TestShape2 + rdf:type sh:NodeShape ; + ex:optionalParam "Two" ; + ex:requiredParam "One" ; + rdfs:label "Test shape 1" ; + sh:targetNode "One" ; + sh:targetNode "Three" ; + sh:targetNode "Two" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:optional 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode "One" ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent ex:TestConstraintComponent ; + sh:sourceShape ex:TestShape1 ; + sh:value "One" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode "One" ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent ex:TestConstraintComponent ; + sh:sourceShape ex:TestShape2 ; + sh:value "One" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode "Three" ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent ex:TestConstraintComponent ; + sh:sourceShape ex:TestShape1 ; + sh:value "Three" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode "Two" ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent ex:TestConstraintComponent ; + sh:sourceShape ex:TestShape2 ; + sh:value "Two" ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/sparql/component/propertyValidator-select-001.ttl b/src/test/resources/shacl/tests/sparql/component/propertyValidator-select-001.ttl new file mode 100644 index 000000000..a501c542f --- /dev/null +++ b/src/test/resources/shacl/tests/sparql/component/propertyValidator-select-001.ttl @@ -0,0 +1,107 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:Country + rdf:type rdfs:Class ; + rdfs:label "Country" ; +. +ex:InvalidCountry1 + rdf:type ex:Country ; + ex:englishLabel "Munich" ; + ex:germanLabel "Muenchen" ; + rdfs:label "Invalid country1" ; +. +ex:LanguageConstraintComponentUsingSELECT + rdf:type sh:ConstraintComponent ; + rdfs:label "Language constraint component" ; + sh:labelTemplate "Values are literals with language \"{$lang}\"" ; + sh:parameter [ + sh:path ex:lang ; + sh:datatype xsd:string ; + sh:description "The language tag, e.g. \"de\"." ; + sh:minLength 2 ; + sh:name "language" ; + ] ; + sh:propertyValidator [ + rdf:type sh:SPARQLSelectValidator ; + sh:message "Values are literals with language \"{?lang}\"" ; + sh:prefixes ; + sh:select """ + SELECT DISTINCT $this ?value + WHERE { + $this $PATH ?value . + FILTER (!isLiteral(?value) || !langMatches(lang(?value), $lang)) + } + """ ; + ] ; +. +ex:LanguageExampleShape + rdf:type sh:NodeShape ; + sh:property _:b56647 ; + sh:property _:b71712 ; + sh:targetClass ex:Country ; +. +ex:ValidCountry1 + rdf:type ex:Country ; + ex:englishLabel "Beijing"@en ; + ex:germanLabel "Peking"@de ; + rdfs:label "Valid country1" ; +. +ex:englishLabel + rdfs:domain ex:Country ; +. +ex:germanLabel + rdfs:domain ex:Country ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:propertyValidator with SELECT 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidCountry1 ; + sh:resultPath ex:englishLabel ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent ex:LanguageConstraintComponentUsingSELECT ; + sh:sourceShape _:b56647 ; + sh:value "Munich" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidCountry1 ; + sh:resultPath ex:germanLabel ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent ex:LanguageConstraintComponentUsingSELECT ; + sh:sourceShape _:b71712 ; + sh:value "Muenchen" ; + ] ; + ] ; + mf:status sht:approved ; +. +_:b56647 + sh:path ex:englishLabel ; + ex:lang "en" ; +. +_:b71712 + sh:path ex:germanLabel ; + ex:lang "de" ; +. diff --git a/src/test/resources/shacl/tests/sparql/component/validator-001.ttl b/src/test/resources/shacl/tests/sparql/component/validator-001.ttl new file mode 100644 index 000000000..67b9d94ac --- /dev/null +++ b/src/test/resources/shacl/tests/sparql/component/validator-001.ttl @@ -0,0 +1,81 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + + + owl:imports ; +. +ex:ConstraintComponent + rdf:type rdfs:Class ; + rdfs:label "Constraint component" ; + rdfs:subClassOf sh:ConstraintComponent ; +. +ex:SPARQLAskValidator + rdfs:subClassOf sh:SPARQLAskValidator ; +. +ex:TestConstraintComponent + rdf:type ex:ConstraintComponent ; + rdfs:comment """A simple test component with two parameters, which flags all values as invalid unless they are the concatenation of the two parameters. + +Part of this test is to also use various subclasses of the system classes.""" ; + rdfs:label "Test constraint component" ; + sh:parameter ex:TestParameter1 ; + sh:parameter ex:TestParameter2 ; + sh:validator [ + rdf:type ex:SPARQLAskValidator ; + sh:ask """ +ASK { FILTER (?value = CONCAT($test1, $test2)) } + """ ; + ] ; +. +ex:TestParameter1 + rdf:type sh:Parameter ; + sh:path ex:test1 ; + sh:datatype xsd:string ; +. +ex:TestParameter2 + rdf:type sh:Parameter ; + sh:path ex:test2 ; + sh:datatype xsd:string ; +. +ex:TestShape + rdf:type sh:NodeShape ; + ex:test1 "Hello " ; + ex:test2 "World" ; + rdfs:label "Test shape" ; + sh:targetNode "Hallo Welt" ; + sh:targetNode "Hello World" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:validator 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode "Hallo Welt" ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent ex:TestConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value "Hallo Welt" ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/sparql/manifest.ttl b/src/test/resources/shacl/tests/sparql/manifest.ttl new file mode 100644 index 000000000..d823c551a --- /dev/null +++ b/src/test/resources/shacl/tests/sparql/manifest.ttl @@ -0,0 +1,11 @@ +@prefix mf: . +@prefix rdfs: . +@prefix sht: . + +<> + a mf:Manifest ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + . diff --git a/src/test/resources/shacl/tests/sparql/node/manifest.ttl b/src/test/resources/shacl/tests/sparql/node/manifest.ttl new file mode 100644 index 000000000..c5f4b86e4 --- /dev/null +++ b/src/test/resources/shacl/tests/sparql/node/manifest.ttl @@ -0,0 +1,12 @@ +@prefix mf: . +@prefix rdfs: . +@prefix sht: . + +<> + a mf:Manifest ; + rdfs:label "Tests converted from http://datashapes.org/sh/tests/tests/sparql/node" ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + . \ No newline at end of file diff --git a/src/test/resources/shacl/tests/sparql/node/prefixes-001.ttl b/src/test/resources/shacl/tests/sparql/node/prefixes-001.ttl new file mode 100644 index 000000000..de29d1f6a --- /dev/null +++ b/src/test/resources/shacl/tests/sparql/node/prefixes-001.ttl @@ -0,0 +1,70 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + + + sh:declare [ + rdf:type sh:PrefixDeclaration ; + sh:namespace "http://datashapes.org/sh/tests/sparql/node/prefixes-001.test#"^^xsd:anyURI ; + sh:prefix "ex" ; + ] ; +. +ex:InvalidResource1 + ex:property ; +. +ex:TestPrefixes + owl:imports ; + sh:declare [ + sh:namespace "http://test.com/ns#"^^xsd:anyURI ; + sh:prefix "test" ; + ] ; +. +ex:TestSPARQL + sh:prefixes ex:TestPrefixes ; + sh:select """ + SELECT $this ?value + WHERE { + $this ex:property ?value . + FILTER (?value = test:Value) . + } """ ; +. +ex:TestShape + rdf:type sh:NodeShape ; + sh:sparql ex:TestSPARQL ; + sh:targetNode ex:InvalidResource1 ; + sh:targetNode ex:ValidResource1 ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:prefixes 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraint ex:TestSPARQL ; + sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/sparql/node/sparql-001.ttl b/src/test/resources/shacl/tests/sparql/node/sparql-001.ttl new file mode 100644 index 000000000..eae95ebcd --- /dev/null +++ b/src/test/resources/shacl/tests/sparql/node/sparql-001.ttl @@ -0,0 +1,89 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:InvalidResource1 + rdf:type rdfs:Resource ; + rdfs:label "Invalid resource 1" ; +. +ex:InvalidResource2 + rdf:type rdfs:Resource ; + rdfs:label "Invalid label 1" ; + rdfs:label "Invalid label 2" ; +. +ex:TestShape + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:sparql ex:TestShape-sparql ; + sh:targetNode ex:InvalidResource1 ; + sh:targetNode ex:InvalidResource2 ; + sh:targetNode ex:ValidResource1 ; +. +ex:TestShape-sparql + sh:message "Cannot have a label" ; + sh:prefixes ; + sh:select """ + SELECT $this ?path ?value + WHERE { + $this ?path ?value . + FILTER (?path = ) . + }""" ; +. +ex:ValidResource1 + rdf:type rdfs:Resource ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:sparql at node shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource1 ; + sh:resultPath rdfs:label ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraint ex:TestShape-sparql ; + sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value "Invalid resource 1" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource2 ; + sh:resultPath rdfs:label ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraint ex:TestShape-sparql ; + sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value "Invalid label 1" ; + ] ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource2 ; + sh:resultPath rdfs:label ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraint ex:TestShape-sparql ; + sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value "Invalid label 2" ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/sparql/node/sparql-002.ttl b/src/test/resources/shacl/tests/sparql/node/sparql-002.ttl new file mode 100644 index 000000000..e6dd7c11b --- /dev/null +++ b/src/test/resources/shacl/tests/sparql/node/sparql-002.ttl @@ -0,0 +1,69 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + + + sh:declare [ + rdf:type sh:PrefixDeclaration ; + sh:namespace "http://datashapes.org/sh/tests/sparql/node/sparql-002.test#"^^xsd:anyURI ; + sh:prefix "ex" ; + ] ; +. +ex:InvalidCountry + rdf:type ex:Country ; + ex:germanLabel "Spain"@en ; +. +ex:LanguageExampleShape + rdf:type sh:NodeShape ; + rdf:type sh:SPARQLConstraint ; + sh:message "Values are literals with German language tag." ; + sh:prefixes ; + sh:select """ + SELECT $this (ex:germanLabel AS ?path) ?value + WHERE { + $this ex:germanLabel ?value . + FILTER (!isLiteral(?value) || !langMatches(lang(?value), \"de\")) + } + """ ; + sh:sparql ex:LanguageExampleShape ; + sh:targetClass ex:Country ; +. +ex:ValidCountry + rdf:type ex:Country ; + ex:germanLabel "Spanien"@de ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:sparql at node shape 002" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidCountry ; + sh:resultPath ex:germanLabel ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraint ex:LanguageExampleShape ; + sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; + sh:sourceShape ex:LanguageExampleShape ; + sh:value "Spain"@en ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/sparql/node/sparql-003.ttl b/src/test/resources/shacl/tests/sparql/node/sparql-003.ttl new file mode 100644 index 000000000..2c603e1a6 --- /dev/null +++ b/src/test/resources/shacl/tests/sparql/node/sparql-003.ttl @@ -0,0 +1,70 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + + + sh:declare [ + rdf:type sh:PrefixDeclaration ; + sh:namespace "http://datashapes.org/sh/tests/sparql/node/sparql-003.test#"^^xsd:anyURI ; + sh:prefix "ex" ; + ] ; +. +ex:InvalidCountry + rdf:type ex:Country ; + ex:germanLabel "Spain"@en ; +. +ex:LanguageExampleShape + rdf:type sh:NodeShape ; + rdf:type sh:SPARQLConstraint ; + sh:message "Values are literals with German language tag." ; + sh:prefixes ; + sh:select """ + SELECT $this (ex:germanLabel AS ?path) + WHERE { + $this ex:germanLabel ?value . + FILTER (!isLiteral(?value) || !langMatches(lang(?value), \"de\")) + } + """ ; + sh:severity sh:Warning ; + sh:sparql ex:LanguageExampleShape ; + sh:targetClass ex:Country ; +. +ex:ValidCountry + rdf:type ex:Country ; + ex:germanLabel "Spanien"@de ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:sparql at node shape 003" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidCountry ; + sh:resultPath ex:germanLabel ; + sh:resultSeverity sh:Warning ; + sh:sourceConstraint ex:LanguageExampleShape ; + sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; + sh:sourceShape ex:LanguageExampleShape ; + sh:value ex:InvalidCountry ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/sparql/pre-binding/manifest.ttl b/src/test/resources/shacl/tests/sparql/pre-binding/manifest.ttl new file mode 100644 index 000000000..187159a61 --- /dev/null +++ b/src/test/resources/shacl/tests/sparql/pre-binding/manifest.ttl @@ -0,0 +1,22 @@ +@prefix mf: . +@prefix rdfs: . +@prefix sht: . + +<> + a mf:Manifest ; + rdfs:label "Tests for pre-binding" ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; +. diff --git a/src/test/resources/shacl/tests/sparql/pre-binding/pre-binding-001.ttl b/src/test/resources/shacl/tests/sparql/pre-binding/pre-binding-001.ttl new file mode 100644 index 000000000..cf9027541 --- /dev/null +++ b/src/test/resources/shacl/tests/sparql/pre-binding/pre-binding-001.ttl @@ -0,0 +1,63 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex: + sh:declare [ + sh:prefix "ex" ; + sh:namespace "http://datashapes.org/sh/tests/sparql/pre-binding/pre-binding-001.test#"^^xsd:anyURI ; + ] . + +ex:TestShape + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:sparql ex:TestShape-sparql ; + sh:targetNode ex:InvalidResource ; +. +ex:TestShape-sparql + sh:message "Test message" ; + sh:prefixes ex: ; + sh:select """ + SELECT $this + WHERE { + FILTER ($this = ex:InvalidResource) . + }""" ; +. +ex:ValidResource1 + rdf:type rdfs:Resource ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of pre-binding in FILTER" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource ; + sh:resultMessage "Test message" ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraint ex:TestShape-sparql ; + sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:InvalidResource ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/sparql/pre-binding/pre-binding-002.ttl b/src/test/resources/shacl/tests/sparql/pre-binding/pre-binding-002.ttl new file mode 100644 index 000000000..819b6816a --- /dev/null +++ b/src/test/resources/shacl/tests/sparql/pre-binding/pre-binding-002.ttl @@ -0,0 +1,67 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex: + sh:declare [ + sh:prefix "ex" ; + sh:namespace "http://datashapes.org/sh/tests/sparql/pre-binding/pre-binding-002.test#"^^xsd:anyURI ; + ] . + +ex:TestShape + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:sparql ex:TestShape-sparql ; + sh:targetNode ex:InvalidResource ; +. +ex:TestShape-sparql + sh:prefixes ex: ; + sh:select """ + SELECT $this + WHERE { + { + FILTER (false) . + } + UNION + { + FILTER ($this = ex:InvalidResource) . + } + }""" ; +. +ex:ValidResource1 + rdf:type rdfs:Resource ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of pre-binding in UNION" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraint ex:TestShape-sparql ; + sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:InvalidResource ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/sparql/pre-binding/pre-binding-003.ttl b/src/test/resources/shacl/tests/sparql/pre-binding/pre-binding-003.ttl new file mode 100644 index 000000000..2cc510c48 --- /dev/null +++ b/src/test/resources/shacl/tests/sparql/pre-binding/pre-binding-003.ttl @@ -0,0 +1,67 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex: + sh:declare [ + sh:prefix "ex" ; + sh:namespace "http://datashapes.org/sh/tests/sparql/pre-binding/pre-binding-003.test#"^^xsd:anyURI ; + ] . + +ex:TestShape + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:sparql ex:TestShape-sparql ; + sh:targetNode ex:InvalidResource ; +. +ex:TestShape-sparql + sh:prefixes ex: ; + sh:select """ + SELECT $this + WHERE { + { + { + FILTER ($this = ex:InvalidResource) . + } + FILTER bound($this) . + } + FILTER (true) . + }""" ; +. +ex:ValidResource1 + rdf:type rdfs:Resource ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of pre-binding in inner {...} blocks" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraint ex:TestShape-sparql ; + sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:InvalidResource ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/sparql/pre-binding/pre-binding-004.ttl b/src/test/resources/shacl/tests/sparql/pre-binding/pre-binding-004.ttl new file mode 100644 index 000000000..e19c2e0d0 --- /dev/null +++ b/src/test/resources/shacl/tests/sparql/pre-binding/pre-binding-004.ttl @@ -0,0 +1,62 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex: + sh:declare [ + sh:prefix "ex" ; + sh:namespace "http://datashapes.org/sh/tests/sparql/pre-binding/pre-binding-004.test#"^^xsd:anyURI ; + ] . + +ex:TestShape + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:sparql ex:TestShape-sparql ; + sh:targetNode ex:InvalidResource ; +. +ex:TestShape-sparql + sh:prefixes ex: ; + sh:select """ + SELECT $this + WHERE { + BIND ($this AS ?that) . + FILTER (?that = ex:InvalidResource) . + }""" ; +. +ex:ValidResource1 + rdf:type rdfs:Resource ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of pre-binding in BIND expressions" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraint ex:TestShape-sparql ; + sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:InvalidResource ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/sparql/pre-binding/pre-binding-005.ttl b/src/test/resources/shacl/tests/sparql/pre-binding/pre-binding-005.ttl new file mode 100644 index 000000000..83790bb3c --- /dev/null +++ b/src/test/resources/shacl/tests/sparql/pre-binding/pre-binding-005.ttl @@ -0,0 +1,68 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex: + sh:declare [ + sh:prefix "ex" ; + sh:namespace "http://datashapes.org/sh/tests/sparql/pre-binding/pre-binding-005.test#"^^xsd:anyURI ; + ] . + +ex:InvalidResource + ex:property "Label" . + +ex:TestShape + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:sparql ex:TestShape-sparql ; + sh:targetNode ex:InvalidResource ; +. +ex:TestShape-sparql + sh:prefixes ex: ; + sh:select """ + SELECT $this + WHERE { + { + FILTER (bound($this)) + } + $this ex:property "Label" . + FILTER (bound($this)) . + }""" ; +. +ex:ValidResource1 + rdf:type rdfs:Resource ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of pre-binding in BGP and FILTER" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraint ex:TestShape-sparql ; + sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:InvalidResource ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/sparql/pre-binding/pre-binding-006.ttl b/src/test/resources/shacl/tests/sparql/pre-binding/pre-binding-006.ttl new file mode 100644 index 000000000..5e8062b63 --- /dev/null +++ b/src/test/resources/shacl/tests/sparql/pre-binding/pre-binding-006.ttl @@ -0,0 +1,54 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex: + sh:declare [ + sh:prefix "ex" ; + sh:namespace "http://datashapes.org/sh/tests/sparql/pre-binding/pre-binding-006.test#"^^xsd:anyURI ; + ] . + +ex:TestShape + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:sparql ex:TestShape-sparql ; + sh:targetNode ex:InvalidResource ; +. +ex:TestShape-sparql + sh:prefixes ex: ; + sh:select """ + SELECT $this + WHERE { + { + SELECT * + WHERE { + FILTER ($this = ex:InvalidResource) . + } + } + }""" ; +. +ex:ValidResource1 + rdf:type rdfs:Resource ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of pre-binding in nested SELECT" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result sht:Failure ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/sparql/pre-binding/pre-binding-007.ttl b/src/test/resources/shacl/tests/sparql/pre-binding/pre-binding-007.ttl new file mode 100644 index 000000000..bba550e67 --- /dev/null +++ b/src/test/resources/shacl/tests/sparql/pre-binding/pre-binding-007.ttl @@ -0,0 +1,66 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex: + sh:declare [ + sh:prefix "ex" ; + sh:namespace "http://datashapes.org/sh/tests/sparql/pre-binding/pre-binding-007.test#"^^xsd:anyURI ; + ] . + +ex:TestShape + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:sparql ex:TestShape-sparql ; + sh:targetNode ex:InvalidResource ; +. +ex:TestShape-sparql + sh:prefixes ex: ; + sh:select """ + SELECT $this + WHERE { + { + SELECT $this + WHERE { + FILTER ($this = ex:InvalidResource) . + } + } + }""" ; +. +ex:ValidResource1 + rdf:type rdfs:Resource ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of pre-binding in nested SELECT" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraint ex:TestShape-sparql ; + sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:InvalidResource ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/sparql/pre-binding/shapesGraph-001.ttl b/src/test/resources/shacl/tests/sparql/pre-binding/shapesGraph-001.ttl new file mode 100644 index 000000000..c80585126 --- /dev/null +++ b/src/test/resources/shacl/tests/sparql/pre-binding/shapesGraph-001.ttl @@ -0,0 +1,64 @@ +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex: + sh:declare [ + sh:prefix "ex" ; + sh:namespace "http://datashapes.org/sh/tests/sparql/pre-binding/shapesGraph-001.test#"^^xsd:anyURI ; + ] . + +ex:TestShape + rdf:type sh:NodeShape ; + rdfs:label "Test shape" ; + sh:sparql ex:TestShape-sparql ; + sh:targetNode ex:InvalidResource ; + ex:property 42 ; +. +ex:TestShape-sparql + sh:message "Test message" ; + sh:prefixes ex: ; + sh:select """ + SELECT $this + WHERE { + FILTER bound($shapesGraph) . + GRAPH $shapesGraph { + FILTER bound($currentShape) . + $currentShape ex:property 42 . + } + }""" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of $shapesGraph and $currentShape" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidResource ; + sh:resultMessage "Test message" ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraint ex:TestShape-sparql ; + sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; + sh:sourceShape ex:TestShape ; + sh:value ex:InvalidResource ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/src/test/resources/shacl/tests/sparql/pre-binding/unsupported-sparql-001.ttl b/src/test/resources/shacl/tests/sparql/pre-binding/unsupported-sparql-001.ttl new file mode 100644 index 000000000..ddc007aae --- /dev/null +++ b/src/test/resources/shacl/tests/sparql/pre-binding/unsupported-sparql-001.ttl @@ -0,0 +1,34 @@ +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +<> + rdf:type mf:Manifest ; + mf:entries ( ) . + + + rdf:type sht:Validate ; + rdfs:label "Test of unsupported MINUS" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result sht:Failure ; + mf:status sht:approved . + +ex:TestShape + a sh:NodeShape ; + sh:targetNode ex:InvalidResource ; + sh:sparql [ + sh:select """ + SELECT $this + WHERE { + $this ?x ?any . + MINUS { $this ?x "Value" } + }""" ; + ] . diff --git a/src/test/resources/shacl/tests/sparql/pre-binding/unsupported-sparql-002.ttl b/src/test/resources/shacl/tests/sparql/pre-binding/unsupported-sparql-002.ttl new file mode 100644 index 000000000..529ef9a01 --- /dev/null +++ b/src/test/resources/shacl/tests/sparql/pre-binding/unsupported-sparql-002.ttl @@ -0,0 +1,33 @@ +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +<> + rdf:type mf:Manifest ; + mf:entries ( ) . + + + rdf:type sht:Validate ; + rdfs:label "Test of unsupported VALUES" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result sht:Failure ; + mf:status sht:approved . + +ex:TestShape + a sh:NodeShape ; + sh:targetNode ex:InvalidResource ; + sh:sparql [ + sh:select """ + SELECT $this + WHERE { + VALUES ?any { true } + }""" ; + ] . diff --git a/src/test/resources/shacl/tests/sparql/pre-binding/unsupported-sparql-003.ttl b/src/test/resources/shacl/tests/sparql/pre-binding/unsupported-sparql-003.ttl new file mode 100644 index 000000000..02c191ec8 --- /dev/null +++ b/src/test/resources/shacl/tests/sparql/pre-binding/unsupported-sparql-003.ttl @@ -0,0 +1,36 @@ +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +<> + rdf:type mf:Manifest ; + mf:entries ( ) . + + + rdf:type sht:Validate ; + rdfs:label "Test of unsupported SERVICE" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result sht:Failure ; + mf:status sht:approved . + +ex:TestShape + a sh:NodeShape ; + sh:targetNode ex:InvalidResource ; + sh:sparql [ + sh:select """ + SELECT $this + WHERE { + $this ?x ?any . + SERVICE { + ?a ?b ?c . + } + }""" ; + ] . diff --git a/src/test/resources/shacl/tests/sparql/pre-binding/unsupported-sparql-004.ttl b/src/test/resources/shacl/tests/sparql/pre-binding/unsupported-sparql-004.ttl new file mode 100644 index 000000000..7ebf22fa2 --- /dev/null +++ b/src/test/resources/shacl/tests/sparql/pre-binding/unsupported-sparql-004.ttl @@ -0,0 +1,39 @@ +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +<> + rdf:type mf:Manifest ; + mf:entries ( ) . + + + rdf:type sht:Validate ; + rdfs:label "Test of unsupported SELECT" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result sht:Failure ; + mf:status sht:approved . + +ex:TestShape + a sh:NodeShape ; + sh:targetNode ex:InvalidResource ; + sh:sparql [ + sh:select """ + SELECT $this + WHERE { + $this ?x ?any . + { + SELECT ?other ?b + WHERE { + ?other ?b ?c . + } + } + }""" ; + ] . diff --git a/src/test/resources/shacl/tests/sparql/pre-binding/unsupported-sparql-005.ttl b/src/test/resources/shacl/tests/sparql/pre-binding/unsupported-sparql-005.ttl new file mode 100644 index 000000000..3d47bce58 --- /dev/null +++ b/src/test/resources/shacl/tests/sparql/pre-binding/unsupported-sparql-005.ttl @@ -0,0 +1,33 @@ +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +<> + rdf:type mf:Manifest ; + mf:entries ( ) . + + + rdf:type sht:Validate ; + rdfs:label "Test of unsupported AS ?prebound" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result sht:Failure ; + mf:status sht:approved . + +ex:TestShape + a sh:NodeShape ; + sh:targetNode ex:InvalidResource ; + sh:sparql [ + sh:select """ + SELECT $this + WHERE { + BIND (true AS $this) . + }""" ; + ] . diff --git a/src/test/resources/shacl/tests/sparql/pre-binding/unsupported-sparql-006.ttl b/src/test/resources/shacl/tests/sparql/pre-binding/unsupported-sparql-006.ttl new file mode 100644 index 000000000..83a99204a --- /dev/null +++ b/src/test/resources/shacl/tests/sparql/pre-binding/unsupported-sparql-006.ttl @@ -0,0 +1,85 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:Country + rdf:type rdfs:Class ; + rdfs:label "Country" ; +. +ex:InvalidCountry1 + rdf:type ex:Country ; + ex:englishLabel "Munich" ; + ex:germanLabel "Muenchen" ; + rdfs:label "Invalid country1" ; +. +ex:LanguageConstraintComponentUsingASK + rdf:type sh:ConstraintComponent ; + rdfs:label "Language constraint component" ; + sh:labelTemplate "Values are literals with language \"{$lang}\"" ; + sh:parameter [ + sh:path ex:lang ; + sh:datatype xsd:string ; + sh:description "The language tag, e.g. \"de\"." ; + sh:minLength 2 ; + sh:name "language" ; + ] ; + sh:propertyValidator ex:hasLang ; +. +ex:LanguageExampleShape + rdf:type sh:NodeShape ; + sh:property _:b41651 ; + sh:property _:b75747 ; + sh:targetClass ex:Country ; +. +ex:ValidCountry1 + rdf:type ex:Country ; + ex:englishLabel "Beijing"@en ; + ex:germanLabel "Peking"@de ; + rdfs:label "Valid country1" ; +. +ex:englishLabel + rdfs:domain ex:Country ; +. +ex:germanLabel + rdfs:domain ex:Country ; +. +ex:hasLang + rdf:type sh:SPARQLAskValidator ; + sh:ask """ + ASK { + BIND (true AS ?value) . + FILTER (isLiteral(?value) && langMatches(lang(?value), $lang)) + } + """ ; + sh:message "Values are literals with language \"{?lang}\"" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of ASK trying to reassign ?value" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result sht:Failure ; + mf:status sht:approved ; +. +_:b41651 + sh:path ex:englishLabel ; + ex:lang "en" ; +. +_:b75747 + sh:path ex:germanLabel ; + ex:lang "de" ; +. diff --git a/src/test/resources/shacl/tests/sparql/property/manifest.ttl b/src/test/resources/shacl/tests/sparql/property/manifest.ttl new file mode 100644 index 000000000..bb76f42b9 --- /dev/null +++ b/src/test/resources/shacl/tests/sparql/property/manifest.ttl @@ -0,0 +1,9 @@ +@prefix mf: . +@prefix rdfs: . +@prefix sht: . + +<> + a mf:Manifest ; + rdfs:label "Tests converted from http://datashapes.org/sh/tests/tests/sparql/property" ; + mf:include ; + . \ No newline at end of file diff --git a/src/test/resources/shacl/tests/sparql/property/sparql-001.ttl b/src/test/resources/shacl/tests/sparql/property/sparql-001.ttl new file mode 100644 index 000000000..d7aae0320 --- /dev/null +++ b/src/test/resources/shacl/tests/sparql/property/sparql-001.ttl @@ -0,0 +1,68 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:Country + rdf:type rdfs:Class ; +. +ex:InvalidCountry + rdf:type ex:Country ; + ex:germanLabel "Spain"@en ; +. +ex:LanguageExamplePropertyShape + rdf:type sh:PropertyShape ; + sh:path ex:germanLabel ; + sh:sparql ex:LanguageExamplePropertyShape-sparql ; + sh:targetClass ex:Country ; +. +ex:LanguageExamplePropertyShape-sparql + rdf:type sh:SPARQLConstraint ; + sh:message "Values are literals with German language tag." ; + sh:prefixes ex: ; + sh:select """ + SELECT $this ?value + WHERE { + $this $PATH ?value . + FILTER (!isLiteral(?value) || !langMatches(lang(?value), \"de\")) + } + """ ; +. +ex:ValidCountry + rdf:type ex:Country ; + ex:germanLabel "Spanien"@de ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of sh:sparql at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:InvalidCountry ; + sh:resultPath ex:germanLabel ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraint ex:LanguageExamplePropertyShape-sparql ; + sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; + sh:sourceShape ex:LanguageExamplePropertyShape ; + sh:value "Spain"@en ; + ] ; + ] ; + mf:status sht:approved ; +.