Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add kb compilation #132

Merged
merged 3 commits into from
Aug 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions examples/illustrations/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
all-drafting.ttl
generated-*.md
generated-*.sed
generated-*.json
kb.ttl
6 changes: 6 additions & 0 deletions examples/illustrations/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ all-%:

check: \
$(check_targets)
$(MAKE) \
--file postvisit.mk \
check

check-%:
export x=$@ \
Expand All @@ -46,6 +49,9 @@ check-%:

clean: \
$(clean_targets)
@$(MAKE) \
--file postvisit.mk \
clean

clean-%:
@export x=$@ \
Expand Down
8 changes: 4 additions & 4 deletions examples/illustrations/analysis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This example illustrates manual software malware analysis within the Cyber Threa
```json
[
{
"@id": "kb:organization-fb6c05a0-b6be-4a10-ba62-0e7b1da4c0ec",
"@id": "kb:organization-0dfaf75a-7b42-4d9a-9aa1-c84c176461ae",
"@type": "uco-identity:Organization",
"uco-core:name": "hex-rays"
},
Expand All @@ -18,7 +18,7 @@ This example illustrates manual software malware analysis within the Cyber Threa
"uco-core:name": "IDA Pro",
"uco-tool:toolType": "binary code analysis tool",
"uco-tool:creator": {
"@id": "kb:organization-fb6c05a0-b6be-4a10-ba62-0e7b1da4c0ec"
"@id": "kb:organization-0dfaf75a-7b42-4d9a-9aa1-c84c176461ae"
},
"uco-tool:version": "7.7"
},
Expand Down Expand Up @@ -80,7 +80,7 @@ This example illustrates multimedia classification.
```json
[
{
"@id": "kb:organization-2b3b98e2-aea2-4270-876a-7f9917623cb7",
"@id": "kb:organization-db3e6578-ae0a-4e5c-8bfc-d4470774f20f",
"@type": "uco-identity:Organization",
"uco-core:name": "NFI"
},
Expand All @@ -93,7 +93,7 @@ This example illustrates multimedia classification.
"uco-core:name": "Hansken",
"uco-tool:toolType": "DFaaS",
"uco-tool:creator": {
"@id": "kb:organization-2b3b98e2-aea2-4270-876a-7f9917623cb7"
"@id": "kb:organization-db3e6578-ae0a-4e5c-8bfc-d4470774f20f"
},
"uco-tool:version": "1.0",
"uco-configuration:usesConfiguration": [
Expand Down
12 changes: 6 additions & 6 deletions examples/illustrations/analysis/analysis.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
"@type": "uco-tool:AnalyticTool",
"uco-core:name": "IDA Pro",
"uco-tool:creator": {
"@id": "kb:organization-fb6c05a0-b6be-4a10-ba62-0e7b1da4c0ec"
"@id": "kb:organization-0dfaf75a-7b42-4d9a-9aa1-c84c176461ae"
},
"uco-tool:toolType": "binary code analysis tool",
"uco-tool:version": "7.7"
Expand Down Expand Up @@ -175,7 +175,7 @@
],
"uco-core:name": "Hansken",
"uco-tool:creator": {
"@id": "kb:organization-2b3b98e2-aea2-4270-876a-7f9917623cb7"
"@id": "kb:organization-db3e6578-ae0a-4e5c-8bfc-d4470774f20f"
},
"uco-tool:toolType": "DFaaS",
"uco-tool:version": "1.0"
Expand Down Expand Up @@ -215,14 +215,14 @@
"@type": "uco-observable:Software"
},
{
"@id": "kb:organization-2b3b98e2-aea2-4270-876a-7f9917623cb7",
"@id": "kb:organization-0dfaf75a-7b42-4d9a-9aa1-c84c176461ae",
"@type": "uco-identity:Organization",
"uco-core:name": "NFI"
"uco-core:name": "hex-rays"
},
{
"@id": "kb:organization-fb6c05a0-b6be-4a10-ba62-0e7b1da4c0ec",
"@id": "kb:organization-db3e6578-ae0a-4e5c-8bfc-d4470774f20f",
"@type": "uco-identity:Organization",
"uco-core:name": "hex-rays"
"uco-core:name": "NFI"
}
]
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[
{
"@id": "kb:organization-fb6c05a0-b6be-4a10-ba62-0e7b1da4c0ec",
"@id": "kb:organization-0dfaf75a-7b42-4d9a-9aa1-c84c176461ae",
"@type": "uco-identity:Organization",
"uco-core:name": "hex-rays"
},
Expand All @@ -10,7 +10,7 @@
"uco-core:name": "IDA Pro",
"uco-tool:toolType": "binary code analysis tool",
"uco-tool:creator": {
"@id": "kb:organization-fb6c05a0-b6be-4a10-ba62-0e7b1da4c0ec"
"@id": "kb:organization-0dfaf75a-7b42-4d9a-9aa1-c84c176461ae"
},
"uco-tool:version": "7.7"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[
{
"@id": "kb:organization-2b3b98e2-aea2-4270-876a-7f9917623cb7",
"@id": "kb:organization-db3e6578-ae0a-4e5c-8bfc-d4470774f20f",
"@type": "uco-identity:Organization",
"uco-core:name": "NFI"
},
Expand All @@ -13,7 +13,7 @@
"uco-core:name": "Hansken",
"uco-tool:toolType": "DFaaS",
"uco-tool:creator": {
"@id": "kb:organization-2b3b98e2-aea2-4270-876a-7f9917623cb7"
"@id": "kb:organization-db3e6578-ae0a-4e5c-8bfc-d4470774f20f"
},
"uco-tool:version": "1.0",
"uco-configuration:usesConfiguration": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
],
"uco-core:object": [
{
"@id": "kb:investigation-952d677d-6b62-4e53-9bac-1b113d268ac5",
"@id": "kb:investigation-6d58da47-0879-47f0-a1c8-d233dc4f090c",
"@type": "case-investigation:Investigation",
"uco-core:name": "NetTheft1234",
"case-investigation:focus": "Media Theft",
Expand Down
61 changes: 61 additions & 0 deletions examples/illustrations/postvisit.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#!/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)

# Set up descending into each directory that has a Makefile.
illustration_dirs := $(shell ls */Makefile | xargs dirname)

all_drafting_ttl := $(wildcard */drafting.ttl)

all_jsonld := $(foreach illustration_dir,$(illustration_dirs),$(illustration_dir)/$(illustration_dir).json)

all: \
kb.ttl

all-drafting.ttl: \
$(all_drafting_ttl)
source $(top_srcdir)/venv/bin/activate \
&& rdfpipe \
--output-format turtle \
$^ \
> _$@
mv _$@ $@

check: \
kb.ttl

clean:
@rm -f \
_all-drafting.ttl \
_kb.ttl \
all-drafting.ttl \
kb.ttl

kb.ttl: \
$(all_jsonld) \
all-drafting.ttl
source $(top_srcdir)/venv/bin/activate \
&& rdfpipe \
--output-format turtle \
$(all_jsonld) \
> _$@
source $(top_srcdir)/venv/bin/activate \
&& case_validate \
--allow-infos \
--metashacl \
--ontology-graph all-drafting.ttl \
_$@
mv _$@ $@
Loading