types:ProperDictionary leaf node


URI

https://ontology.unifiedcyberontology.org/uco/types/ProperDictionary

Label

ProperDictionary

Description

A proper dictionary is list of (term/key, value) pairs with each term/key existing no more than once.

Target Classes (1)

Shape Properties

Instances of types:ProperDictionary can have the following properties:

PROPERTY

MIN COUNT

MAX COUNT

TYPE

types:Dictionary
types:entry types:DictionaryEntry

Implementation

@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix types: <https://ontology.unifiedcyberontology.org/uco/types/> .

types:ProperDictionary a owl:Class,
        sh:NodeShape ;
    rdfs:label "ProperDictionary"@en ;
    rdfs:comment "A proper dictionary is list of (term/key, value) pairs with each term/key existing no more than once."@en ;
    rdfs:subClassOf types:Dictionary ;
    owl:disjointWith types:ImproperDictionary ;
    sh:sparql [ a sh:SPARQLConstraint ;
            sh:message "A key in a proper dictionary can appear no more than once."@en ;
            sh:select """
			PREFIX types: <https://ontology.unifiedcyberontology.org/uco/types/>
			SELECT $this ?value
			WHERE {
				$this
					types:entry/types:key ?value ;
					.
			}
			GROUP BY ?value
			HAVING (COUNT(?value) > 1)
		""" ] ;
    sh:targetClass types:ProperDictionary .