Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion ontology/uco/action/action.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ action:Action
owl:Class ,
sh:NodeShape
;
rdfs:subClassOf core:UcoObject ;
rdfs:subClassOf
core:NeverInformationResource ,
core:UcoObject
;
rdfs:label "Action"@en ;
rdfs:comment "An action is something that may be done or performed."@en ;
owl:disjointWith core:Event ;
Expand Down
45 changes: 43 additions & 2 deletions ontology/uco/core/core.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,10 @@ core:Event
owl:Class ,
sh:NodeShape
;
rdfs:subClassOf core:UcoObject ;
rdfs:subClassOf
core:NeverInformationResource ,
core:UcoObject
;
rdfs:label "Event"@en ;
rdfs:comment "An Event is a noteworthy occurrence (something that happens or might happen)."@en ;
owl:disjointWith action:Action ;
Expand Down Expand Up @@ -284,6 +287,26 @@ core:IdentityAbstraction
sh:targetClass core:IdentityAbstraction ;
.

core:InformationResource
a
owl:Class ,
sh:NodeShape
;
rdfs:subClassOf core:UcoThing ;
owl:disjointWith core:NeverInformationResource ;
sh:targetClass core:InformationResource ;
.

core:InformationResource-disjointWith-NeverInformationResource-shape
a sh:NodeShape ;
sh:message "core:InformationResource and core:NeverInformationResource are disjoint classes."@en ;
sh:not [
a sh:NodeShape ;
sh:class core:NeverInformationResource ;
] ;
sh:targetClass core:InformationResource ;
.

core:Item
a
owl:Class ,
Expand Down Expand Up @@ -317,6 +340,24 @@ core:ModusOperandi
sh:targetClass core:ModusOperandi ;
.

core:NeverInformationResource
a
owl:Class ,
sh:NodeShape
;
rdfs:subClassOf core:NonInformationResource ;
sh:targetClass core:NeverInformationResource ;
.

core:NonInformationResource
a
owl:Class ,
sh:NodeShape
;
rdfs:subClassOf core:UcoThing ;
sh:targetClass core:NonInformationResource ;
.

core:Relationship
a
owl:Class ,
Expand Down Expand Up @@ -371,7 +412,7 @@ core:UcoInherentCharacterizationThing
owl:Class ,
sh:NodeShape
;
rdfs:subClassOf core:UcoThing ;
rdfs:subClassOf core:NeverInformationResource ;
rdfs:label "UcoInherentCharacterizationThing"@en ;
rdfs:comment "A UCO inherent characterization thing is a grouping of characteristics unique to a particular inherent aspect of a UCO domain object."@en ;
sh:targetClass core:UcoInherentCharacterizationThing ;
Expand Down
10 changes: 8 additions & 2 deletions ontology/uco/identity/identity.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,10 @@ identity:Organization
owl:Class ,
sh:NodeShape
;
rdfs:subClassOf identity:Identity ;
rdfs:subClassOf
core:NeverInformationResource ,
identity:Identity
;
rdfs:label "Organization"@en ;
rdfs:comment "An organization is a grouping of identifying characteristics unique to a group of people who work together in an organized way for a shared purpose. [based on https://dictionary.cambridge.org/us/dictionary/english/organization]"@en ;
sh:targetClass identity:Organization ;
Expand All @@ -182,7 +185,10 @@ identity:Person
owl:Class ,
sh:NodeShape
;
rdfs:subClassOf identity:Identity ;
rdfs:subClassOf
core:NeverInformationResource ,
identity:Identity
;
rdfs:label "Person"@en ;
rdfs:comment "A person is a grouping of identifying characteristics unique to a human being regarded as an individual. [based on https://www.lexico.com/en/definition/person]"@en ;
sh:targetClass identity:Person ;
Expand Down
26 changes: 23 additions & 3 deletions ontology/uco/observable/observable.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -2214,7 +2214,10 @@ observable:Device
owl:Class ,
sh:NodeShape
;
rdfs:subClassOf observable:ObservableObject ;
rdfs:subClassOf
core:NeverInformationResource ,
observable:ObservableObject
;
rdfs:label "Device"@en ;
rdfs:comment "A device is a piece of equipment or a mechanism designed to serve a special purpose or perform a special function. [based on https://www.merriam-webster.com/dictionary/device]"@en ;
sh:targetClass observable:Device ;
Expand Down Expand Up @@ -6894,7 +6897,10 @@ observable:URL
owl:Class ,
sh:NodeShape
;
rdfs:subClassOf observable:ObservableObject ;
rdfs:subClassOf
core:NeverInformationResource ,
observable:ObservableObject
;
rdfs:label "URL"@en ;
rdfs:comment "A URL is a uniform resource locator (URL) acting as a resolvable address to a particular WWW (World Wide Web) accessible resource."@en ;
sh:targetClass observable:URL ;
Expand Down Expand Up @@ -7350,12 +7356,26 @@ observable:WebPage
owl:Class ,
sh:NodeShape
;
rdfs:subClassOf observable:ObservableObject ;
rdfs:subClassOf
core:InformationResource ,
observable:WebResource
;
rdfs:label "WebPage"@en ;
rdfs:comment "A web page is a specific collection of information provided by a website and displayed to a user in a web browser. A website typically consists of many web pages linked together in a coherent fashion. [based on https://en.wikipedia.org/wiki/Web_page]"@en ;
sh:targetClass observable:WebPage ;
.

