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

@graph declaration missing from network_connection.json #88

Open
gwebb-case opened this issue Aug 10, 2022 · 5 comments
Open

@graph declaration missing from network_connection.json #88

gwebb-case opened this issue Aug 10, 2022 · 5 comments

Comments

@gwebb-case
Copy link

gwebb-case commented Aug 10, 2022

I found the following problem when checking the validity of UUID definitions in the file 'network_connection.json'
The "@graph" collection definition is missing from the example

"@graph": [
]

the proposed change is to insert the missing lines of code in the network_connection.json example between lines 15-16 and 452-453, and indent the lines 16-452 accordingly.

i.e

1 {
2 "@context": {
:
15 },
"@graph": [
16 "@id": "kb:bundle-2a13e958a-d975-41aa-b1bb-029d2b6707ab",
:
452 ]
]
453 }

@ajnelson-nist
Copy link
Member

@gwebb-case - Putting an @id on @graph actually turns this into a named graph, a quads structure instead of triples. Neither UCO nor CASE supports quads at this time. So, no need to worry about an ID on the @graph.

@ajnelson-nist
Copy link
Member

Also! Don't worry about indenting anything. pre-commit handles all menial indentation matters. Only indent as much as you need to in order to make sure your braces are paired. When you run git commit, pre-commit should take care of all of the indentation if you have pre-commit installed. (If you don't, no worries, it's a quick mechanical fix for me to apply.)

This repo is set up to install a dedicated instance of pre-commit if you have access to the make command and run make at the top level of the repo.

@gwebb-case
Copy link
Author

@ajnelson-nist - Before I plough on and make the change, I just want to confirm that if the expected structure of the examples is always meant to be:
{
"@context": { ... },
"@graph" [ { ... }, { ... }, ..., { ... } ]
}
which all but 2 of the CASE_Examples *.json examples follow.

Is correct, then the "@graph" collection change should actually result in the following changes from the original example:

  1. Delete the following existing lines 16 and 17
    16 "@id": "kb:bundle-2a13e958a-d975-41aa-b1bb-029d2b6707ab",
    17 "@type": "uco-core:Bundle",
  2. Delete or retain existing line 18
    18 "uco-core:name": "PCAP Analysis 4711",
  3. Delete or retain existing lines 19-21
    19 "uco-core:description": [
    20 "This example of representing network connections in captured network traffic (e.g., PCAP)."
    21 ],
  4. Replace the existing line 22
    "uco-core:object": [
    with
    "@graph": [

The reason for asking is that Oresteia.json, which I generally try to use as the guidance example if I get stuck, has the same structure as network_connection.json, which I'm about to change:.

If the above changes are correct, then I am happy to make the similar changes to Oresteia.json if no one is already assigned to do so.

@ajnelson-nist
Copy link
Member

Oh dear, good catch on Oresteia.

Please consider re-shaping things to use the @graph pattern as out of scope of this Issue. It's a not-quite-mechanical change to fix Oresteia up with a revision to your steps 1--4.

You should just be fixing the @ids in-place. I.e. nodes like kb:cctv-recording-uuid, any IRI that doesn't end with a UUID pattern, should be converted to new UUID4s (e.g. kb:cctv-recording-8515316d-51aa-408a-9276-e82f48b8790c) while preserving linkages (see lines 55 and 75 in Oresteia for that cctv node).

@gwebb-case
Copy link
Author

gwebb-case commented Aug 12, 2022

No worries, I will leave raising the issue to request altering Orestia.json until after the uuid issue I am currently working on has been made.

The pull request for this issue fix "network_connection.json" will be completed after the branch fork to alter any uuid changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants