diff --git a/case_utils/case_file/__init__.py b/case_utils/case_file/__init__.py
index cd77303..df157f0 100644
--- a/case_utils/case_file/__init__.py
+++ b/case_utils/case_file/__init__.py
@@ -82,9 +82,11 @@ def create_file_node(
:returns: The File Observable Object's node.
:rtype: rdflib.URIRef
"""
+ node_namespace = rdflib.Namespace(node_prefix)
+
if node_iri is None:
node_slug = "file-" + case_utils.local_uuid.local_uuid()
- node_iri = rdflib.Namespace(node_prefix)[node_slug]
+ node_iri = node_namespace[node_slug]
n_file = rdflib.URIRef(node_iri)
graph.add((n_file, NS_RDF.type, NS_UCO_OBSERVABLE.File))
@@ -92,7 +94,7 @@ def create_file_node(
literal_basename = rdflib.Literal(basename)
file_stat = os.stat(filepath)
- n_file_facet = rdflib.BNode()
+ n_file_facet = node_namespace["file-facet-" + case_utils.local_uuid.local_uuid()]
graph.add(
(
n_file_facet,
@@ -119,7 +121,9 @@ def create_file_node(
graph.add((n_file_facet, NS_UCO_OBSERVABLE.modifiedTime, literal_mtime))
if not disable_hashes:
- n_contentdata_facet = rdflib.BNode()
+ n_contentdata_facet = node_namespace[
+ "content-data-facet-" + case_utils.local_uuid.local_uuid()
+ ]
graph.add((n_file, NS_UCO_CORE.hasFacet, n_contentdata_facet))
graph.add(
(n_contentdata_facet, NS_RDF.type, NS_UCO_OBSERVABLE.ContentDataFacet)
@@ -191,7 +195,7 @@ def create_file_node(
for key in successful_hashdict._fields:
if key not in ("md5", "sha1", "sha256", "sha512"):
continue
- n_hash = rdflib.BNode()
+ n_hash = node_namespace["hash-" + case_utils.local_uuid.local_uuid()]
graph.add((n_contentdata_facet, NS_UCO_OBSERVABLE.hash, n_hash))
graph.add((n_hash, NS_RDF.type, NS_UCO_TYPES.Hash))
graph.add(
diff --git a/tests/case_utils/case_file/kb.json b/tests/case_utils/case_file/kb.json
index b968377..771a30b 100644
--- a/tests/case_utils/case_file/kb.json
+++ b/tests/case_utils/case_file/kb.json
@@ -8,20 +8,33 @@
"xsd": "http://www.w3.org/2001/XMLSchema#"
},
"@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"
+ }
+ ],
+ "uco-observable:sizeInBytes": {
+ "@type": "xsd:integer",
+ "@value": "4"
+ }
+ },
{
"@id": "kb:file-800784de-5c9e-5eb2-b843-0ac51a1bd4b9",
"@type": "uco-observable:File",
"uco-core:hasFacet": {
- "@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": {
- "@type": "xsd:integer",
- "@value": "4"
- }
+ "@id": "kb:file-facet-ffa3e6bb-dffc-549d-a7c4-ffc5e90ac55d"
}
},
{
@@ -29,71 +42,86 @@
"@type": "uco-observable:File",
"uco-core:hasFacet": [
{
- "@type": "uco-observable:ContentDataFacet",
- "uco-observable:hash": [
- {
- "@type": "uco-types:Hash",
- "uco-types:hashMethod": {
- "@type": "uco-vocabulary:HashNameVocab",
- "@value": "MD5"
- },
- "uco-types:hashValue": {
- "@type": "xsd:hexBinary",
- "@value": "098f6bcd4621d373cade4e832627b4f6"
- }
- },
- {
- "@type": "uco-types:Hash",
- "uco-types:hashMethod": {
- "@type": "uco-vocabulary:HashNameVocab",
- "@value": "SHA1"
- },
- "uco-types:hashValue": {
- "@type": "xsd:hexBinary",
- "@value": "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3"
- }
- },
- {
- "@type": "uco-types:Hash",
- "uco-types:hashMethod": {
- "@type": "uco-vocabulary:HashNameVocab",
- "@value": "SHA256"
- },
- "uco-types:hashValue": {
- "@type": "xsd:hexBinary",
- "@value": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
- }
- },
- {
- "@type": "uco-types:Hash",
- "uco-types:hashMethod": {
- "@type": "uco-vocabulary:HashNameVocab",
- "@value": "SHA512"
- },
- "uco-types:hashValue": {
- "@type": "xsd:hexBinary",
- "@value": "ee26b0dd4af7e749aa1a8ee3c10ae9923f618980772e473f8819a5d4940e0db27ac185f8a0e1d5f84f88bc887fd67b143732c304cc5fa9ad8e6f57f50028a8ff"
- }
- }
- ],
- "uco-observable:sizeInBytes": {
- "@type": "xsd:integer",
- "@value": "4"
- }
+ "@id": "kb:content-data-facet-1833f979-1f19-5543-9d82-6cefd144b169"
},
{
- "@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": {
- "@type": "xsd:integer",
- "@value": "4"
- }
+ "@id": "kb:file-facet-1297a4bd-563b-54c3-ad8a-f67f01ba9b10"
}
]
+ },
+ {
+ "@id": "kb:file-facet-1297a4bd-563b-54c3-ad8a-f67f01ba9b10",
+ "@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": {
+ "@type": "xsd:integer",
+ "@value": "4"
+ }
+ },
+ {
+ "@id": "kb:file-facet-ffa3e6bb-dffc-549d-a7c4-ffc5e90ac55d",
+ "@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": {
+ "@type": "xsd:integer",
+ "@value": "4"
+ }
+ },
+ {
+ "@id": "kb:hash-24644904-83ea-5911-aea8-be687a9f3caf",
+ "@type": "uco-types:Hash",
+ "uco-types:hashMethod": {
+ "@type": "uco-vocabulary:HashNameVocab",
+ "@value": "MD5"
+ },
+ "uco-types:hashValue": {
+ "@type": "xsd:hexBinary",
+ "@value": "098f6bcd4621d373cade4e832627b4f6"
+ }
+ },
+ {
+ "@id": "kb:hash-295bdeb5-7f23-5a3f-8b7f-4bb1191b7c21",
+ "@type": "uco-types:Hash",
+ "uco-types:hashMethod": {
+ "@type": "uco-vocabulary:HashNameVocab",
+ "@value": "SHA1"
+ },
+ "uco-types:hashValue": {
+ "@type": "xsd:hexBinary",
+ "@value": "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3"
+ }
+ },
+ {
+ "@id": "kb:hash-39127f5c-598b-51d4-a720-2e949f18f85f",
+ "@type": "uco-types:Hash",
+ "uco-types:hashMethod": {
+ "@type": "uco-vocabulary:HashNameVocab",
+ "@value": "SHA256"
+ },
+ "uco-types:hashValue": {
+ "@type": "xsd:hexBinary",
+ "@value": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
+ }
+ },
+ {
+ "@id": "kb:hash-49e81fee-c6b3-5f5f-af8b-0746d32e4932",
+ "@type": "uco-types:Hash",
+ "uco-types:hashMethod": {
+ "@type": "uco-vocabulary:HashNameVocab",
+ "@value": "SHA512"
+ },
+ "uco-types:hashValue": {
+ "@type": "xsd:hexBinary",
+ "@value": "ee26b0dd4af7e749aa1a8ee3c10ae9923f618980772e473f8819a5d4940e0db27ac185f8a0e1d5f84f88bc887fd67b143732c304cc5fa9ad8e6f57f50028a8ff"
+ }
}
]
}
\ No newline at end of file
diff --git a/tests/case_utils/case_file/kb.ttl b/tests/case_utils/case_file/kb.ttl
index 942249b..0de60e3 100644
--- a/tests/case_utils/case_file/kb.ttl
+++ b/tests/case_utils/case_file/kb.ttl
@@ -8,51 +8,65 @@
@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
+ ;
+ uco-observable:sizeInBytes "4"^^xsd:integer ;
+ .
+
kb:file-800784de-5c9e-5eb2-b843-0ac51a1bd4b9
a uco-observable:File ;
- uco-core:hasFacet [
- 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 ;
- ] ;
+ uco-core:hasFacet kb:file-facet-ffa3e6bb-dffc-549d-a7c4-ffc5e90ac55d ;
.
kb:file-ace6460a-92a9-58b9-83ea-a18ae87f6e04
a uco-observable:File ;
uco-core:hasFacet
- [
- a uco-observable:ContentDataFacet ;
- uco-observable:hash
- [
- a uco-types:Hash ;
- uco-types:hashMethod "MD5"^^uco-vocabulary:HashNameVocab ;
- uco-types:hashValue "098f6bcd4621d373cade4e832627b4f6"^^xsd:hexBinary ;
- ] ,
- [
- a uco-types:Hash ;
- uco-types:hashMethod "SHA1"^^uco-vocabulary:HashNameVocab ;
- uco-types:hashValue "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3"^^xsd:hexBinary ;
- ] ,
- [
- a uco-types:Hash ;
- uco-types:hashMethod "SHA256"^^uco-vocabulary:HashNameVocab ;
- uco-types:hashValue "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"^^xsd:hexBinary ;
- ] ,
- [
- a uco-types:Hash ;
- uco-types:hashMethod "SHA512"^^uco-vocabulary:HashNameVocab ;
- uco-types:hashValue "ee26b0dd4af7e749aa1a8ee3c10ae9923f618980772e473f8819a5d4940e0db27ac185f8a0e1d5f84f88bc887fd67b143732c304cc5fa9ad8e6f57f50028a8ff"^^xsd:hexBinary ;
- ]
- ;
- uco-observable:sizeInBytes "4"^^xsd:integer ;
- ] ,
- [
- 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 ,
+ 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:file-facet-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:hash-24644904-83ea-5911-aea8-be687a9f3caf
+ a uco-types:Hash ;
+ uco-types:hashMethod "MD5"^^uco-vocabulary:HashNameVocab ;
+ uco-types:hashValue "098f6bcd4621d373cade4e832627b4f6"^^xsd:hexBinary ;
+ .
+
+kb:hash-295bdeb5-7f23-5a3f-8b7f-4bb1191b7c21
+ a uco-types:Hash ;
+ uco-types:hashMethod "SHA1"^^uco-vocabulary:HashNameVocab ;
+ uco-types:hashValue "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3"^^xsd:hexBinary ;
+ .
+
+kb:hash-39127f5c-598b-51d4-a720-2e949f18f85f
+ a uco-types:Hash ;
+ uco-types:hashMethod "SHA256"^^uco-vocabulary:HashNameVocab ;
+ uco-types:hashValue "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"^^xsd:hexBinary ;
+ .
+
+kb:hash-49e81fee-c6b3-5f5f-af8b-0746d32e4932
+ a uco-types:Hash ;
+ uco-types:hashMethod "SHA512"^^uco-vocabulary:HashNameVocab ;
+ uco-types:hashValue "ee26b0dd4af7e749aa1a8ee3c10ae9923f618980772e473f8819a5d4940e0db27ac185f8a0e1d5f84f88bc887fd67b143732c304cc5fa9ad8e6f57f50028a8ff"^^xsd:hexBinary ;
+ .
+
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 edea5af..d9bc216 100644
--- a/tests/case_utils/case_file/sample.txt-disable_hashes.ttl
+++ b/tests/case_utils/case_file/sample.txt-disable_hashes.ttl
@@ -8,11 +8,13 @@
kb:file-800784de-5c9e-5eb2-b843-0ac51a1bd4b9
a uco-observable:File ;
- uco-core:hasFacet [
- 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 ;
- ] ;
+ uco-core:hasFacet kb:file-facet-ffa3e6bb-dffc-549d-a7c4-ffc5e90ac55d ;
+ .
+
+kb:file-facet-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 ;
.
diff --git a/tests/case_utils/case_file/sample.txt-nocompact.json b/tests/case_utils/case_file/sample.txt-nocompact.json
index e848ebf..8c59f44 100644
--- a/tests/case_utils/case_file/sample.txt-nocompact.json
+++ b/tests/case_utils/case_file/sample.txt-nocompact.json
@@ -1,126 +1,104 @@
{
"@context": {
- "brick": "https://brickschema.org/schema/Brick#",
- "csvw": "http://www.w3.org/ns/csvw#",
- "dc": "http://purl.org/dc/elements/1.1/",
- "dcam": "http://purl.org/dc/dcam/",
- "dcat": "http://www.w3.org/ns/dcat#",
- "dcmitype": "http://purl.org/dc/dcmitype/",
- "dcterms": "http://purl.org/dc/terms/",
- "doap": "http://usefulinc.com/ns/doap#",
- "foaf": "http://xmlns.com/foaf/0.1/",
"kb": "http://example.org/kb/",
- "odrl": "http://www.w3.org/ns/odrl/2/",
- "org": "http://www.w3.org/ns/org#",
"owl": "http://www.w3.org/2002/07/owl#",
- "prof": "http://www.w3.org/ns/dx/prof/",
- "prov": "http://www.w3.org/ns/prov#",
- "qb": "http://purl.org/linked-data/cube#",
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
- "schema": "https://schema.org/",
- "sh": "http://www.w3.org/ns/shacl#",
- "skos": "http://www.w3.org/2004/02/skos/core#",
- "sosa": "http://www.w3.org/ns/sosa/",
- "ssn": "http://www.w3.org/ns/ssn/",
- "time": "http://www.w3.org/2006/time#",
"uco-core": "https://ontology.unifiedcyberontology.org/uco/core/",
"uco-observable": "https://ontology.unifiedcyberontology.org/uco/observable/",
"uco-types": "https://ontology.unifiedcyberontology.org/uco/types/",
"uco-vocabulary": "https://ontology.unifiedcyberontology.org/uco/vocabulary/",
- "vann": "http://purl.org/vocab/vann/",
- "void": "http://rdfs.org/ns/void#",
"xml": "http://www.w3.org/XML/1998/namespace",
"xsd": "http://www.w3.org/2001/XMLSchema#"
},
"@graph": [
+ {
+ "@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": "SHA1"
+ },
+ "https://ontology.unifiedcyberontology.org/uco/types/hashValue": {
+ "@type": "http://www.w3.org/2001/XMLSchema#hexBinary",
+ "@value": "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3"
+ }
+ },
{
"@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": "_:N7b4f54f0f233497a8981441323dfdd27"
+ "@id": "http://example.org/kb/file-facet-a5d9606e-a5cf-5531-9462-5bed0ac4219c"
},
{
- "@id": "_:Nf3c8a77cca9e4807a8b016f8b94eae64"
+ "@id": "http://example.org/kb/content-data-facet-bda9b72d-2753-54ab-9292-e1e260be4f6d"
}
]
},
{
- "@id": "_:N7b4f54f0f233497a8981441323dfdd27",
- "@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": "_:Nf3c8a77cca9e4807a8b016f8b94eae64",
- "@type": "https://ontology.unifiedcyberontology.org/uco/observable/ContentDataFacet",
- "https://ontology.unifiedcyberontology.org/uco/observable/hash": [
- {
- "@id": "_:N32345c071afb41eb8e4ac36497356af8"
- },
- {
- "@id": "_:N8f2e8439e67c4ae4b5d6dcf7947cf57a"
- },
- {
- "@id": "_:N94114772034d4c7f9ea8a7ce77a3b848"
- },
- {
- "@id": "_:Ndc9c78f6e42e4c96a9015ba58f3e8b3b"
- }
- ],
- "https://ontology.unifiedcyberontology.org/uco/observable/sizeInBytes": 4
- },
- {
- "@id": "_:N32345c071afb41eb8e4ac36497356af8",
+ "@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": "_:N8f2e8439e67c4ae4b5d6dcf7947cf57a",
+ "@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": "SHA1"
+ "@value": "SHA512"
},
"https://ontology.unifiedcyberontology.org/uco/types/hashValue": {
"@type": "http://www.w3.org/2001/XMLSchema#hexBinary",
- "@value": "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3"
+ "@value": "ee26b0dd4af7e749aa1a8ee3c10ae9923f618980772e473f8819a5d4940e0db27ac185f8a0e1d5f84f88bc887fd67b143732c304cc5fa9ad8e6f57f50028a8ff"
}
},
{
- "@id": "_:N94114772034d4c7f9ea8a7ce77a3b848",
- "@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"
+ "@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"
+ }
+ ],
+ "https://ontology.unifiedcyberontology.org/uco/observable/sizeInBytes": 4
+ },
+ {
+ "@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/types/hashValue": {
- "@type": "http://www.w3.org/2001/XMLSchema#hexBinary",
- "@value": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
- }
+ "https://ontology.unifiedcyberontology.org/uco/observable/sizeInBytes": 4
},
{
- "@id": "_:Ndc9c78f6e42e4c96a9015ba58f3e8b3b",
+ "@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"
}
}
]
diff --git a/tests/case_utils/case_file/sample.txt.json b/tests/case_utils/case_file/sample.txt.json
index 2539324..a4a97c8 100644
--- a/tests/case_utils/case_file/sample.txt.json
+++ b/tests/case_utils/case_file/sample.txt.json
@@ -1,53 +1,43 @@
{
"@context": {
- "brick": "https://brickschema.org/schema/Brick#",
- "csvw": "http://www.w3.org/ns/csvw#",
- "dc": "http://purl.org/dc/elements/1.1/",
- "dcam": "http://purl.org/dc/dcam/",
- "dcat": "http://www.w3.org/ns/dcat#",
- "dcmitype": "http://purl.org/dc/dcmitype/",
- "dcterms": "http://purl.org/dc/terms/",
- "doap": "http://usefulinc.com/ns/doap#",
- "foaf": "http://xmlns.com/foaf/0.1/",
"kb": "http://example.org/kb/",
- "odrl": "http://www.w3.org/ns/odrl/2/",
- "org": "http://www.w3.org/ns/org#",
"owl": "http://www.w3.org/2002/07/owl#",
- "prof": "http://www.w3.org/ns/dx/prof/",
- "prov": "http://www.w3.org/ns/prov#",
- "qb": "http://purl.org/linked-data/cube#",
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
- "schema": "https://schema.org/",
- "sh": "http://www.w3.org/ns/shacl#",
- "skos": "http://www.w3.org/2004/02/skos/core#",
- "sosa": "http://www.w3.org/ns/sosa/",
- "ssn": "http://www.w3.org/ns/ssn/",
- "time": "http://www.w3.org/2006/time#",
"uco-core": "https://ontology.unifiedcyberontology.org/uco/core/",
"uco-observable": "https://ontology.unifiedcyberontology.org/uco/observable/",
"uco-types": "https://ontology.unifiedcyberontology.org/uco/types/",
"uco-vocabulary": "https://ontology.unifiedcyberontology.org/uco/vocabulary/",
- "vann": "http://purl.org/vocab/vann/",
- "void": "http://rdfs.org/ns/void#",
"xml": "http://www.w3.org/XML/1998/namespace",
"xsd": "http://www.w3.org/2001/XMLSchema#"
},
"@graph": [
{
- "@id": "kb:file-789a91ef-6446-548c-9911-dcc5168f25ea",
- "@type": "uco-observable:File",
- "uco-core:hasFacet": [
- {
- "@id": "_:N9cb3cc2ab59546a3a8409b0a43beb4c3"
- },
- {
- "@id": "_:N34067c06b9364c50870f642861cac333"
- }
- ]
+ "@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-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": "_:N9cb3cc2ab59546a3a8409b0a43beb4c3",
+ "@id": "kb:file-facet-e6bb7192-3a63-561b-87c2-9aea090b49e4",
"@type": "uco-observable:FileFacet",
"uco-observable:fileName": "sample.txt",
"uco-observable:modifiedTime": {
@@ -57,50 +47,50 @@
"uco-observable:sizeInBytes": 4
},
{
- "@id": "_:N34067c06b9364c50870f642861cac333",
+ "@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:content-data-facet-f48466e4-5394-584d-84ad-c46a7b9680bf",
"@type": "uco-observable:ContentDataFacet",
"uco-observable:hash": [
{
- "@id": "_:N8536d3196ade4a33898077091ffe7b37"
+ "@id": "kb:hash-f067246c-a31a-597d-a84b-7b70ce4c8795"
},
{
- "@id": "_:Nee102c2e670c450b9c7bfe532916631a"
+ "@id": "kb:hash-2cae4ae2-d773-5ea2-ba3e-2c4092574959"
},
{
- "@id": "_:N874bad97d6e94943a23d04234517307f"
+ "@id": "kb:hash-2b723e8c-6125-5867-83c3-a46753e41a07"
},
{
- "@id": "_:Nb1f22efd766f43768fc83a2183df2396"
+ "@id": "kb:hash-9652135a-b58d-592d-b0f4-ac684ecdf6ed"
}
],
"uco-observable:sizeInBytes": 4
},
{
- "@id": "_:N8536d3196ade4a33898077091ffe7b37",
- "@type": "uco-types:Hash",
- "uco-types:hashMethod": {
- "@type": "uco-vocabulary:HashNameVocab",
- "@value": "MD5"
- },
- "uco-types:hashValue": {
- "@type": "xsd:hexBinary",
- "@value": "098f6bcd4621d373cade4e832627b4f6"
- }
- },
- {
- "@id": "_:Nee102c2e670c450b9c7bfe532916631a",
+ "@id": "kb:hash-9652135a-b58d-592d-b0f4-ac684ecdf6ed",
"@type": "uco-types:Hash",
"uco-types:hashMethod": {
"@type": "uco-vocabulary:HashNameVocab",
- "@value": "SHA1"
+ "@value": "SHA512"
},
"uco-types:hashValue": {
"@type": "xsd:hexBinary",
- "@value": "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3"
+ "@value": "ee26b0dd4af7e749aa1a8ee3c10ae9923f618980772e473f8819a5d4940e0db27ac185f8a0e1d5f84f88bc887fd67b143732c304cc5fa9ad8e6f57f50028a8ff"
}
},
{
- "@id": "_:N874bad97d6e94943a23d04234517307f",
+ "@id": "kb:hash-2b723e8c-6125-5867-83c3-a46753e41a07",
"@type": "uco-types:Hash",
"uco-types:hashMethod": {
"@type": "uco-vocabulary:HashNameVocab",
@@ -110,18 +100,6 @@
"@type": "xsd:hexBinary",
"@value": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
}
- },
- {
- "@id": "_:Nb1f22efd766f43768fc83a2183df2396",
- "@type": "uco-types:Hash",
- "uco-types:hashMethod": {
- "@type": "uco-vocabulary:HashNameVocab",
- "@value": "SHA512"
- },
- "uco-types:hashValue": {
- "@type": "xsd:hexBinary",
- "@value": "ee26b0dd4af7e749aa1a8ee3c10ae9923f618980772e473f8819a5d4940e0db27ac185f8a0e1d5f84f88bc887fd67b143732c304cc5fa9ad8e6f57f50028a8ff"
- }
}
]
}
\ 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 3bcac8f..8f20b60 100644
--- a/tests/case_utils/case_file/sample.txt.ttl
+++ b/tests/case_utils/case_file/sample.txt.ttl
@@ -8,41 +8,53 @@
@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
+ ;
+ uco-observable:sizeInBytes "4"^^xsd:integer ;
+ .
+
kb:file-ace6460a-92a9-58b9-83ea-a18ae87f6e04
a uco-observable:File ;
uco-core:hasFacet
- [
- a uco-observable:ContentDataFacet ;
- uco-observable:hash
- [
- a uco-types:Hash ;
- uco-types:hashMethod "MD5"^^uco-vocabulary:HashNameVocab ;
- uco-types:hashValue "098f6bcd4621d373cade4e832627b4f6"^^xsd:hexBinary ;
- ] ,
- [
- a uco-types:Hash ;
- uco-types:hashMethod "SHA1"^^uco-vocabulary:HashNameVocab ;
- uco-types:hashValue "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3"^^xsd:hexBinary ;
- ] ,
- [
- a uco-types:Hash ;
- uco-types:hashMethod "SHA256"^^uco-vocabulary:HashNameVocab ;
- uco-types:hashValue "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"^^xsd:hexBinary ;
- ] ,
- [
- a uco-types:Hash ;
- uco-types:hashMethod "SHA512"^^uco-vocabulary:HashNameVocab ;
- uco-types:hashValue "ee26b0dd4af7e749aa1a8ee3c10ae9923f618980772e473f8819a5d4940e0db27ac185f8a0e1d5f84f88bc887fd67b143732c304cc5fa9ad8e6f57f50028a8ff"^^xsd:hexBinary ;
- ]
- ;
- uco-observable:sizeInBytes "4"^^xsd:integer ;
- ] ,
- [
- 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 ,
+ 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 ;
+ uco-types:hashValue "098f6bcd4621d373cade4e832627b4f6"^^xsd:hexBinary ;
+ .
+
+kb:hash-295bdeb5-7f23-5a3f-8b7f-4bb1191b7c21
+ a uco-types:Hash ;
+ uco-types:hashMethod "SHA1"^^uco-vocabulary:HashNameVocab ;
+ uco-types:hashValue "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3"^^xsd:hexBinary ;
+ .
+
+kb:hash-39127f5c-598b-51d4-a720-2e949f18f85f
+ a uco-types:Hash ;
+ uco-types:hashMethod "SHA256"^^uco-vocabulary:HashNameVocab ;
+ uco-types:hashValue "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"^^xsd:hexBinary ;
+ .
+
+kb:hash-49e81fee-c6b3-5f5f-af8b-0746d32e4932
+ a uco-types:Hash ;
+ uco-types:hashMethod "SHA512"^^uco-vocabulary:HashNameVocab ;
+ uco-types:hashValue "ee26b0dd4af7e749aa1a8ee3c10ae9923f618980772e473f8819a5d4940e0db27ac185f8a0e1d5f84f88bc887fd67b143732c304cc5fa9ad8e6f57f50028a8ff"^^xsd:hexBinary ;
+ .
+