uco-owl:DatatypeProperty-shacl-constraints-shape leaf node


URI

https://ontology.unifiedcyberontology.org/owl/DatatypeProperty-shacl-constraints-shape

Label

DatatypeProperty-shacl-constraints-shape

Implementation

@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix uco-owl: <https://ontology.unifiedcyberontology.org/owl/> .

uco-owl:DatatypeProperty-shacl-constraints-shape a sh:NodeShape ;
    sh:sparql [ a sh:SPARQLConstraint ;
            sh:message "An OWL Datatype Property cannot use a SHACL ClassConstraintComponent."@en ;
            sh:select """
				PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
				PREFIX sh: <http://www.w3.org/ns/shacl#>
				SELECT $this ?value
				WHERE {
					?value
						sh:class ?nClass ;
						sh:path / rdf:rest* ?nLastSequenceMember ;
						.
					?nLastSequenceMember
						rdf:first $this ;
						rdf:rest rdf:nil ;
						.
				}
			""" ],
        [ a sh:SPARQLConstraint ;
            sh:message "An OWL Datatype Property must not permit a non-Literal value via SHACL constraints."@en ;
            sh:select """
				PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
				PREFIX sh: <http://www.w3.org/ns/shacl#>
				SELECT $this ?value
				WHERE {
					?value
						sh:path / rdf:rest* ?nLastSequenceMember ;
						.
					?nLastSequenceMember
						rdf:first $this ;
						rdf:rest rdf:nil ;
						.

					{ ?value sh:nodeKind sh:BlankNode . }
					UNION
					{ ?value sh:nodeKind sh:BlankNodeOrIRI . }
					UNION
					{ ?value sh:nodeKind sh:BlankNodeOrLiteral . }
					UNION
					{ ?value sh:nodeKind sh:IRI . }
					UNION
					{ ?value sh:nodeKind sh:IRIOrLiteral . }
				}
			""" ] ;
    sh:targetClass owl:DatatypeProperty .