Skip to content
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

Release 0.6.0 #61

Merged
merged 28 commits into from
Dec 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
3447040
Merge pull request #51 from casework/release-0.5.0
ajnelson-nist Sep 2, 2022
abbe345
Prefix IDs with namespace manager
ajnelson-nist Nov 10, 2022
6b17ce6
Regenerate Make-managed files
ajnelson-nist Nov 10, 2022
a6f76c8
Run CI on Python 3.11
ajnelson-nist Nov 10, 2022
351afb9
Merge pull request #52 from casework/prefix_ids_with_namespace_manager
kchason Nov 10, 2022
e26004e
Merge pull request #53 from casework/run_ci_on_python_3_11
kchason Nov 11, 2022
8f2f6da
Run pre-commit autoupdate
ajnelson-nist Nov 28, 2022
a5fdf99
Roll flake8 version back to 5.0.4
ajnelson-nist Nov 28, 2022
42d0308
Merge pull request #55 from casework/run_precommit_autoupdate
ajnelson-nist Nov 28, 2022
10cd6e0
Regenerate figures
ajnelson-nist Nov 29, 2022
a1da806
Bump examples QC submodule pointer
ajnelson-nist Dec 5, 2022
3414ebe
Regenerate Make-managed files
ajnelson-nist Dec 5, 2022
b620d42
Add example manifest cross-check
ajnelson-nist Dec 5, 2022
bf29c72
Add review Makefiles for recent examples
ajnelson-nist Dec 5, 2022
7b823d3
Regenerate Make-managed files
ajnelson-nist Dec 5, 2022
f9634c0
Add inferred classes in CASE property mappings
ajnelson-nist Dec 5, 2022
773340a
Merge branch 'infer_mapped_property_classes' into bump_qc_pointer
ajnelson-nist Dec 5, 2022
e2f7537
Merge pull request #57 from casework/infer_mapped_property_classes
ajnelson-nist Dec 5, 2022
17b605c
Update examples and review
ajnelson-nist Dec 5, 2022
de64a9c
Regenerate Make-managed files
ajnelson-nist Dec 5, 2022
8d31a55
Merge pull request #56 from casework/bump_qc_pointer
ajnelson-nist Dec 5, 2022
539d8b4
Fix default-finder syntax
ajnelson-nist Dec 6, 2022
e548e2f
Merge pull request #58 from casework/fix_default_finder_syntax
ajnelson-nist Dec 6, 2022
eb90ca2
Adopt case-utils 0.9.0
ajnelson-nist Dec 9, 2022
28d57f3
Merge pull request #59 from casework/adopt_case_utils_0_9_0
ajnelson-nist Dec 9, 2022
31f01eb
Use RDFLib PROV DefinedNamespace
ajnelson-nist Dec 9, 2022
b36f771
Merge pull request #60 from casework/use_prov_defined_namespace
ajnelson-nist Dec 9, 2022
e7f663b
Bump versions
ajnelson-nist Dec 9, 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
2 changes: 1 addition & 1 deletion .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
matrix:
python-version:
- '3.7'
- '3.10'
- '3.11'

steps:
- uses: actions/checkout@v2
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@

repos:
- repo: https://github.com/psf/black
rev: 22.3.0
rev: 22.10.0
hooks:
- id: black
- repo: https://github.com/pycqa/flake8
rev: 4.0.1
rev: 5.0.4
hooks:
- id: flake8
- repo: https://github.com/pycqa/isort
Expand Down
2 changes: 1 addition & 1 deletion case_prov/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
#
# We would appreciate acknowledgement if the software is used.

__version__ = "0.5.0"
__version__ = "0.6.0"
31 changes: 16 additions & 15 deletions case_prov/case_prov_dot.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# get quoted. This turns out to be a dot syntax error. Need to report
# this upstream to pydot.

__version__ = "0.3.0"
__version__ = "0.4.0"

import argparse
import collections
Expand All @@ -41,7 +41,7 @@

_logger = logging.getLogger(os.path.basename(__file__))

NS_PROV = rdflib.Namespace("http://www.w3.org/ns/prov#")
NS_PROV = rdflib.PROV
NS_RDFS = rdflib.RDFS

# This one isn't among the prov constants.
Expand Down Expand Up @@ -74,12 +74,6 @@ def iri_to_gv_node_id(iri: str) -> str:
return "_" + hasher.hexdigest()


def iri_to_short_iri(iri: str) -> str:
return iri.replace("http://example.org/kb/", "kb:").replace(
"http://www.w3.org/ns/prov#", "prov:"
)


