Skip to content

Commit

Permalink
Add example of shorter JSON MIME object usage c/o Context Dictionary …
Browse files Browse the repository at this point in the history
…feature

A follow-on patch will generate a Make-managed file.

References:
* #363

Signed-off-by: Alex Nelson <[email protected]>
  • Loading branch information
ajnelson-nist committed May 4, 2022
1 parent 9902977 commit 3fdba5e
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/examples/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ all: \
location_XFAIL_validation.ttl \
mime_PASS_validation.ttl \
mime_XFAIL_validation.ttl \
mime_prefix_PASS_validation.ttl \
relationship_PASS_validation.ttl \
relationship_XFAIL_validation.ttl

Expand Down Expand Up @@ -78,6 +79,7 @@ check: \
location_XFAIL_validation.ttl \
mime_PASS_validation.ttl \
mime_XFAIL_validation.ttl \
mime_prefix_PASS_validation.ttl \
relationship_PASS_validation.ttl \
relationship_XFAIL_validation.ttl
source $(tests_srcdir)/venv/bin/activate \
Expand Down
36 changes: 36 additions & 0 deletions tests/examples/mime_prefix_PASS.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"@context": {
"core": "https://ontology.unifiedcyberontology.org/uco/core/",
"ex-mime": "urn:example:mime:custom:",
"kb": "http://example.org/kb/",
"observable": "https://ontology.unifiedcyberontology.org/uco/observable/",
"observable:mimeType": {
"@type": "@id"
},
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
"skos": "http://www.w3.org/2004/02/skos/core#",
"types": "https://ontology.unifiedcyberontology.org/uco/types/"
},
"@graph": [
{
"@id": "ex-mime:application/gzip",
"@type": "types:IANAMediaType",
"rdfs:comment": "This is a custom media type individual, designed for just this unit test. A larger taxonomy of individuals should be used outside of testing contexts.",
"skos:notation": "application/gzip"
},
{
"@id": "kb:file-8",
"@type": "observable:File",
"core:hasFacet": [
{
"@type": "observable:ContentDataFacet",
"observable:mimeType": "ex-mime:application/gzip"
},
{
"@type": "observable:FileFacet",
"observable:fileName": "8.gz"
}
]
}
]
}
7 changes: 7 additions & 0 deletions tests/examples/test_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,13 @@ def test_mime_XFAIL_validation() -> None:
}
)

def test_mime_prefix_PASS_validation() -> None:
confirm_validation_results(
"mime_prefix_PASS_validation.ttl",
True,
expected_focus_node_severities=set()
)

def test_relationship_PASS_partial() -> None:
"""
This test should be replaced with test_relationship_XFAIL_full when the semi-open vocabulary design current as of UCO 0.8.0 is re-done.
Expand Down

0 comments on commit 3fdba5e

Please sign in to comment.