mustrd 0.3.2__py3-none-any.whl → 0.3.3a1__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/mustrd.py CHANGED
@@ -548,13 +548,38 @@ def run_spec(spec: Specification) -> SpecResult:
548
548
 
549
549
 
550
550
  def get_triple_store_graph(triple_store_graph_path: Path, secrets: str):
551
+ graph = Graph()
552
+ # Parse the main triple store graph file
553
+ try:
554
+ graph.parse(triple_store_graph_path)
555
+ except Exception as e:
556
+ log.error(f"Failed to parse triple store graph file '{triple_store_graph_path}': {e}")
557
+ raise
558
+
559
+ # Parse secrets, either from string or from file
551
560
  if secrets:
552
- return Graph().parse(triple_store_graph_path).parse(data=secrets)
561
+ log.info("Parsing secrets from provided string (--secrets option)")
562
+ log.info("" + secrets)
563
+ try:
564
+ graph.parse(data=secrets)
565
+ except Exception as e:
566
+ log.error(f"Failed to parse secrets data for triple store graph: {e}")
567
+ raise
553
568
  else:
554
- secret_path = triple_store_graph_path.parent / Path(
569
+ secret_path = triple_store_graph_path.with_name(
555
570
  triple_store_graph_path.stem + "_secrets" + triple_store_graph_path.suffix
556
571
  )
557
- return Graph().parse(triple_store_graph_path).parse(secret_path)
572
+ log.info("Parsing secrets from secrets file: " + str(secret_path))
573
+ if secret_path.exists():
574
+ try:
575
+ graph.parse(secret_path)
576
+ except Exception as e:
577
+ log.error(f"Failed to parse secrets file '{secret_path}': {e}")
578
+ raise
579
+ else:
580
+ log.info(f"No secrets file found at '{secret_path}', continuing without it.")
581
+
582
+ return graph
558
583
 
559
584
 
560
585
  # Parse and validate triple store configuration
mustrd/shared_utils.py ADDED
File without changes
mustrd/spec_component.py CHANGED
@@ -179,6 +179,8 @@ def get_file_absolute_path(spec_component_details: SpecComponentDetails, relativ
179
179
 
180
180
 
181
181
  def get_spec_component_type(spec_components: List[SpecComponent]) -> Type[SpecComponent]:
182
+ if not spec_components:
183
+ raise ValueError("spec_components list is empty")
182
184
  # Get the type of the first object in the list
183
185
  spec_type = type(spec_components[0])
184
186
  # Loop through the remaining objects in the list and check their types
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: mustrd
3
- Version: 0.3.2
3
+ Version: 0.3.3a1
4
4
  Summary: A Spec By Example framework for RDF and SPARQL, Inspired by Cucumber.
5
5
  License: MIT
6
6
  Author: John Placek
@@ -12,21 +12,22 @@ mustrd/model/ontology.ttl,sha256=orb8VgPiVrmzp3dKHc53hgkq_9ic9SbqIAyLZ_cHv38,170
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=Ac42FUVY_6u1rt8uQmmIRo6-lV1vmOTy5fNu1CqPEIQ,41021
15
+ mustrd/mustrd.py,sha256=fhJZFU4q3eXbMlxu5OM7WWcnUQe1Mcg_FuGCmwZJvjg,41894
16
16
  mustrd/mustrdAnzo.py,sha256=B5uwN17XBuIJu5IBE7GKZ_SuA8yLDzeKywVz3HzAWYI,7451
17
17
  mustrd/mustrdGraphDb.py,sha256=Ro_fxDPFl64r-FAM18awhZydydEY1-IXO0zdKpvZD3U,5405
18
18
  mustrd/mustrdRdfLib.py,sha256=1dYoyohjDhonKItYMNkFybySFt9lgez3zYN2kU9mW-I,2369
19
19
  mustrd/mustrdTestPlugin.py,sha256=n6xISiYP1WrntcKOhtL0XZhdZigmBBHFfwrB5CEyV70,20577
20
20
  mustrd/namespace.py,sha256=1l8RJDFI7rYkWvmRokaTvSvqrDJEdRNIkq3lmPb0xpI,3854
21
21
  mustrd/run.py,sha256=5xZUgKPMBQ-03cWROAnwtbOs2Nb0Vat6n8Fi6EyfS-k,4257
22
- mustrd/spec_component.py,sha256=515XqP4Wc_TVaCOSswxTJM5i00bnuXvJZyEYa0N9_-o,38627
22
+ mustrd/shared_utils.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
23
+ mustrd/spec_component.py,sha256=TTqF27JcIQyuXlIVYpMHfy2TajYbyJg9eb_OQ9fSp_c,38713
23
24
  mustrd/steprunner.py,sha256=JnajkFay-oeSJnBH3OxFVGfz5WhKjxEH1PV4WUoRPRE,10752
24
25
  mustrd/templates/md_ResultList_leaf_template.jinja,sha256=IzwZjliCx7-viipATDQK6MQg_5q1kLMKdeNSZg1sXXY,508
25
26
  mustrd/templates/md_ResultList_template.jinja,sha256=_8joJ7vtw_qoqxv3HhUtBgRfhOeqmgfaRFwEo4MROvQ,203
26
27
  mustrd/templates/md_stats_template.jinja,sha256=96W62cMWu9UGLNv65ZQ8RYLjkxKHhJy-FlUtXgud6XY,155
27
28
  mustrd/utils.py,sha256=OGdLvw7GvjrFgTJo0J97Xwdh-_ZgSmapmOistrEchO0,1387
28
- mustrd-0.3.2.dist-info/LICENSE,sha256=r8nmh5fUct9h2w8_RDl13EIscvmwCLoarPr1kg35MnA,1078
29
- mustrd-0.3.2.dist-info/METADATA,sha256=0ksOxgbiJlegZeLCQjwnSz4dlOw3pBhBVUqzrG8wP5Q,4107
30
- mustrd-0.3.2.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
31
- mustrd-0.3.2.dist-info/entry_points.txt,sha256=v7V7sN0_L1aB4Ug_9io5axlQSeJ1C0tNrQWwdXdV58s,50
32
- mustrd-0.3.2.dist-info/RECORD,,
29
+ mustrd-0.3.3a1.dist-info/LICENSE,sha256=r8nmh5fUct9h2w8_RDl13EIscvmwCLoarPr1kg35MnA,1078
30
+ mustrd-0.3.3a1.dist-info/METADATA,sha256=UxtIqq1AZVppm4z4b2p52dmpCuNntnI6opNkRdS-mIQ,4109
31
+ mustrd-0.3.3a1.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
32
+ mustrd-0.3.3a1.dist-info/entry_points.txt,sha256=v7V7sN0_L1aB4Ug_9io5axlQSeJ1C0tNrQWwdXdV58s,50
33
+ mustrd-0.3.3a1.dist-info/RECORD,,