You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
git commit -m "Update CASE ontology pointer to version 0.6.0" dependencies/CASE case_utils/ontology/version_info.py
35
37
```
36
38
@@ -43,4 +45,4 @@ pre-commit --version
43
45
The `pre-commit` tool hooks into Git's commit machinery to run a set of linters and static analyzers over each change. To install `pre-commit` into Git's hooks, run:
To use one or more supplementary ontology files, the `--ontology-graph` flag can be used, more than once if desired, to supplement the selected CASE version:
58
+
To use one or more supplementary ontology or shape files, the `--ontology-graph` flag can be used, more than once if desired, to supplement the selected CASE version:
This tool uses the `--built-version` flag, described [below](#built-versions).
68
+
64
69
Other flags are reviewable with `case_validate --help`.
65
70
66
71
@@ -87,6 +92,8 @@ These commands can be used with any RDF files to run arbitrary SPARQL queries.
87
92
88
93
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).
89
94
95
+
These tools use the `--built-version` flag, described [below](#built-versions).
This [module](case_utils/local_uuid.py) provides a wrapper UUID generator, `local_uuid()`. Its main purpose is making example data generate consistent identifiers, and intentionally includes mechanisms to make it difficult to activate this mode without awareness of the caller.
117
124
118
125
126
+
### Built versions
127
+
128
+
Several tools in this package include a flag `--built-version`. This flag tailors the tool's behavior to a certain CASE ontology version; typically, this involves mixing the ontology graph into the data graph for certain necessary knowledge expansion for pattern matching (such as making queries aware of the OWL subclass hierarchy).
129
+
130
+
If not provided, the tool will assume a default value of the latest ontology version.
131
+
132
+
If the special value `none` is provided, none of the ontology builds this package ships will be included in the data graph. The `none` value supports use cases that are wholly independent of CASE, such as running a test in a specialized vocabulary; and also suports use cases where a non-released CASE version is meant to be used, such as a locally revised version of CASE where some concept revisions are being reviewed.
133
+
134
+
119
135
## Development status
120
136
121
137
This repository follows [CASE community guidance on describing development status](https://caseontology.org/resources/software.html#development_status), by adherence to noted support requirements.
Copy file name to clipboardExpand all lines: case_utils/case_sparql_construct/__init__.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@
15
15
This script executes a SPARQL CONSTRUCT query, returning a graph of the generated triples.
16
16
"""
17
17
18
-
__version__="0.2.3"
18
+
__version__="0.2.4"
19
19
20
20
importargparse
21
21
importlogging
@@ -49,7 +49,7 @@ def main() -> None:
49
49
"--built-version",
50
50
choices=tuple(built_version_choices_list),
51
51
default="case-"+CURRENT_CASE_VERSION,
52
-
help="Ontology version to use to supplement query, such as for subclass querying. Does not require networking to use. Default is most recent CASE release.",
52
+
help="Ontology version to use to supplement query, such as for subclass querying. Does not require networking to use. Default is most recent CASE release. Passing 'none' will mean no pre-built CASE ontology versions accompanying this tool will be included in the analysis.",
Copy file name to clipboardExpand all lines: case_utils/case_sparql_select/__init__.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@
26
26
Should a more complex query be necessary, an outer, wrapping SELECT query would let this script continue to function.
27
27
"""
28
28
29
-
__version__="0.4.3"
29
+
__version__="0.4.4"
30
30
31
31
importargparse
32
32
importbinascii
@@ -63,7 +63,7 @@ def main() -> None:
63
63
"--built-version",
64
64
choices=tuple(built_version_choices_list),
65
65
default="case-"+CURRENT_CASE_VERSION,
66
-
help="Ontology version to use to supplement query, such as for subclass querying. Does not require networking to use. Default is most recent CASE release.",
66
+
help="Ontology version to use to supplement query, such as for subclass querying. Does not require networking to use. Default is most recent CASE release. Passing 'none' will mean no pre-built CASE ontology versions accompanying this tool will be included in the analysis.",
This class is used when a concept is encountered in the data graph that is not part of CDO ontologies, according to the --built-version flags and --ontology-graph flags.
description="CASE wrapper to pySHACL command line tool."
@@ -72,7 +92,7 @@ def main() -> None:
72
92
"--built-version",
73
93
choices=tuple(built_version_choices_list),
74
94
default="case-"+CURRENT_CASE_VERSION,
75
-
help="Monolithic aggregation of CASE ontology files at certain versions. Does not require networking to use. Default is most recent CASE release.",
95
+
help="Monolithic aggregation of CASE ontology files at certain versions. Does not require networking to use. Default is most recent CASE release. Passing 'none' will mean no pre-built CASE ontology versions accompanying this tool will be included in the analysis.",
76
96
)
77
97
parser.add_argument(
78
98
"--ontology-graph",
@@ -86,10 +106,20 @@ def main() -> None:
86
106
action="store_true",
87
107
help="(As with pyshacl CLI) Abort on first invalid data.",
88
108
)
109
+
parser.add_argument(
110
+
"--allow-info",
111
+
"--allow-infos",
112
+
dest="allow_infos",
113
+
action="store_true",
114
+
default=False,
115
+
help="(As with pyshacl CLI) Shapes marked with severity of Info will not cause result to be invalid.",
116
+
)
89
117
parser.add_argument(
90
118
"-w",
119
+
"--allow-warning",
91
120
"--allow-warnings",
92
121
action="store_true",
122
+
dest="allow_warnings",
93
123
help="(As with pyshacl CLI) Shapes marked with severity of Warning or Info will not cause result to be invalid.",
94
124
)
95
125
parser.add_argument(
@@ -112,6 +142,14 @@ def main() -> None:
112
142
default="none",
113
143
help='(As with pyshacl CLI) Choose a type of inferencing to run against the Data Graph before validating. Default is "none".',
114
144
)
145
+
parser.add_argument(
146
+
"-m",
147
+
"--metashacl",
148
+
dest="metashacl",
149
+
action="store_true",
150
+
default=False,
151
+
help="(As with pyshacl CLI) Validate the SHACL Shapes graph against the shacl-shacl Shapes Graph before validating the Data Graph.",
undefined_cdo_concepts_alleviation_message="The data graph is SHACL-conformant with the CDO ontologies, but nonexistent-concept references raise Warnings with this tool. Please either correct the concept names in the data graph; use the --ontology-graph flag to pass a corrected CDO ontology file, also using --built-version none; or, use the --allow-warnings flag."
"Environment variable DEMO_UUID_REQUESTING_NONRANDOM is deprecated. See case_utils.local_uuid.demo_uuid for usage notes on its replacement, CASE_DEMO_NONRANDOM_UUID_BASE. Proceeding with random UUIDs.",
"Environment variable CASE_DEMO_NONRANDOM_UUID_BASE is expected to refer to an existing directory. Proceeding with random UUIDs."
52
+
"Environment variable CASE_DEMO_NONRANDOM_UUID_BASE is expected to refer to an existing directory. Proceeding with random UUIDs.",
53
+
RuntimeWarning,
53
54
)
54
55
return
55
56
ifnotbase_dir_original_path.is_dir():
56
57
warnings.warn(
57
-
"Environment variable CASE_DEMO_NONRANDOM_UUID_BASE is expected to refer to a directory. Proceeding with random UUIDs."
58
+
"Environment variable CASE_DEMO_NONRANDOM_UUID_BASE is expected to refer to a directory. Proceeding with random UUIDs.",
59
+
RuntimeWarning,
58
60
)
59
61
return
60
62
@@ -108,9 +110,9 @@ def demo_uuid() -> str:
108
110
"""
109
111
This function generates a repeatable UUID, drawing on non-varying elements of the environment and process call for entropy.
110
112
111
-
WARNING: This function was developed for use ONLY for reducing (but not eliminating) version-control edits to identifiers in sample data. It creates UUIDs that are decidedly NOT random, and should remain consistent on repeated calls to the importing script.
113
+
WARNING: This function was developed for use ONLY for reducing (but not eliminating) version-control edits to identifiers when generating sample data. It creates UUIDs that are decidedly NOT random, and should remain consistent on repeated calls to the importing script.
112
114
113
-
To prevent accidental non-random UUID usage, an environment variable must be set to a string provided by the caller. The variable's required value is the path to some directory. The variable's recommended value is the equivalent of the Make variable "top_srcdir" - that is, the root directory of the containing Git repository, some parent of the current process's current working directory.
115
+
To prevent accidental non-random UUID usage, an environment variable, CASE_DEMO_NONRANDOM_UUID_BASE, must be set to a string provided by the caller. The variable's required value is the path to some directory. The variable's recommended value is the equivalent of the Make variable "top_srcdir" - that is, the root directory of the containing Git repository, some parent of the current process's current working directory.
Copy file name to clipboardExpand all lines: case_utils/namespace.py
+4-1Lines changed: 4 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@
17
17
To use, add "from case_utils.namespace import *". Namespace variables starting with "NS_" are imported. As needs are demonstrated in CASE tooling (both in case_utils and from downstream requests), namespaces will also be imported from rdflib for a consistent "NS_*" spelling.
0 commit comments