From 705dc77c29399ba490510f555ceb9fd64d85399e Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Wed, 27 Oct 2021 15:56:38 -0400 Subject: [PATCH 1/2] Align test directories with /case_utils structure A follow-on patch will regenerate files that will have updated UUIDs. Signed-off-by: Alex Nelson --- tests/Makefile | 63 +++----------- tests/case_utils/Makefile | 86 +++++++++++++++++++ tests/{ => case_utils}/case_file/.gitignore | 0 tests/{ => case_utils}/case_file/Makefile | 2 +- tests/{ => case_utils}/case_file/kb.json | 0 tests/{ => case_utils}/case_file/kb.ttl | 0 .../case_file/sample.txt-disable_hashes.ttl | 0 .../case_file/sample.txt-nocompact.json | 0 .../case_file/sample.txt.json | 0 .../{ => case_utils}/case_file/sample.txt.ttl | 0 .../{ => case_utils}/case_file/sample_txt.py | 0 .../case_file/test_case_file.py | 0 .../case_file/undefined_vocabulary.txt | 0 .../case_sparql_construct/.gitignore | 0 .../case_sparql_construct/Makefile | 2 +- .../case_sparql_construct/README.md | 0 .../case_sparql_construct/input-1.sparql | 0 .../case_sparql_construct/input-2.ttl | 0 .../case_sparql_construct/input-3.json | 0 .../test_case_sparql_construct.py | 0 .../case_sparql_select/.check-output.html | 0 .../case_sparql_select/.check-output.md | 0 .../case_sparql_select/.gitignore | 0 .../case_sparql_select/Makefile | 2 +- .../case_sparql_select/input-1.sparql | 0 .../case_sparql_select/input-2.ttl | 0 .../case_sparql_select/input-3.json | 0 27 files changed, 100 insertions(+), 55 deletions(-) create mode 100644 tests/case_utils/Makefile rename tests/{ => case_utils}/case_file/.gitignore (100%) rename tests/{ => case_utils}/case_file/Makefile (99%) rename tests/{ => case_utils}/case_file/kb.json (100%) rename tests/{ => case_utils}/case_file/kb.ttl (100%) rename tests/{ => case_utils}/case_file/sample.txt-disable_hashes.ttl (100%) rename tests/{ => case_utils}/case_file/sample.txt-nocompact.json (100%) rename tests/{ => case_utils}/case_file/sample.txt.json (100%) rename tests/{ => case_utils}/case_file/sample.txt.ttl (100%) rename tests/{ => case_utils}/case_file/sample_txt.py (100%) rename tests/{ => case_utils}/case_file/test_case_file.py (100%) rename tests/{ => case_utils}/case_file/undefined_vocabulary.txt (100%) rename tests/{ => case_utils}/case_sparql_construct/.gitignore (100%) rename tests/{ => case_utils}/case_sparql_construct/Makefile (96%) rename tests/{ => case_utils}/case_sparql_construct/README.md (100%) rename tests/{ => case_utils}/case_sparql_construct/input-1.sparql (100%) rename tests/{ => case_utils}/case_sparql_construct/input-2.ttl (100%) rename tests/{ => case_utils}/case_sparql_construct/input-3.json (100%) rename tests/{ => case_utils}/case_sparql_construct/test_case_sparql_construct.py (100%) rename tests/{ => case_utils}/case_sparql_select/.check-output.html (100%) rename tests/{ => case_utils}/case_sparql_select/.check-output.md (100%) rename tests/{ => case_utils}/case_sparql_select/.gitignore (100%) rename tests/{ => case_utils}/case_sparql_select/Makefile (96%) rename tests/{ => case_utils}/case_sparql_select/input-1.sparql (100%) rename tests/{ => case_utils}/case_sparql_select/input-2.ttl (100%) rename tests/{ => case_utils}/case_sparql_select/input-3.json (100%) diff --git a/tests/Makefile b/tests/Makefile index 3676436..340aca2 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -15,22 +15,14 @@ SHELL := /bin/bash top_srcdir := $(shell cd .. ; pwd) -srcdir := $(shell pwd) - PYTHON3 ?= $(shell which python3.9 2>/dev/null || which python3.8 2>/dev/null || which python3.7 2>/dev/null || which python3.6 2>/dev/null || which python3) all: \ - all-case_file \ - all-case_sparql_construct \ - all-case_sparql_select + all-case_utils .PHONY: \ - all-case_file \ - all-case_sparql_construct \ - all-case_sparql_select \ - check-case_file \ - check-case_sparql_construct \ - check-case_sparql_select \ + all-case_utils \ + check-case_utils \ check-isomorphic_diff \ check-mypy \ download @@ -60,51 +52,26 @@ all: \ . touch $@ -all-case_file: \ - .venv.done.log - $(MAKE) \ - --directory case_file - -all-case_sparql_construct: \ - .venv.done.log - $(MAKE) \ - --directory case_sparql_construct -all-case_sparql_select: \ +all-case_utils: \ .venv.done.log $(MAKE) \ - --directory case_sparql_select + --directory case_utils # These check calls are provided in preferred run-order. check: \ - check-isomorphic_diff \ check-mypy \ - check-case_file \ - check-case_sparql_construct \ - check-case_sparql_select + check-isomorphic_diff \ + check-case_utils source venv/bin/activate \ && pytest \ - --ignore case_file \ - --ignore case_sparql_construct \ - --ignore case_sparql_select \ + --ignore case_utils \ --log-level=DEBUG -check-case_file: \ - .venv.done.log - $(MAKE) \ - --directory case_file \ - check - -check-case_sparql_construct: \ - .venv.done.log - $(MAKE) \ - --directory case_sparql_construct \ - check - -check-case_sparql_select: \ +check-case_utils: \ .venv.done.log $(MAKE) \ - --directory case_sparql_select \ + --directory case_utils \ check check-isomorphic_diff: \ @@ -119,21 +86,13 @@ check-mypy: \ source venv/bin/activate \ && mypy \ $(top_srcdir)/case_utils \ - case_file \ - case_sparql_construct \ case_utils \ hexbinary \ src clean: @$(MAKE) \ - --directory case_sparql_select \ - clean - @$(MAKE) \ - --directory case_sparql_construct \ - clean - @$(MAKE) \ - --directory case_file \ + --directory case_utils \ clean @rm -f \ .venv.done.log diff --git a/tests/case_utils/Makefile b/tests/case_utils/Makefile new file mode 100644 index 0000000..14ac4be --- /dev/null +++ b/tests/case_utils/Makefile @@ -0,0 +1,86 @@ +#!/usr/bin/make -f + +# This software was developed at the National Institute of Standards +# and Technology by employees of the Federal Government in the course +# of their official duties. Pursuant to title 17 Section 105 of the +# United States Code this software is not subject to copyright +# protection and is in the public domain. NIST assumes no +# responsibility whatsoever for its use by other parties, and makes +# no guarantees, expressed or implied, about its quality, +# reliability, or any other characteristic. +# +# We would appreciate acknowledgement if the software is used. + +SHELL := /bin/bash + +top_srcdir := $(shell cd ../.. ; pwd) + +tests_srcdir := $(top_srcdir)/tests + +all: \ + all-case_file \ + all-case_sparql_construct \ + all-case_sparql_select + +.PHONY: \ + all-case_file \ + all-case_sparql_construct \ + all-case_sparql_select \ + check-case_file \ + check-case_sparql_construct \ + check-case_sparql_select + +all-case_file: \ + $(tests_srcdir)/.venv.done.log + $(MAKE) \ + --directory case_file + +all-case_sparql_construct: \ + $(tests_srcdir)/.venv.done.log + $(MAKE) \ + --directory case_sparql_construct + +all-case_sparql_select: \ + $(tests_srcdir)/.venv.done.log + $(MAKE) \ + --directory case_sparql_select + +check: \ + check-case_file \ + check-case_sparql_construct \ + check-case_sparql_select + source $(tests_srcdir)/venv/bin/activate \ + && pytest \ + --ignore case_file \ + --ignore case_sparql_construct \ + --ignore case_sparql_select \ + --log-level=DEBUG + +check-case_file: \ + $(tests_srcdir)/.venv.done.log + $(MAKE) \ + --directory case_file \ + check + +check-case_sparql_construct: \ + $(tests_srcdir)/.venv.done.log + $(MAKE) \ + --directory case_sparql_construct \ + check + +check-case_sparql_select: \ + $(tests_srcdir)/.venv.done.log + $(MAKE) \ + --directory case_sparql_select \ + check + +clean: + @$(MAKE) \ + --directory case_sparql_select \ + clean + @$(MAKE) \ + --directory case_sparql_construct \ + clean + @$(MAKE) \ + --directory case_file \ + clean diff --git a/tests/case_file/.gitignore b/tests/case_utils/case_file/.gitignore similarity index 100% rename from tests/case_file/.gitignore rename to tests/case_utils/case_file/.gitignore diff --git a/tests/case_file/Makefile b/tests/case_utils/case_file/Makefile similarity index 99% rename from tests/case_file/Makefile rename to tests/case_utils/case_file/Makefile index 0f91a02..ecf4508 100644 --- a/tests/case_file/Makefile +++ b/tests/case_utils/case_file/Makefile @@ -13,7 +13,7 @@ SHELL := /bin/bash -top_srcdir := $(shell cd ../.. ; pwd) +top_srcdir := $(shell cd ../../.. ; pwd) tests_srcdir := $(top_srcdir)/tests diff --git a/tests/case_file/kb.json b/tests/case_utils/case_file/kb.json similarity index 100% rename from tests/case_file/kb.json rename to tests/case_utils/case_file/kb.json diff --git a/tests/case_file/kb.ttl b/tests/case_utils/case_file/kb.ttl similarity index 100% rename from tests/case_file/kb.ttl rename to tests/case_utils/case_file/kb.ttl diff --git a/tests/case_file/sample.txt-disable_hashes.ttl b/tests/case_utils/case_file/sample.txt-disable_hashes.ttl similarity index 100% rename from tests/case_file/sample.txt-disable_hashes.ttl rename to tests/case_utils/case_file/sample.txt-disable_hashes.ttl diff --git a/tests/case_file/sample.txt-nocompact.json b/tests/case_utils/case_file/sample.txt-nocompact.json similarity index 100% rename from tests/case_file/sample.txt-nocompact.json rename to tests/case_utils/case_file/sample.txt-nocompact.json diff --git a/tests/case_file/sample.txt.json b/tests/case_utils/case_file/sample.txt.json similarity index 100% rename from tests/case_file/sample.txt.json rename to tests/case_utils/case_file/sample.txt.json diff --git a/tests/case_file/sample.txt.ttl b/tests/case_utils/case_file/sample.txt.ttl similarity index 100% rename from tests/case_file/sample.txt.ttl rename to tests/case_utils/case_file/sample.txt.ttl diff --git a/tests/case_file/sample_txt.py b/tests/case_utils/case_file/sample_txt.py similarity index 100% rename from tests/case_file/sample_txt.py rename to tests/case_utils/case_file/sample_txt.py diff --git a/tests/case_file/test_case_file.py b/tests/case_utils/case_file/test_case_file.py similarity index 100% rename from tests/case_file/test_case_file.py rename to tests/case_utils/case_file/test_case_file.py diff --git a/tests/case_file/undefined_vocabulary.txt b/tests/case_utils/case_file/undefined_vocabulary.txt similarity index 100% rename from tests/case_file/undefined_vocabulary.txt rename to tests/case_utils/case_file/undefined_vocabulary.txt diff --git a/tests/case_sparql_construct/.gitignore b/tests/case_utils/case_sparql_construct/.gitignore similarity index 100% rename from tests/case_sparql_construct/.gitignore rename to tests/case_utils/case_sparql_construct/.gitignore diff --git a/tests/case_sparql_construct/Makefile b/tests/case_utils/case_sparql_construct/Makefile similarity index 96% rename from tests/case_sparql_construct/Makefile rename to tests/case_utils/case_sparql_construct/Makefile index 55343fc..d0dabb3 100644 --- a/tests/case_sparql_construct/Makefile +++ b/tests/case_utils/case_sparql_construct/Makefile @@ -13,7 +13,7 @@ SHELL := /bin/bash -top_srcdir := $(shell cd ../.. ; pwd) +top_srcdir := $(shell cd ../../.. ; pwd) tests_srcdir := $(top_srcdir)/tests diff --git a/tests/case_sparql_construct/README.md b/tests/case_utils/case_sparql_construct/README.md similarity index 100% rename from tests/case_sparql_construct/README.md rename to tests/case_utils/case_sparql_construct/README.md diff --git a/tests/case_sparql_construct/input-1.sparql b/tests/case_utils/case_sparql_construct/input-1.sparql similarity index 100% rename from tests/case_sparql_construct/input-1.sparql rename to tests/case_utils/case_sparql_construct/input-1.sparql diff --git a/tests/case_sparql_construct/input-2.ttl b/tests/case_utils/case_sparql_construct/input-2.ttl similarity index 100% rename from tests/case_sparql_construct/input-2.ttl rename to tests/case_utils/case_sparql_construct/input-2.ttl diff --git a/tests/case_sparql_construct/input-3.json b/tests/case_utils/case_sparql_construct/input-3.json similarity index 100% rename from tests/case_sparql_construct/input-3.json rename to tests/case_utils/case_sparql_construct/input-3.json diff --git a/tests/case_sparql_construct/test_case_sparql_construct.py b/tests/case_utils/case_sparql_construct/test_case_sparql_construct.py similarity index 100% rename from tests/case_sparql_construct/test_case_sparql_construct.py rename to tests/case_utils/case_sparql_construct/test_case_sparql_construct.py diff --git a/tests/case_sparql_select/.check-output.html b/tests/case_utils/case_sparql_select/.check-output.html similarity index 100% rename from tests/case_sparql_select/.check-output.html rename to tests/case_utils/case_sparql_select/.check-output.html diff --git a/tests/case_sparql_select/.check-output.md b/tests/case_utils/case_sparql_select/.check-output.md similarity index 100% rename from tests/case_sparql_select/.check-output.md rename to tests/case_utils/case_sparql_select/.check-output.md diff --git a/tests/case_sparql_select/.gitignore b/tests/case_utils/case_sparql_select/.gitignore similarity index 100% rename from tests/case_sparql_select/.gitignore rename to tests/case_utils/case_sparql_select/.gitignore diff --git a/tests/case_sparql_select/Makefile b/tests/case_utils/case_sparql_select/Makefile similarity index 96% rename from tests/case_sparql_select/Makefile rename to tests/case_utils/case_sparql_select/Makefile index f88732d..6070739 100644 --- a/tests/case_sparql_select/Makefile +++ b/tests/case_utils/case_sparql_select/Makefile @@ -13,7 +13,7 @@ SHELL := /bin/bash -top_srcdir := $(shell cd ../.. ; pwd) +top_srcdir := $(shell cd ../../.. ; pwd) tests_srcdir := $(top_srcdir)/tests diff --git a/tests/case_sparql_select/input-1.sparql b/tests/case_utils/case_sparql_select/input-1.sparql similarity index 100% rename from tests/case_sparql_select/input-1.sparql rename to tests/case_utils/case_sparql_select/input-1.sparql diff --git a/tests/case_sparql_select/input-2.ttl b/tests/case_utils/case_sparql_select/input-2.ttl similarity index 100% rename from tests/case_sparql_select/input-2.ttl rename to tests/case_utils/case_sparql_select/input-2.ttl diff --git a/tests/case_sparql_select/input-3.json b/tests/case_utils/case_sparql_select/input-3.json similarity index 100% rename from tests/case_sparql_select/input-3.json rename to tests/case_utils/case_sparql_select/input-3.json From 444ae1f53d68697b661312c3c8402b44df485fd0 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Wed, 27 Oct 2021 16:04:42 -0400 Subject: [PATCH 2/2] Regenerate Make-managed files UUIDs were expected to change, as present working directory is part of the hashed data. Signed-off-by: Alex Nelson --- tests/case_utils/case_file/kb.json | 4 +- tests/case_utils/case_file/kb.ttl | 4 +- .../case_file/sample.txt-disable_hashes.ttl | 2 +- .../case_file/sample.txt-nocompact.json | 62 +++++++++---------- tests/case_utils/case_file/sample.txt.json | 58 ++++++++--------- tests/case_utils/case_file/sample.txt.ttl | 2 +- 6 files changed, 66 insertions(+), 66 deletions(-) diff --git a/tests/case_utils/case_file/kb.json b/tests/case_utils/case_file/kb.json index a2d427a..5f3863b 100644 --- a/tests/case_utils/case_file/kb.json +++ b/tests/case_utils/case_file/kb.json @@ -9,7 +9,7 @@ }, "@graph": [ { - "@id": "kb:file-16d49634-ba5d-5f46-ab4e-7a577a4e096d", + "@id": "kb:file-69751792-9d04-5f5f-8791-99ca3729cd3c", "@type": "uco-observable:ObservableObject", "uco-core:hasFacet": { "@type": "uco-observable:FileFacet", @@ -25,7 +25,7 @@ } }, { - "@id": "kb:file-57400969-69d0-5d5d-95c4-9dd7de330d3d", + "@id": "kb:file-9477a6eb-3a94-590b-b51e-6ce6892f0941", "@type": "uco-observable:ObservableObject", "uco-core:hasFacet": [ { diff --git a/tests/case_utils/case_file/kb.ttl b/tests/case_utils/case_file/kb.ttl index 4e0b8a8..0fb50ca 100644 --- a/tests/case_utils/case_file/kb.ttl +++ b/tests/case_utils/case_file/kb.ttl @@ -8,7 +8,7 @@ @prefix uco-vocabulary: . @prefix xsd: . -kb:file-16d49634-ba5d-5f46-ab4e-7a577a4e096d +kb:file-69751792-9d04-5f5f-8791-99ca3729cd3c a uco-observable:ObservableObject ; uco-core:hasFacet [ a uco-observable:FileFacet ; @@ -18,7 +18,7 @@ kb:file-16d49634-ba5d-5f46-ab4e-7a577a4e096d ] ; . -kb:file-57400969-69d0-5d5d-95c4-9dd7de330d3d +kb:file-9477a6eb-3a94-590b-b51e-6ce6892f0941 a uco-observable:ObservableObject ; uco-core:hasFacet [ 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 4462c33..0bc4d82 100644 --- a/tests/case_utils/case_file/sample.txt-disable_hashes.ttl +++ b/tests/case_utils/case_file/sample.txt-disable_hashes.ttl @@ -6,7 +6,7 @@ @prefix uco-observable: . @prefix xsd: . -kb:file-16d49634-ba5d-5f46-ab4e-7a577a4e096d +kb:file-69751792-9d04-5f5f-8791-99ca3729cd3c a uco-observable:ObservableObject ; uco-core:hasFacet [ a uco-observable:FileFacet ; diff --git a/tests/case_utils/case_file/sample.txt-nocompact.json b/tests/case_utils/case_file/sample.txt-nocompact.json index 563291d..6d2569b 100644 --- a/tests/case_utils/case_file/sample.txt-nocompact.json +++ b/tests/case_utils/case_file/sample.txt-nocompact.json @@ -12,93 +12,93 @@ }, "@graph": [ { - "@id": "http://example.org/kb/file-72a7af43-7798-5794-88fd-49c0d3c76ccb", + "@id": "http://example.org/kb/file-4216a9f3-45fc-55aa-8e48-a9f828173625", "@type": "https://unifiedcyberontology.org/ontology/uco/observable#ObservableObject", "https://unifiedcyberontology.org/ontology/uco/core#hasFacet": [ { - "@id": "_:N9465521b80bf49c586f914908dfc46a2" + "@id": "_:Ncbd74ec540fa42b09802cdf033ec0e86" }, { - "@id": "_:Ne7887bd0a239424bb588bed06ec4fc77" + "@id": "_:N1b091168b6e746ca8ffef67ba546f52c" } ] }, { - "@id": "_:N9465521b80bf49c586f914908dfc46a2", + "@id": "_:Ncbd74ec540fa42b09802cdf033ec0e86", + "@type": "https://unifiedcyberontology.org/ontology/uco/observable#FileFacet", + "https://unifiedcyberontology.org/ontology/uco/observable#fileName": "sample.txt", + "https://unifiedcyberontology.org/ontology/uco/observable#modifiedTime": { + "@type": "http://www.w3.org/2001/XMLSchema#dateTime", + "@value": "2010-01-02T03:04:56+00:00" + }, + "https://unifiedcyberontology.org/ontology/uco/observable#sizeInBytes": 4 + }, + { + "@id": "_:N1b091168b6e746ca8ffef67ba546f52c", "@type": "https://unifiedcyberontology.org/ontology/uco/observable#ContentDataFacet", "https://unifiedcyberontology.org/ontology/uco/observable#hash": [ { - "@id": "_:Nad6171b4933a4a84b83faa5d48fd4ddb" + "@id": "_:Nf0f6ff73c49045ffa53e2fc83249d20b" }, { - "@id": "_:N1ee7a053f4bd466e8fca1105b8392292" + "@id": "_:Na2470e1f29914026a1690b0e9386cc1f" }, { - "@id": "_:N098fa95f7ef2409b864a9fb6b291ab08" + "@id": "_:Nd8473ff30e87456d8dcd034729ba27ed" }, { - "@id": "_:Na99d1f2a83814ac491c9b02662ea8587" + "@id": "_:Ncaa10f1e5cf84d8286f1d1c536b9fa06" } ], "https://unifiedcyberontology.org/ontology/uco/observable#sizeInBytes": 4 }, { - "@id": "_:Nad6171b4933a4a84b83faa5d48fd4ddb", + "@id": "_:Nf0f6ff73c49045ffa53e2fc83249d20b", "@type": "https://unifiedcyberontology.org/ontology/uco/types#Hash", "https://unifiedcyberontology.org/ontology/uco/types#hashMethod": { "@type": "https://unifiedcyberontology.org/ontology/uco/vocabulary#HashNameVocab", - "@value": "SHA512" + "@value": "MD5" }, "https://unifiedcyberontology.org/ontology/uco/types#hashValue": { "@type": "http://www.w3.org/2001/XMLSchema#hexBinary", - "@value": "ee26b0dd4af7e749aa1a8ee3c10ae9923f618980772e473f8819a5d4940e0db27ac185f8a0e1d5f84f88bc887fd67b143732c304cc5fa9ad8e6f57f50028a8ff" + "@value": "098f6bcd4621d373cade4e832627b4f6" } }, { - "@id": "_:N1ee7a053f4bd466e8fca1105b8392292", + "@id": "_:Na2470e1f29914026a1690b0e9386cc1f", "@type": "https://unifiedcyberontology.org/ontology/uco/types#Hash", "https://unifiedcyberontology.org/ontology/uco/types#hashMethod": { "@type": "https://unifiedcyberontology.org/ontology/uco/vocabulary#HashNameVocab", - "@value": "SHA256" + "@value": "SHA1" }, "https://unifiedcyberontology.org/ontology/uco/types#hashValue": { "@type": "http://www.w3.org/2001/XMLSchema#hexBinary", - "@value": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08" + "@value": "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3" } }, { - "@id": "_:N098fa95f7ef2409b864a9fb6b291ab08", + "@id": "_:Nd8473ff30e87456d8dcd034729ba27ed", "@type": "https://unifiedcyberontology.org/ontology/uco/types#Hash", "https://unifiedcyberontology.org/ontology/uco/types#hashMethod": { "@type": "https://unifiedcyberontology.org/ontology/uco/vocabulary#HashNameVocab", - "@value": "SHA1" + "@value": "SHA256" }, "https://unifiedcyberontology.org/ontology/uco/types#hashValue": { "@type": "http://www.w3.org/2001/XMLSchema#hexBinary", - "@value": "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3" + "@value": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08" } }, { - "@id": "_:Na99d1f2a83814ac491c9b02662ea8587", + "@id": "_:Ncaa10f1e5cf84d8286f1d1c536b9fa06", "@type": "https://unifiedcyberontology.org/ontology/uco/types#Hash", "https://unifiedcyberontology.org/ontology/uco/types#hashMethod": { "@type": "https://unifiedcyberontology.org/ontology/uco/vocabulary#HashNameVocab", - "@value": "MD5" + "@value": "SHA512" }, "https://unifiedcyberontology.org/ontology/uco/types#hashValue": { "@type": "http://www.w3.org/2001/XMLSchema#hexBinary", - "@value": "098f6bcd4621d373cade4e832627b4f6" + "@value": "ee26b0dd4af7e749aa1a8ee3c10ae9923f618980772e473f8819a5d4940e0db27ac185f8a0e1d5f84f88bc887fd67b143732c304cc5fa9ad8e6f57f50028a8ff" } - }, - { - "@id": "_:Ne7887bd0a239424bb588bed06ec4fc77", - "@type": "https://unifiedcyberontology.org/ontology/uco/observable#FileFacet", - "https://unifiedcyberontology.org/ontology/uco/observable#fileName": "sample.txt", - "https://unifiedcyberontology.org/ontology/uco/observable#modifiedTime": { - "@type": "http://www.w3.org/2001/XMLSchema#dateTime", - "@value": "2010-01-02T03:04:56+00:00" - }, - "https://unifiedcyberontology.org/ontology/uco/observable#sizeInBytes": 4 } ] -} +} \ No newline at end of file diff --git a/tests/case_utils/case_file/sample.txt.json b/tests/case_utils/case_file/sample.txt.json index dfc3075..c2b4f6e 100644 --- a/tests/case_utils/case_file/sample.txt.json +++ b/tests/case_utils/case_file/sample.txt.json @@ -12,74 +12,84 @@ }, "@graph": [ { - "@id": "kb:file-d30556a8-8082-5ffb-95a5-ca3839414d4f", + "@id": "kb:file-a44b2ee3-968f-5528-883a-fa65ac45ce2c", "@type": "uco-observable:ObservableObject", "uco-core:hasFacet": [ { - "@id": "_:N0db8031480664f87b08e49c18a767095" + "@id": "_:N4acc005af38245cb843d4a7009cce7df" }, { - "@id": "_:Nddb40eef75a94f8e979ff1fbfad9aca5" + "@id": "_:Nc02deac289534fbf93c061d03bbb589d" } ] }, { - "@id": "_:N0db8031480664f87b08e49c18a767095", + "@id": "_:N4acc005af38245cb843d4a7009cce7df", + "@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": "_:Nc02deac289534fbf93c061d03bbb589d", "@type": "uco-observable:ContentDataFacet", "uco-observable:hash": [ { - "@id": "_:N839986b2d63a4963beafbb65016449da" + "@id": "_:Nbbf71d61d9fa4615bc074268fd60b4b5" }, { - "@id": "_:N065fc8f395464db38cf36008593a16f9" + "@id": "_:N6741cf44d9da464191c6a0014dbb602b" }, { - "@id": "_:N379cd3902adc4912a74a8eacd32afb9c" + "@id": "_:N3b6cc89816394294bc260958408d74de" }, { - "@id": "_:N77e79676ee5449ea9f6db813fb9dc095" + "@id": "_:Nfc008212dd584b16a8d4d50df33f0a47" } ], "uco-observable:sizeInBytes": 4 }, { - "@id": "_:N839986b2d63a4963beafbb65016449da", + "@id": "_:Nbbf71d61d9fa4615bc074268fd60b4b5", "@type": "uco-types:Hash", "uco-types:hashMethod": { "@type": "uco-vocabulary:HashNameVocab", - "@value": "SHA256" + "@value": "MD5" }, "uco-types:hashValue": { "@type": "xsd:hexBinary", - "@value": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08" + "@value": "098f6bcd4621d373cade4e832627b4f6" } }, { - "@id": "_:N065fc8f395464db38cf36008593a16f9", + "@id": "_:N6741cf44d9da464191c6a0014dbb602b", "@type": "uco-types:Hash", "uco-types:hashMethod": { "@type": "uco-vocabulary:HashNameVocab", - "@value": "MD5" + "@value": "SHA1" }, "uco-types:hashValue": { "@type": "xsd:hexBinary", - "@value": "098f6bcd4621d373cade4e832627b4f6" + "@value": "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3" } }, { - "@id": "_:N379cd3902adc4912a74a8eacd32afb9c", + "@id": "_:N3b6cc89816394294bc260958408d74de", "@type": "uco-types:Hash", "uco-types:hashMethod": { "@type": "uco-vocabulary:HashNameVocab", - "@value": "SHA1" + "@value": "SHA256" }, "uco-types:hashValue": { "@type": "xsd:hexBinary", - "@value": "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3" + "@value": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08" } }, { - "@id": "_:N77e79676ee5449ea9f6db813fb9dc095", + "@id": "_:Nfc008212dd584b16a8d4d50df33f0a47", "@type": "uco-types:Hash", "uco-types:hashMethod": { "@type": "uco-vocabulary:HashNameVocab", @@ -89,16 +99,6 @@ "@type": "xsd:hexBinary", "@value": "ee26b0dd4af7e749aa1a8ee3c10ae9923f618980772e473f8819a5d4940e0db27ac185f8a0e1d5f84f88bc887fd67b143732c304cc5fa9ad8e6f57f50028a8ff" } - }, - { - "@id": "_:Nddb40eef75a94f8e979ff1fbfad9aca5", - "@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 } ] -} +} \ 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 f5d275b..16029aa 100644 --- a/tests/case_utils/case_file/sample.txt.ttl +++ b/tests/case_utils/case_file/sample.txt.ttl @@ -8,7 +8,7 @@ @prefix uco-vocabulary: . @prefix xsd: . -kb:file-57400969-69d0-5d5d-95c4-9dd7de330d3d +kb:file-9477a6eb-3a94-590b-b51e-6ce6892f0941 a uco-observable:ObservableObject ; uco-core:hasFacet [