Skip to content

Utility for validation of UCO 0.4.0, UCO 0.5.0, UCO 0.6.0 & UCO 0.7.0 content

License

Notifications You must be signed in to change notification settings

ucoProject/UCO-Utility-Pre-0.7.0-Validator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UCO-Utility-Pre-0.7.0-Validator

Description - (Beta Release Version 1.1)

The UCO/CASE Validation Toolkit provides the capability to validate JSON-LD data files against a turtle-file based ontology such as the Unified Cyber Ontology (UCO) and Cyber-Investigation Analysis Standard Expression (CASE).

Note - this tool has a number of suggested improvements that may be added in the future. Among these, the tool may present error messages that could be viewed by some as warnings vs errors in ontological representation.

Getting Started

Dependencies:

  • Preferred operating system: linux
  • alternate operating system: windows
  • python version 3.6.8 or newer
  • git
  • pip
  • virtualenv

There are minor toolkit setup differences between Linux and Windows, described here:

Installing - Linux

  1. Create empty working directory
  • $ mkdir foo
  • $ cd foo
  1. Copy source files into the working directory
  1. In the tookit directory, create a python3 virtual environment
  • $ cd UCO-Utility-Pre-0.7.0-Validator
  • $ virtualenv --python=python3 venv
  1. Activate the virtual environment
  • $ source venv/bin/activate
  1. Install the source into the virtual environment
  • $ pip install --upgrade pip
  • $ pip install --editable src
  1. Run python commands

Installing - Windows

  1. Create empty working directory
  • mkdir foo
  1. Copy source files
  1. Create virtual environment
  • foo> cd UCO-Utility-Pre-0.7.0-Validator
  • foo\enhanced-case-toolkit> virtualenv --python=python3 venv
  1. Activate the virtual environment
  • foo\enhanced-case-toolkit> venv\Scripts\activate
  1. Install the source
  • (venv) foo\enhanced-case-toolkit> pip install --editable src
  1. Run the scripts from src directory, for example:
  • (venv) foo\enhanced-case-toolkit> cd src
  • (venv) foo\enhanced-case-toolkit\src> python validate.py ..\data\ontology-0.4.0\ontology ..\data\samples-0.4\accounts.json
  1. When done, deactivate the virtual environment
  • (venv) foo\enhanced-case-toolkit> deactivate

Executing the tool

As long as the virtual environment is activated, you can now run these scripts.


validate ontology_path jsonld_path [jsonld_path...]

Validate json-ld data against an ontology

  • ontology_path: path to serialized ontology file or directory containing turtle files.

  • jsonld_path: path to json-ld file or serialized json-ld file.


v4to5 [-o output_filepath] input_filepath

Convert version UCO 0.4 json-ld data to UCO 0.5

  • input_filepath path to version 0.4 jsonld data file

  • output_filepath path to output version 0.5 jsonld data file [default: STDOUT]


serialize [-c comment] [-o output_filepath] input_filepath

Serialize ontology or json-ld file

  • comment: description to include in serialized file [default: read from stdin].

  • output_filepath: path to write serialized file [default: input_filepath.pkl].

  • input_filepath: path to json-ld file or directory containing turtle files.


describe serialized_filepath

Describe serialized file

  • serialized_filepath: path to serialized file.