This template repository is provided for those looking to draft JSON-oriented utilities using ontologies within the Cyber Domain Ontology ecosystem, particularly CASE and UCO. "Stub" JSON dictionaries are provided for each class within CASE and UCO, generated from the ontologies.
Each "stub" provides a minimal JSON-LD context dictionary specific to a class, and null-valued entries for each property on that class and entailed by parent classes. Cardinality is reflected by the null-ish value recorded: null
is used when a property has maximum-cardinality 1, and an empty list ([]
) is recorded when a property has a maximum-cardinality greater than 1 or is unbounded.
/templates
is generated by case_utils ontology and sub-ontologies alone.
Resources in this repository do not require use of any code for their typical usage.
For those making updates to the repository (such as on ontology releases), see CONTRIBUTE.md
.
The script src/generate_single_stub_json.py
is usable for generating a stub JSON-LD object for any class, if the ontology (including all ontologies reached by owl:imports
) is provided on the command line.
usage: generate_single_stub_json.py [-h] [--debug] out_json class_iri [supplemental_graph ...]
positional arguments:
out_json
class_iri
supplemental_graph
options:
-h, --help show this help message and exit
--debug
See tests/Makefile
for examples of how to run generate_single_stub_json.py
for specific classes of interest. Demonstrations are done for:
case-investigation:InvestigativeAction
uco-observable:ArchiveFile
co:Bag
(from the Collections Ontology)
-
Properties applicable to a class are drawn directly from the class definition, and from all parent class definitions.
- Properties are also associated with classes from explicit
rdfs:domain
statements. When ardfs:domain
domain statement is absent, under OWL semantics this implies that the property applies toowl:Thing
(i.e., is universal); but, to support use cases where domains are represented with other structural properties (e.g.,dcam:domainIncludes
,schema:domainIncludes
), this project requires explicit statements ofrdfs:domain owl:Thing
for adding to a stub.
- Properties are also associated with classes from explicit
-
Stubs for
uco-core:Facet
s applicable to any eventual subclass ofuco-core:UcoObject
are also inlined in the stub for theuco-core:UcoObject
.
Portions of this repository contributed by NIST are governed by the NIST Software Licensing Statement.