mustrd 0.2.7a0__py3-none-any.whl → 0.3.1a0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mustrd/README.md +2 -0
- mustrd/anzo_utils.py +8 -5
- mustrd/logger_setup.py +3 -0
- mustrd/model/mustrdShapes.ttl +25 -6
- mustrd/model/ontology.ttl +6 -2
- mustrd/mustrd.py +508 -235
- mustrd/mustrdAnzo.py +3 -2
- mustrd/mustrdRdfLib.py +8 -1
- mustrd/mustrdTestPlugin.py +299 -128
- mustrd/namespace.py +10 -1
- mustrd/spec_component.py +238 -58
- mustrd/steprunner.py +78 -20
- mustrd-0.3.1a0.dist-info/METADATA +96 -0
- {mustrd-0.2.7a0.dist-info → mustrd-0.3.1a0.dist-info}/RECORD +17 -17
- mustrd-0.2.7a0.dist-info/METADATA +0 -96
- {mustrd-0.2.7a0.dist-info → mustrd-0.3.1a0.dist-info}/LICENSE +0 -0
- {mustrd-0.2.7a0.dist-info → mustrd-0.3.1a0.dist-info}/WHEEL +0 -0
- {mustrd-0.2.7a0.dist-info → mustrd-0.3.1a0.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,96 @@
|
|
1
|
+
Metadata-Version: 2.3
|
2
|
+
Name: mustrd
|
3
|
+
Version: 0.3.1a0
|
4
|
+
Summary: A Spec By Example framework for RDF and SPARQL, Inspired by Cucumber.
|
5
|
+
License: MIT
|
6
|
+
Author: John Placek
|
7
|
+
Author-email: john.placek@semanticpartners.com
|
8
|
+
Requires-Python: >=3.11,<4.0
|
9
|
+
Classifier: Framework :: Pytest
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
11
|
+
Classifier: Natural Language :: English
|
12
|
+
Classifier: Programming Language :: Python
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
17
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
18
|
+
Classifier: Topic :: Software Development :: Testing
|
19
|
+
Classifier: Topic :: Utilities
|
20
|
+
Requires-Dist: Jinja2 (==3.1.5)
|
21
|
+
Requires-Dist: beautifulsoup4 (>=4.11.1,<5.0.0)
|
22
|
+
Requires-Dist: colorama (==0.4.6)
|
23
|
+
Requires-Dist: colorlog (>=6.7.0,<7.0.0)
|
24
|
+
Requires-Dist: coverage (==7.4.3)
|
25
|
+
Requires-Dist: edn-format (>=0.7.5,<0.8.0)
|
26
|
+
Requires-Dist: flake8 (==7.0.0)
|
27
|
+
Requires-Dist: multimethods-py (>=0.5.3,<0.6.0)
|
28
|
+
Requires-Dist: numpy (>=1.26.0,<1.27.0)
|
29
|
+
Requires-Dist: openpyxl (>=3.1.2,<4.0.0)
|
30
|
+
Requires-Dist: pandas (>=2.0,<3.0)
|
31
|
+
Requires-Dist: pyshacl (>=0.30.0,<0.31.0)
|
32
|
+
Requires-Dist: pytest (>=7.2.0,<8.0.0)
|
33
|
+
Requires-Dist: rdflib (>=7.1.3,<8.0.0)
|
34
|
+
Requires-Dist: requests (>=2.28.2,<3.0.0)
|
35
|
+
Requires-Dist: tabulate (>=0.9.0,<0.10.0)
|
36
|
+
Requires-Dist: toml (>=0.10.2,<0.11.0)
|
37
|
+
Requires-Dist: tomli (>=2.0.1,<3.0.0)
|
38
|
+
Requires-Dist: urllib3 (==1.26.19)
|
39
|
+
Project-URL: Repository, https://github.com/Semantic-partners/mustrd
|
40
|
+
Description-Content-Type: text/markdown
|
41
|
+
|
42
|
+
# mustrd
|
43
|
+
|
44
|
+
**"MustRD: Validate your SPARQL queries and transformations with precision and confidence, using BDD and Given-When-Then principles."**
|
45
|
+
|
46
|
+
[<img src="https://github.com/Semantic-partners/mustrd/raw/python-coverage-comment-action-data/badge.svg?sanitize=true" alt="coverage badge">](https://github.com/Semantic-partners/mustrd/tree/python-coverage-comment-action-data)
|
47
|
+
|
48
|
+
### Why?
|
49
|
+
|
50
|
+
SPARQL is a powerful query language for RDF data, but how can you ensure your queries and transformations are doing what you intend? Whether you're working on a pipeline or a standalone query, certainty is key.
|
51
|
+
|
52
|
+
While RDF and SPARQL offer great flexibility, we noticed a gap in tooling to validate their behavior. We missed the robust testing frameworks available in imperative programming languages that help ensure your code works as expected.
|
53
|
+
|
54
|
+
With MustRD, you can:
|
55
|
+
|
56
|
+
* Define data scenarios and verify that queries produce the expected results.
|
57
|
+
* Test edge cases to ensure your queries remain reliable.
|
58
|
+
* Isolate small SPARQL enrichment or transformation steps and confirm you're only inserting what you intend.
|
59
|
+
|
60
|
+
### What?
|
61
|
+
|
62
|
+
MustRD is a Spec-By-Example ontology with a reference Python implementation, inspired by tools like Cucumber. It uses the Given-When-Then approach to define and validate SPARQL queries and transformations.
|
63
|
+
|
64
|
+
MustRD is designed to be triplestore/SPARQL engine agnostic, leveraging open standards to ensure compatibility across different platforms.
|
65
|
+
|
66
|
+
### What it is NOT
|
67
|
+
|
68
|
+
MustRD is not an alternative to SHACL. While SHACL validates data structures, MustRD focuses on validating data transformations and query results.
|
69
|
+
|
70
|
+
### How?
|
71
|
+
|
72
|
+
You define your specs in Turtle (`.ttl`) or TriG (`.trig`) files using the Given-When-Then approach:
|
73
|
+
|
74
|
+
* **Given**: Define the starting dataset.
|
75
|
+
* **When**: Specify the action (e.g., a SPARQL query).
|
76
|
+
* **Then**: Outline the expected results.
|
77
|
+
|
78
|
+
Depending on the type of SPARQL query (CONSTRUCT, SELECT, INSERT/DELETE), MustRD runs the query and compares the results against the expectations defined in the spec.
|
79
|
+
|
80
|
+
Expectations can also be defined as:
|
81
|
+
|
82
|
+
* INSERT queries.
|
83
|
+
* SELECT queries.
|
84
|
+
* Higher-order expectation languages, similar to those used in various platforms.
|
85
|
+
|
86
|
+
### When?
|
87
|
+
|
88
|
+
MustRD is a work in progress, built to meet the needs of our projects across multiple clients and vendor stacks. While we find it useful, it may not meet your needs out of the box.
|
89
|
+
|
90
|
+
We invite you to try it, raise issues, or contribute via pull requests. If you need custom features, contact us for consultancy rates, and we may prioritize your request.
|
91
|
+
|
92
|
+
## Support
|
93
|
+
|
94
|
+
Semantic Partners is a specialist consultancy in Semantic Technology. If you need more support, contact us at info@semanticpartners.com or mustrd@semanticpartners.com.
|
95
|
+
|
96
|
+
|
@@ -1,32 +1,32 @@
|
|
1
1
|
mustrd/README.adoc,sha256=E5KuShPEl2U6NmRzEAwZtAhBoyJsOvjGS1CM2UsbSQ4,1394
|
2
|
-
mustrd/README.md,sha256=
|
2
|
+
mustrd/README.md,sha256=uyg4Pn1JkYic_H5WcWn7llL_m4gBsIl02rIEikKa_2A,1609
|
3
3
|
mustrd/TestResult.py,sha256=K4yth-rYrK6Pl7SFiTAZkUStBIzHlgq0oxSSpq5F34M,4849
|
4
4
|
mustrd/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
|
-
mustrd/anzo_utils.py,sha256=
|
6
|
-
mustrd/logger_setup.py,sha256=
|
5
|
+
mustrd/anzo_utils.py,sha256=CKNSF_oTFKc4v64EDXJzeirP1GxOIOCUKNfaJKk0oEc,4677
|
6
|
+
mustrd/logger_setup.py,sha256=kuzrFaW8Ar-q5Bvjg1OqKn9l4U5MVDyfOQF13SYk8nQ,1780
|
7
7
|
mustrd/model/catalog-v001.xml,sha256=IEtaw3FK4KGQWKancEe1HqzUQTrKdk89vNxnoLKGF4o,381
|
8
|
-
mustrd/model/mustrdShapes.ttl,sha256=
|
8
|
+
mustrd/model/mustrdShapes.ttl,sha256=Qw99dIakGEra-vcENs3Oc9pJ33yYBZ0GEZJa2dLI3xo,10107
|
9
9
|
mustrd/model/mustrdTestOntology.ttl,sha256=W7IRbPKrhpYFweZvc9QH8gdjBiuZMHKETIuHBepLnYw,2034
|
10
10
|
mustrd/model/mustrdTestShapes.ttl,sha256=5PUpU9AzPSeLpF_UzNBVnACLOhs3hfoQpiz-ybsrbj8,818
|
11
|
-
mustrd/model/ontology.ttl,sha256=
|
11
|
+
mustrd/model/ontology.ttl,sha256=orb8VgPiVrmzp3dKHc53hgkq_9ic9SbqIAyLZ_cHv38,17079
|
12
12
|
mustrd/model/test-resources/resources.ttl,sha256=1Dsp1nuNxauj9bxeX-HShQsiO-CVy5Irwm2y2x0cdjI,1498
|
13
13
|
mustrd/model/triplestoreOntology.ttl,sha256=9K5gj0hDOolRYjHc58UT4igex8cUnq9h7SUe4ToYbdw,5834
|
14
14
|
mustrd/model/triplestoreshapes.ttl,sha256=G1kdgASdPa8s5JVGXL4KM2ewp-F5Vmbdist0f77VTBc,1706
|
15
|
-
mustrd/mustrd.py,sha256=
|
16
|
-
mustrd/mustrdAnzo.py,sha256=
|
15
|
+
mustrd/mustrd.py,sha256=Ac42FUVY_6u1rt8uQmmIRo6-lV1vmOTy5fNu1CqPEIQ,41021
|
16
|
+
mustrd/mustrdAnzo.py,sha256=0XhLkfagW_HManfZ3iGAf_K2_d-pLVTAOT-0pX8hhM4,8352
|
17
17
|
mustrd/mustrdGraphDb.py,sha256=Ro_fxDPFl64r-FAM18awhZydydEY1-IXO0zdKpvZD3U,5405
|
18
|
-
mustrd/mustrdRdfLib.py,sha256=
|
19
|
-
mustrd/mustrdTestPlugin.py,sha256=
|
20
|
-
mustrd/namespace.py,sha256=
|
18
|
+
mustrd/mustrdRdfLib.py,sha256=1dYoyohjDhonKItYMNkFybySFt9lgez3zYN2kU9mW-I,2369
|
19
|
+
mustrd/mustrdTestPlugin.py,sha256=hbYo8i1j4uFuRekXGd4Mnjt9wkSgQrS5o809xtbcLgs,19664
|
20
|
+
mustrd/namespace.py,sha256=1l8RJDFI7rYkWvmRokaTvSvqrDJEdRNIkq3lmPb0xpI,3854
|
21
21
|
mustrd/run.py,sha256=5xZUgKPMBQ-03cWROAnwtbOs2Nb0Vat6n8Fi6EyfS-k,4257
|
22
|
-
mustrd/spec_component.py,sha256=
|
23
|
-
mustrd/steprunner.py,sha256=
|
22
|
+
mustrd/spec_component.py,sha256=FQPLX5W0wGOLUOJgPxf-9YpyNhMYnV3xU2nJch99NOI,38452
|
23
|
+
mustrd/steprunner.py,sha256=BHY4UhN7oqHVoXYPk4ROnv0nCqy4-NXfbzFzOyb3G4k,10032
|
24
24
|
mustrd/templates/md_ResultList_leaf_template.jinja,sha256=IzwZjliCx7-viipATDQK6MQg_5q1kLMKdeNSZg1sXXY,508
|
25
25
|
mustrd/templates/md_ResultList_template.jinja,sha256=_8joJ7vtw_qoqxv3HhUtBgRfhOeqmgfaRFwEo4MROvQ,203
|
26
26
|
mustrd/templates/md_stats_template.jinja,sha256=96W62cMWu9UGLNv65ZQ8RYLjkxKHhJy-FlUtXgud6XY,155
|
27
27
|
mustrd/utils.py,sha256=OGdLvw7GvjrFgTJo0J97Xwdh-_ZgSmapmOistrEchO0,1387
|
28
|
-
mustrd-0.
|
29
|
-
mustrd-0.
|
30
|
-
mustrd-0.
|
31
|
-
mustrd-0.
|
32
|
-
mustrd-0.
|
28
|
+
mustrd-0.3.1a0.dist-info/LICENSE,sha256=r8nmh5fUct9h2w8_RDl13EIscvmwCLoarPr1kg35MnA,1078
|
29
|
+
mustrd-0.3.1a0.dist-info/METADATA,sha256=Kf--ygg87njQLL6YTu-Prt63nMrj0aMwpSAoya_FtDk,4361
|
30
|
+
mustrd-0.3.1a0.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
31
|
+
mustrd-0.3.1a0.dist-info/entry_points.txt,sha256=v7V7sN0_L1aB4Ug_9io5axlQSeJ1C0tNrQWwdXdV58s,50
|
32
|
+
mustrd-0.3.1a0.dist-info/RECORD,,
|
@@ -1,96 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.3
|
2
|
-
Name: mustrd
|
3
|
-
Version: 0.2.7a0
|
4
|
-
Summary: A Spec By Example framework for RDF and SPARQL, Inspired by Cucumber.
|
5
|
-
License: MIT
|
6
|
-
Author: John Placek
|
7
|
-
Author-email: john.placek@semanticpartners.com
|
8
|
-
Requires-Python: >=3.11,<4.0
|
9
|
-
Classifier: Framework :: Pytest
|
10
|
-
Classifier: License :: OSI Approved :: MIT License
|
11
|
-
Classifier: Natural Language :: English
|
12
|
-
Classifier: Programming Language :: Python
|
13
|
-
Classifier: Programming Language :: Python :: 3
|
14
|
-
Classifier: Programming Language :: Python :: 3.11
|
15
|
-
Classifier: Programming Language :: Python :: 3.12
|
16
|
-
Classifier: Programming Language :: Python :: 3.13
|
17
|
-
Classifier: Topic :: Software Development :: Quality Assurance
|
18
|
-
Classifier: Topic :: Software Development :: Testing
|
19
|
-
Classifier: Topic :: Utilities
|
20
|
-
Requires-Dist: Jinja2 (==3.1.5)
|
21
|
-
Requires-Dist: beautifulsoup4 (>=4.11.1,<5.0.0)
|
22
|
-
Requires-Dist: colorama (==0.4.6)
|
23
|
-
Requires-Dist: colorlog (>=6.7.0,<7.0.0)
|
24
|
-
Requires-Dist: coverage (==7.4.3)
|
25
|
-
Requires-Dist: flake8 (==7.0.0)
|
26
|
-
Requires-Dist: multimethods-py (>=0.5.3,<0.6.0)
|
27
|
-
Requires-Dist: numpy (>=1.26.0,<1.27.0)
|
28
|
-
Requires-Dist: openpyxl (>=3.1.2,<4.0.0)
|
29
|
-
Requires-Dist: pandas (>=2.0,<3.0)
|
30
|
-
Requires-Dist: pyshacl (>=0.30.0,<0.31.0)
|
31
|
-
Requires-Dist: pytest (>=7.2.0,<8.0.0)
|
32
|
-
Requires-Dist: rdflib (>=7.1.3,<8.0.0)
|
33
|
-
Requires-Dist: requests (>=2.28.2,<3.0.0)
|
34
|
-
Requires-Dist: tabulate (>=0.9.0,<0.10.0)
|
35
|
-
Requires-Dist: toml (>=0.10.2,<0.11.0)
|
36
|
-
Requires-Dist: tomli (>=2.0.1,<3.0.0)
|
37
|
-
Requires-Dist: urllib3 (==1.26.19)
|
38
|
-
Project-URL: Repository, https://github.com/Semantic-partners/mustrd
|
39
|
-
Description-Content-Type: text/markdown
|
40
|
-
|
41
|
-
# mustrd
|
42
|
-
|
43
|
-
|
44
|
-
[<img src="https://github.com/Semantic-partners/mustrd/raw/python-coverage-comment-action-data/badge.svg?sanitize=true" alt="coverage badge">](https://github.com/Semantic-partners/mustrd/tree/python-coverage-comment-action-data)
|
45
|
-
|
46
|
-
### Why?
|
47
|
-
|
48
|
-
How do you know your SPARQL, whether it's in a pipeline, or a query, is doing what you intend?
|
49
|
-
|
50
|
-
As much as we love RDF and SPARQL and Semantic Tech in general, we found a small gap in tooling to give us that certainty.
|
51
|
-
|
52
|
-
We missed the powerful testing frameworks that have evolved in imperative languages that help ensure you've written code that does what you think it should.
|
53
|
-
|
54
|
-
We wanted to be able to
|
55
|
-
|
56
|
-
* setup data scenarios and ensure queries worked as expected
|
57
|
-
* setup edge cases for queries and ensure they still work
|
58
|
-
* isolate small sparql enrichment / transformation steps and know we're only INSERTing what we intend
|
59
|
-
|
60
|
-
Enter MustRD.
|
61
|
-
|
62
|
-
### What?
|
63
|
-
|
64
|
-
MustRD is a Spec-By-Example ontology, with a reference python implementation, inspired by the likes of Cucumber.
|
65
|
-
|
66
|
-
It's designed to be triplestore/SPARQL engine agnostic (aren't open standards *wonderful*!).
|
67
|
-
|
68
|
-
### What it is NOT
|
69
|
-
MustRD is nothing to do with SHACL, or an alternative to it. In fact, we use SHACL for some of our features.
|
70
|
-
|
71
|
-
SHACL provides validation around data.
|
72
|
-
|
73
|
-
MustRD provides validation around data transformations.
|
74
|
-
|
75
|
-
### How?
|
76
|
-
You define your specs in ttl, or trig files.
|
77
|
-
We use the SBE approach of *Given*, *When*, *Then* to define starting dataset, an action, and a set of expectations. We build up a set of data.
|
78
|
-
Then, depending on whether your SPARQL is a CONSTRUCT, SELECT or a INSERT/DELETE, we run it, and compare results against a set of expectations (*Then*) that are defined in the same way as a *Given* .
|
79
|
-
Alternatively, you could define your *Then*
|
80
|
-
|
81
|
-
* as an explicit ASK, or
|
82
|
-
* select; or
|
83
|
-
* in a higher-order expectation language like you will be used to in various platforms, a set of expectations.
|
84
|
-
|
85
|
-
|
86
|
-
### When?
|
87
|
-
|
88
|
-
Soon. It's a work in progress, and we're building the things *we* need for the projects we work on at multiple clients, with multiple vendor stacks.
|
89
|
-
We already think it's useful, but it might not meet *your* needs, out of the box.
|
90
|
-
|
91
|
-
We invite you to try it, see where it doesn't fit, and raise an issue, or even better, a PR! If you need something custom, please check out our consultancy rates, and we might be able to prioritise a new feature for you.
|
92
|
-
|
93
|
-
## Support
|
94
|
-
We're a specialist consultancy in Semantic Tech, we're putting this out in case it's useful, but if you need more support, kindly contact our business team on info@semanticpartners.com, or mustrd@semanticpartners.com
|
95
|
-
|
96
|
-
|
File without changes
|
File without changes
|
File without changes
|