diff --git a/case_utils/case_file/__init__.py b/case_utils/case_file/__init__.py index e58fa92..d5cb65a 100644 --- a/case_utils/case_file/__init__.py +++ b/case_utils/case_file/__init__.py @@ -70,7 +70,7 @@ def create_file_node( :param filepath: The path to the file to characterize. Can be relative or absolute. :type filepath: str - :param node_iri: The desired full IRI for the node. If absent, will make an IRI of the pattern ``ns_base + 'file-' + uuid4`` + :param node_iri: The desired full IRI for the node. If absent, will make an IRI of the pattern ``ns_base + 'File-' + uuid4`` :type node_iri: str :param node_prefix: The base prefix to use if node_iri is not supplied. @@ -88,7 +88,7 @@ def create_file_node( node_namespace = rdflib.Namespace(node_prefix) if node_iri is None: - node_slug = "file-" + case_utils.local_uuid.local_uuid() + node_slug = "File-" + case_utils.local_uuid.local_uuid() node_iri = node_namespace[node_slug] n_file = rdflib.URIRef(node_iri) graph.add((n_file, NS_RDF.type, NS_UCO_OBSERVABLE.File)) @@ -97,7 +97,7 @@ def create_file_node( literal_basename = rdflib.Literal(basename) file_stat = os.stat(filepath) - n_file_facet = node_namespace["file-facet-" + case_utils.local_uuid.local_uuid()] + n_file_facet = node_namespace["FileFacet-" + case_utils.local_uuid.local_uuid()] graph.add( ( n_file_facet, @@ -273,7 +273,7 @@ def main() -> None: context_dictionary = {k: v for (k, v) in graph.namespace_manager.namespaces()} serialize_kwargs["context"] = context_dictionary - node_iri = NS_BASE["file-" + case_utils.local_uuid.local_uuid()] + node_iri = NS_BASE["File-" + case_utils.local_uuid.local_uuid()] create_file_node( graph, args.in_file, diff --git a/tests/case_utils/case_file/kb.json b/tests/case_utils/case_file/kb.json index 5aa6bc9..a557e2f 100644 --- a/tests/case_utils/case_file/kb.json +++ b/tests/case_utils/case_file/kb.json @@ -9,54 +9,26 @@ }, "@graph": [ { - "@id": "kb:content-data-facet-1833f979-1f19-5543-9d82-6cefd144b169", - "@type": "uco-observable:ContentDataFacet", - "uco-observable:hash": [ - { - "@id": "kb:hash-24644904-83ea-5911-aea8-be687a9f3caf" - }, - { - "@id": "kb:hash-295bdeb5-7f23-5a3f-8b7f-4bb1191b7c21" - }, - { - "@id": "kb:hash-39127f5c-598b-51d4-a720-2e949f18f85f" - }, - { - "@id": "kb:hash-49e81fee-c6b3-5f5f-af8b-0746d32e4932" - }, - { - "@id": "kb:hash-720759b8-9544-5dab-ab12-003372b17a4e" - }, - { - "@id": "kb:hash-b02ebdb3-edf7-5fbf-8088-3d064e316b93" - } - ], - "uco-observable:sizeInBytes": { - "@type": "xsd:integer", - "@value": "4" - } - }, - { - "@id": "kb:file-800784de-5c9e-5eb2-b843-0ac51a1bd4b9", + "@id": "kb:File-800784de-5c9e-5eb2-b843-0ac51a1bd4b9", "@type": "uco-observable:File", "uco-core:hasFacet": { - "@id": "kb:file-facet-ffa3e6bb-dffc-549d-a7c4-ffc5e90ac55d" + "@id": "kb:FileFacet-ffa3e6bb-dffc-549d-a7c4-ffc5e90ac55d" } }, { - "@id": "kb:file-ace6460a-92a9-58b9-83ea-a18ae87f6e04", + "@id": "kb:File-ace6460a-92a9-58b9-83ea-a18ae87f6e04", "@type": "uco-observable:File", "uco-core:hasFacet": [ { - "@id": "kb:content-data-facet-1833f979-1f19-5543-9d82-6cefd144b169" + "@id": "kb:FileFacet-1297a4bd-563b-54c3-ad8a-f67f01ba9b10" }, { - "@id": "kb:file-facet-1297a4bd-563b-54c3-ad8a-f67f01ba9b10" + "@id": "kb:content-data-facet-1833f979-1f19-5543-9d82-6cefd144b169" } ] }, { - "@id": "kb:file-facet-1297a4bd-563b-54c3-ad8a-f67f01ba9b10", + "@id": "kb:FileFacet-1297a4bd-563b-54c3-ad8a-f67f01ba9b10", "@type": "uco-observable:FileFacet", "uco-observable:fileName": "sample.txt", "uco-observable:modifiedTime": { @@ -69,7 +41,7 @@ } }, { - "@id": "kb:file-facet-ffa3e6bb-dffc-549d-a7c4-ffc5e90ac55d", + "@id": "kb:FileFacet-ffa3e6bb-dffc-549d-a7c4-ffc5e90ac55d", "@type": "uco-observable:FileFacet", "uco-observable:fileName": "sample.txt", "uco-observable:modifiedTime": { @@ -81,6 +53,34 @@ "@value": "4" } }, + { + "@id": "kb:content-data-facet-1833f979-1f19-5543-9d82-6cefd144b169", + "@type": "uco-observable:ContentDataFacet", + "uco-observable:hash": [ + { + "@id": "kb:hash-24644904-83ea-5911-aea8-be687a9f3caf" + }, + { + "@id": "kb:hash-295bdeb5-7f23-5a3f-8b7f-4bb1191b7c21" + }, + { + "@id": "kb:hash-39127f5c-598b-51d4-a720-2e949f18f85f" + }, + { + "@id": "kb:hash-49e81fee-c6b3-5f5f-af8b-0746d32e4932" + }, + { + "@id": "kb:hash-720759b8-9544-5dab-ab12-003372b17a4e" + }, + { + "@id": "kb:hash-b02ebdb3-edf7-5fbf-8088-3d064e316b93" + } + ], + "uco-observable:sizeInBytes": { + "@type": "xsd:integer", + "@value": "4" + } + }, { "@id": "kb:hash-24644904-83ea-5911-aea8-be687a9f3caf", "@type": "uco-types:Hash", diff --git a/tests/case_utils/case_file/kb.ttl b/tests/case_utils/case_file/kb.ttl index 566013e..45ad25e 100644 --- a/tests/case_utils/case_file/kb.ttl +++ b/tests/case_utils/case_file/kb.ttl @@ -8,46 +8,46 @@ @prefix uco-vocabulary: . @prefix xsd: . -kb:content-data-facet-1833f979-1f19-5543-9d82-6cefd144b169 - a uco-observable:ContentDataFacet ; - uco-observable:hash - kb:hash-24644904-83ea-5911-aea8-be687a9f3caf , - kb:hash-295bdeb5-7f23-5a3f-8b7f-4bb1191b7c21 , - kb:hash-39127f5c-598b-51d4-a720-2e949f18f85f , - kb:hash-49e81fee-c6b3-5f5f-af8b-0746d32e4932 , - kb:hash-720759b8-9544-5dab-ab12-003372b17a4e , - kb:hash-b02ebdb3-edf7-5fbf-8088-3d064e316b93 - ; - uco-observable:sizeInBytes "4"^^xsd:integer ; - . - -kb:file-800784de-5c9e-5eb2-b843-0ac51a1bd4b9 +kb:File-800784de-5c9e-5eb2-b843-0ac51a1bd4b9 a uco-observable:File ; - uco-core:hasFacet kb:file-facet-ffa3e6bb-dffc-549d-a7c4-ffc5e90ac55d ; + uco-core:hasFacet kb:FileFacet-ffa3e6bb-dffc-549d-a7c4-ffc5e90ac55d ; . -kb:file-ace6460a-92a9-58b9-83ea-a18ae87f6e04 +kb:File-ace6460a-92a9-58b9-83ea-a18ae87f6e04 a uco-observable:File ; uco-core:hasFacet - kb:content-data-facet-1833f979-1f19-5543-9d82-6cefd144b169 , - kb:file-facet-1297a4bd-563b-54c3-ad8a-f67f01ba9b10 + kb:FileFacet-1297a4bd-563b-54c3-ad8a-f67f01ba9b10 , + kb:content-data-facet-1833f979-1f19-5543-9d82-6cefd144b169 ; . -kb:file-facet-1297a4bd-563b-54c3-ad8a-f67f01ba9b10 +kb:FileFacet-1297a4bd-563b-54c3-ad8a-f67f01ba9b10 a uco-observable:FileFacet ; uco-observable:fileName "sample.txt" ; uco-observable:modifiedTime "2010-01-02T03:04:56+00:00"^^xsd:dateTime ; uco-observable:sizeInBytes "4"^^xsd:integer ; . -kb:file-facet-ffa3e6bb-dffc-549d-a7c4-ffc5e90ac55d +kb:FileFacet-ffa3e6bb-dffc-549d-a7c4-ffc5e90ac55d a uco-observable:FileFacet ; uco-observable:fileName "sample.txt" ; uco-observable:modifiedTime "2010-01-02T03:04:56+00:00"^^xsd:dateTime ; uco-observable:sizeInBytes "4"^^xsd:integer ; . +kb:content-data-facet-1833f979-1f19-5543-9d82-6cefd144b169 + a uco-observable:ContentDataFacet ; + uco-observable:hash + kb:hash-24644904-83ea-5911-aea8-be687a9f3caf , + kb:hash-295bdeb5-7f23-5a3f-8b7f-4bb1191b7c21 , + kb:hash-39127f5c-598b-51d4-a720-2e949f18f85f , + kb:hash-49e81fee-c6b3-5f5f-af8b-0746d32e4932 , + kb:hash-720759b8-9544-5dab-ab12-003372b17a4e , + kb:hash-b02ebdb3-edf7-5fbf-8088-3d064e316b93 + ; + uco-observable:sizeInBytes "4"^^xsd:integer ; + . + kb:hash-24644904-83ea-5911-aea8-be687a9f3caf a uco-types:Hash ; uco-types:hashMethod "MD5"^^uco-vocabulary:HashNameVocab ; diff --git a/tests/case_utils/case_file/sample.txt-disable_hashes.ttl b/tests/case_utils/case_file/sample.txt-disable_hashes.ttl index d9bc216..24add3e 100644 --- a/tests/case_utils/case_file/sample.txt-disable_hashes.ttl +++ b/tests/case_utils/case_file/sample.txt-disable_hashes.ttl @@ -6,12 +6,12 @@ @prefix uco-observable: . @prefix xsd: . -kb:file-800784de-5c9e-5eb2-b843-0ac51a1bd4b9 +kb:File-800784de-5c9e-5eb2-b843-0ac51a1bd4b9 a uco-observable:File ; - uco-core:hasFacet kb:file-facet-ffa3e6bb-dffc-549d-a7c4-ffc5e90ac55d ; + uco-core:hasFacet kb:FileFacet-ffa3e6bb-dffc-549d-a7c4-ffc5e90ac55d ; . -kb:file-facet-ffa3e6bb-dffc-549d-a7c4-ffc5e90ac55d +kb:FileFacet-ffa3e6bb-dffc-549d-a7c4-ffc5e90ac55d a uco-observable:FileFacet ; uco-observable:fileName "sample.txt" ; uco-observable:modifiedTime "2010-01-02T03:04:56+00:00"^^xsd:dateTime ; diff --git a/tests/case_utils/case_file/sample.txt-nocompact.json b/tests/case_utils/case_file/sample.txt-nocompact.json index efdb4b7..83e2ff3 100644 --- a/tests/case_utils/case_file/sample.txt-nocompact.json +++ b/tests/case_utils/case_file/sample.txt-nocompact.json @@ -37,48 +37,35 @@ }, "@graph": [ { - "@id": "http://example.org/kb/content-data-facet-bda9b72d-2753-54ab-9292-e1e260be4f6d", - "@type": "https://ontology.unifiedcyberontology.org/uco/observable/ContentDataFacet", - "https://ontology.unifiedcyberontology.org/uco/observable/hash": [ - { - "@id": "http://example.org/kb/hash-8ebb651a-314b-554a-b63e-78b9e69111d8" - }, - { - "@id": "http://example.org/kb/hash-c77cb4f1-ac2a-52c7-b67e-016e209515cb" - }, - { - "@id": "http://example.org/kb/hash-bdb2ba7d-8cb2-5591-a051-0c20d134e894" - }, - { - "@id": "http://example.org/kb/hash-bf689e82-1cc4-507f-a6fb-7fc01b9289c6" - }, - { - "@id": "http://example.org/kb/hash-dd2161f0-4943-55c0-b08e-a2ad8a85dce8" - }, - { - "@id": "http://example.org/kb/hash-28dd6731-4eda-5ae7-9810-efedc7593912" - } - ], - "https://ontology.unifiedcyberontology.org/uco/observable/sizeInBytes": 4 + "@id": "http://example.org/kb/hash-dd2161f0-4943-55c0-b08e-a2ad8a85dce8", + "@type": "https://ontology.unifiedcyberontology.org/uco/types/Hash", + "https://ontology.unifiedcyberontology.org/uco/types/hashMethod": { + "@type": "https://ontology.unifiedcyberontology.org/uco/vocabulary/HashNameVocab", + "@value": "SHA3-256" + }, + "https://ontology.unifiedcyberontology.org/uco/types/hashValue": { + "@type": "http://www.w3.org/2001/XMLSchema#hexBinary", + "@value": "36f028580bb02cc8272a9a020f4200e346e276ae664e45ee80745574e2f5ab80" + } }, { - "@id": "http://example.org/kb/hash-bdb2ba7d-8cb2-5591-a051-0c20d134e894", + "@id": "http://example.org/kb/hash-c77cb4f1-ac2a-52c7-b67e-016e209515cb", "@type": "https://ontology.unifiedcyberontology.org/uco/types/Hash", "https://ontology.unifiedcyberontology.org/uco/types/hashMethod": { "@type": "https://ontology.unifiedcyberontology.org/uco/vocabulary/HashNameVocab", - "@value": "SHA256" + "@value": "SHA1" }, "https://ontology.unifiedcyberontology.org/uco/types/hashValue": { "@type": "http://www.w3.org/2001/XMLSchema#hexBinary", - "@value": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08" + "@value": "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3" } }, { - "@id": "http://example.org/kb/file-23f45d80-7b16-5e7f-ba34-40392fa4f8fc", + "@id": "http://example.org/kb/File-23f45d80-7b16-5e7f-ba34-40392fa4f8fc", "@type": "https://ontology.unifiedcyberontology.org/uco/observable/File", "https://ontology.unifiedcyberontology.org/uco/core/hasFacet": [ { - "@id": "http://example.org/kb/file-facet-a5d9606e-a5cf-5531-9462-5bed0ac4219c" + "@id": "http://example.org/kb/FileFacet-a5d9606e-a5cf-5531-9462-5bed0ac4219c" }, { "@id": "http://example.org/kb/content-data-facet-bda9b72d-2753-54ab-9292-e1e260be4f6d" @@ -86,73 +73,86 @@ ] }, { - "@id": "http://example.org/kb/hash-28dd6731-4eda-5ae7-9810-efedc7593912", + "@id": "http://example.org/kb/hash-bf689e82-1cc4-507f-a6fb-7fc01b9289c6", "@type": "https://ontology.unifiedcyberontology.org/uco/types/Hash", "https://ontology.unifiedcyberontology.org/uco/types/hashMethod": { "@type": "https://ontology.unifiedcyberontology.org/uco/vocabulary/HashNameVocab", - "@value": "SHA3-512" + "@value": "SHA512" }, "https://ontology.unifiedcyberontology.org/uco/types/hashValue": { "@type": "http://www.w3.org/2001/XMLSchema#hexBinary", - "@value": "9ece086e9bac491fac5c1d1046ca11d737b92a2b2ebd93f005d7b710110c0a678288166e7fbe796883a4f2e9b3ca9f484f521d0ce464345cc1aec96779149c14" + "@value": "ee26b0dd4af7e749aa1a8ee3c10ae9923f618980772e473f8819a5d4940e0db27ac185f8a0e1d5f84f88bc887fd67b143732c304cc5fa9ad8e6f57f50028a8ff" } }, { - "@id": "http://example.org/kb/file-facet-a5d9606e-a5cf-5531-9462-5bed0ac4219c", - "@type": "https://ontology.unifiedcyberontology.org/uco/observable/FileFacet", - "https://ontology.unifiedcyberontology.org/uco/observable/fileName": "sample.txt", - "https://ontology.unifiedcyberontology.org/uco/observable/modifiedTime": { - "@type": "http://www.w3.org/2001/XMLSchema#dateTime", - "@value": "2010-01-02T03:04:56+00:00" - }, - "https://ontology.unifiedcyberontology.org/uco/observable/sizeInBytes": 4 - }, - { - "@id": "http://example.org/kb/hash-8ebb651a-314b-554a-b63e-78b9e69111d8", + "@id": "http://example.org/kb/hash-bdb2ba7d-8cb2-5591-a051-0c20d134e894", "@type": "https://ontology.unifiedcyberontology.org/uco/types/Hash", "https://ontology.unifiedcyberontology.org/uco/types/hashMethod": { "@type": "https://ontology.unifiedcyberontology.org/uco/vocabulary/HashNameVocab", - "@value": "MD5" + "@value": "SHA256" }, "https://ontology.unifiedcyberontology.org/uco/types/hashValue": { "@type": "http://www.w3.org/2001/XMLSchema#hexBinary", - "@value": "098f6bcd4621d373cade4e832627b4f6" + "@value": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08" } }, { - "@id": "http://example.org/kb/hash-bf689e82-1cc4-507f-a6fb-7fc01b9289c6", + "@id": "http://example.org/kb/hash-8ebb651a-314b-554a-b63e-78b9e69111d8", "@type": "https://ontology.unifiedcyberontology.org/uco/types/Hash", "https://ontology.unifiedcyberontology.org/uco/types/hashMethod": { "@type": "https://ontology.unifiedcyberontology.org/uco/vocabulary/HashNameVocab", - "@value": "SHA512" + "@value": "MD5" }, "https://ontology.unifiedcyberontology.org/uco/types/hashValue": { "@type": "http://www.w3.org/2001/XMLSchema#hexBinary", - "@value": "ee26b0dd4af7e749aa1a8ee3c10ae9923f618980772e473f8819a5d4940e0db27ac185f8a0e1d5f84f88bc887fd67b143732c304cc5fa9ad8e6f57f50028a8ff" + "@value": "098f6bcd4621d373cade4e832627b4f6" } }, { - "@id": "http://example.org/kb/hash-dd2161f0-4943-55c0-b08e-a2ad8a85dce8", - "@type": "https://ontology.unifiedcyberontology.org/uco/types/Hash", - "https://ontology.unifiedcyberontology.org/uco/types/hashMethod": { - "@type": "https://ontology.unifiedcyberontology.org/uco/vocabulary/HashNameVocab", - "@value": "SHA3-256" + "@id": "http://example.org/kb/content-data-facet-bda9b72d-2753-54ab-9292-e1e260be4f6d", + "@type": "https://ontology.unifiedcyberontology.org/uco/observable/ContentDataFacet", + "https://ontology.unifiedcyberontology.org/uco/observable/hash": [ + { + "@id": "http://example.org/kb/hash-8ebb651a-314b-554a-b63e-78b9e69111d8" + }, + { + "@id": "http://example.org/kb/hash-c77cb4f1-ac2a-52c7-b67e-016e209515cb" + }, + { + "@id": "http://example.org/kb/hash-bdb2ba7d-8cb2-5591-a051-0c20d134e894" + }, + { + "@id": "http://example.org/kb/hash-bf689e82-1cc4-507f-a6fb-7fc01b9289c6" + }, + { + "@id": "http://example.org/kb/hash-dd2161f0-4943-55c0-b08e-a2ad8a85dce8" + }, + { + "@id": "http://example.org/kb/hash-28dd6731-4eda-5ae7-9810-efedc7593912" + } + ], + "https://ontology.unifiedcyberontology.org/uco/observable/sizeInBytes": 4 + }, + { + "@id": "http://example.org/kb/FileFacet-a5d9606e-a5cf-5531-9462-5bed0ac4219c", + "@type": "https://ontology.unifiedcyberontology.org/uco/observable/FileFacet", + "https://ontology.unifiedcyberontology.org/uco/observable/fileName": "sample.txt", + "https://ontology.unifiedcyberontology.org/uco/observable/modifiedTime": { + "@type": "http://www.w3.org/2001/XMLSchema#dateTime", + "@value": "2010-01-02T03:04:56+00:00" }, - "https://ontology.unifiedcyberontology.org/uco/types/hashValue": { - "@type": "http://www.w3.org/2001/XMLSchema#hexBinary", - "@value": "36f028580bb02cc8272a9a020f4200e346e276ae664e45ee80745574e2f5ab80" - } + "https://ontology.unifiedcyberontology.org/uco/observable/sizeInBytes": 4 }, { - "@id": "http://example.org/kb/hash-c77cb4f1-ac2a-52c7-b67e-016e209515cb", + "@id": "http://example.org/kb/hash-28dd6731-4eda-5ae7-9810-efedc7593912", "@type": "https://ontology.unifiedcyberontology.org/uco/types/Hash", "https://ontology.unifiedcyberontology.org/uco/types/hashMethod": { "@type": "https://ontology.unifiedcyberontology.org/uco/vocabulary/HashNameVocab", - "@value": "SHA1" + "@value": "SHA3-512" }, "https://ontology.unifiedcyberontology.org/uco/types/hashValue": { "@type": "http://www.w3.org/2001/XMLSchema#hexBinary", - "@value": "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3" + "@value": "9ece086e9bac491fac5c1d1046ca11d737b92a2b2ebd93f005d7b710110c0a678288166e7fbe796883a4f2e9b3ca9f484f521d0ce464345cc1aec96779149c14" } } ] diff --git a/tests/case_utils/case_file/sample.txt.json b/tests/case_utils/case_file/sample.txt.json index 7120e96..e393a69 100644 --- a/tests/case_utils/case_file/sample.txt.json +++ b/tests/case_utils/case_file/sample.txt.json @@ -36,42 +36,6 @@ "xsd": "http://www.w3.org/2001/XMLSchema#" }, "@graph": [ - { - "@id": "kb:file-789a91ef-6446-548c-9911-dcc5168f25ea", - "@type": "uco-observable:File", - "uco-core:hasFacet": [ - { - "@id": "kb:file-facet-e6bb7192-3a63-561b-87c2-9aea090b49e4" - }, - { - "@id": "kb:content-data-facet-f48466e4-5394-584d-84ad-c46a7b9680bf" - } - ] - }, - { - "@id": "kb:hash-2b723e8c-6125-5867-83c3-a46753e41a07", - "@type": "uco-types:Hash", - "uco-types:hashMethod": { - "@type": "uco-vocabulary:HashNameVocab", - "@value": "SHA256" - }, - "uco-types:hashValue": { - "@type": "xsd:hexBinary", - "@value": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08" - } - }, - { - "@id": "kb:hash-2cae4ae2-d773-5ea2-ba3e-2c4092574959", - "@type": "uco-types:Hash", - "uco-types:hashMethod": { - "@type": "uco-vocabulary:HashNameVocab", - "@value": "SHA1" - }, - "uco-types:hashValue": { - "@type": "xsd:hexBinary", - "@value": "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3" - } - }, { "@id": "kb:hash-b656d6d4-b99b-58c8-a487-9889713a8efe", "@type": "uco-types:Hash", @@ -97,27 +61,37 @@ } }, { - "@id": "kb:hash-3228c9ed-792d-5603-afc2-8b9a9752606d", + "@id": "kb:FileFacet-e6bb7192-3a63-561b-87c2-9aea090b49e4", + "@type": "uco-observable:FileFacet", + "uco-observable:fileName": "sample.txt", + "uco-observable:modifiedTime": { + "@type": "xsd:dateTime", + "@value": "2010-01-02T03:04:56+00:00" + }, + "uco-observable:sizeInBytes": 4 + }, + { + "@id": "kb:hash-2cae4ae2-d773-5ea2-ba3e-2c4092574959", "@type": "uco-types:Hash", "uco-types:hashMethod": { "@type": "uco-vocabulary:HashNameVocab", - "@value": "SHA3-512" + "@value": "SHA1" }, "uco-types:hashValue": { "@type": "xsd:hexBinary", - "@value": "9ece086e9bac491fac5c1d1046ca11d737b92a2b2ebd93f005d7b710110c0a678288166e7fbe796883a4f2e9b3ca9f484f521d0ce464345cc1aec96779149c14" + "@value": "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3" } }, { - "@id": "kb:hash-f067246c-a31a-597d-a84b-7b70ce4c8795", + "@id": "kb:hash-3228c9ed-792d-5603-afc2-8b9a9752606d", "@type": "uco-types:Hash", "uco-types:hashMethod": { "@type": "uco-vocabulary:HashNameVocab", - "@value": "MD5" + "@value": "SHA3-512" }, "uco-types:hashValue": { "@type": "xsd:hexBinary", - "@value": "098f6bcd4621d373cade4e832627b4f6" + "@value": "9ece086e9bac491fac5c1d1046ca11d737b92a2b2ebd93f005d7b710110c0a678288166e7fbe796883a4f2e9b3ca9f484f521d0ce464345cc1aec96779149c14" } }, { @@ -146,14 +120,40 @@ "uco-observable:sizeInBytes": 4 }, { - "@id": "kb:file-facet-e6bb7192-3a63-561b-87c2-9aea090b49e4", - "@type": "uco-observable:FileFacet", - "uco-observable:fileName": "sample.txt", - "uco-observable:modifiedTime": { - "@type": "xsd:dateTime", - "@value": "2010-01-02T03:04:56+00:00" + "@id": "kb:hash-2b723e8c-6125-5867-83c3-a46753e41a07", + "@type": "uco-types:Hash", + "uco-types:hashMethod": { + "@type": "uco-vocabulary:HashNameVocab", + "@value": "SHA256" }, - "uco-observable:sizeInBytes": 4 + "uco-types:hashValue": { + "@type": "xsd:hexBinary", + "@value": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08" + } + }, + { + "@id": "kb:hash-f067246c-a31a-597d-a84b-7b70ce4c8795", + "@type": "uco-types:Hash", + "uco-types:hashMethod": { + "@type": "uco-vocabulary:HashNameVocab", + "@value": "MD5" + }, + "uco-types:hashValue": { + "@type": "xsd:hexBinary", + "@value": "098f6bcd4621d373cade4e832627b4f6" + } + }, + { + "@id": "kb:File-789a91ef-6446-548c-9911-dcc5168f25ea", + "@type": "uco-observable:File", + "uco-core:hasFacet": [ + { + "@id": "kb:FileFacet-e6bb7192-3a63-561b-87c2-9aea090b49e4" + }, + { + "@id": "kb:content-data-facet-f48466e4-5394-584d-84ad-c46a7b9680bf" + } + ] } ] } \ No newline at end of file diff --git a/tests/case_utils/case_file/sample.txt.ttl b/tests/case_utils/case_file/sample.txt.ttl index ddccd88..8ca8973 100644 --- a/tests/case_utils/case_file/sample.txt.ttl +++ b/tests/case_utils/case_file/sample.txt.ttl @@ -8,6 +8,21 @@ @prefix uco-vocabulary: . @prefix xsd: . +kb:File-ace6460a-92a9-58b9-83ea-a18ae87f6e04 + a uco-observable:File ; + uco-core:hasFacet + kb:FileFacet-1297a4bd-563b-54c3-ad8a-f67f01ba9b10 , + kb:content-data-facet-1833f979-1f19-5543-9d82-6cefd144b169 + ; + . + +kb:FileFacet-1297a4bd-563b-54c3-ad8a-f67f01ba9b10 + a uco-observable:FileFacet ; + uco-observable:fileName "sample.txt" ; + uco-observable:modifiedTime "2010-01-02T03:04:56+00:00"^^xsd:dateTime ; + uco-observable:sizeInBytes "4"^^xsd:integer ; + . + kb:content-data-facet-1833f979-1f19-5543-9d82-6cefd144b169 a uco-observable:ContentDataFacet ; uco-observable:hash @@ -21,21 +36,6 @@ kb:content-data-facet-1833f979-1f19-5543-9d82-6cefd144b169 uco-observable:sizeInBytes "4"^^xsd:integer ; . -kb:file-ace6460a-92a9-58b9-83ea-a18ae87f6e04 - a uco-observable:File ; - uco-core:hasFacet - kb:content-data-facet-1833f979-1f19-5543-9d82-6cefd144b169 , - kb:file-facet-1297a4bd-563b-54c3-ad8a-f67f01ba9b10 - ; - . - -kb:file-facet-1297a4bd-563b-54c3-ad8a-f67f01ba9b10 - a uco-observable:FileFacet ; - uco-observable:fileName "sample.txt" ; - uco-observable:modifiedTime "2010-01-02T03:04:56+00:00"^^xsd:dateTime ; - uco-observable:sizeInBytes "4"^^xsd:integer ; - . - kb:hash-24644904-83ea-5911-aea8-be687a9f3caf a uco-types:Hash ; uco-types:hashMethod "MD5"^^uco-vocabulary:HashNameVocab ;