@@ -82,17 +82,19 @@ def create_file_node(
8282 :returns: The File Observable Object's node.
8383 :rtype: rdflib.URIRef
8484 """
85+ node_namespace = rdflib .Namespace (node_prefix )
86+
8587 if node_iri is None :
8688 node_slug = "file-" + case_utils .local_uuid .local_uuid ()
87- node_iri = rdflib . Namespace ( node_prefix ) [node_slug ]
89+ node_iri = node_namespace [node_slug ]
8890 n_file = rdflib .URIRef (node_iri )
8991 graph .add ((n_file , NS_RDF .type , NS_UCO_OBSERVABLE .File ))
9092
9193 basename = os .path .basename (filepath )
9294 literal_basename = rdflib .Literal (basename )
9395
9496 file_stat = os .stat (filepath )
95- n_file_facet = rdflib . BNode ()
97+ n_file_facet = node_namespace [ "file-facet-" + case_utils . local_uuid . local_uuid ()]
9698 graph .add (
9799 (
98100 n_file_facet ,
@@ -119,7 +121,9 @@ def create_file_node(
119121 graph .add ((n_file_facet , NS_UCO_OBSERVABLE .modifiedTime , literal_mtime ))
120122
121123 if not disable_hashes :
122- n_contentdata_facet = rdflib .BNode ()
124+ n_contentdata_facet = node_namespace [
125+ "content-data-facet-" + case_utils .local_uuid .local_uuid ()
126+ ]
123127 graph .add ((n_file , NS_UCO_CORE .hasFacet , n_contentdata_facet ))
124128 graph .add (
125129 (n_contentdata_facet , NS_RDF .type , NS_UCO_OBSERVABLE .ContentDataFacet )
@@ -191,7 +195,7 @@ def create_file_node(
191195 for key in successful_hashdict ._fields :
192196 if key not in ("md5" , "sha1" , "sha256" , "sha512" ):
193197 continue
194- n_hash = rdflib . BNode ()
198+ n_hash = node_namespace [ "hash-" + case_utils . local_uuid . local_uuid ()]
195199 graph .add ((n_contentdata_facet , NS_UCO_OBSERVABLE .hash , n_hash ))
196200 graph .add ((n_hash , NS_RDF .type , NS_UCO_TYPES .Hash ))
197201 graph .add (
0 commit comments