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


URI

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

Label

ObjectProperty-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:ObjectProperty-shacl-constraints-shape a sh:NodeShape ;
    sh:sparql [ a sh:SPARQLConstraint ;
            sh:message "An OWL Object Property cannot use a SHACL DatatypeConstraintComponent."@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:datatype ?nDatatype ;
						sh:path / rdf:rest* ?nLastSequenceMember ;
						.
					?nLastSequenceMember
						rdf:first $this ;
						rdf:rest rdf:nil ;
						.
				}
		""" ],
        [ a sh:SPARQLConstraint ;
            sh:message "An OWL Object Property must not permit a Literal value via SHACL consraints."@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:BlankNodeOrLiteral . }
					UNION
					{ ?value sh:nodeKind sh:IRIOrLiteral . }
					UNION
					{ ?value sh:nodeKind sh:Literal . }
				}
		""" ] ;
    sh:targetClass owl:ObjectProperty .