diff --git a/ontology/uco/core/core.ttl b/ontology/uco/core/core.ttl index 6293d3a..4ad2e15 100644 --- a/ontology/uco/core/core.ttl +++ b/ontology/uco/core/core.ttl @@ -317,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 , @@ -450,6 +463,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 ; @@ -696,6 +720,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 ; diff --git a/ontology/uco/observable/observable.ttl b/ontology/uco/observable/observable.ttl index e29bc16..1ceb2e0 100644 --- a/ontology/uco/observable/observable.ttl +++ b/ontology/uco/observable/observable.ttl @@ -2430,6 +2430,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 ; . diff --git a/ontology/uco/vocabulary/vocabulary.ttl b/ontology/uco/vocabulary/vocabulary.ttl index d13c89e..2e013aa 100644 --- a/ontology/uco/vocabulary/vocabulary.ttl +++ b/ontology/uco/vocabulary/vocabulary.ttl @@ -17,7 +17,6 @@ vocabulary:AccountTypeVocab rdfs:label "Account Type Vocabulary"@en-US ; owl:equivalentClass [ a rdfs:Datatype ; - owl:onDatatype xsd:string ; owl:oneOf ( "ldap"^^vocabulary:AccountTypeVocab "nis"^^vocabulary:AccountTypeVocab @@ -37,7 +36,6 @@ vocabulary:ActionArgumentNameVocab rdfs:comment "Defines an open-vocabulary for common arguments of cyber actions."@en ; owl:equivalentClass [ a rdfs:Datatype ; - owl:onDatatype xsd:string ; owl:oneOf ( "APC Address"^^vocabulary:ActionArgumentNameVocab "APC Mode"^^vocabulary:ActionArgumentNameVocab @@ -100,7 +98,6 @@ vocabulary:ActionNameVocab rdfs:comment "Defines an open-vocabulary of common specific cyber action names."@en ; owl:equivalentClass [ a rdfs:Datatype ; - owl:onDatatype xsd:string ; owl:oneOf ( "Accept Socket Connection"^^vocabulary:ActionNameVocab "Add Connection to Network Share"^^vocabulary:ActionNameVocab @@ -293,7 +290,6 @@ vocabulary:ActionRelationshipTypeVocab rdfs:comment "Defines an open-vocabulary for capturing types of relationships between actions."@en-US ; owl:equivalentClass [ a rdfs:Datatype ; - owl:onDatatype xsd:string ; owl:oneOf ( "Dependent_On"^^vocabulary:ActionRelationshipTypeVocab "Equivalent_To"^^vocabulary:ActionRelationshipTypeVocab @@ -312,7 +308,6 @@ vocabulary:ActionStatusTypeVocab rdfs:comment "Defines an open-vocabulary of action status types."@en-US ; owl:equivalentClass [ a rdfs:Datatype ; - owl:onDatatype xsd:string ; owl:oneOf ( "Complete/Finish"^^vocabulary:ActionStatusTypeVocab "Error"^^vocabulary:ActionStatusTypeVocab @@ -331,7 +326,6 @@ vocabulary:ActionTypeVocab rdfs:comment "Defines an open-vocabulary of common general action types."@en ; owl:equivalentClass [ a rdfs:Datatype ; - owl:onDatatype xsd:string ; owl:oneOf ( "Accept"^^vocabulary:ActionTypeVocab "Access"^^vocabulary:ActionTypeVocab @@ -454,7 +448,6 @@ vocabulary:BitnessVocab rdfs:comment "Defines an open-vocabulary of word sizes that define classes of operating systems."@en ; owl:equivalentClass [ a rdfs:Datatype ; - owl:onDatatype xsd:string ; owl:oneOf ( "32"^^vocabulary:BitnessVocab "64"^^vocabulary:BitnessVocab @@ -468,7 +461,6 @@ vocabulary:CharacterEncodingVocab rdfs:comment "Defines an open-vocabulary of character encodings."@en ; owl:equivalentClass [ a rdfs:Datatype ; - owl:onDatatype xsd:string ; owl:oneOf ( "ASCII"^^vocabulary:CharacterEncodingVocab "UTF-16"^^vocabulary:CharacterEncodingVocab @@ -493,7 +485,6 @@ vocabulary:ContactAddressScopeVocab rdfs:comment "Defines an open-vocabulary of scopes for address entries of digital contacts."@en ; owl:equivalentClass [ a rdfs:Datatype ; - owl:onDatatype xsd:string ; owl:oneOf ( "home"^^vocabulary:ContactAddressScopeVocab "work"^^vocabulary:ContactAddressScopeVocab @@ -508,7 +499,6 @@ vocabulary:ContactEmailScopeVocab rdfs:comment "Defines an open-vocabulary of scopes for email entries of digital contacts."@en ; owl:equivalentClass [ a rdfs:Datatype ; - owl:onDatatype xsd:string ; owl:oneOf ( "home"^^vocabulary:ContactEmailScopeVocab "work"^^vocabulary:ContactEmailScopeVocab @@ -524,7 +514,6 @@ vocabulary:ContactPhoneScopeVocab rdfs:comment "Defines an open-vocabulary of scopes for phone entries of digital contacts."@en ; owl:equivalentClass [ a rdfs:Datatype ; - owl:onDatatype xsd:string ; owl:oneOf ( "home"^^vocabulary:ContactPhoneScopeVocab "work"^^vocabulary:ContactPhoneScopeVocab @@ -544,7 +533,6 @@ vocabulary:ContactSIPScopeVocab rdfs:comment "Defines an open-vocabulary of scopes for Session Initiation Protocol (SIP) entries of digital contacts."@en ; owl:equivalentClass [ a rdfs:Datatype ; - owl:onDatatype xsd:string ; owl:oneOf ( "home"^^vocabulary:ContactSIPScopeVocab "work"^^vocabulary:ContactSIPScopeVocab @@ -559,7 +547,6 @@ vocabulary:ContactURLScopeVocab rdfs:comment "Defines an open-vocabulary of scopes for URL entries of digital contacts."@en ; owl:equivalentClass [ a rdfs:Datatype ; - owl:onDatatype xsd:string ; owl:oneOf ( "home"^^vocabulary:ContactURLScopeVocab "work"^^vocabulary:ContactURLScopeVocab @@ -575,7 +562,6 @@ vocabulary:DiskTypeVocab rdfs:comment "Defines an open-vocabulary of disk types."@en ; owl:equivalentClass [ a rdfs:Datatype ; - owl:onDatatype xsd:string ; owl:oneOf ( "CDRom"^^vocabulary:DiskTypeVocab "Fixed"^^vocabulary:DiskTypeVocab @@ -592,7 +578,6 @@ vocabulary:EndiannessTypeVocab rdfs:comment "Defines an open-vocabulary of byte ordering methods."@en ; owl:equivalentClass [ a rdfs:Datatype ; - owl:onDatatype xsd:string ; owl:oneOf ( "Big-endian"^^vocabulary:EndiannessTypeVocab "Little-endian"^^vocabulary:EndiannessTypeVocab @@ -607,7 +592,6 @@ vocabulary:HashNameVocab rdfs:comment "Defines an open-vocabulary of hashing algorithm names."@en-US ; owl:equivalentClass [ a rdfs:Datatype ; - owl:onDatatype xsd:string ; owl:oneOf ( "MD5"^^vocabulary:HashNameVocab "MD6"^^vocabulary:HashNameVocab @@ -631,7 +615,6 @@ vocabulary:LibraryTypeVocab rdfs:comment "Defines an open-vocabulary of library types."@en ; owl:equivalentClass [ a rdfs:Datatype ; - owl:onDatatype xsd:string ; owl:oneOf ( "Dynamic"^^vocabulary:LibraryTypeVocab "Other"^^vocabulary:LibraryTypeVocab @@ -648,7 +631,6 @@ vocabulary:MemoryBlockTypeVocab rdfs:comment "Defines an open-vocabulary of types of memory blocks."@en ; owl:equivalentClass [ a rdfs:Datatype ; - owl:onDatatype xsd:string ; owl:oneOf ( "Bit-mapped"^^vocabulary:MemoryBlockTypeVocab "Byte-mapped"^^vocabulary:MemoryBlockTypeVocab @@ -665,7 +647,6 @@ vocabulary:ObservableObjectRelationshipVocab rdfs:comment "Defines an open-vocabulary of inter-observable object relationships."@en ; owl:equivalentClass [ a rdfs:Datatype ; - owl:onDatatype xsd:string ; owl:oneOf ( "Allocated"^^vocabulary:ObservableObjectRelationshipVocab "Allocated_By"^^vocabulary:ObservableObjectRelationshipVocab @@ -816,7 +797,6 @@ vocabulary:ObservableObjectStateVocab rdfs:comment "Defines an open-vocabulary of observable object states."@en ; owl:equivalentClass [ a rdfs:Datatype ; - owl:onDatatype xsd:string ; owl:oneOf ( "Active"^^vocabulary:ObservableObjectStateVocab "Closed"^^vocabulary:ObservableObjectStateVocab @@ -838,7 +818,6 @@ vocabulary:PartitionTypeVocab rdfs:comment "Defines an open-vocabulary of partition types. See http://www.win.tue.nl/~aeb/partitions/partition_types-1.html for more information about the various partition types."@en ; owl:equivalentClass [ a rdfs:Datatype ; - owl:onDatatype xsd:string ; owl:oneOf ( "PARTITION_ENTRY_UNUSED"^^vocabulary:PartitionTypeVocab "PARTITION_EXTENDED"^^vocabulary:PartitionTypeVocab @@ -869,7 +848,6 @@ vocabulary:ProcessorArchVocab rdfs:comment "Defines an open-vocabulary of computer processor architectures."@en ; owl:equivalentClass [ a rdfs:Datatype ; - owl:onDatatype xsd:string ; owl:oneOf ( "ARM"^^vocabulary:ProcessorArchVocab "Alpha"^^vocabulary:ProcessorArchVocab @@ -893,7 +871,6 @@ vocabulary:RecoveredObjectStatusVocab rdfs:comment "Defines the vocabulary for Recovered Object status of data."@en ; owl:equivalentClass [ a rdfs:Datatype ; - owl:onDatatype xsd:string ; owl:oneOf ( "recovered"^^vocabulary:RecoveredObjectStatusVocab "partially recovered"^^vocabulary:RecoveredObjectStatusVocab @@ -909,7 +886,6 @@ vocabulary:RegionalRegistryTypeVocab rdfs:comment "Defines an open-vocabulary of Regional Internet Registries (RIRs) names, represented via their respective acronyms."@en ; owl:equivalentClass [ a rdfs:Datatype ; - owl:onDatatype xsd:string ; owl:oneOf ( "APNIC"^^vocabulary:RegionalRegistryTypeVocab "ARIN"^^vocabulary:RegionalRegistryTypeVocab @@ -925,7 +901,6 @@ vocabulary:RegistryDatatypeVocab rdfs:label "Registry Datatype Vocabulary"@en-US ; owl:equivalentClass [ a rdfs:Datatype ; - owl:onDatatype xsd:string ; owl:oneOf ( "reg_binary"^^vocabulary:RegistryDatatypeVocab "reg_dword"^^vocabulary:RegistryDatatypeVocab @@ -950,7 +925,6 @@ vocabulary:SIMFormVocab rdfs:comment "Defines an open-vocabulary of common SIM card form factors."@en ; owl:equivalentClass [ a rdfs:Datatype ; - owl:onDatatype xsd:string ; owl:oneOf ( "Full-size SIM"^^vocabulary:SIMFormVocab "Micro SIM"^^vocabulary:SIMFormVocab @@ -965,7 +939,6 @@ vocabulary:SIMTypeVocab rdfs:comment "Defines an open-vocabulary of common SIM card types."@en ; owl:equivalentClass [ a rdfs:Datatype ; - owl:onDatatype xsd:string ; owl:oneOf ( "SIM"^^vocabulary:SIMTypeVocab "UICC"^^vocabulary:SIMTypeVocab @@ -980,7 +953,6 @@ vocabulary:TaskActionTypeVocab rdfs:comment "Defines an open-vocabulary of task action types. See also: http://msdn.microsoft.com/en-us/library/windows/desktop/aa380596(v=vs.85).aspx."@en ; owl:equivalentClass [ a rdfs:Datatype ; - owl:onDatatype xsd:string ; owl:oneOf ( "TASK_ACTION_COM_HANDLER"^^vocabulary:TaskActionTypeVocab "TASK_ACTION_EXEC"^^vocabulary:TaskActionTypeVocab @@ -996,7 +968,6 @@ vocabulary:TaskFlagVocab rdfs:comment "Defines an open-vocabulary of the run flags for a task scheduler task. See also: http://msdn.microsoft.com/en-us/library/windows/desktop/aa381283(v=vs.85).aspx See Also: http://msdn.microsoft.com/en-us/library/microsoft.office.excel.server.addins.computecluster.taskscheduler.taskflags(v=office.12).aspx."@en ; owl:equivalentClass [ a rdfs:Datatype ; - owl:onDatatype xsd:string ; owl:oneOf ( "TASK_FLAG_DELETE_WHEN_DONE"^^vocabulary:TaskFlagVocab "TASK_FLAG_DISABLED"^^vocabulary:TaskFlagVocab @@ -1021,7 +992,6 @@ vocabulary:TaskPriorityVocab rdfs:comment "Defines an open-vocabulary of the priority levels of task scheduler tasks. See also: http://msdn.microsoft.com/en-us/library/windows/desktop/aa383512(v=vs.85).aspx."@en ; owl:equivalentClass [ a rdfs:Datatype ; - owl:onDatatype xsd:string ; owl:oneOf ( "ABOVE_NORMAL_PRIORITY_CLASS"^^vocabulary:TaskPriorityVocab "BELOW_NORMAL_PRIORITY_CLASS"^^vocabulary:TaskPriorityVocab @@ -1039,7 +1009,6 @@ vocabulary:TaskStatusVocab rdfs:comment "Defines an open-vocabulary of the possible statuses of a scheduled task. See also: http://msdn.microsoft.com/en-us/library/windows/desktop/aa383604(v=vs.85).aspx See also: http://msdn.microsoft.com/en-us/library/windows/desktop/aa381263(v=vs.85).aspx See also: http://msdn.microsoft.com/en-us/library/windows/desktop/aa381833(v=vs.85).aspx See also: http://msdn.microsoft.com/en-us/library/windows/desktop/aa383617(v=vs.85).aspx."@en ; owl:equivalentClass [ a rdfs:Datatype ; - owl:onDatatype xsd:string ; owl:oneOf ( "SCHED_E_ACCOUNT_DBASE_CORRUPT"^^vocabulary:TaskStatusVocab "SCHED_E_ACCOUNT_INFORMATION_NOT_SET"^^vocabulary:TaskStatusVocab @@ -1075,7 +1044,6 @@ vocabulary:ThreadRunningStatusVocab rdfs:comment "Defines an open-vocabulary of the various states that a thread may be in before, during, or after execution. See http://msdn.microsoft.com/en-us/library/system.diagnostics.threadstate(v=vs.110).aspx."@en ; owl:equivalentClass [ a rdfs:Datatype ; - owl:onDatatype xsd:string ; owl:oneOf ( "Initialized"^^vocabulary:ThreadRunningStatusVocab "Ready"^^vocabulary:ThreadRunningStatusVocab @@ -1095,7 +1063,6 @@ vocabulary:TimestampPrecisionVocab rdfs:comment "Defines an open-vocabulary of timestamp precision granularities."@en-US ; owl:equivalentClass [ a rdfs:Datatype ; - owl:onDatatype xsd:string ; owl:oneOf ( "day"^^vocabulary:TimestampPrecisionVocab "hour"^^vocabulary:TimestampPrecisionVocab @@ -1113,7 +1080,6 @@ vocabulary:TrendVocab rdfs:comment "Defines an open-vocabulary of trend values."@en-US ; owl:equivalentClass [ a rdfs:Datatype ; - owl:onDatatype xsd:string ; owl:oneOf ( "Decreasing"^^vocabulary:TrendVocab "Increasing"^^vocabulary:TrendVocab @@ -1127,7 +1093,6 @@ vocabulary:TriggerFrequencyVocab rdfs:comment "Defines an open-vocabulary of the frequency types that a trigger may use. See also: http://msdn.microsoft.com/en-us/library/windows/desktop/aa383620(v=vs.85).aspx and http://msdn.microsoft.com/en-us/library/windows/desktop/aa383987(v=vs.85).aspx."@en ; owl:equivalentClass [ a rdfs:Datatype ; - owl:onDatatype xsd:string ; owl:oneOf ( "TASK_EVENT_TRIGGER_AT_LOGON"^^vocabulary:TriggerFrequencyVocab "TASK_EVENT_TRIGGER_AT_SYSTEMSTART"^^vocabulary:TriggerFrequencyVocab @@ -1147,7 +1112,6 @@ vocabulary:TriggerTypeVocab rdfs:comment "Defines an open-vocabulary of the types of triggers associated with a task."@en ; owl:equivalentClass [ a rdfs:Datatype ; - owl:onDatatype xsd:string ; owl:oneOf ( "TASK_TRIGGER_BOOT"^^vocabulary:TriggerTypeVocab "TASK_TRIGGER_EVENT"^^vocabulary:TriggerTypeVocab @@ -1166,7 +1130,6 @@ vocabulary:URLTransitionTypeVocab rdfs:comment "Defines an open-vocabulary of types of URL transitions."@en ; owl:equivalentClass [ a rdfs:Datatype ; - owl:onDatatype xsd:string ; owl:oneOf ( "link"^^vocabulary:URLTransitionTypeVocab "typed"^^vocabulary:URLTransitionTypeVocab @@ -1189,7 +1152,6 @@ vocabulary:UnixProcessStateVocab rdfs:comment "Defines an open-vocabulary of Unix process states"@en ; owl:equivalentClass [ a rdfs:Datatype ; - owl:onDatatype xsd:string ; owl:oneOf ( "Dead"^^vocabulary:UnixProcessStateVocab "InterruptibleSleep"^^vocabulary:UnixProcessStateVocab @@ -1208,7 +1170,6 @@ vocabulary:WhoisContactTypeVocab rdfs:comment "Defines an open-vocabulary of types of registrar contacts listed in a whois entry."@en ; owl:equivalentClass [ a rdfs:Datatype ; - owl:onDatatype xsd:string ; owl:oneOf ( "ADMIN"^^vocabulary:WhoisContactTypeVocab "BILLING"^^vocabulary:WhoisContactTypeVocab @@ -1223,7 +1184,6 @@ vocabulary:WhoisDNSSECTypeVocab rdfs:comment "Defines an open-vocabulary of acceptable values for the DNSSEC field in a Whois entry."@en ; owl:equivalentClass [ a rdfs:Datatype ; - owl:onDatatype xsd:string ; owl:oneOf ( "Signed"^^vocabulary:WhoisDNSSECTypeVocab "Unsigned"^^vocabulary:WhoisDNSSECTypeVocab @@ -1237,7 +1197,6 @@ vocabulary:WhoisStatusTypeVocab rdfs:comment "Defines an open-vocabulary of all valid statuses for a domain within a whois entry."@en ; owl:equivalentClass [ a rdfs:Datatype ; - owl:onDatatype xsd:string ; owl:oneOf ( "ADD_PERIOD"^^vocabulary:WhoisStatusTypeVocab "AUTO_RENEW_PERIOD"^^vocabulary:WhoisStatusTypeVocab @@ -1268,7 +1227,6 @@ vocabulary:WindowsDriveTypeVocab rdfs:comment "Defines an open-vocabulary of possible drive types, as enumerated by the WINAPI GetDriveType function: http://msdn.microsoft.com/en-us/library/windows/desktop/aa364939(v=vs.85).aspx."@en ; owl:equivalentClass [ a rdfs:Datatype ; - owl:onDatatype xsd:string ; owl:oneOf ( "DRIVE_CDROM"^^vocabulary:WindowsDriveTypeVocab "DRIVE_FIXED"^^vocabulary:WindowsDriveTypeVocab @@ -1287,7 +1245,6 @@ vocabulary:WindowsVolumeAttributeVocab rdfs:comment "Defines an open-vocabulary of attributes that may be returned by the diskpart attributes command: http://technet.microsoft.com/en-us/library/cc766465(v=ws.10).aspx."@en ; owl:equivalentClass [ a rdfs:Datatype ; - owl:onDatatype xsd:string ; owl:oneOf ( "Hidden"^^vocabulary:WindowsVolumeAttributeVocab "NoDefaultDriveLetter"^^vocabulary:WindowsVolumeAttributeVocab @@ -1303,7 +1260,6 @@ vocabulary:WirelessNetworkSecurityModeVocab rdfs:comment "Defines an open-vocabulary of security modes that may be configured for wireless network connections."@en ; owl:equivalentClass [ a rdfs:Datatype ; - owl:onDatatype xsd:string ; owl:oneOf ( "None"^^vocabulary:WirelessNetworkSecurityModeVocab "WEP"^^vocabulary:WirelessNetworkSecurityModeVocab diff --git a/tests/examples/Makefile b/tests/examples/Makefile index 2fa809b..5b38e45 100644 --- a/tests/examples/Makefile +++ b/tests/examples/Makefile @@ -41,6 +41,8 @@ all: \ location_XFAIL_validation.ttl \ message_thread_PASS_validation.ttl \ message_thread_XFAIL_validation.ttl \ + object_status_PASS_validation.ttl \ + object_status_XFAIL_validation.ttl \ observable_creation_time_XFAIL_validation.ttl \ owl_axiom_PASS_validation.ttl \ owl_axiom_XFAIL_validation.ttl \ @@ -116,6 +118,8 @@ check: \ location_XFAIL_validation.ttl \ message_thread_PASS_validation.ttl \ message_thread_XFAIL_validation.ttl \ + object_status_PASS_validation.ttl \ + object_status_XFAIL_validation.ttl \ observable_creation_time_XFAIL_validation.ttl \ owl_axiom_PASS_validation.ttl \ owl_axiom_XFAIL_validation.ttl \ diff --git a/tests/examples/object_status_PASS.json b/tests/examples/object_status_PASS.json new file mode 100644 index 0000000..2d10dc4 --- /dev/null +++ b/tests/examples/object_status_PASS.json @@ -0,0 +1,16 @@ +{ + "@context": { + "core": "https://ontology.unifiedcyberontology.org/uco/core/", + "kb": "http://example.org/kb/" + }, + "@graph": [ + { + "@id": "kb:UcoObject-f86c567d-374a-4873-b9bc-a746ca2bf360", + "@type": "core:UcoObject", + "core:objectStatus": { + "@type": "core:ObjectStatusVocab", + "@value": "Draft" + } + } + ] +} diff --git a/tests/examples/object_status_PASS_validation.ttl b/tests/examples/object_status_PASS_validation.ttl new file mode 100644 index 0000000..33496ff --- /dev/null +++ b/tests/examples/object_status_PASS_validation.ttl @@ -0,0 +1,11 @@ +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix xsd: . + +[] + a sh:ValidationReport ; + sh:conforms "true"^^xsd:boolean ; + . + diff --git a/tests/examples/object_status_XFAIL.json b/tests/examples/object_status_XFAIL.json new file mode 100644 index 0000000..b827c23 --- /dev/null +++ b/tests/examples/object_status_XFAIL.json @@ -0,0 +1,26 @@ +{ + "@context": { + "core": "https://ontology.unifiedcyberontology.org/uco/core/", + "kb": "http://example.org/kb/", + "rdfs": "http://www.w3.org/2000/01/rdf-schema#" + }, + "@graph": [ + { + "@id": "kb:UcoObject-6ae2b245-a8cd-45dc-9f40-5b2738879351", + "@type": "core:UcoObject", + "rdfs:comment": "This will trigger an error from using a value outside of the required vocabulary.", + "core:objectStatus": "Initial draft" + }, + { + "@id": "kb:File-c9c36379-8eca-4a85-887c-b51f7721edfd", + "@type": "observable:File", + "core:hasFacet": { + "@id": "kb:ArchiveFileFacet-5884ca1c-2f5e-4e66-bdc6-7d48606f9fbc", + "@type": "observable:ArchiveFileFacet", + "rdfs:comment": "This will trigger an error from using objectStatus on a non-UcoObject thing.", + "core:objectStatus": "Draft", + "observable:archiveType": "Currently-unknown compressing-and-encrypting type seen multiple places, further research needed" + } + } + ] +} diff --git a/tests/examples/object_status_XFAIL_validation.ttl b/tests/examples/object_status_XFAIL_validation.ttl new file mode 100644 index 0000000..b84dd57 --- /dev/null +++ b/tests/examples/object_status_XFAIL_validation.ttl @@ -0,0 +1,63 @@ +@prefix core: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix xsd: . + +[] + a sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result + [ + a sh:ValidationResult ; + sh:focusNode ; + sh:resultMessage "Value does not have class core:UcoObject" ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:ClassConstraintComponent ; + sh:sourceShape core:objectStatus-subjects-shape ; + sh:value ; + ] , + [ + a sh:ValidationResult ; + sh:focusNode ; + sh:resultMessage "Value Literal(\"Initial draft\") not in list ['Literal(\"Draft\" = None, datatype=core:ObjectStatusVocab)', 'Literal(\"Final\" = None, datatype=core:ObjectStatusVocab)', 'Literal(\"Deprecated\" = None, datatype=core:ObjectStatusVocab)']" ; + sh:resultPath core:objectStatus ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:InConstraintComponent ; + sh:sourceShape [ + 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:value "Initial draft" ; + ] , + [ + a sh:ValidationResult ; + sh:focusNode ; + sh:resultMessage "Value is not Literal with datatype core:ObjectStatusVocab" ; + sh:resultPath core:objectStatus ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; + sh:sourceShape [ + 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:value "Initial draft" ; + ] + ; + . + diff --git a/tests/examples/test_validation.py b/tests/examples/test_validation.py index 162c21c..3461ea7 100644 --- a/tests/examples/test_validation.py +++ b/tests/examples/test_validation.py @@ -419,6 +419,28 @@ def test_message_thread_PASS_validation() -> None: def test_message_thread_XFAIL_validation() -> None: confirm_validation_results("message_thread_XFAIL_validation.ttl", False) +def test_object_status_PASS() -> None: + confirm_validation_results( + "object_status_PASS_validation.ttl", + True, + ) + +def test_object_status_XFAIL() -> None: + confirm_validation_results( + "object_status_XFAIL_validation.ttl", + False, + expected_focus_node_severities={ + ( + "http://example.org/kb/UcoObject-6ae2b245-a8cd-45dc-9f40-5b2738879351", + str(NS_SH.Violation) + ), + ( + "http://example.org/kb/ArchiveFileFacet-5884ca1c-2f5e-4e66-bdc6-7d48606f9fbc", + str(NS_SH.Violation) + ), + } + ) + def test_observable_creation_time_XFAIL() -> None: confirm_validation_results( "observable_creation_time_XFAIL_validation.ttl",