Skip to content

Release 0.4.0 #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 25 commits into from
Mar 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
66fdaa2
Merge pull request #27 from casework/release-0.3.0
ajnelson-nist Nov 10, 2021
cf7026c
Fix installation directions
ajnelson-nist Nov 29, 2021
1468c22
Merge pull request #30 from casework/issue_29
ajnelson-nist Nov 29, 2021
8f49fbd
Add JetBrains to gitignore
kchason Nov 22, 2021
586d74e
Merge pull request #31 from casework/add_jetbrains_to_gitignore
ajnelson-nist Jan 4, 2022
539b21f
Document prefix inheritance
ajnelson-nist Mar 2, 2022
39157fb
Merge pull request #33 from casework/document_sparql_prefix_order_beh…
kchason Mar 2, 2022
ddf7a32
Add Python code formatting with Black as Make steps
ajnelson-nist Mar 21, 2022
6b9093d
Format Python code with Black
ajnelson-nist Mar 21, 2022
f174764
Merge pull request #35 from casework/AC-216
kchason Mar 21, 2022
b0a0d78
Drop CASE-Examples-QC as submodule
ajnelson-nist Mar 24, 2022
116cc10
Centralize built_version_choices_list into version_info.py
ajnelson-nist Mar 24, 2022
9404468
Allow warnings in re-runs of upstream validation tests
ajnelson-nist Mar 24, 2022
bb6b523
Remove lightly used variables
ajnelson-nist Mar 24, 2022
d2ecd8e
Test synchronization of hard-coded variable with built ontology files
ajnelson-nist Mar 24, 2022
10fa31c
Account for CI dependency with new ontology builds
ajnelson-nist Mar 24, 2022
e4b7d1e
Build CASE 0.6.0 monolithic .ttl files
ajnelson-nist Mar 24, 2022
aa9a9a8
Update CASE ontology pointer to version 0.6.0
ajnelson-nist Mar 24, 2022
d2da4f5
Regenerate Make-managed files
ajnelson-nist Mar 24, 2022
ecc5d60
Format Python code with Black
ajnelson-nist Mar 24, 2022
55b7be4
Merge pull request #41 from casework/ONT-463
ajnelson-nist Mar 24, 2022
a984d70
Complete transfer of case_utils.guess_format
ajnelson-nist Mar 24, 2022
038443a
Merge pull request #42 from casework/AC-208
ajnelson-nist Mar 24, 2022
5cf10e6
Regenerate Make-managed files
ajnelson-nist Mar 24, 2022
8b0cff8
Bump versions
ajnelson-nist Mar 24, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*.done.log
*.swp
.DS_Store
.idea/
__pycache__
build/
case_utils.egg-info/
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "dependencies/CASE"]
path = dependencies/CASE
url = https://github.com/casework/CASE.git
[submodule "dependencies/CASE-Examples-QC"]
path = dependencies/CASE-Examples-QC
url = https://github.com/ajnelson-nist/CASE-Examples-QC.git
9 changes: 5 additions & 4 deletions CONTRIBUTE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
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`.
2. Update the CASE submodule pointer to the new tagged release.
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`.
4. From the top source directory, run `make clean`. This guarantees a clean state of this repository as well as the ontology submodules.
5. Still from the top source directory, run `make`.
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.)
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`.
5. From the top source directory, run `make clean`. This guarantees a clean state of this repository as well as the ontology submodules.
6. Still from the top source directory, run `make`.
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.)

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

Expand All @@ -29,6 +30,6 @@ pushd case_utils/ontology
popd
make check
# Assuming `make check` passes:
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
git commit -m "Update CASE ontology pointer to version 0.6.0" dependencies/CASE case_utils/ontology/version_info.py
git commit -m "Build CASE 0.6.0.ttl" case_utils/ontology/case-0.6.0.ttl
```
14 changes: 0 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,6 @@ all: \
cd dependencies \
&& git diff . \
| cat
git submodule init dependencies/CASE-Examples-QC
git submodule update dependencies/CASE-Examples-QC
# Build an ontology terms list, which has a side effect of initiating further submodules.
$(MAKE) \
--directory dependencies/CASE-Examples-QC \
.git_submodule_init.done.log \
.venv.done.log
$(MAKE) \
--directory dependencies/CASE-Examples-QC/tests \
ontology_vocabulary.txt
test -r dependencies/CASE/ontology/master/case.ttl \
|| (git submodule init dependencies/CASE && git submodule update dependencies/CASE)
test -r dependencies/CASE/ontology/master/case.ttl
Expand Down Expand Up @@ -91,10 +81,6 @@ clean:
tests/examples \
|| true \
)
@#Remove flag files that are normally set after deeper submodules and rdf-toolkit are downloaded.
@rm -f \
dependencies/CASE-Examples-QC/.git_submodule_init.done.log \
dependencies/CASE-Examples-QC/.lib.done.log

# This recipe guarantees timestamp update order, and is otherwise intended to be a no-op.
dependencies/CASE/ontology/master/case.ttl: \
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ Participation by NIST in the creation of the documentation of mentioned software

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

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


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

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.

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).


#### `case_sparql_construct`

Expand Down
15 changes: 1 addition & 14 deletions case_utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,6 @@
#
# We would appreciate acknowledgement if the software is used.

__version__ = "0.3.0"

import typing
import warnings

import rdflib.util # type: ignore
__version__ = "0.4.0"

from . import local_uuid

def guess_format(
fpath : str,
fmap : typing.Optional[typing.Dict[str, str]] = None
) -> typing.Optional[str]:
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)

return rdflib.util.guess_format(fpath, fmap) # type: ignore
Loading