Skip to content

Commit 2b285e1

Browse files
committed
Merge branch 'develop' into Issue_38
2 parents 5c75d60 + 5df4a05 commit 2b285e1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+19340
-281
lines changed

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
[submodule "dependencies/CASE"]
22
path = dependencies/CASE
33
url = https://github.com/casework/CASE.git
4-
[submodule "dependencies/CASE-Examples-QC"]
5-
path = dependencies/CASE-Examples-QC
6-
url = https://github.com/ajnelson-nist/CASE-Examples-QC.git

CONTRIBUTE.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
1. After cloning this repository, ensure the CASE submodule is checked out. This can be done with either `git submodule init && git submodule update`, `make .git_submodule_init.done.log`, or `make check`.
77
2. Update the CASE submodule pointer to the new tagged release.
88
3. The version of CASE is also hard-coded in [`case_utils/ontology/version_info.py`](case_utils/ontology/version_info.py). Edit the variable `CURRENT_CASE_VERSION`.
9-
4. From the top source directory, run `make clean`. This guarantees a clean state of this repository as well as the ontology submodules.
10-
5. Still from the top source directory, run `make`.
11-
6. Any new `.ttl` files will be created under [`case_utils/ontology/`](case_utils/ontology/). Use `git add` to add each of them. (The patch-weight of these files could overshadow manual revisions, so it is fine to commit the built files after the manual changes are committed.)
9+
4. A list of built versions of CASE is also hard-coded in [`case_utils/ontology/version_info.py`](case_utils/ontology/version_info.py). Edit the variable `built_version_choices_list`.
10+
5. From the top source directory, run `make clean`. This guarantees a clean state of this repository as well as the ontology submodules.
11+
6. Still from the top source directory, run `make`.
12+
7. Any new `.ttl` files will be created under [`case_utils/ontology/`](case_utils/ontology/). Use `git add` to add each of them. (The patch-weight of these files could overshadow manual revisions, so it is fine to commit the built files separately from the manual changes being committed. Preferably, commit the built files *before* manual changes - this prevents later issues with a `git bisect` that relies on CI passing.)
1213

1314
Here is a sample sequence of shell commands to run the build:
1415

