Skip to content

Commit

Permalink
Merge pull request #2 from casework/note_documentation_sources
Browse files Browse the repository at this point in the history
Note documentation sources
  • Loading branch information
ajnelson-nist authored Dec 27, 2024
2 parents 67ba54e + e3751d6 commit 1733975
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ This is only one possible application development style, and templates are avail

* [casework/CASE-Mapping-Template-Python](https://github.com/casework/CASE-Mapping-Template-Python), which demonstrates an approach based on constructing Python `dict`s and checking generated results afterwards for CASE conformance with the [CASE Validation Action](https://github.com/kchason/case-validation-action).

Other options and considerations for application development are noted on the [CASE Get Started page](https://caseontology.org/ontology/get-started.html).

Testing procedures run in _this_ repository are:

* _GitHub Actions_: [Workflows](.github/workflows/) are defined to run testing as they would be run in a local command-line environment, reviewing on pushes and pull requests to certain branches.
Expand Down
23 changes: 22 additions & 1 deletion case_cli_example/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,30 @@ def main() -> None:
# multiple tools contribute to the same graph.
graph.namespace_manager.bind("xsd", NS_XSD)

# Generate an example object.
# Generate a graph node for an example object.
n_example_organization = ns_kb["Organization-" + local_uuid()]

# The graph node is not added to the graph until it is part of some
# statement. A common first statement is a type, denoting
# class-membership. This example object is an organization. The
# class IRI of organization is:
#
# https://ontology.unifiedcyberontology.org/uco/identity/Organization
#
# In Python, NS_UCO_IDENTITY.Organization spells this IRI as a
# property in an RDFLib Namespace object.
#
# Visiting that IRI in a browser will show documentation for that class.
# The classes in CASE are listed here (and include the classes in UCO):
# https://ontology.caseontology.org/documentation/entities-tree-classes.html
graph.add((n_example_organization, NS_RDF.type, NS_UCO_IDENTITY.Organization))

# Assign some property for the example object - in this case, the
# organization's name. Other properties available to an object are
# viewable in the documentation system noted above, or in "stub"
# JSON-LD objects, such as Organization's stub here:
#
# https://github.com/casework/CASE-Mapping-Template-Stubs/blob/main/templates/uco-identity/Organization.json
graph.add(
(n_example_organization, NS_UCO_CORE.name, Literal("Cyber Domain Ontology"))
)
Expand Down

0 comments on commit 1733975

Please sign in to comment.