holosdb 0.26.2__tar.gz → 0.26.3__tar.gz
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.
- {holosdb-0.26.2 → holosdb-0.26.3}/Cargo.lock +15 -15
- {holosdb-0.26.2 → holosdb-0.26.3}/Cargo.toml +23 -14
- {holosdb-0.26.2 → holosdb-0.26.3}/PKG-INFO +1 -1
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/examples/surface.rs +81 -2
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/src/topk.rs +22 -6
- holosdb-0.26.3/crates/holos-engine/tests/calendar.rs +161 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-python/tests/test_holosdb.py +14 -0
- holosdb-0.26.3/crates/holos-shacl/tests/date_constraint.rs +59 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/README.md +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-core/Cargo.toml +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-core/src/inline.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-core/src/lib.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-core/src/term_id.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-core/src/vocab.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-core/tests/codec_properties.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/Cargo.toml +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/examples/algdump.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/examples/pp.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/src/admit.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/src/bindjoin.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/src/boundjoin.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/src/crs.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/src/distinct.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/src/dump.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/src/entailment.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/src/equality.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/src/functions.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/src/geo_ext.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/src/group.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/src/lib.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/src/memory.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/src/options.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/src/range.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/src/reach.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/src/rules.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/src/service.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/src/source.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/src/spatial.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/src/spill.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/src/topology.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/src/update.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/src/validate.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/src/view.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/tests/admit.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/tests/arithmetic.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/tests/bindjoin.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/tests/bindjoin_graph.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/tests/bindjoin_minus.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/tests/bindjoin_optional.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/tests/bindjoin_range.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/tests/bindjoin_subquery.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/tests/boundjoin.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/tests/bulk_load.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/tests/closure_paths.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/tests/decimal.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/tests/distinct.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/tests/entailment.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/tests/equality.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/tests/geo_crs.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/tests/geosparql.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/tests/group.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/tests/gzip.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/tests/nested_filter_scope.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/tests/options.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/tests/range_policy.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/tests/range_soundness.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/tests/sort_spill.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/tests/spatial.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/tests/spill.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/tests/spill_leak.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/tests/transient_graph.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/tests/update.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-engine/tests/update_atomicity.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-python/Cargo.toml +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-python/PACKAGING.md +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-python/README.md +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-python/src/lib.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-security/Cargo.toml +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-security/src/audit.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-security/src/lib.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-security/src/policy.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-security/src/principal.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-shacl/Cargo.toml +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-shacl/examples/bridge_vs_load.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-shacl/examples/incremental.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-shacl/src/access.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-shacl/src/bridge.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-shacl/src/engine.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-shacl/src/incremental.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-shacl/src/ir.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-shacl/src/lib.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-shacl/src/report.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-shacl/src/validate.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-shacl/src/vocab.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-shacl/tests/decimal_message.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-shacl/tests/engine_delta.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-shacl/tests/engine_revalidate.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-shacl/tests/fails_closed.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-shacl/tests/incremental_is_safe.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-shacl-engine/Cargo.toml +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-shacl-engine/LICENSE-APACHE +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-shacl-engine/LICENSE-MIT +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-shacl-engine/PROVENANCE.md +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-shacl-engine/src/datatypes.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-shacl-engine/src/error.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-shacl-engine/src/inference.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-shacl-engine/src/lib.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-shacl-engine/src/model/graph.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-shacl-engine/src/model/interner.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-shacl-engine/src/model/loader.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-shacl-engine/src/model/mod.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-shacl-engine/src/model/term.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-shacl-engine/src/model/vocab.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-shacl-engine/src/nodeexpr.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-shacl-engine/src/path.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-shacl-engine/src/report.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-shacl-engine/src/rules.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-shacl-engine/src/shapes.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-shacl-engine/src/sparql.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-shacl-engine/src/validate.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-shacl-engine/src/valueset.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-stats/Cargo.toml +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-stats/examples/does_order_matter.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-stats/examples/estimator_accuracy.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-stats/src/baseline.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-stats/src/characteristic.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-stats/src/hll.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-stats/src/lib.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-stats/src/reorder.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-store/Cargo.toml +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-store/src/dictionary.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-store/src/error.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-store/src/index.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-store/src/lib.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-store/src/memory.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-store/src/rocks/codec.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-store/src/rocks/dictsort.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-store/src/rocks/mod.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-store/src/rocks/seen.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-store/src/rocks/sort.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-store/src/storage.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-store/tests/backend_parity.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-store/tests/bulk_ingest.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-store/tests/checkpoint.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-store/tests/commit_scope.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-store/tests/compaction.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-store/tests/dict_ingest.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-store/tests/generation.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/crates/holos-store/tests/range_scan.rs +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/pyproject.toml +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/python/holosdb/__init__.py +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/python/holosdb/_holosdb.pyi +0 -0
- {holosdb-0.26.2 → holosdb-0.26.3}/python/holosdb/py.typed +0 -0
|
@@ -601,7 +601,7 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
|
|
|
601
601
|
|
|
602
602
|
[[package]]
|
|
603
603
|
name = "holos-bench"
|
|
604
|
-
version = "0.26.
|
|
604
|
+
version = "0.26.3"
|
|
605
605
|
dependencies = [
|
|
606
606
|
"anyhow",
|
|
607
607
|
"geo",
|
|
@@ -621,11 +621,11 @@ dependencies = [
|
|
|
621
621
|
|
|
622
622
|
[[package]]
|
|
623
623
|
name = "holos-build"
|
|
624
|
-
version = "0.26.
|
|
624
|
+
version = "0.26.3"
|
|
625
625
|
|
|
626
626
|
[[package]]
|
|
627
627
|
name = "holos-cli"
|
|
628
|
-
version = "0.26.
|
|
628
|
+
version = "0.26.3"
|
|
629
629
|
dependencies = [
|
|
630
630
|
"anyhow",
|
|
631
631
|
"fs4",
|
|
@@ -645,7 +645,7 @@ dependencies = [
|
|
|
645
645
|
|
|
646
646
|
[[package]]
|
|
647
647
|
name = "holos-conformance"
|
|
648
|
-
version = "0.26.
|
|
648
|
+
version = "0.26.3"
|
|
649
649
|
dependencies = [
|
|
650
650
|
"anyhow",
|
|
651
651
|
"holos-core",
|
|
@@ -664,7 +664,7 @@ dependencies = [
|
|
|
664
664
|
|
|
665
665
|
[[package]]
|
|
666
666
|
name = "holos-core"
|
|
667
|
-
version = "0.26.
|
|
667
|
+
version = "0.26.3"
|
|
668
668
|
dependencies = [
|
|
669
669
|
"oxrdf",
|
|
670
670
|
"oxsdatatypes",
|
|
@@ -674,7 +674,7 @@ dependencies = [
|
|
|
674
674
|
|
|
675
675
|
[[package]]
|
|
676
676
|
name = "holos-engine"
|
|
677
|
-
version = "0.26.
|
|
677
|
+
version = "0.26.3"
|
|
678
678
|
dependencies = [
|
|
679
679
|
"flate2",
|
|
680
680
|
"geo",
|
|
@@ -703,7 +703,7 @@ dependencies = [
|
|
|
703
703
|
|
|
704
704
|
[[package]]
|
|
705
705
|
name = "holos-holon"
|
|
706
|
-
version = "0.26.
|
|
706
|
+
version = "0.26.3"
|
|
707
707
|
dependencies = [
|
|
708
708
|
"holos-core",
|
|
709
709
|
"holos-engine",
|
|
@@ -719,7 +719,7 @@ dependencies = [
|
|
|
719
719
|
|
|
720
720
|
[[package]]
|
|
721
721
|
name = "holos-python"
|
|
722
|
-
version = "0.26.
|
|
722
|
+
version = "0.26.3"
|
|
723
723
|
dependencies = [
|
|
724
724
|
"holos-core",
|
|
725
725
|
"holos-engine",
|
|
@@ -737,7 +737,7 @@ dependencies = [
|
|
|
737
737
|
|
|
738
738
|
[[package]]
|
|
739
739
|
name = "holos-security"
|
|
740
|
-
version = "0.26.
|
|
740
|
+
version = "0.26.3"
|
|
741
741
|
dependencies = [
|
|
742
742
|
"holos-core",
|
|
743
743
|
"holos-store",
|
|
@@ -747,7 +747,7 @@ dependencies = [
|
|
|
747
747
|
|
|
748
748
|
[[package]]
|
|
749
749
|
name = "holos-server"
|
|
750
|
-
version = "0.26.
|
|
750
|
+
version = "0.26.3"
|
|
751
751
|
dependencies = [
|
|
752
752
|
"anyhow",
|
|
753
753
|
"fs4",
|
|
@@ -767,7 +767,7 @@ dependencies = [
|
|
|
767
767
|
|
|
768
768
|
[[package]]
|
|
769
769
|
name = "holos-shacl"
|
|
770
|
-
version = "0.26.
|
|
770
|
+
version = "0.26.3"
|
|
771
771
|
dependencies = [
|
|
772
772
|
"holos-core",
|
|
773
773
|
"holos-shacl-engine",
|
|
@@ -782,7 +782,7 @@ dependencies = [
|
|
|
782
782
|
|
|
783
783
|
[[package]]
|
|
784
784
|
name = "holos-shacl-engine"
|
|
785
|
-
version = "0.26.
|
|
785
|
+
version = "0.26.3"
|
|
786
786
|
dependencies = [
|
|
787
787
|
"anyhow",
|
|
788
788
|
"flate2",
|
|
@@ -800,7 +800,7 @@ dependencies = [
|
|
|
800
800
|
|
|
801
801
|
[[package]]
|
|
802
802
|
name = "holos-stats"
|
|
803
|
-
version = "0.26.
|
|
803
|
+
version = "0.26.3"
|
|
804
804
|
dependencies = [
|
|
805
805
|
"holos-core",
|
|
806
806
|
"holos-engine",
|
|
@@ -815,7 +815,7 @@ dependencies = [
|
|
|
815
815
|
|
|
816
816
|
[[package]]
|
|
817
817
|
name = "holos-store"
|
|
818
|
-
version = "0.26.
|
|
818
|
+
version = "0.26.3"
|
|
819
819
|
dependencies = [
|
|
820
820
|
"holos-core",
|
|
821
821
|
"oxrdf",
|
|
@@ -827,7 +827,7 @@ dependencies = [
|
|
|
827
827
|
|
|
828
828
|
[[package]]
|
|
829
829
|
name = "holos-wasm"
|
|
830
|
-
version = "0.26.
|
|
830
|
+
version = "0.26.3"
|
|
831
831
|
dependencies = [
|
|
832
832
|
"console_error_panic_hook",
|
|
833
833
|
"getrandom 0.3.4",
|
|
@@ -3,7 +3,7 @@ resolver = "2"
|
|
|
3
3
|
members = ["crates/holos-core", "crates/holos-store", "crates/holos-security", "crates/holos-shacl", "crates/holos-shacl-engine", "crates/holos-stats", "crates/holos-engine", "crates/holos-python"]
|
|
4
4
|
|
|
5
5
|
[workspace.package]
|
|
6
|
-
version = "0.26.
|
|
6
|
+
version = "0.26.3"
|
|
7
7
|
edition = "2021"
|
|
8
8
|
rust-version = "1.87"
|
|
9
9
|
license = "MIT OR Apache-2.0"
|
|
@@ -19,11 +19,20 @@ oxrdf = { version = "0.3", features = ["rdf-12", "oxsdatatypes", "rdfc-10"] }
|
|
|
19
19
|
oxrdfio = { version = "0.2", features = ["rdf-12"] }
|
|
20
20
|
oxsdatatypes = "0.2"
|
|
21
21
|
sparesults = { version = "0.3", features = ["sparql-12"] }
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
# `sep-0002` gives xsd:date, xsd:time and the three duration types values, so that they
|
|
23
|
+
# compare (`?d < "2024-11-04"^^xsd:date`), sort by value and take part in date and duration
|
|
24
|
+
# arithmetic, and adds ADJUST. Without it the evaluator treats them as opaque typed literals:
|
|
25
|
+
# `<` between two dates is an error, a FILTER using it drops every row, and only dateTime
|
|
26
|
+
# compares. SEP-0002 is the SPARQL 1.2 community proposal for exactly these operators,
|
|
27
|
+
# following XPath's; Oxigraph keeps it behind a feature. Oxigraph's further `calendar-ext`
|
|
28
|
+
# (an order on gYear and the other Gregorian types, which XPath defines equality for but no
|
|
29
|
+
# order) is deliberately not enabled. All three crates take the feature so the parser, the
|
|
30
|
+
# optimiser and the evaluator agree.
|
|
31
|
+
spargebra = { version = "0.4", features = ["sparql-12", "sep-0002"] }
|
|
32
|
+
spareval = { version = "0.2", features = ["sparql-12", "sep-0002"] }
|
|
24
33
|
# Only for `sparopt::algebra::Expression`, which is what `spareval`'s public expression
|
|
25
34
|
# evaluator takes. Same version `spareval` itself resolves, so the types match.
|
|
26
|
-
sparopt = "0.3"
|
|
35
|
+
sparopt = { version = "0.3", features = ["sep-0002"] }
|
|
27
36
|
# GeoSPARQL function library, from the Oxigraph family. Same reuse argument as the
|
|
28
37
|
# rest of L0: 43 conformance-heavy geometry functions nobody should rewrite.
|
|
29
38
|
spargeo = "0.5"
|
|
@@ -37,16 +46,16 @@ wkt = "0.14"
|
|
|
37
46
|
geojson = "0.24"
|
|
38
47
|
|
|
39
48
|
# --- internal
|
|
40
|
-
holos-build = { path = "crates/holos-build", version = "0.26.
|
|
41
|
-
holos-core = { path = "crates/holos-core", version = "0.26.
|
|
42
|
-
holos-store = { path = "crates/holos-store", version = "0.26.
|
|
43
|
-
holos-engine = { path = "crates/holos-engine", version = "0.26.
|
|
44
|
-
holos-security = { path = "crates/holos-security", version = "0.26.
|
|
45
|
-
holos-conformance = { path = "crates/holos-conformance", version = "0.26.
|
|
46
|
-
holos-shacl = { path = "crates/holos-shacl", version = "0.26.
|
|
47
|
-
holos-shacl-engine = { path = "crates/holos-shacl-engine", version = "0.26.
|
|
48
|
-
holos-holon = { path = "crates/holos-holon", version = "0.26.
|
|
49
|
-
holos-stats = { path = "crates/holos-stats", version = "0.26.
|
|
49
|
+
holos-build = { path = "crates/holos-build", version = "0.26.3" }
|
|
50
|
+
holos-core = { path = "crates/holos-core", version = "0.26.3" }
|
|
51
|
+
holos-store = { path = "crates/holos-store", version = "0.26.3" }
|
|
52
|
+
holos-engine = { path = "crates/holos-engine", version = "0.26.3" }
|
|
53
|
+
holos-security = { path = "crates/holos-security", version = "0.26.3" }
|
|
54
|
+
holos-conformance = { path = "crates/holos-conformance", version = "0.26.3" }
|
|
55
|
+
holos-shacl = { path = "crates/holos-shacl", version = "0.26.3" }
|
|
56
|
+
holos-shacl-engine = { path = "crates/holos-shacl-engine", version = "0.26.3" }
|
|
57
|
+
holos-holon = { path = "crates/holos-holon", version = "0.26.3" }
|
|
58
|
+
holos-stats = { path = "crates/holos-stats", version = "0.26.3" }
|
|
50
59
|
|
|
51
60
|
# --- everything else
|
|
52
61
|
anyhow = "1"
|
|
@@ -180,6 +180,13 @@ fn expr(e: &str) -> String {
|
|
|
180
180
|
format!("{} SELECT ({e} AS ?v) WHERE {{}}", prefixes())
|
|
181
181
|
}
|
|
182
182
|
|
|
183
|
+
/// `SELECT * WHERE { FILTER(cond) }` — one row if `cond` is true, none if it is false or an
|
|
184
|
+
/// error. For operators, whose failure is an error inside the expression rather than a
|
|
185
|
+
/// query that will not run.
|
|
186
|
+
fn holds(cond: &str) -> String {
|
|
187
|
+
format!("{} SELECT * WHERE {{ FILTER({cond}) }}", prefixes())
|
|
188
|
+
}
|
|
189
|
+
|
|
183
190
|
/// A probe that needs data under it.
|
|
184
191
|
fn over_data(body: &str) -> String {
|
|
185
192
|
format!("{} SELECT * WHERE {{ {body} }}", prefixes())
|
|
@@ -319,6 +326,56 @@ fn datetime_functions() -> Vec<Probe> {
|
|
|
319
326
|
p("seconds", "17.4.5.7", expr("seconds(now())"), ""),
|
|
320
327
|
p("timezone", "17.4.5.8", expr("STR(timezone(now()))"), ""),
|
|
321
328
|
p("tz", "17.4.5.9", expr("tz(now())"), ""),
|
|
329
|
+
// An expression that errors leaves `?v` unbound and the row still there, so these
|
|
330
|
+
// are FILTERs: unsupported means no row, which `section` reports as a failure.
|
|
331
|
+
p(
|
|
332
|
+
"year on xsd:date",
|
|
333
|
+
"SEP-0002",
|
|
334
|
+
holds(r#"YEAR("2025-03-08"^^xsd:date) = 2025"#),
|
|
335
|
+
"also month and day; before 0.26.3, dateTime only",
|
|
336
|
+
),
|
|
337
|
+
p(
|
|
338
|
+
"< on xsd:date",
|
|
339
|
+
"SEP-0002",
|
|
340
|
+
holds(r#""2024-11-04"^^xsd:date < "2025-06-12"^^xsd:date"#),
|
|
341
|
+
"also <=, >, >=",
|
|
342
|
+
),
|
|
343
|
+
p(
|
|
344
|
+
"< on xsd:time",
|
|
345
|
+
"SEP-0002",
|
|
346
|
+
holds(r#""08:30:00"^^xsd:time < "09:00:00"^^xsd:time"#),
|
|
347
|
+
"",
|
|
348
|
+
),
|
|
349
|
+
p(
|
|
350
|
+
"< on durations",
|
|
351
|
+
"SEP-0002",
|
|
352
|
+
holds(r#""PT32M"^^xsd:dayTimeDuration < "PT45M"^^xsd:dayTimeDuration"#),
|
|
353
|
+
"xsd:duration, xsd:yearMonthDuration, xsd:dayTimeDuration",
|
|
354
|
+
),
|
|
355
|
+
p(
|
|
356
|
+
"xsd:date - xsd:date",
|
|
357
|
+
"SEP-0002",
|
|
358
|
+
holds(r#"("2026-11-04"^^xsd:date - "2024-11-04"^^xsd:date) = "P730D"^^xsd:dayTimeDuration"#),
|
|
359
|
+
"a duration",
|
|
360
|
+
),
|
|
361
|
+
p(
|
|
362
|
+
"xsd:dateTime - xsd:dateTime",
|
|
363
|
+
"SEP-0002",
|
|
364
|
+
holds(r#"("2026-11-20T14:00:00Z"^^xsd:dateTime - "2026-11-20T13:28:00Z"^^xsd:dateTime) = "PT32M"^^xsd:dayTimeDuration"#),
|
|
365
|
+
"a duration",
|
|
366
|
+
),
|
|
367
|
+
p(
|
|
368
|
+
"date + duration",
|
|
369
|
+
"SEP-0002",
|
|
370
|
+
holds(r#"("2026-11-04"^^xsd:date + "P1D"^^xsd:dayTimeDuration) = "2026-11-05"^^xsd:date"#),
|
|
371
|
+
"also dateTime and time",
|
|
372
|
+
),
|
|
373
|
+
p(
|
|
374
|
+
"ADJUST",
|
|
375
|
+
"SEP-0002",
|
|
376
|
+
holds(r#"ADJUST("2026-01-01T12:00:00Z"^^xsd:dateTime, "PT1H"^^xsd:dayTimeDuration) = "2026-01-01T13:00:00+01:00"^^xsd:dateTime"#),
|
|
377
|
+
"",
|
|
378
|
+
),
|
|
322
379
|
]
|
|
323
380
|
}
|
|
324
381
|
|
|
@@ -370,6 +427,16 @@ fn casts() -> Vec<Probe> {
|
|
|
370
427
|
expr(r#"STR(xsd:dateTime("2026-01-01T00:00:00Z"))"#),
|
|
371
428
|
"",
|
|
372
429
|
),
|
|
430
|
+
// A cast that fails leaves the variable unbound in a row that is still there, so these
|
|
431
|
+
// compare the cast's result in a FILTER, and fail as no row.
|
|
432
|
+
p("xsd:date", "SEP-0002", holds(r#"xsd:date("2026-01-01") = "2026-01-01"^^xsd:date"#), ""),
|
|
433
|
+
p("xsd:time", "SEP-0002", holds(r#"xsd:time("12:00:00") = "12:00:00"^^xsd:time"#), ""),
|
|
434
|
+
p(
|
|
435
|
+
"xsd:dayTimeDuration",
|
|
436
|
+
"SEP-0002",
|
|
437
|
+
holds(r#"xsd:dayTimeDuration("P1D") = "P1D"^^xsd:dayTimeDuration"#),
|
|
438
|
+
"also xsd:duration, xsd:yearMonthDuration",
|
|
439
|
+
),
|
|
373
440
|
]
|
|
374
441
|
}
|
|
375
442
|
|
|
@@ -408,7 +475,12 @@ fn sparql12() -> Vec<Probe> {
|
|
|
408
475
|
p(
|
|
409
476
|
"triple term pattern",
|
|
410
477
|
"1.2",
|
|
411
|
-
|
|
478
|
+
// ASK, because no reifier is in the probe data, so a SELECT would correctly
|
|
479
|
+
// return no rows and `section` would count that as a failure.
|
|
480
|
+
format!(
|
|
481
|
+
"{} ASK {{ ?r rdf:reifies <<( ex:alice ex:name \"Alice\" )>> }}",
|
|
482
|
+
prefixes()
|
|
483
|
+
),
|
|
412
484
|
"matches a triple term in object position; zero rows here is correct",
|
|
413
485
|
),
|
|
414
486
|
p(
|
|
@@ -779,7 +851,14 @@ fn section(title: &str, spec: &str, probes: Vec<Probe>, engine: &Engine, session
|
|
|
779
851
|
println!("| {spec} | Spec | Status | Notes |");
|
|
780
852
|
println!("|---|---|---|---|");
|
|
781
853
|
for entry in probes {
|
|
782
|
-
|
|
854
|
+
// A query that runs and returns nothing is not "supported": an operator that errors
|
|
855
|
+
// inside a FILTER fails exactly that way, silently, which is how xsd:date comparison
|
|
856
|
+
// went unreported until 0.26.3. Every probe is written to return a row when it works.
|
|
857
|
+
let outcome = match probe(engine, session, &entry) {
|
|
858
|
+
Ok(0) => Err("evaluated, but returned no rows".to_owned()),
|
|
859
|
+
other => other,
|
|
860
|
+
};
|
|
861
|
+
let (status, note) = match outcome {
|
|
783
862
|
Ok(_) => ("✅ yes".to_owned(), entry.note.to_owned()),
|
|
784
863
|
Err(reason) => {
|
|
785
864
|
let combined = if entry.note.is_empty() {
|
|
@@ -748,9 +748,12 @@ fn cmp_triples(a: &ExpressionTriple, b: &ExpressionTriple) -> Ordering {
|
|
|
748
748
|
/// SPARQL's `<` between two literals, where it is defined.
|
|
749
749
|
///
|
|
750
750
|
/// Numbers of any of the four numeric types compare with each other; strings with strings,
|
|
751
|
-
/// language-tagged strings with the same tag
|
|
752
|
-
///
|
|
753
|
-
///
|
|
751
|
+
/// language-tagged strings with the same tag; `xsd:dateTime`, `xsd:date` and `xsd:time`
|
|
752
|
+
/// each with their own kind; and the three duration types with each other. This is
|
|
753
|
+
/// `spareval`'s own `partial_cmp_literals` with the workspace's features (`sep-0002`, not
|
|
754
|
+
/// `calendar-ext`), which that crate does not export. A datatype the evaluator does not
|
|
755
|
+
/// give a value to — `xsd:gYear` and its kin, and every user-defined type — is not
|
|
756
|
+
/// comparable by value, and falls to the lexical order.
|
|
754
757
|
fn partial_cmp_literals(a: &ExpressionTerm, b: &ExpressionTerm) -> Option<Ordering> {
|
|
755
758
|
use ExpressionTerm as T;
|
|
756
759
|
use oxsdatatypes::{Decimal, Double, Float};
|
|
@@ -795,6 +798,17 @@ fn partial_cmp_literals(a: &ExpressionTerm, b: &ExpressionTerm) -> Option<Orderi
|
|
|
795
798
|
(T::DecimalLiteral(a), T::IntegerLiteral(b)) => a.partial_cmp(&Decimal::from(*b)),
|
|
796
799
|
(T::DecimalLiteral(a), T::DecimalLiteral(b)) => a.partial_cmp(b),
|
|
797
800
|
(T::DateTimeLiteral(a), T::DateTimeLiteral(b)) => a.partial_cmp(b),
|
|
801
|
+
(T::DateLiteral(a), T::DateLiteral(b)) => a.partial_cmp(b),
|
|
802
|
+
(T::TimeLiteral(a), T::TimeLiteral(b)) => a.partial_cmp(b),
|
|
803
|
+
(T::DurationLiteral(a), T::DurationLiteral(b)) => a.partial_cmp(b),
|
|
804
|
+
(T::DurationLiteral(a), T::YearMonthDurationLiteral(b)) => a.partial_cmp(b),
|
|
805
|
+
(T::DurationLiteral(a), T::DayTimeDurationLiteral(b)) => a.partial_cmp(b),
|
|
806
|
+
(T::YearMonthDurationLiteral(a), T::DurationLiteral(b)) => a.partial_cmp(b),
|
|
807
|
+
(T::YearMonthDurationLiteral(a), T::YearMonthDurationLiteral(b)) => a.partial_cmp(b),
|
|
808
|
+
(T::YearMonthDurationLiteral(a), T::DayTimeDurationLiteral(b)) => a.partial_cmp(b),
|
|
809
|
+
(T::DayTimeDurationLiteral(a), T::DurationLiteral(b)) => a.partial_cmp(b),
|
|
810
|
+
(T::DayTimeDurationLiteral(a), T::YearMonthDurationLiteral(b)) => a.partial_cmp(b),
|
|
811
|
+
(T::DayTimeDurationLiteral(a), T::DayTimeDurationLiteral(b)) => a.partial_cmp(b),
|
|
798
812
|
_ => None,
|
|
799
813
|
}
|
|
800
814
|
}
|
|
@@ -802,9 +816,11 @@ fn partial_cmp_literals(a: &ExpressionTerm, b: &ExpressionTerm) -> Option<Orderi
|
|
|
802
816
|
/// The order two literals fall back to when `<` is not defined between them: lexical form,
|
|
803
817
|
/// then datatype, then language tag — what `spareval` does, and what makes the order total.
|
|
804
818
|
///
|
|
805
|
-
/// Two literals of a datatype the evaluator does not value —
|
|
806
|
-
///
|
|
807
|
-
///
|
|
819
|
+
/// Two literals of a datatype the evaluator does not value — `xsd:gYear` and its kin, or a
|
|
820
|
+
/// user-defined type — are compared in place. (Until 0.26.3 that was every `xsd:date`, and
|
|
821
|
+
/// so every key of the query this module was written for; dates now compare by value in
|
|
822
|
+
/// [`partial_cmp_literals`] and reach this only against a term of another kind.) The
|
|
823
|
+
/// general case goes back through `Term`, which canonicalises a valued
|
|
808
824
|
/// literal's lexical form the way the evaluator does; it is reached only for a pair of
|
|
809
825
|
/// different kinds, which a well-typed sort key seldom produces.
|
|
810
826
|
fn lexical_cmp(a: &ExpressionTerm, b: &ExpressionTerm) -> Ordering {
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
//! `xsd:date`, `xsd:time` and the duration types compare, sort and subtract by value.
|
|
2
|
+
//!
|
|
3
|
+
//! Until 0.26.3 the workspace built `spareval` without its `sep-0002` feature, which is what
|
|
4
|
+
//! gives these datatypes values. Without it they were opaque typed literals: `<` between two
|
|
5
|
+
//! dates was a type error, and a FILTER whose expression errors removes the row, so
|
|
6
|
+
//! `FILTER(?d >= "2024-11-04"^^xsd:date)` returned nothing at all, silently. Only
|
|
7
|
+
//! `xsd:dateTime` compared. The case that found it was a "what is open on this day?" query
|
|
8
|
+
//! over seasons with xsd:date bounds, which answered "closed" for every place on every day:
|
|
9
|
+
//! right in November, wrong in July. These tests are that query and its parts, against the
|
|
10
|
+
//! evaluator HOLOS actually runs, reading the dates from the store.
|
|
11
|
+
|
|
12
|
+
use holos_engine::Engine;
|
|
13
|
+
use holos_security::Session;
|
|
14
|
+
use oxrdfio::RdfFormat;
|
|
15
|
+
use spareval::QueryResults;
|
|
16
|
+
|
|
17
|
+
const DATA: &str = r#"
|
|
18
|
+
@prefix ex: <http://example.com/> .
|
|
19
|
+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
20
|
+
|
|
21
|
+
ex:meeting1 ex:on "2025-06-12"^^xsd:date .
|
|
22
|
+
ex:meeting2 ex:on "2023-05-10"^^xsd:date .
|
|
23
|
+
ex:meeting3 ex:on "2026-02-03"^^xsd:date .
|
|
24
|
+
|
|
25
|
+
ex:centre ex:from "2026-03-06"^^xsd:date ; ex:to "2026-11-08"^^xsd:date .
|
|
26
|
+
ex:skellig ex:from "2026-05-12"^^xsd:date ; ex:to "2026-09-21"^^xsd:date .
|
|
27
|
+
ex:museum ex:name "no season published" .
|
|
28
|
+
|
|
29
|
+
ex:early ex:opens "08:30:00"^^xsd:time .
|
|
30
|
+
ex:late ex:opens "10:00:00"^^xsd:time .
|
|
31
|
+
"#;
|
|
32
|
+
|
|
33
|
+
fn rows(query: &str) -> Vec<String> {
|
|
34
|
+
let mut e = Engine::new();
|
|
35
|
+
e.bulk_load(DATA.as_bytes(), RdfFormat::Turtle, None)
|
|
36
|
+
.expect("load");
|
|
37
|
+
let session = Session::unrestricted(e.store()).expect("session");
|
|
38
|
+
let view = e.view(&session);
|
|
39
|
+
let results = Engine::query(&view, query, None).expect("query");
|
|
40
|
+
let QueryResults::Solutions(iter) = results else {
|
|
41
|
+
panic!("expected a solutions result");
|
|
42
|
+
};
|
|
43
|
+
iter.map(|s| {
|
|
44
|
+
s.expect("solution")
|
|
45
|
+
.iter()
|
|
46
|
+
.map(|(v, t)| format!("{}={t}", v.as_str()))
|
|
47
|
+
.collect::<Vec<_>>()
|
|
48
|
+
.join(" ")
|
|
49
|
+
})
|
|
50
|
+
.collect()
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const PREFIXES: &str =
|
|
54
|
+
"PREFIX ex: <http://example.com/> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> ";
|
|
55
|
+
|
|
56
|
+
fn q(body: &str) -> Vec<String> {
|
|
57
|
+
rows(&format!("{PREFIXES}{body}"))
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
#[test]
|
|
61
|
+
fn a_filter_compares_stored_dates_with_a_constant() {
|
|
62
|
+
assert_eq!(
|
|
63
|
+
q(r#"SELECT ?m WHERE { ?m ex:on ?d FILTER(?d >= "2024-11-04"^^xsd:date) } ORDER BY ?m"#),
|
|
64
|
+
[
|
|
65
|
+
"m=<http://example.com/meeting1>",
|
|
66
|
+
"m=<http://example.com/meeting3>"
|
|
67
|
+
]
|
|
68
|
+
);
|
|
69
|
+
assert_eq!(
|
|
70
|
+
q(r#"SELECT ?m WHERE { ?m ex:on ?d FILTER(?d < "2024-11-04"^^xsd:date) }"#),
|
|
71
|
+
["m=<http://example.com/meeting2>"]
|
|
72
|
+
);
|
|
73
|
+
// Equality worked before and still does.
|
|
74
|
+
assert_eq!(
|
|
75
|
+
q(r#"SELECT ?m WHERE { ?m ex:on ?d FILTER(?d = "2023-05-10"^^xsd:date) }"#),
|
|
76
|
+
["m=<http://example.com/meeting2>"]
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
#[test]
|
|
81
|
+
fn a_date_bound_by_values_compares_with_a_stored_one() {
|
|
82
|
+
// The shape of the reported query: the day comes from VALUES, the season from the data.
|
|
83
|
+
let open = |day: &str| {
|
|
84
|
+
q(&format!(
|
|
85
|
+
r#"SELECT ?place WHERE {{
|
|
86
|
+
VALUES ?day {{ "{day}"^^xsd:date }}
|
|
87
|
+
?place ex:from ?from ; ex:to ?to .
|
|
88
|
+
FILTER (?from <= ?day && ?day <= ?to)
|
|
89
|
+
}} ORDER BY ?place"#
|
|
90
|
+
))
|
|
91
|
+
};
|
|
92
|
+
assert_eq!(
|
|
93
|
+
open("2026-07-15"),
|
|
94
|
+
[
|
|
95
|
+
"place=<http://example.com/centre>",
|
|
96
|
+
"place=<http://example.com/skellig>"
|
|
97
|
+
]
|
|
98
|
+
);
|
|
99
|
+
assert_eq!(open("2026-10-01"), ["place=<http://example.com/centre>"]);
|
|
100
|
+
assert!(open("2026-11-21").is_empty());
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
#[test]
|
|
104
|
+
fn exists_over_a_date_range_is_true_in_season() {
|
|
105
|
+
// Inside EXISTS, an erroring comparison made EXISTS false rather than failing loudly,
|
|
106
|
+
// so the place was reported closed.
|
|
107
|
+
let status = q(r#"SELECT ?place ?status WHERE {
|
|
108
|
+
VALUES ?day { "2026-07-15"^^xsd:date }
|
|
109
|
+
VALUES ?place { ex:centre ex:skellig ex:museum }
|
|
110
|
+
BIND (IF(EXISTS { ?place ex:from ?f ; ex:to ?t . FILTER(?f <= ?day && ?day <= ?t) }, "open",
|
|
111
|
+
IF(EXISTS { ?place ex:from ?f }, "closed", "not known")) AS ?status)
|
|
112
|
+
} ORDER BY ?place"#);
|
|
113
|
+
assert_eq!(
|
|
114
|
+
status,
|
|
115
|
+
[
|
|
116
|
+
"place=<http://example.com/centre> status=\"open\"",
|
|
117
|
+
"place=<http://example.com/museum> status=\"not known\"",
|
|
118
|
+
"place=<http://example.com/skellig> status=\"open\"",
|
|
119
|
+
]
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
#[test]
|
|
124
|
+
fn dates_sort_by_value() {
|
|
125
|
+
assert_eq!(
|
|
126
|
+
q("SELECT ?d WHERE { ?m ex:on ?d } ORDER BY DESC(?d) LIMIT 1"),
|
|
127
|
+
["d=\"2026-02-03\"^^<http://www.w3.org/2001/XMLSchema#date>"]
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
#[test]
|
|
132
|
+
fn times_compare() {
|
|
133
|
+
assert_eq!(
|
|
134
|
+
q(r#"SELECT ?s WHERE { ?s ex:opens ?t FILTER(?t < "09:00:00"^^xsd:time) }"#),
|
|
135
|
+
["s=<http://example.com/early>"]
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
#[test]
|
|
140
|
+
fn subtracting_dates_gives_a_duration() {
|
|
141
|
+
assert_eq!(
|
|
142
|
+
q(r#"SELECT ?gap WHERE { BIND("2026-11-04"^^xsd:date - "2024-11-04"^^xsd:date AS ?gap) }"#),
|
|
143
|
+
["gap=\"P730D\"^^<http://www.w3.org/2001/XMLSchema#dayTimeDuration>"]
|
|
144
|
+
);
|
|
145
|
+
assert_eq!(
|
|
146
|
+
q(
|
|
147
|
+
r#"SELECT ?gap WHERE { BIND("2026-11-20T14:00:00"^^xsd:dateTime - "2026-11-20T13:28:00"^^xsd:dateTime AS ?gap) }"#
|
|
148
|
+
),
|
|
149
|
+
["gap=\"PT32M\"^^<http://www.w3.org/2001/XMLSchema#dayTimeDuration>"]
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
#[test]
|
|
154
|
+
fn durations_compare() {
|
|
155
|
+
assert_eq!(
|
|
156
|
+
q(
|
|
157
|
+
r#"SELECT ?ok WHERE { BIND("PT32M"^^xsd:dayTimeDuration < "PT45M"^^xsd:dayTimeDuration AS ?ok) }"#
|
|
158
|
+
),
|
|
159
|
+
["ok=\"true\"^^<http://www.w3.org/2001/XMLSchema#boolean>"]
|
|
160
|
+
);
|
|
161
|
+
}
|
|
@@ -116,6 +116,20 @@ def test_a_decimal_product_is_rounded_rather_than_left_unbound(store):
|
|
|
116
116
|
)
|
|
117
117
|
|
|
118
118
|
|
|
119
|
+
def test_dates_compare_in_a_filter():
|
|
120
|
+
# xsd:date values come from spareval's sep-0002 feature, which the wheel has to resolve as
|
|
121
|
+
# the native build does. Without it `<` between two dates is a type error, the FILTER
|
|
122
|
+
# drops the row, and this returns nothing.
|
|
123
|
+
s = Store()
|
|
124
|
+
prefixes = "PREFIX ex: <http://example.com/> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> "
|
|
125
|
+
s.update(
|
|
126
|
+
prefixes + 'INSERT DATA { ex:a ex:on "2025-06-12"^^xsd:date . '
|
|
127
|
+
'ex:b ex:on "2023-05-10"^^xsd:date }'
|
|
128
|
+
)
|
|
129
|
+
rows = s.query(prefixes + 'SELECT ?s WHERE { ?s ex:on ?d FILTER(?d >= "2024-11-04"^^xsd:date) }')
|
|
130
|
+
assert [r.term("s") for r in rows] == ["<http://example.com/a>"]
|
|
131
|
+
|
|
132
|
+
|
|
119
133
|
def test_an_unknown_variable_raises(store):
|
|
120
134
|
rows = store.query(f"SELECT ?n WHERE {{ GRAPH ?g {{ ?s <{EX}name> ?n }} }} LIMIT 1")
|
|
121
135
|
with pytest.raises(KeyError):
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
//! A SHACL-SPARQL constraint that compares `xsd:date` values fires.
|
|
2
|
+
//!
|
|
3
|
+
//! Until 0.26.3 the evaluator gave dates no value, so `?until < "2026-11-10"^^xsd:date` was a
|
|
4
|
+
//! type error, the FILTER dropped the row, and the constraint never reported anything: an
|
|
5
|
+
//! expired certificate passed validation silently. `sh:lessThan` and the other Core
|
|
6
|
+
//! comparisons were never affected, because the SHACL engine compares those itself.
|
|
7
|
+
|
|
8
|
+
use holos_shacl::engine::EngineRun;
|
|
9
|
+
use holos_shacl::Options;
|
|
10
|
+
use holos_store::{GraphFilter, Store};
|
|
11
|
+
use oxrdf::{NamedNodeRef, TermRef};
|
|
12
|
+
use oxrdfio::{RdfFormat, RdfParser};
|
|
13
|
+
|
|
14
|
+
const SHAPES_AND_DATA: &str = r#"
|
|
15
|
+
@prefix ex: <http://example.com/> .
|
|
16
|
+
@prefix sh: <http://www.w3.org/ns/shacl#> .
|
|
17
|
+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
18
|
+
|
|
19
|
+
ex:CertificateShape a sh:NodeShape ;
|
|
20
|
+
sh:targetClass ex:Certificate ;
|
|
21
|
+
sh:sparql [
|
|
22
|
+
sh:message "expired on {?until}" ;
|
|
23
|
+
sh:select """
|
|
24
|
+
SELECT $this ?until WHERE {
|
|
25
|
+
$this <http://example.com/validUntil> ?until .
|
|
26
|
+
FILTER (?until < "2026-11-10"^^<http://www.w3.org/2001/XMLSchema#date>)
|
|
27
|
+
}""" ;
|
|
28
|
+
] .
|
|
29
|
+
|
|
30
|
+
ex:current a ex:Certificate ; ex:validUntil "2027-03-31"^^xsd:date .
|
|
31
|
+
ex:expired a ex:Certificate ; ex:validUntil "2026-06-30"^^xsd:date .
|
|
32
|
+
"#;
|
|
33
|
+
|
|
34
|
+
#[test]
|
|
35
|
+
fn an_expired_date_is_reported() {
|
|
36
|
+
let mut store = Store::new();
|
|
37
|
+
let parser = RdfParser::from_format(RdfFormat::Turtle)
|
|
38
|
+
.with_base_iri("http://example.com/")
|
|
39
|
+
.expect("base");
|
|
40
|
+
for quad in parser.for_reader(SHAPES_AND_DATA.as_bytes()) {
|
|
41
|
+
store.insert(quad.expect("parse").as_ref()).expect("insert");
|
|
42
|
+
}
|
|
43
|
+
let options = Options {
|
|
44
|
+
data_graph: GraphFilter::Default,
|
|
45
|
+
shapes_graph: GraphFilter::Default,
|
|
46
|
+
};
|
|
47
|
+
let mut run = EngineRun::prepare(&store, options).expect("prepare");
|
|
48
|
+
let report = run.validate().expect("validate");
|
|
49
|
+
let graph = run.report_to_oxrdf(&report);
|
|
50
|
+
let message = NamedNodeRef::new_unchecked("http://www.w3.org/ns/shacl#resultMessage");
|
|
51
|
+
let messages: Vec<String> = graph
|
|
52
|
+
.triples_for_predicate(message)
|
|
53
|
+
.filter_map(|t| match t.object {
|
|
54
|
+
TermRef::Literal(l) => Some(l.value().to_owned()),
|
|
55
|
+
_ => None,
|
|
56
|
+
})
|
|
57
|
+
.collect();
|
|
58
|
+
assert_eq!(messages, ["expired on 2026-06-30"]);
|
|
59
|
+
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|