def main() -> None:
parser = argparse.ArgumentParser()
parser.add_argument("--debug", action="store_true")
Expand Down Expand Up @@ -145,7 +139,7 @@ def main() -> None:
filter_iris: typing.Optional[typing.Set[str]] = None
if args.from_empty_set:
filter_iris = set()
filter_iris.add("http://www.w3.org/ns/prov#EmptyCollection")
filter_iris.add(str(NS_PROV.EmptyCollection))
select_query_actions_text = """\
SELECT ?nDerivingAction
WHERE {
Expand Down Expand Up @@ -325,7 +319,7 @@ def main() -> None:
for record in graph.query(select_query_object):
(n_agent, l_label, l_comment) = record
agent_iri = n_agent.toPython()
dot_label = "ID - " + iri_to_short_iri(agent_iri)
dot_label = "ID - " + graph.namespace_manager.qname(agent_iri)
if l_label is not None:
dot_label += "\n" + l_label.toPython()
if l_comment is not None:
Expand All @@ -339,7 +333,7 @@ def main() -> None:
# _logger.debug("nodes = %s." % pprint.pformat(nodes))

# Find Collections, to adjust Entity rendering in the next block.
collection_iris = {"http://www.w3.org/ns/prov#EmptyCollection"}
collection_iris: typing.Set[str] = {str(NS_PROV.EmptyCollection)}
select_query_text = """\
SELECT ?nCollection
WHERE {
Expand All @@ -357,9 +351,16 @@ def main() -> None:

# Render Entities.
# This loop operates differently from the others, to insert prov:EmptyCollection.
entity_iri_to_label_comment = dict()
entity_iri_to_label_comment: typing.Dict[
str,
typing.Tuple[
typing.Optional[str],
typing.Optional[str],
typing.Optional[str],
],
] = dict()
if not args.omit_empty_set:
entity_iri_to_label_comment["http://www.w3.org/ns/prov#EmptyCollection"] = (
entity_iri_to_label_comment[str(NS_PROV.EmptyCollection)] = (
None,
None,
None,
Expand Down Expand Up @@ -391,7 +392,7 @@ def main() -> None:
entity_iri_to_label_comment[entity_iri] = (l_label, l_comment, l_exhibit_number)
for entity_iri in sorted(entity_iri_to_label_comment):
(l_label, l_comment, l_exhibit_number) = entity_iri_to_label_comment[entity_iri]
dot_label = "ID - " + iri_to_short_iri(entity_iri)
dot_label = "ID - " + graph.namespace_manager.qname(entity_iri)
if l_exhibit_number is not None:
dot_label += "\nExhibit - " + l_exhibit_number.toPython()
if l_label is not None:
Expand Down Expand Up @@ -437,7 +438,7 @@ def main() -> None:
for record in graph.query(select_query_object):
(n_activity, l_label, l_comment, l_start_time, l_end_time) = record
activity_iri = n_activity.toPython()
dot_label = "ID - " + iri_to_short_iri(activity_iri)
dot_label = "ID - " + graph.namespace_manager.qname(activity_iri)
if l_label is not None:
dot_label += "\n" + l_label.toPython()
if l_start_time is not None or l_end_time is not None:
Expand Down
4 changes: 2 additions & 2 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, returning a supplemental graph.
"""

__version__ = "0.2.1"
__version__ = "0.3.0"

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

_logger = logging.getLogger(os.path.basename(__file__))

NS_PROV = rdflib.Namespace("http://www.w3.org/ns/prov#")
NS_PROV = rdflib.PROV


def main() -> None:
Expand Down
2 changes: 2 additions & 0 deletions case_prov/queries/construct-wasDerivedFrom-map.sparql
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

CONSTRUCT {
?x prov:wasDerivedFrom ?y .
?x a prov:Entity .
?y a prov:Entity .
}
WHERE {
?x case-investigation:wasDerivedFrom ?y .
Expand Down
2 changes: 2 additions & 0 deletions case_prov/queries/construct-wasInformedBy-map.sparql
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

CONSTRUCT {
?x prov:wasInformedBy ?y .
?x a prov:Activity .
?y a prov:Activity .
}
WHERE {
?x case-investigation:wasInformedBy ?y .
Expand Down
2 changes: 1 addition & 1 deletion dependencies/CASE-Examples-QC
Submodule CASE-Examples-QC updated 119 files
10 changes: 5 additions & 5 deletions figures/readme-activities.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 16 additions & 16 deletions figures/readme-attribution.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 12 additions & 12 deletions figures/readme-provenance-records.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.7.0,< 0.8.0
case_utils >=0.9.0,< 0.10.0
prov
pydot
packages = find:
Expand Down
8 changes: 8 additions & 0 deletions tests/CASE-Examples/examples/illustrations/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@

SHELL := /bin/bash

top_srcdir := $(shell cd ../../../.. ; pwd)

illustrations_srcdir := $(top_srcdir)/dependencies/CASE-Examples-QC/dependencies/CASE-Examples/examples/illustrations

illdirs := $(shell find * -maxdepth 0 -type d | sort | egrep -v '^src$$')

all_targets := $(foreach illdir,$(illdirs),all-$(illdir))
Expand All @@ -28,6 +32,10 @@ all-%:

check: \
$(check_targets)
@diff \
<(ls */prov-constraints.log | while read x; do dirname $$x ; done) \
<(cd $(illustrations_srcdir) ; ls */*.json | while read x; do dirname $$x ; done | sort | uniq) \
|| (echo "ERROR:Makefile:The illustrations listed above do not have evaluation directories under $(top_srcdir)/tests/CASE-Examples/examples/illustrations." >&2 ; exit 1)

check-%:
$(MAKE) \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,10 @@ all:
$<
mv _$@ $@

# TODO: Fix constraints errors, then uncomment the recipe to enforce unit testing.
check:
@echo "ERROR:PROV constraints reports errors for forensic_lifecycle.json, which need fixing." >&2
# $(MAKE) \
# --file ../src/illustration.mk \
# check
$(MAKE) \
--file ../src/illustration.mk \
check

clean:
@$(MAKE) \
Expand Down
Loading