Skip to content

Commit

Permalink
Exercise shapes constraining Thread-of-Messages items
Browse files Browse the repository at this point in the history
A follow-on patch will generate Make-managed files.

References:
#393

Signed-off-by: Alex Nelson <alexander.nelson@nist.gov>
  • Loading branch information
ajnelson-nist committed Jun 30, 2022
1 parent 2c7837a commit eb01aa7
Show file tree
Hide file tree
Showing 3 changed files with 224 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 @@ -28,6 +28,7 @@ all: \
location_PASS_validation.ttl \
location_XFAIL_validation.ttl \
message_thread_PASS_validation.ttl \
message_thread_XFAIL_validation.ttl \
relationship_PASS_validation.ttl \
relationship_XFAIL_validation.ttl \
thread_PASS_validation.ttl \
Expand Down Expand Up @@ -82,6 +83,7 @@ check: \
location_PASS_validation.ttl \
location_XFAIL_validation.ttl \
message_thread_PASS_validation.ttl \
message_thread_XFAIL_validation.ttl \
relationship_PASS_validation.ttl \
relationship_XFAIL_validation.ttl \
thread_PASS_validation.ttl \
Expand Down
219 changes: 219 additions & 0 deletions tests/examples/message_thread_XFAIL.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,219 @@
{
"@context": {
"co": "http://purl.org/co/",
"kb": "http://example.org/kb/",
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
"observable": "https://ontology.unifiedcyberontology.org/uco/observable/",
"types": "https://ontology.unifiedcyberontology.org/uco/types/",
"xsd": "http://www.w3.org/2001/XMLSchema#"
},
"@graph": [
{
"@id": "kb:message-1",
"@type": "observable:ObservableObject",
"rdfs:comment": "The non-Message class will trigger errors pertaining to co:element, co:itemContent and types:threadOriginItem."
},
{
"@id": "kb:message-2",
"@type": "observable:Message"
},
{
"@id": "kb:message-3",
"@type": "observable:Message"
},
{
"@id": "kb:message-4",
"@type": "observable:Message"
},
{
"@id": "kb:message-5",
"@type": "observable:Message"
},
{
"@id": "kb:message-6",
"@type": "observable:ObservableObject",
"rdfs:comment": "The non-Message class will trigger errors pertaining to co:element, co:itemContent and types:threadTerminalItem."
},
{
"@id": "kb:message-7",
"@type": "observable:Message"
},
{
"@id": "kb:message-thread-2",
"@type": "observable:MessageThread",
"core:hasFacet": {
"@type": "observable:MessageThreadFacet",
"observable:message": [
{
"@id": "kb:message-1"
},
{
"@id": "kb:message-2"
},
{
"@id": "kb:message-3"
},
{
"@id": "kb:message-4"
},
{
"@id": "kb:message-5"
},
{
"@id": "kb:message-6"
}
],
"observable:messageThread": {
"@id": "kb:thread-2"
}
}
},
{
"@id": "kb:thread-2",
"@type": "types:Thread",
"co:size": {
"@type": "xsd:nonNegativeInteger",
"@value": "6"
},
"co:element": [
{
"@id": "kb:message-1"
},
{
"@id": "kb:message-2"
},
{
"@id": "kb:message-3"
},
{
"@id": "kb:message-4"
},
{
"@id": "kb:message-5"
},
{
"@id": "kb:message-6"
}
],
"co:item": [

{
"@id": "kb:message-thread-2-item-1"
},
{
"@id": "kb:message-thread-2-item-2"
},
{
"@id": "kb:message-thread-2-item-3"
},
{
"@id": "kb:message-thread-2-item-4"
},
{
"@id": "kb:message-thread-2-item-5"
},
{
"@id": "kb:message-thread-2-item-6"
}

],
"types:threadOriginItem": [
{
"@id": "kb:message-thread-2-item-1"
},
{
"@id": "kb:message-thread-2-item-5"
}
],
"types:threadTerminalItem": [
{
"@id": "kb:message-thread-2-item-3"
},
{
"@id": "kb:message-thread-2-item-4"
},
{
"@id": "kb:message-thread-2-item-6"
}
]
},
{
"@id": "kb:message-thread-2-item-1",
"@type": "types:ThreadItem",
"co:itemContent": {
"@id": "kb:message-1"
},
"types:threadNextItem": [
{
"@id": "kb:message-thread-2-item-2"
},
{
"@id": "kb:message-thread-2-item-6"
}
]
},
{
"@id": "kb:message-thread-2-item-2",
"@type": "types:ThreadItem",
"co:itemContent": {
"@id": "kb:message-2"
},
"types:threadNextItem": [
{
"@id": "kb:message-thread-2-item-3"
},
{
"@id": "kb:message-thread-2-item-4"
}
],
"types:threadPreviousItem": {
"@id": "kb:message-thread-2-item-1"
}
},
{
"@id": "kb:message-thread-2-item-3",
"@type": "types:ThreadItem",
"co:itemContent": {
"@id": "kb:message-3"
},
"types:threadPreviousItem": {
"@id": "kb:message-thread-2-item-2"
}
},
{
"@id": "kb:message-thread-2-item-4",
"@type": "types:ThreadItem",
"co:itemContent": {
"@id": "kb:message-4"
},
"types:threadPreviousItem": {
"@id": "kb:message-thread-2-item-2"
}
},
{
"@id": "kb:message-thread-2-item-5",
"@type": "types:ThreadItem",
"co:itemContent": {
"@id": "kb:message-5"
},
"types:threadNextItem": {
"@id": "kb:message-thread-2-item-6"
}
},
{
"@id": "kb:message-thread-2-item-6",
"@type": "types:ThreadItem",
"co:itemContent": {
"@id": "kb:message-6"
},
"types:threadPreviousItem": [
{
"@id": "kb:message-thread-2-item-1"
},
{
"@id": "kb:message-thread-2-item-5"
}
]
}
]
}
3 changes: 3 additions & 0 deletions tests/examples/test_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,9 @@ def test_message_thread(monolithic_ontology_graph: rdflib.Graph) -> None:
def test_message_thread_PASS_validation():
confirm_validation_results("message_thread_PASS_validation.ttl", True)

def test_message_thread_XFAIL_validation():
confirm_validation_results("message_thread_XFAIL_validation.ttl", False)

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 eb01aa7

Please sign in to comment.