All Downloads are FREE. Search and download functionalities are using the official Maven repository.

data-shapes-test-suite.tests.sparql.component.optional-001.ttl Maven / Gradle / Ivy

The newest version!
@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 ;
.




© 2015 - 2025 Weber Informatics LLC | Privacy Policy