Skip to content

Commit

Permalink
Merge branch 'develop' into Feature-Issue-591
Browse files Browse the repository at this point in the history
  • Loading branch information
ajnelson-nist committed Oct 29, 2024
2 parents b1a5b7f + 13d372c commit 4d1766c
Show file tree
Hide file tree
Showing 27 changed files with 954 additions and 61 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Start from clean state
Expand Down
4 changes: 2 additions & 2 deletions ontology/owl/owl.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,12 @@ uco-owl:Disjointedness-C-DT-shape
sh:sparql [
a sh:SPARQLConstraint ;
rdfs:seeAlso <https://www.w3.org/TR/2012/REC-owl2-syntax-20121211/#Typing_Constraints_of_OWL_2_DL> ;
sh:message "An IRI may not be a member of both an owl:Class and owl:Datatype."@en ;
sh:message "An IRI may not be a member of both an owl:Class and rdfs:Datatype."@en ;
sh:select """
PREFIX owl: <http://www.w3.org/2002/07/owl#>
SELECT $this
WHERE {
$this a owl:Datatype ;
$this a rdfs:Datatype ;
}
""" ;
] ;
Expand Down
49 changes: 48 additions & 1 deletion ontology/uco/core/core.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ core:ContextualCompilation
rdfs:comment "A contextual compilation is a grouping of things sharing some context (e.g., a set of network connections observed on a given day, all accounts associated with a given person)."@en ;
sh:property [
sh:class core:UcoObject ;
sh:minCount "1"^^xsd:integer ;
sh:nodeKind sh:IRI ;
sh:path core:object ;
] ;
Expand Down Expand Up @@ -318,6 +317,19 @@ core:ModusOperandi
sh:targetClass core:ModusOperandi ;
.

core:ObjectStatusVocab
a rdfs:Datatype ;
rdfs:label "Object Status Vocabulary"@en-US ;
owl:equivalentClass [
a rdfs:Datatype ;
owl:oneOf (
"Draft"^^core:ObjectStatusVocab
"Final"^^core:ObjectStatusVocab
"Deprecated"^^core:ObjectStatusVocab
) ;
] ;
.

core:Relationship
a
owl:Class ,
Expand Down Expand Up @@ -378,6 +390,17 @@ core:UcoInherentCharacterizationThing
sh:targetClass core:UcoInherentCharacterizationThing ;
.

core:UcoInherentCharacterizationThing-disjointWith-UcoObject-shape
a sh:NodeShape ;
sh:message "core:UcoInherentCharacterizationThing and core:UcoObject are disjoint classes. Assigning both types to a single node will be an error in UCO 2.0.0."@en ;
sh:not [
a sh:NodeShape ;
sh:class core:UcoObject ;
] ;
sh:severity sh:Warning ;
sh:targetClass core:UcoInherentCharacterizationThing ;
.

core:UcoObject
a
owl:Class ,
Expand Down Expand Up @@ -441,6 +464,17 @@ core:UcoObject
sh:datatype xsd:string ;
sh:nodeKind sh:Literal ;
sh:path core:tag ;
] ,
[
sh:datatype core:ObjectStatusVocab ;
sh:in (
"Draft"^^core:ObjectStatusVocab
"Final"^^core:ObjectStatusVocab
"Deprecated"^^core:ObjectStatusVocab
) ;
sh:maxCount "1"^^xsd:integer ;
sh:nodeKind sh:Literal ;
sh:path core:objectStatus ;
]
;
sh:targetClass core:UcoObject ;
Expand Down Expand Up @@ -687,6 +721,19 @@ core:objectMarking
rdfs:range core:MarkingDefinitionAbstraction ;
.

core:objectStatus
a owl:AnnotationProperty ;
rdfs:label "objectStatus"@en ;
rdfs:comment "The current state of formality and acceptance for a UCO object."@en-US ;
rdfs:range core:ObjectStatusVocab ;
.

core:objectStatus-subjects-shape
a sh:NodeShape ;
sh:class core:UcoObject ;
sh:targetSubjectsOf core:objectStatus ;
.