observable:WebResource
a
owl:Class ,
sh:NodeShape
;
rdfs:subClassOf observable:ObservableObject ;
rdfs:label "WebResource"@en ;
rdfs:seeAlso <https://www.rfc-editor.org/rfc/rfc9110.html#name-resources> ;
sh:targetClass observable:WebResource ;
.

observable:WhoIs
a
owl:Class ,
Expand Down
102 changes: 100 additions & 2 deletions ontology/uco/types/types.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,47 @@ types:Dictionary
;
rdfs:subClassOf core:UcoInherentCharacterizationThing ;
rdfs:label "Dictionary"@en ;
rdfs:comment "A dictionary is list of (term/key, value) pairs with each term/key existing no more than once."@en ;
rdfs:comment "A dictionary is list of (term/key, value) pairs with each term/key having an expectation to exist no more than once. types:Dictionary alone does not validate this expectation, but validation is available. For use cases where this expectation must be validated, the subclass types:ProperDictionary should be used instead of types:Dictionary. For instances where this expectation has been found to be violated, the subclass types:ImproperDictionary should be used instead of types:Dictionary."@en ;
sh:property [
sh:class types:DictionaryEntry ;
sh:minCount "1"^^xsd:integer ;
sh:nodeKind sh:IRI ;
sh:path types:entry ;
] ;
sh:targetClass types:Dictionary ;
.

types:Dictionary-keyUniqueness-shape
a sh:NodeShape ;
sh:description "This shape is separated from the types:Dictionary class-shape in order to associate a warning-severity SPARQL-based shape."@en ;
sh:severity sh:Warning ;
sh:sparql [
a sh:SPARQLConstraint ;
sh:message "A key in a dictionary should appear no more than once. The value literal does. Please consider using the types:ImproperDictionary class and types:repeatsKey property."@en ;
sh:select """
PREFIX types: <https://ontology.unifiedcyberontology.org/uco/types/>
SELECT $this ?value
WHERE {
$this
types:entry/types:key ?value ;
.
FILTER NOT EXISTS {
$this
a types:ImproperDictionary ;
.
}
FILTER NOT EXISTS {
$this
a types:ProperDictionary ;
.
}
}
GROUP BY ?value
HAVING (COUNT(?value) > 1)
""" ;
] ;
sh:targetClass types:Dictionary ;
.

types:DictionaryEntry
a
owl:Class ,
Expand Down Expand Up @@ -167,11 +198,64 @@ types:Identifier
rdfs:comment "An identifier is a string conformant to the specified UUID-based format for UCO object identifiers."@en ;
.

types:ImproperDictionary
a
owl:Class ,
sh:NodeShape
;
rdfs:subClassOf types:Dictionary ;
rdfs:label "ImproperDictionary"@en ;
owl:disjointWith types:ProperDictionary ;
sh:property [
sh:datatype xsd:string ;
sh:nodeKind sh:Literal ;
sh:path types:repeatsKey ;
] ;
sh:targetClass types:ImproperDictionary ;
.

types:ImproperDictionary-disjointWith-ProperDictionary-shape
a sh:NodeShape ;
sh:message "types:ImproperDictionary and types:ProperDictionary are disjoint classes."@en ;
sh:not [
a sh:NodeShape ;
sh:class types:ProperDictionary ;
] ;
sh:targetClass types:ImproperDictionary ;
.

types:NativeFormatString
a rdfs:Datatype ;
rdfs:comment "Specifies data in its native format of some external language. The data may be encoded in Base64 per [RFC4648]. Data encoded in Base64 must be denoted as such using the encoded property."@en ;
.

types:ProperDictionary
a
owl:Class ,
sh:NodeShape
;
rdfs:subClassOf types:Dictionary ;
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 ;
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 ;
.

types:StructuredText
a rdfs:Datatype ;
rdfs:comment "Expresses string-based data in some information structuring format (e.g., HTML5)."@en ;
Expand Down Expand Up @@ -267,6 +351,20 @@ types:key
rdfs:range xsd:string ;
.

