@prefix rdf: . @prefix rdfs: . @prefix xsd: . @prefix owl: . @prefix qudt: . @prefix sh: . a owl:Ontology ; rdfs:isDefinedBy ; rdfs:label "QUDT Collection - USER TESTS - v 3.4.0" . sh:declare [ a sh:PrefixDeclaration ; sh:namespace "http://purl.org/dc/terms/"^^xsd:anyURI ; sh:prefix "dcterms" ; ] ; sh:declare [ a sh:PrefixDeclaration ; sh:namespace "http://qudt.org/schema/qudt/"^^xsd:anyURI ; sh:prefix "qudt" ; ] ; sh:declare [ a sh:PrefixDeclaration ; sh:namespace "http://qudt.org/vocab/dimensionvector/"^^xsd:anyURI ; sh:prefix "qkdv" ; ] ; sh:declare [ a sh:PrefixDeclaration ; sh:namespace "http://qudt.org/vocab/quantitykind/"^^xsd:anyURI ; sh:prefix "quantitykind" ; ] ; sh:declare [ a sh:PrefixDeclaration ; sh:namespace "http://qudt.org/vocab/unit/"^^xsd:anyURI ; sh:prefix "unit" ; ] ; sh:declare [ a sh:PrefixDeclaration ; sh:namespace "http://www.w3.org/1999/02/22-rdf-syntax-ns#"^^xsd:anyURI ; sh:prefix "rdf" ; ] ; sh:declare [ a sh:PrefixDeclaration ; sh:namespace "http://www.w3.org/2000/01/rdf-schema#"^^xsd:anyURI ; sh:prefix "rdfs" ; ] ; sh:declare [ a sh:PrefixDeclaration ; sh:namespace "http://www.w3.org/2002/07/owl#"^^xsd:anyURI ; sh:prefix "owl" ; ] ; sh:declare [ a sh:PrefixDeclaration ; sh:namespace "http://www.w3.org/2004/02/skos/core#"^^xsd:anyURI ; sh:prefix "skos" ; ] ; sh:declare [ a sh:PrefixDeclaration ; sh:namespace "http://www.w3.org/ns/shacl#"^^xsd:anyURI ; sh:prefix "sh" ; ] ; sh:declare [ a sh:PrefixDeclaration ; sh:namespace "http://www.w3.org/2001/XMLSchema#"^^xsd:anyURI ; sh:prefix "xsd" ; ] . qudt:AllValuesMustHaveSameDataTypeShape a sh:NodeShape ; rdfs:isDefinedBy ; rdfs:label "All Values must have same DataType Shape" ; sh:severity sh:Violation ; sh:sparql [ sh:message "Data Item {$this} has type {?valueType}." ; sh:prefixes ; sh:select """ SELECT $this ?valueType WHERE { $this qudt:datatype/qudt:rdfsDatatype ?datatype . $this qudt:value ?valueList. ?valueList rdf:rest*/rdf:first ?value . BIND(datatype(?value) as ?valueType) . FILTER(?valueType != ?datatype) } """ ; ] ; sh:targetClass qudt:HomogeneousArray . qudt:ConsistentDimensionVectorConstraint a sh:NodeShape ; rdfs:isDefinedBy ; rdfs:label "Consistent Dimension Vector Constraint" ; sh:sparql [ a sh:SPARQLConstraint ; rdfs:comment "Checks for consistent dimension vectors for a QuantityKind and the Unit" ; sh:message "s223: Inconsistent dimensionalities for a Quantity's Unit and Quantity Kind" ; sh:prefixes ; sh:select """ SELECT $this WHERE { $this qudt:hasQuantityKind/qudt:hasDimensionVector ?qkdv1 . $this qudt:hasUnit/qudt:hasDimensionVector ?qkdv2 . FILTER (?qkdv1 != ?qkdv2) . } """ ; ] ; sh:targetClass qudt:Quantity . qudt:DimensionalityShape a sh:NodeShape ; rdfs:isDefinedBy ; rdfs:label "Dimensions Shape" ; sh:severity sh:Warning ; sh:sparql [ sh:message "\"{$this}\" has {$actualDimensions} dimensions extent and needs to have {$specifiedDimensions}" ; sh:prefixes ; sh:select """ SELECT $this $actualDimensions $specifiedDimensions WHERE { $this qudt:dimensionality $dimensionality . $this qudt:dimensions ?dimensions . ?dimensions rdf:rest*/rdf:first $specifiedDimensions . { SELECT $this (COUNT(?listValue )AS $actualDimensions) WHERE { $this qudt:value/rdf:rest*/rdf:first ?listValue . } GROUP BY $this } FILTER ($actualDimensions != $specifiedDimensions) } """ ; ] ; sh:targetClass qudt:Array ; sh:targetClass qudt:List . qudt:DontReferToDeprecatedConceptConstraint a sh:NodeShape ; rdfs:isDefinedBy ; rdfs:label "Warning about use of a deprecated QUDT resource" ; sh:severity sh:Warning ; sh:sparql [ a sh:SPARQLConstraint ; rdfs:comment "Warns if a deprecated QUDT resource is used" ; sh:message "Resource '{?s}' refers to deprecated resource '{$this}', which will be removed in the next major version of QUDT. {?replacementMessage}" ; sh:prefixes ; sh:select """ SELECT ?s $this ?replacementMessage WHERE { $this qudt:deprecated true . ?s ?p $this . FILTER NOT EXISTS {?s qudt:deprecated true} . OPTIONAL { $this dcterms:isReplacedBy ?replacement . } BIND(IF( BOUND(?replacement), CONCAT("Please refer to ", STR(?replacement), " instead."), "Please do not refer to this resource any longer - it will be removed without replacement.") AS ?replacementMessage) } """ ; ] ; sh:targetClass qudt:Concept . qudt:DontUseDeprecatedPropertyConstraint a sh:NodeShape ; rdfs:isDefinedBy ; rdfs:label "Warning about use of a deprecated QUDT property" ; sh:severity sh:Warning ; sh:sparql [ a sh:SPARQLConstraint ; rdfs:comment "Warns if a deprecated QUDT property is used" ; sh:message "Resource '{?s}' uses the deprecated property '{$this}', which will be removed in the next major version of QUDT.{?replacementMessage}" ; sh:prefixes ; sh:select """ SELECT ?s $this ?replacementMessage WHERE { $this qudt:deprecated true . ?s $this ?o . OPTIONAL { $this dcterms:isReplacedBy ?replacement . } BIND(IF( BOUND(?replacement), CONCAT(" Please use ", STR(?replacement), " instead."), " Please do not use this property any longer - it will be removed without replacement.") AS ?replacementMessage) }""" ; ] ; sh:targetClass rdf:Property .