core:referenceURL
a owl:DatatypeProperty ;
rdfs:label "referenceURL"@en ;
Expand Down
30 changes: 30 additions & 0 deletions ontology/uco/observable/observable.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,14 @@ observable:AlternateDataStream
rdfs:subClassOf observable:ObservableObject ;
rdfs:label "AlternateDataStream"@en ;
rdfs:comment "An alternate data stream is data content stored within an NTFS file that is independent of the standard content stream of the file and is hidden from access by default NTFS file viewing mechanisms."@en ;
rdfs:seeAlso [
a sh:NodeShape ;
rdfs:comment "This anonymous shape is attached with rdfs:seeAlso in order to associate a warning-severity class constraint, that will only be necessary as an independent shape until UCO 2.0.0."@en ;
sh:class observable:FileSystemObject ;
sh:message "In UCO 2.0.0, uco-observable:AlternateDataStream will be a subclass of uco-observable:FileSystemObject. In preparation for UCO 2.0.0, the additional type uco-observable:FileSystemObject should be assigned to this node."@en ;
sh:severity sh:Warning ;
sh:targetClass observable:AlternateDataStream ;
] ;
sh:targetClass observable:AlternateDataStream ;
.

Expand Down Expand Up @@ -2429,6 +2437,14 @@ observable:Disk
rdfs:subClassOf observable:ObservableObject ;
rdfs:label "Disk"@en ;
rdfs:comment "A disk is a storage mechanism where data is recorded by various electronic, magnetic, optical, or mechanical changes to a surface layer of one or more rotating disks."@en ;
rdfs:seeAlso [
a sh:NodeShape ;
rdfs:comment "This anonymous shape is attached with rdfs:seeAlso in order to associate a warning-severity class constraint, that will only be necessary as an independent shape until UCO 2.0.0."@en ;
sh:class observable:StorageMedium ;
sh:message "In UCO 2.0.0, uco-observable:Disk will be a subclass of uco-observable:StorageMedium. In preparation for UCO 2.0.0, the additional type uco-observable:StorageMedium should be assigned to this node."@en ;
sh:severity sh:Warning ;
sh:targetClass observable:Disk ;
] ;
sh:targetClass observable:Disk ;
.

Expand Down Expand Up @@ -5056,6 +5072,20 @@ observable:ObservableRelationship
;
rdfs:label "ObservableRelationship"@en ;
rdfs:comment "An observable relationship is a grouping of characteristics unique to an assertion of an association between two observable objects."@en ;
sh:property
[
sh:class observable:Observable ;
sh:message "The source on an ObservableRelationship is expected to be typed as an Observable, and the noted value node is not. This will be an error in UCO 2.0.0."@en ;
sh:path core:source ;
sh:severity sh:Warning ;
] ,
[
sh:class observable:Observable ;
sh:message "The target on an ObservableRelationship is expected to be typed as an Observable, and the noted value node is not. This will be an error in UCO 2.0.0."@en ;
sh:path core:target ;
sh:severity sh:Warning ;
]
;
sh:targetClass observable:ObservableRelationship ;
.

Expand Down
124 changes: 122 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 All @@ -195,6 +279,17 @@ types:Thread
] ;
.

types:Thread-disjointWith-co-List-shape
a sh:NodeShape ;
sh:message "types:Thread and co:List are disjoint classes. Assigning both types to a single node will be an error in UCO 2.0.0."@en ;
sh:not [
a sh:NodeShape ;
sh:class co:List ;
] ;
sh:severity sh:Warning ;
sh:targetClass types:Thread ;
.

types:ThreadItem
a
owl:Class ,
Expand All @@ -213,6 +308,17 @@ types:ThreadItem
] ;
.

types:ThreadItem-disjointWith-co-ListItem-shape
a sh:NodeShape ;
sh:message "types:ThreadItem and co:ListItem are disjoint classes. Assigning both types to a single node will be an error in UCO 2.0.0."@en ;
sh:not [
a sh:NodeShape ;
sh:class co:ListItem ;
] ;
sh:severity sh:Warning ;
sh:targetClass types:ThreadItem ;
.

types:entry
a owl:ObjectProperty ;
rdfs:label "entry"@en ;
Expand Down Expand Up @@ -247,6 +353,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
Loading

0 comments on commit 4d1766c

Please sign in to comment.