Skip to content

Commit 1521663

Browse files
Merge pull request #43 from casework/release-0.4.0
Release 0.4.0
2 parents 0390ee7 + 8b0cff8 commit 1521663

Some content is hidden

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

52 files changed

+19865
-664
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
*.done.log
22
*.swp
33
.DS_Store
4+
.idea/
45
__pycache__
56
build/
67
case_utils.egg-info/

.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: \

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ Participation by NIST in the creation of the documentation of mentioned software
1212

1313
1. Clone this repository.
1414
2. (Optional) Create and activate a virtual environment.
15-
3. Run `python setup.py`.
15+
3. (Optional) Upgrade `pip` with `pip install --upgrade pip`. (This can speed installation of some dependent packages.)
16+
4. Run `pip install .`.
1617

17-
Installation is demonstrated in the `.venv.done.log` target of the [`tests/`](tests/) directory.
18+
Installation is demonstrated in the `.venv.done.log` target of the `tests/` directory's [`Makefile`](tests/Makefile).
1819

1920

2021
## Usage
@@ -68,6 +69,8 @@ Two commands are provided to generate output from a SPARQL query and one or more
6869

6970
These commands can be used with any RDF files to run arbitrary SPARQL queries. They have one additional behavior tailored to CASE: If a path query is used for subclasses, the CASE subclass hierarchy will be loaded to supplement the input graph. An expected use case of this feature is subclasses of `ObservableObject`. For instance, if a data graph included an object with only the class `uco-observable:File` specified, the query `?x a/rdfs:subClassOf* uco-observable:ObservableObject` would match `?x` against that object.
7071

72+
Note that prefixes used in the SPARQL queries do not need to be defined in the SPARQL query. Their mapping will be inherited from their first definition in the input graph files. However, input graphs are not required to agree on prefix mappings, so there is potential for confusion from input argument order mattering if two input graph files disagree on what a prefix maps to. If there is concern of ambiguity from inputs, a `PREFIX` statement should be included in the query, such as is shown in [this test query](tests/case_utils/case_sparql_select/subclass.sparql).
73+
7174

7275
#### `case_sparql_construct`
7376

case_utils/__init__.py

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +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-
def guess_format(
24-
fpath : str,
25-
fmap : typing.Optional[typing.Dict[str, str]] = None
26-
) -> typing.Optional[str]:
27-
warnings.warn("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.", DeprecationWarning)
28-
29-
return rdflib.util.guess_format(fpath, fmap) # type: ignore

0 commit comments

Comments
 (0)