Skip to content

Commit

Permalink
Merge pull request #99 from casework/release-0.11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kchason authored Jan 10, 2024
2 parents e2daffe + a9c8ede commit f5fdff1
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 38 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@

repos:
- repo: https://github.com/psf/black
rev: 23.11.0
rev: 23.12.1
hooks:
- id: black
- repo: https://github.com/pycqa/flake8
rev: 6.1.0
rev: 7.0.0
hooks:
- id: flake8
- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
name: isort (python)
8 changes: 4 additions & 4 deletions case_prov/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
#
# We would appreciate acknowledgement if the software is used.

__version__ = "0.10.0"
__version__ = "0.11.0"

import datetime
import typing
import uuid
import warnings

import case_utils.inherent_uuid
import case_utils.local_uuid
import rdflib
from case_utils.namespace import NS_RDF, NS_UCO_ACTION, NS_XSD
from cdo_local_uuid import local_uuid

NS_PROV = rdflib.PROV
NS_TIME = rdflib.TIME
Expand Down Expand Up @@ -245,7 +245,7 @@ def infer_prov_instantaneous_influence_event(
uuid.uuid5(predicated_uuid_namespace, str(n_prov_related_thing))
)
else:
node_uuid = case_utils.local_uuid.local_uuid()
node_uuid = local_uuid()
n_instantaneous_event = rdf_namespace[slug + node_uuid]
else:
n_instantaneous_event = rdflib.BNode()
Expand Down Expand Up @@ -326,7 +326,7 @@ def infer_interval_terminus(
if use_deterministic_uuids:
node_uuid = str(uuid.uuid5(uuid_namespace, str(n_predicate)))
else:
node_uuid = case_utils.local_uuid.local_uuid()
node_uuid = local_uuid()
n_terminus = rdf_namespace[slug + node_uuid]
else:
n_terminus = rdflib.BNode()
Expand Down
10 changes: 6 additions & 4 deletions case_prov/case_prov_dot.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
# get quoted. This turns out to be a dot syntax error. Need to report
# this upstream to pydot.

__version__ = "0.5.0"
__version__ = "0.5.1"

import argparse
import collections
Expand All @@ -39,12 +39,14 @@
import typing
import uuid

import case_utils.local_uuid
import case_utils.inherent_uuid
import cdo_local_uuid
import prov.constants # type: ignore
import prov.dot # type: ignore
import pydot # type: ignore
import rdflib.plugins.sparql
from case_utils.namespace import NS_CASE_INVESTIGATION, NS_RDF, NS_RDFS, NS_UCO_CORE
from cdo_local_uuid import local_uuid

import case_prov

Expand Down Expand Up @@ -551,7 +553,7 @@ def _define_witnesses(
uuid_namespace = uuid.uuid5(uuid_namespace, n_thing)
node_uuid = str(uuid_namespace)
else:
node_uuid = case_utils.local_uuid.local_uuid()
node_uuid = local_uuid()
n_witness = ns_kb["Instant-" + node_uuid]
else:
n_witness = rdflib.BNode()
Expand Down Expand Up @@ -674,7 +676,7 @@ def main() -> None:

logging.basicConfig(level=logging.DEBUG if args.debug else logging.INFO)

case_utils.local_uuid.configure()
cdo_local_uuid.configure()

graph = rdflib.Graph()
for in_graph_filename in args.in_graph:
Expand Down
13 changes: 7 additions & 6 deletions case_prov/case_prov_rdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
This script executes CONSTRUCT queries and other data translation, returning a supplemental graph.
"""

__version__ = "0.4.0"
__version__ = "0.4.1"

import argparse
import importlib.resources
Expand All @@ -25,7 +25,7 @@
import uuid

import case_utils.inherent_uuid
import case_utils.local_uuid
import cdo_local_uuid
import rdflib.plugins.sparql
from case_utils.namespace import (
NS_CASE_INVESTIGATION,
Expand All @@ -34,6 +34,7 @@
NS_UCO_CORE,
NS_UCO_IDENTITY,
)
from cdo_local_uuid import local_uuid

import case_prov

Expand Down Expand Up @@ -88,7 +89,7 @@ def main() -> None:

logging.basicConfig(level=logging.DEBUG if args.debug else logging.INFO)

case_utils.local_uuid.configure()
cdo_local_uuid.configure()

in_graph = rdflib.Graph()
out_graph = rdflib.Graph()
Expand Down Expand Up @@ -206,7 +207,7 @@ def main() -> None:
)
)
else:
association_uuid = case_utils.local_uuid.local_uuid()
association_uuid = local_uuid()
n_association = NS_KB["Association-" + association_uuid]
out_graph.add(
(n_action, NS_PROV.qualifiedAssociation, n_association)
Expand Down Expand Up @@ -248,7 +249,7 @@ def main() -> None:
)
)
else:
delegation_uuid = case_utils.local_uuid.local_uuid()
delegation_uuid = local_uuid()
n_delegation = NS_KB["Delegation-" + delegation_uuid]
out_graph.add(
(n_instrument, NS_PROV.qualifiedDelegation, n_delegation)
Expand Down Expand Up @@ -320,7 +321,7 @@ def main() -> None:
uuid.uuid5(qualifed_attribution_uuid_namespace, str(n_agent))
)
else:
attribution_uuid = case_utils.local_uuid.local_uuid()
attribution_uuid = local_uuid()

n_attribution = NS_KB["Attribution-" + attribution_uuid]
tmp_triples.add((n_entity, NS_PROV.qualifiedAttribution, n_attribution))
Expand Down
38 changes: 19 additions & 19 deletions figures/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ readme-actions-ordered-by-timestamp-expanded.ttl: \
$(top_srcdir)/case_prov/shapes/prov-shapes.ttl \
$(top_srcdir)/dependencies/prov-check/provcheck/provconstraints.py \
$(top_srcdir)/tests/.venv.done.log
export CASE_DEMO_NONRANDOM_UUID_BASE="$(top_srcdir)" \
export CDO_DEMO_NONRANDOM_UUID_BASE="$(top_srcdir)" \
&& source $(top_srcdir)/tests/venv/bin/activate \
&& case_prov_rdf \
__$@ \
Expand Down Expand Up @@ -138,7 +138,7 @@ readme-actions-ordered-by-timestamp-invisible.dot: \
$(top_srcdir)/case_prov/__init__.py \
$(top_srcdir)/case_prov/case_prov_dot.py \
$(top_srcdir)/tests/.venv.done.log
export CASE_DEMO_NONRANDOM_UUID_BASE="$(top_srcdir)" \
export CDO_DEMO_NONRANDOM_UUID_BASE="$(top_srcdir)" \
&& source $(top_srcdir)/tests/venv/bin/activate \
&& case_prov_dot \
--omit-empty-set \
Expand Down Expand Up @@ -173,7 +173,7 @@ readme-actions-ordered-by-timestamp-visible.dot: \
$(top_srcdir)/case_prov/__init__.py \
$(top_srcdir)/case_prov/case_prov_dot.py \
$(top_srcdir)/tests/.venv.done.log
export CASE_DEMO_NONRANDOM_UUID_BASE="$(top_srcdir)" \
export CDO_DEMO_NONRANDOM_UUID_BASE="$(top_srcdir)" \
&& source $(top_srcdir)/tests/venv/bin/activate \
&& case_prov_dot \
--display-time-links \
Expand All @@ -188,7 +188,7 @@ readme-activities.dot: \
$(top_srcdir)/case_prov/__init__.py \
$(top_srcdir)/case_prov/case_prov_dot.py \
$(top_srcdir)/tests/.venv.done.log
export CASE_DEMO_NONRANDOM_UUID_BASE="$(top_srcdir)" \
export CDO_DEMO_NONRANDOM_UUID_BASE="$(top_srcdir)" \
&& source $(top_srcdir)/tests/venv/bin/activate \
&& case_prov_dot \
--omit-empty-set \
Expand All @@ -202,7 +202,7 @@ readme-activities-related-by-intervals-invisible.dot: \
$(top_srcdir)/case_prov/__init__.py \
$(top_srcdir)/case_prov/case_prov_dot.py \
$(top_srcdir)/tests/.venv.done.log
export CASE_DEMO_NONRANDOM_UUID_BASE="$(top_srcdir)" \
export CDO_DEMO_NONRANDOM_UUID_BASE="$(top_srcdir)" \
&& source $(top_srcdir)/tests/venv/bin/activate \
&& case_prov_dot \
--debug \
Expand All @@ -216,7 +216,7 @@ readme-activities-related-by-intervals-visible.dot: \
$(top_srcdir)/case_prov/__init__.py \
$(top_srcdir)/case_prov/case_prov_dot.py \
$(top_srcdir)/tests/.venv.done.log
export CASE_DEMO_NONRANDOM_UUID_BASE="$(top_srcdir)" \
export CDO_DEMO_NONRANDOM_UUID_BASE="$(top_srcdir)" \
&& source $(top_srcdir)/tests/venv/bin/activate \
&& case_prov_dot \
--debug \
Expand All @@ -231,7 +231,7 @@ readme-activities-related-by-intervals-with-intervals.dot: \
$(top_srcdir)/case_prov/__init__.py \
$(top_srcdir)/case_prov/case_prov_dot.py \
$(top_srcdir)/tests/.venv.done.log
export CASE_DEMO_NONRANDOM_UUID_BASE="$(top_srcdir)" \
export CDO_DEMO_NONRANDOM_UUID_BASE="$(top_srcdir)" \
&& source $(top_srcdir)/tests/venv/bin/activate \
&& case_prov_dot \
--debug \
Expand All @@ -246,7 +246,7 @@ readme-activity-vs-proper-interval-visible.dot: \
$(top_srcdir)/case_prov/__init__.py \
$(top_srcdir)/case_prov/case_prov_dot.py \
$(top_srcdir)/tests/.venv.done.log
export CASE_DEMO_NONRANDOM_UUID_BASE="$(top_srcdir)" \
export CDO_DEMO_NONRANDOM_UUID_BASE="$(top_srcdir)" \
&& source $(top_srcdir)/tests/venv/bin/activate \
&& case_prov_dot \
--debug \
Expand All @@ -261,7 +261,7 @@ readme-allen-relations-invisible.dot: \
$(top_srcdir)/case_prov/__init__.py \
$(top_srcdir)/case_prov/case_prov_dot.py \
$(top_srcdir)/tests/.venv.done.log
export CASE_DEMO_NONRANDOM_UUID_BASE="$(top_srcdir)" \
export CDO_DEMO_NONRANDOM_UUID_BASE="$(top_srcdir)" \
&& source $(top_srcdir)/tests/venv/bin/activate \
&& case_prov_dot \
--debug \
Expand All @@ -275,7 +275,7 @@ readme-allen-relations-visible.dot: \
$(top_srcdir)/case_prov/__init__.py \
$(top_srcdir)/case_prov/case_prov_dot.py \
$(top_srcdir)/tests/.venv.done.log
export CASE_DEMO_NONRANDOM_UUID_BASE="$(top_srcdir)" \
export CDO_DEMO_NONRANDOM_UUID_BASE="$(top_srcdir)" \
&& source $(top_srcdir)/tests/venv/bin/activate \
&& case_prov_dot \
--debug \
Expand All @@ -290,7 +290,7 @@ readme-attribution.dot: \
$(top_srcdir)/case_prov/__init__.py \
$(top_srcdir)/case_prov/case_prov_dot.py \
$(top_srcdir)/tests/.venv.done.log
export CASE_DEMO_NONRANDOM_UUID_BASE="$(top_srcdir)" \
export CDO_DEMO_NONRANDOM_UUID_BASE="$(top_srcdir)" \
&& source $(top_srcdir)/tests/venv/bin/activate \
&& case_prov_dot \
--dash-unqualified \
Expand All @@ -304,7 +304,7 @@ readme-eapi-bounded-visible.dot: \
$(top_srcdir)/case_prov/__init__.py \
$(top_srcdir)/case_prov/case_prov_dot.py \
$(top_srcdir)/tests/.venv.done.log
export CASE_DEMO_NONRANDOM_UUID_BASE="$(top_srcdir)" \
export CDO_DEMO_NONRANDOM_UUID_BASE="$(top_srcdir)" \
&& source $(top_srcdir)/tests/venv/bin/activate \
&& case_prov_dot \
--display-time-links \
Expand All @@ -318,7 +318,7 @@ readme-eapi-default-visible.dot: \
$(top_srcdir)/case_prov/__init__.py \
$(top_srcdir)/case_prov/case_prov_dot.py \
$(top_srcdir)/tests/.venv.done.log
export CASE_DEMO_NONRANDOM_UUID_BASE="$(top_srcdir)" \
export CDO_DEMO_NONRANDOM_UUID_BASE="$(top_srcdir)" \
&& source $(top_srcdir)/tests/venv/bin/activate \
&& case_prov_dot \
--display-time-links \
Expand All @@ -332,7 +332,7 @@ readme-provenance-records.dot: \
$(top_srcdir)/case_prov/__init__.py \
$(top_srcdir)/case_prov/case_prov_dot.py \
$(top_srcdir)/tests/.venv.done.log
export CASE_DEMO_NONRANDOM_UUID_BASE="$(top_srcdir)" \
export CDO_DEMO_NONRANDOM_UUID_BASE="$(top_srcdir)" \
&& source $(top_srcdir)/tests/venv/bin/activate \
&& case_prov_dot \
--omit-empty-set \
Expand All @@ -345,7 +345,7 @@ readme-time-instants-invisible.dot: \
$(top_srcdir)/case_prov/__init__.py \
$(top_srcdir)/case_prov/case_prov_dot.py \
$(top_srcdir)/tests/.venv.done.log
export CASE_DEMO_NONRANDOM_UUID_BASE="$(top_srcdir)" \
export CDO_DEMO_NONRANDOM_UUID_BASE="$(top_srcdir)" \
&& source $(top_srcdir)/tests/venv/bin/activate \
&& case_prov_dot \
--debug \
Expand All @@ -359,7 +359,7 @@ readme-time-instants-visible.dot: \
$(top_srcdir)/case_prov/__init__.py \
$(top_srcdir)/case_prov/case_prov_dot.py \
$(top_srcdir)/tests/.venv.done.log
export CASE_DEMO_NONRANDOM_UUID_BASE="$(top_srcdir)" \
export CDO_DEMO_NONRANDOM_UUID_BASE="$(top_srcdir)" \
&& source $(top_srcdir)/tests/venv/bin/activate \
&& case_prov_dot \
--debug \
Expand All @@ -378,7 +378,7 @@ readme-two-files-expanded.ttl: \
$(top_srcdir)/case_prov/case_prov_rdf.py \
$(top_srcdir)/case_prov/shapes/prov-shapes.ttl \
$(top_srcdir)/tests/.venv.done.log
export CASE_DEMO_NONRANDOM_UUID_BASE="$(top_srcdir)" \
export CDO_DEMO_NONRANDOM_UUID_BASE="$(top_srcdir)" \
&& source $(top_srcdir)/tests/venv/bin/activate \
&& case_prov_rdf \
__$@ \
Expand Down Expand Up @@ -420,7 +420,7 @@ readme-two-files-invisible.dot: \
$(top_srcdir)/case_prov/__init__.py \
$(top_srcdir)/case_prov/case_prov_dot.py \
$(top_srcdir)/tests/.venv.done.log
export CASE_DEMO_NONRANDOM_UUID_BASE="$(top_srcdir)" \
export CDO_DEMO_NONRANDOM_UUID_BASE="$(top_srcdir)" \
&& source $(top_srcdir)/tests/venv/bin/activate \
&& case_prov_dot \
--omit-empty-set \
Expand Down Expand Up @@ -455,7 +455,7 @@ readme-two-files-visible.dot: \
$(top_srcdir)/case_prov/__init__.py \
$(top_srcdir)/case_prov/case_prov_dot.py \
$(top_srcdir)/tests/.venv.done.log
export CASE_DEMO_NONRANDOM_UUID_BASE="$(top_srcdir)" \
export CDO_DEMO_NONRANDOM_UUID_BASE="$(top_srcdir)" \
&& source $(top_srcdir)/tests/venv/bin/activate \
&& case_prov_dot \
--display-time-links \
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ license_files =
[options]
include_package_data = true
install_requires =
case_utils >=0.14.0,< 0.15.0
case_utils >=0.15.0,< 0.16.0
prov
pydot
packages = find:
Expand Down
2 changes: 1 addition & 1 deletion tests/casework.github.io/examples/src/example.mk
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ $(subjectdir_basename)-prov.ttl: \
$(construct_sparql_files) \
$(tests_srcdir)/.venv.done.log \
$(top_srcdir)/case_prov/case_prov_rdf.py
export CASE_DEMO_NONRANDOM_UUID_BASE="$(top_srcdir)" \
export CDO_DEMO_NONRANDOM_UUID_BASE="$(top_srcdir)" \
&& source $(tests_srcdir)/venv/bin/activate \
&& case_prov_rdf \
--allow-empty-results \
Expand Down

0 comments on commit f5fdff1

Please sign in to comment.