@@ -29,6 +30,6 @@ pushd case_utils/ontology
2930
popd
3031
make check
3132
# Assuming `make check` passes:
33+
git commit -m "Build CASE 0.6.0 monolithic .ttl files" case_utils/ontology/case-0.6.0-subclasses.ttl case_utils/ontology/case-0.6.0.ttl
3234
git commit -m "Update CASE ontology pointer to version 0.6.0" dependencies/CASE case_utils/ontology/version_info.py
33-
git commit -m "Build CASE 0.6.0.ttl" case_utils/ontology/case-0.6.0.ttl
3435
```

Makefile

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,6 @@ all: \
3232
cd dependencies \
3333
&& git diff . \
3434
| cat
35-
git submodule init dependencies/CASE-Examples-QC
36-
git submodule update dependencies/CASE-Examples-QC
37-
# Build an ontology terms list, which has a side effect of initiating further submodules.
38-
$(MAKE) \
39-
--directory dependencies/CASE-Examples-QC \
40-
.git_submodule_init.done.log \
41-
.venv.done.log
42-
$(MAKE) \
43-
--directory dependencies/CASE-Examples-QC/tests \
44-
ontology_vocabulary.txt
4535
test -r dependencies/CASE/ontology/master/case.ttl \
4636
|| (git submodule init dependencies/CASE && git submodule update dependencies/CASE)
4737
test -r dependencies/CASE/ontology/master/case.ttl
@@ -91,10 +81,6 @@ clean:
9181
tests/examples \
9282
|| true \
9383
)
94-
@#Remove flag files that are normally set after deeper submodules and rdf-toolkit are downloaded.
95-
@rm -f \
96-
dependencies/CASE-Examples-QC/.git_submodule_init.done.log \
97-
dependencies/CASE-Examples-QC/.lib.done.log
9884

9985
# This recipe guarantees timestamp update order, and is otherwise intended to be a no-op.
10086
dependencies/CASE/ontology/master/case.ttl: \

case_utils/__init__.py

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,6 @@
1111
#
1212
# We would appreciate acknowledgement if the software is used.
1313

14-
__version__ = "0.3.0"
15-
16-
import typing
17-
import warnings
18-
19-
import rdflib.util # type: ignore
14+
__version__ = "0.4.0"
2015

2116
from . import local_uuid
22-
23-
24-
def guess_format(
25-
fpath: str, fmap: typing.Optional[typing.Dict[str, str]] = None
26-
) -> typing.Optional[str]:
27-
warnings.warn(
28-
"The functionality in case_utils.guess_format is now upstream. Please revise your code to use rdflib.util.guess_format. The function arguments remain the same. case_utils.guess_format will be removed in case_utils 0.4.0.",
29-
DeprecationWarning,
30-
)
31-
32-
return rdflib.util.guess_format(fpath, fmap) # type: ignore

case_utils/case_file/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
This module creates a graph object that provides a basic UCO characterization of a single file. The gathered metadata is among the more "durable" file characteristics, i.e. characteristics that would remain consistent when transferring a file between locations.
1616
"""
1717

18-
__version__ = "0.2.0"
18+
__version__ = "0.3.0"
1919

2020
import datetime
2121
import hashlib
@@ -234,7 +234,7 @@ def main() -> None:
234234

235235
output_format = None
236236
if args.output_format is None:
237-
output_format = case_utils.guess_format(args.out_graph)
237+
output_format = rdflib.util.guess_format(args.out_graph)
238238
else:
239239
output_format = args.output_format
240240

case_utils/case_sparql_construct/__init__.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
This script executes a SPARQL CONSTRUCT query, returning a graph of the generated triples.
1616
"""
1717

18-
__version__ = "0.2.0"
18+
__version__ = "0.2.1"
1919

2020
import argparse
2121
import logging
@@ -42,8 +42,6 @@ def main() -> None:
4242
else logging.INFO
4343
)
4444

45-
built_version_choices_list = ["none", "case-" + CURRENT_CASE_VERSION]
46-
4745
parser.add_argument("-d", "--debug", action="store_true")
4846
parser.add_argument(
4947
"--built-version",
@@ -105,7 +103,7 @@ def main() -> None:
105103

106104
output_format = None
107105
if args.output_format is None:
108-
output_format = case_utils.guess_format(args.out_graph)
106+
output_format = rdflib.util.guess_format(args.out_graph)
109107
else:
110108
output_format = args.output_format
111109

case_utils/case_sparql_select/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
Should a more complex query be necessary, an outer, wrapping SELECT query would let this script continue to function.
2727
"""
2828

29-
__version__ = "0.4.0"
29+
__version__ = "0.4.1"
3030

3131
import argparse
3232
import binascii
@@ -57,8 +57,6 @@ def main() -> None:
5757
else logging.INFO
5858
)
5959

60-
built_version_choices_list = ["none", "case-" + CURRENT_CASE_VERSION]
61-
6260
parser.add_argument("-d", "--debug", action="store_true")
6361
parser.add_argument(
6462
"--built-version",

case_utils/case_validate/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
details.)
3030
"""
3131

32-
__version__ = "0.1.0"
32+
__version__ = "0.1.1"
3333

3434
import argparse
3535
import importlib.resources
@@ -63,8 +63,6 @@ def main() -> None:
6363
else logging.INFO
6464
)
6565

66-
built_version_choices_list = ["none", "case-" + CURRENT_CASE_VERSION]
67-
6866
# Add arguments specific to case_validate.
6967
parser.add_argument(
7068
"-d", "--debug", action="store_true", help="Output additional runtime messages."

case_utils/namespace.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@
2626
NS_CASE_INVESTIGATION = rdflib.Namespace(
2727
"https://ontology.caseontology.org/case/investigation/"
2828
)
29-
NS_UCO_ACTION = rdflib.Namespace("https://unifiedcyberontology.org/ontology/uco/action#")
30-
NS_UCO_CORE = rdflib.Namespace("https://unifiedcyberontology.org/ontology/uco/core#")
31-
NS_UCO_LOCATION = rdflib.Namespace("https://unifiedcyberontology.org/ontology/uco/location#")
29+
NS_UCO_ACTION = rdflib.Namespace("https://ontology.unifiedcyberontology.org/uco/action/")
30+
NS_UCO_CORE = rdflib.Namespace("https://ontology.unifiedcyberontology.org/uco/core/")
31+
NS_UCO_LOCATION = rdflib.Namespace("https://ontology.unifiedcyberontology.org/uco/location/")
3232
NS_UCO_OBSERVABLE = rdflib.Namespace(
33-
"https://unifiedcyberontology.org/ontology/uco/observable#"
33+
"https://ontology.unifiedcyberontology.org/uco/observable/"
3434
)
35-
NS_UCO_TYPES = rdflib.Namespace("https://unifiedcyberontology.org/ontology/uco/types#")
35+
NS_UCO_TYPES = rdflib.Namespace("https://ontology.unifiedcyberontology.org/uco/types/")
3636
NS_UCO_VOCABULARY = rdflib.Namespace(
37-
"https://unifiedcyberontology.org/ontology/uco/vocabulary#"
37+
"https://ontology.unifiedcyberontology.org/uco/vocabulary/"
3838
)

0 commit comments

Comments
 (0)