types:repeatsKey
a owl:DatatypeProperty ;
rdfs:label "repeatsKey"@en ;
rdfs:comment "A key found to be repeated in multiple dictionary entries within one dictionary."@en ;
rdfs:domain types:ImproperDictionary ;
rdfs:range xsd:string ;
.

types:repeatsKey-subjects-shape
a sh:NodeShape ;
sh:class types:ImproperDictionary ;
sh:targetSubjectsOf types:repeatsKey ;
.

types:threadNextItem
a owl:ObjectProperty ;
rdfs:subPropertyOf types:threadSuccessor ;
Expand Down
8 changes: 8 additions & 0 deletions tests/examples/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,17 @@ all: \
configuration_setting_XFAIL_validation.ttl \
database_records_PASS_validation.ttl \
database_records_XFAIL_validation.ttl \
dictionary_PASS_validation.ttl \
dictionary_XFAIL_validation.ttl \
disjointedness_XFAIL_validation.ttl \
event_XFAIL_validation.ttl \
file_url_XFAIL_validation.ttl \
has_facet_inverse_functional_PASS_validation.ttl \
has_facet_inverse_functional_XFAIL_validation.ttl \
hash_PASS_validation.ttl \
hash_XFAIL_validation.ttl \
information_resource_PASS_validation.ttl \
information_resource_XFAIL_validation.ttl \
location_PASS_validation.ttl \
location_XFAIL_validation.ttl \
message_thread_PASS_validation.ttl \
Expand Down Expand Up @@ -101,13 +105,17 @@ check: \
configuration_setting_XFAIL_validation.ttl \
database_records_PASS_validation.ttl \
database_records_XFAIL_validation.ttl \
dictionary_PASS_validation.ttl \
dictionary_XFAIL_validation.ttl \
disjointedness_XFAIL_validation.ttl \
event_XFAIL_validation.ttl \
file_url_XFAIL_validation.ttl \
has_facet_inverse_functional_PASS_validation.ttl \
has_facet_inverse_functional_XFAIL_validation.ttl \
hash_PASS_validation.ttl \
hash_XFAIL_validation.ttl \
information_resource_PASS_validation.ttl \
information_resource_XFAIL_validation.ttl \
location_PASS_validation.ttl \
location_XFAIL_validation.ttl \
message_thread_PASS_validation.ttl \
Expand Down
26 changes: 26 additions & 0 deletions tests/examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,32 @@ Two instance data files are currently in the directory:
SHACL validation results are stored in corresponding files named `..._validation.ttl`, to present the current state of validation conditions.


## Design of the Dictionary tests

The `Dictionary` objects in the `dictionary_*.json` files cover these combinations of asserted type (proper dictionary, improper dictionary, or the generic parent class), whether a dictionary entry key is repeated in the data, and whether the `repeatsKey` property is asserted. (P/X denotes whether the instance is a PASS or XFAIL test case.)

| uuid | P/X | Dictionary type | Key repeats | repeatsKey asserted |
| --- | --- | --- | --- | --- |
| `3bb38b3e` | P | `Dictionary` | no | no |
| `e6dc9c2e` | X | `Dictionary` | no | yes |
| `e9adf6c1` | P | `Dictionary` | yes | no |
| `34ac0c49` | X | `Dictionary` | yes | yes |
| `cbc1c80d` | P | `ImproperDictionary` | no | no |
| `7fa3ea45` | P | `ImproperDictionary` | no | yes |
| `14e28425` | P | `ImproperDictionary` | yes | no |
| `a8e5e8e1` | P | `ImproperDictionary` | yes | yes |
| `eaded28e` | P | `ProperDictionary` | no | no |
| `8114819f` | X | `ProperDictionary` | no | yes |
| `b2baf8af` | X | `ProperDictionary` | yes | no |
| `f5ae2e6a` | X | `ProperDictionary` | yes | yes |

Other miscellaneous tests are added without full combinatoric review:

* `kb:ProperDictionary-f5ae2e6a-9b10-46f3-8441-30aada36aa1b` also demonstrates an XFAIL case where a key-value *pair* is repeated.
* `kb:ImproperDictionary-7fa3ea45-6426-4ad3-bb5f-7559e07adeb4` also demonstrates a PASS case where `repeatsKey`'s value is not in the supplied dictionary.
* `kb:Dictionary-5bc55661-4808-48e6-9e02-80a153eee5d3` demonstrates an XFAIL case where the disjoint `Dictionary` subtypes are both asserted.


## Design of the Relationship tests

The `Relationship` objects in the `relationship_*.json` files include a numbering scheme in their identifiers, (object class)-(lexical value)-(datatype). These track the following matrix of test cases:
Expand Down
Loading