maplib 0.18.14__tar.gz → 0.18.18__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.
- {maplib-0.18.14 → maplib-0.18.18}/Cargo.lock +2 -1
- {maplib-0.18.14 → maplib-0.18.18}/Cargo.toml +1 -1
- {maplib-0.18.14 → maplib-0.18.18}/PKG-INFO +1 -1
- {maplib-0.18.14 → maplib-0.18.18}/lib/datalog/src/inference.rs +6 -4
- {maplib-0.18.14 → maplib-0.18.18}/lib/datalog/src/lib.rs +1 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/datalog/src/parser.rs +3 -0
- maplib-0.18.18/lib/datalog/src/python.rs +19 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/fts/src/lib.rs +1 -1
- {maplib-0.18.14 → maplib-0.18.18}/lib/maplib/src/errors.rs +1 -1
- {maplib-0.18.14 → maplib-0.18.18}/lib/maplib/src/lib.rs +2 -1
- {maplib-0.18.14/lib/maplib/src/mapping → maplib-0.18.18/lib/maplib/src/model}/constant_terms.rs +2 -2
- {maplib-0.18.14/lib/maplib/src/mapping → maplib-0.18.18/lib/maplib/src/model}/default.rs +3 -3
- {maplib-0.18.14/lib/maplib/src/mapping → maplib-0.18.18/lib/maplib/src/model}/errors.rs +1 -1
- {maplib-0.18.14/lib/maplib/src/mapping → maplib-0.18.18/lib/maplib/src/model}/expansion/validation.rs +1 -1
- {maplib-0.18.14/lib/maplib/src/mapping → maplib-0.18.18/lib/maplib/src/model}/expansion.rs +3 -3
- maplib-0.18.14/lib/maplib/src/mapping.rs → maplib-0.18.18/lib/maplib/src/model.rs +61 -18
- maplib-0.18.18/lib/maplib/src/prefixes.rs +22 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/pydf_io/src/to_python.rs +4 -1
- {maplib-0.18.14 → maplib-0.18.18}/lib/query_processing/src/pushdowns.rs +1 -1
- {maplib-0.18.14 → maplib-0.18.18}/lib/query_processing/src/type_constraints.rs +2 -4
- {maplib-0.18.14 → maplib-0.18.18}/lib/report_mapping/src/lib.rs +1 -1
- {maplib-0.18.14 → maplib-0.18.18}/lib/representation/src/cats/encode.rs +2 -5
- {maplib-0.18.14 → maplib-0.18.18}/lib/representation/src/cats/re_encode.rs +31 -31
- {maplib-0.18.14 → maplib-0.18.18}/lib/representation/src/cats.rs +15 -25
- maplib-0.18.18/lib/representation/src/debug.rs +92 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/representation/src/lib.rs +1 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/representation/src/python.rs +11 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/shacl/src/lib.rs +2 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/spargebra/README.md +1 -1
- {maplib-0.18.14 → maplib-0.18.18}/lib/spargebra/src/parser.rs +26 -6
- {maplib-0.18.14 → maplib-0.18.18}/lib/spargebra/src/query.rs +9 -4
- {maplib-0.18.14 → maplib-0.18.18}/lib/spargebra/src/update.rs +9 -4
- {maplib-0.18.14 → maplib-0.18.18}/lib/templates/src/dataset.rs +7 -3
- maplib-0.18.18/lib/templates/src/document.rs +23 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/templates/src/parsing.rs +15 -20
- {maplib-0.18.14 → maplib-0.18.18}/lib/triplestore/src/dblf.rs +3 -1
- {maplib-0.18.14 → maplib-0.18.18}/lib/triplestore/src/query_solutions.rs +15 -5
- {maplib-0.18.14 → maplib-0.18.18}/lib/triplestore/src/rdfs_inferencing.rs +11 -2
- maplib-0.18.18/lib/triplestore/src/sparql/debug.rs +340 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/triplestore/src/sparql/delete.rs +9 -9
- {maplib-0.18.14 → maplib-0.18.18}/lib/triplestore/src/sparql/lazy_graph_patterns/join.rs +4 -3
- {maplib-0.18.14 → maplib-0.18.18}/lib/triplestore/src/sparql/lazy_graph_patterns/path.rs +2 -2
- {maplib-0.18.14 → maplib-0.18.18}/lib/triplestore/src/sparql/lazy_graph_patterns/pvalues.rs +1 -1
- {maplib-0.18.14 → maplib-0.18.18}/lib/triplestore/src/sparql/lazy_graph_patterns/triple.rs +1 -3
- {maplib-0.18.14 → maplib-0.18.18}/lib/triplestore/src/sparql/lazy_graph_patterns.rs +2 -2
- {maplib-0.18.14 → maplib-0.18.18}/lib/triplestore/src/sparql.rs +110 -110
- {maplib-0.18.14 → maplib-0.18.18}/maplib/__init__.py +2 -0
- {maplib-0.18.14/py_maplib → maplib-0.18.18}/maplib/__init__.pyi +53 -6
- {maplib-0.18.14/py_maplib → maplib-0.18.18}/maplib/adding_triples.py +4 -4
- maplib-0.18.18/maplib/template_generator/__init__.py +1 -0
- maplib-0.18.18/maplib/template_generator/generate.py +235 -0
- maplib-0.18.18/maplib/template_generator/ordering.py +40 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/Cargo.toml +3 -2
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/maplib/__init__.py +2 -0
- {maplib-0.18.14 → maplib-0.18.18/py_maplib}/maplib/__init__.pyi +53 -6
- {maplib-0.18.14 → maplib-0.18.18/py_maplib}/maplib/adding_triples.py +4 -4
- maplib-0.18.18/py_maplib/maplib/template_generator/__init__.py +1 -0
- maplib-0.18.18/py_maplib/maplib/template_generator/generate.py +235 -0
- maplib-0.18.18/py_maplib/maplib/template_generator/ordering.py +40 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/src/lib.rs +191 -71
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/src/shacl.rs +4 -2
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/tests/test_integration.py +87 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/tests/test_stottr.py +32 -3
- maplib-0.18.18/py_maplib/tests/testdata/templates.ttl +10 -0
- maplib-0.18.14/lib/templates/src/document.rs +0 -15
- {maplib-0.18.14 → maplib-0.18.18}/LICENSE +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/README.md +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/cimxml/Cargo.toml +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/cimxml/src/export.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/cimxml/src/lib.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/datalog/Cargo.toml +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/datalog/src/ast.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/file_io/Cargo.toml +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/file_io/src/lib.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/fts/Cargo.toml +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/maplib/Cargo.toml +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/pydf_io/Cargo.toml +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/pydf_io/LICENSE +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/pydf_io/README.md +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/pydf_io/licensing/POLARS_LICENSE +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/pydf_io/src/lib.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/pydf_io/src/to_rust.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/query_processing/Cargo.toml +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/query_processing/LICENSE +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/query_processing/README.md +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/query_processing/src/aggregates.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/query_processing/src/cats.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/query_processing/src/constants.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/query_processing/src/errors.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/query_processing/src/exists_helper.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/query_processing/src/expressions/comparisons.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/query_processing/src/expressions/functions.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/query_processing/src/expressions/operations.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/query_processing/src/expressions.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/query_processing/src/find_query_variables.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/query_processing/src/graph_patterns/cats.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/query_processing/src/graph_patterns/group.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/query_processing/src/graph_patterns/join.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/query_processing/src/graph_patterns/order.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/query_processing/src/graph_patterns/union.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/query_processing/src/graph_patterns/values.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/query_processing/src/graph_patterns.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/query_processing/src/lib.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/report_mapping/Cargo.toml +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/representation/Cargo.toml +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/representation/LICENSE +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/representation/README.md +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/representation/src/base_rdf_type.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/representation/src/cats/decode.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/representation/src/cats/globalize.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/representation/src/cats/image.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/representation/src/dataset.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/representation/src/errors.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/representation/src/formatting.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/representation/src/literals.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/representation/src/multitype.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/representation/src/polars_to_rdf.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/representation/src/query_context.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/representation/src/rdf_state.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/representation/src/rdf_to_polars.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/representation/src/rdf_type.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/representation/src/solution_mapping.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/representation/src/subtypes.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/shacl/Cargo.toml +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/shacl/src/errors.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/shacl/src/storage.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/spargebra/Cargo.toml +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/spargebra/LICENSE +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/spargebra/src/algebra.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/spargebra/src/lib.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/spargebra/src/query_context.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/spargebra/src/remove_sugar.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/spargebra/src/term.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/spargebra/src/treehouse.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/templates/Cargo.toml +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/templates/src/ast.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/templates/src/compatible.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/templates/src/constants.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/templates/src/dataset/errors.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/templates/src/lib.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/templates/src/python.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/templates/src/subtypes_ext.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/triplestore/Cargo.toml +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/triplestore/src/cats.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/triplestore/src/errors.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/triplestore/src/io_funcs.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/triplestore/src/lib.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/triplestore/src/native_parquet_write.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/triplestore/src/sparql/errors.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/triplestore/src/sparql/insert.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/triplestore/src/sparql/lazy_aggregate.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/triplestore/src/sparql/lazy_expressions.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/triplestore/src/sparql/lazy_graph_patterns/distinct.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/triplestore/src/sparql/lazy_graph_patterns/extend.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/triplestore/src/sparql/lazy_graph_patterns/filter.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/triplestore/src/sparql/lazy_graph_patterns/group.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/triplestore/src/sparql/lazy_graph_patterns/left_join.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/triplestore/src/sparql/lazy_graph_patterns/minus.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/triplestore/src/sparql/lazy_graph_patterns/order_by.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/triplestore/src/sparql/lazy_graph_patterns/project.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/triplestore/src/sparql/lazy_graph_patterns/triples_ordering.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/triplestore/src/sparql/lazy_graph_patterns/union.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/triplestore/src/sparql/lazy_graph_patterns/values.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/triplestore/src/sparql/lazy_order.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/triplestore/src/sparql/rewrite/rewrite_cse.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/triplestore/src/sparql/rewrite/rewrite_pushdown.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/triplestore/src/sparql/rewrite.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/triplestore/src/storage.rs +1 -1
- {maplib-0.18.14 → maplib-0.18.18}/lib/triplestore/src/triples_read.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/triplestore/src/triples_write/fast_ntriples.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/triplestore/src/triples_write/serializers.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/triplestore/src/triples_write.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/utils/Cargo.toml +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/utils/src/lib.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/lib/utils/src/polars.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/maplib/py.typed +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/LICENSE +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/README.md +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/maplib/.gitignore +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/maplib/py.typed +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/src/error.rs +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/tests/.gitignore +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/tests/__init__.py +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/tests/out.ttl +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/tests/requirements.txt +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/tests/test_basics.py +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/tests/test_blank_nodes_multi.py +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/tests/test_data_validation.py +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/tests/test_exceptions.py +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/tests/test_multi_expressions.py +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/tests/test_pizza_example.py +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/tests/test_programmatic_pizza_example.py +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/tests/test_rdf_parser.py +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/tests/test_read_write.py +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/tests/test_validate_iris.py +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/tests/testdata/expected_easy_case.ttl +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/tests/testdata/iterated_property_path_constant_object_query.csv +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/tests/testdata/iterated_property_path_constant_subject_query.csv +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/tests/testdata/iterated_property_path_query.csv +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/tests/testdata/iterated_property_path_query_with_bug.csv +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/tests/testdata/larger_ordered_query.csv +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/tests/testdata/larger_query.csv +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/tests/testdata/multi_concat.csv +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/tests/testdata/multi_datatype_join_query.csv +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/tests/testdata/multi_datatype_join_query_two_vars.csv +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/tests/testdata/multi_datatype_leftjoin_query.csv +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/tests/testdata/multi_datatype_query.csv +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/tests/testdata/multi_datatype_query_sorting.csv +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/tests/testdata/multi_datatype_union_query.csv +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/tests/testdata/multi_datatype_union_query_native_df.parquet +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/tests/testdata/multi_datatype_union_sort_desc1_query.csv +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/tests/testdata/multi_datatype_union_sort_query.csv +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/tests/testdata/multi_many_comp.csv +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/tests/testdata/property_path_query.csv +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/tests/testdata/rdf_parser/date_panic.nt +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/tests/testdata/read_ntriples.csv +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/tests/testdata/read_ntriples.nt +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/tests/testdata/read_ntriples2.csv +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/tests/testdata/simple_construct_query_nothing.csv +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/tests/testdata/simple_construct_query_something.csv +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/tests/testdata/simple_insert_query_nothing.csv +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/tests/testdata/simple_insert_query_something.csv +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/tests/testdata/simple_property_path_query.csv +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/tests/testdata/simple_query.csv +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/py_maplib/tests/testdata/stringfuncs.csv +0 -0
- {maplib-0.18.14 → maplib-0.18.18}/pyproject.toml +0 -0
|
@@ -2451,10 +2451,11 @@ dependencies = [
|
|
|
2451
2451
|
|
|
2452
2452
|
[[package]]
|
|
2453
2453
|
name = "py_maplib"
|
|
2454
|
-
version = "0.18.
|
|
2454
|
+
version = "0.18.18"
|
|
2455
2455
|
dependencies = [
|
|
2456
2456
|
"chrono",
|
|
2457
2457
|
"cimxml",
|
|
2458
|
+
"datalog",
|
|
2458
2459
|
"maplib",
|
|
2459
2460
|
"mimalloc",
|
|
2460
2461
|
"oxrdf",
|
|
@@ -8,7 +8,7 @@ rust-version = "1.88.0"
|
|
|
8
8
|
[workspace.dependencies]
|
|
9
9
|
pyo3 = {version = "0.25", features = ["py-clone"] }
|
|
10
10
|
#Moment is there to work around a feature toggle bug
|
|
11
|
-
polars = { version = "0.52.0", features = ["simd", "nightly", "new_streaming", "performant", "cse", "fmt", "parquet", "moment"] }
|
|
11
|
+
polars = { version = "0.52.0", features = ["simd", "nightly", "new_streaming", "performant", "cse", "fmt", "parquet", "moment", "timezones"] }
|
|
12
12
|
polars-core = { version = "0.52.0" }
|
|
13
13
|
rayon = "1.10.0"
|
|
14
14
|
regex = "1.11.1"
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
use crate::ast::DatalogRuleset;
|
|
2
|
-
use oxrdf::NamedNode;
|
|
3
2
|
use representation::dataset::NamedGraph;
|
|
4
|
-
use representation::solution_mapping::EagerSolutionMappings;
|
|
5
|
-
use std::collections::HashMap;
|
|
6
3
|
use thiserror::*;
|
|
7
4
|
use triplestore::sparql::errors::SparqlError;
|
|
8
5
|
use triplestore::Triplestore;
|
|
@@ -13,6 +10,10 @@ pub enum DatalogError {
|
|
|
13
10
|
SparqlError(SparqlError),
|
|
14
11
|
}
|
|
15
12
|
|
|
13
|
+
#[derive(Clone)]
|
|
14
|
+
pub struct InferenceResult {
|
|
15
|
+
}
|
|
16
|
+
|
|
16
17
|
pub fn infer(
|
|
17
18
|
_triplestore: &mut Triplestore,
|
|
18
19
|
_graph: Option<&NamedGraph>,
|
|
@@ -21,6 +22,7 @@ pub fn infer(
|
|
|
21
22
|
_max_results: Option<usize>,
|
|
22
23
|
_include_transient: bool,
|
|
23
24
|
_max_rows: Option<usize>,
|
|
24
|
-
|
|
25
|
+
_debug_no_results: bool,
|
|
26
|
+
) -> Result<InferenceResult, DatalogError> {
|
|
25
27
|
unimplemented!("Contact data treehouse to try")
|
|
26
28
|
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
use std::collections::HashMap;
|
|
2
|
+
use oxrdf::NamedNode;
|
|
1
3
|
use crate::ast::DatalogRuleset;
|
|
2
4
|
use thiserror::*;
|
|
3
5
|
|
|
4
6
|
pub fn parse_datalog_ruleset(
|
|
5
7
|
_datalog_ruleset: &str,
|
|
6
8
|
_base_iri: Option<&str>,
|
|
9
|
+
_prefixes: Option<&HashMap<String, NamedNode>>,
|
|
7
10
|
) -> Result<DatalogRuleset, DatalogSyntaxError> {
|
|
8
11
|
unimplemented!("Contact Data Treehouse to try")
|
|
9
12
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
use pyo3::{pyclass, pymethods, PyResult};
|
|
2
|
+
use crate::inference::InferenceResult;
|
|
3
|
+
|
|
4
|
+
#[derive(Clone)]
|
|
5
|
+
#[pyclass(name = "InferenceResult")]
|
|
6
|
+
pub struct PyInferenceResult {
|
|
7
|
+
pub inner: InferenceResult,
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
#[pymethods]
|
|
11
|
+
impl PyInferenceResult {
|
|
12
|
+
fn __repr__(&self) -> PyResult<String> {
|
|
13
|
+
Ok("Contact Data Treehouse to try".to_string())
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
fn __str__(&self) -> PyResult<String> {
|
|
17
|
+
Ok("Contact Data Treehouse to try".to_string())
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -14,7 +14,7 @@ pub enum FtsError {}
|
|
|
14
14
|
pub struct FtsIndex {}
|
|
15
15
|
|
|
16
16
|
impl FtsIndex {
|
|
17
|
-
pub fn new(_path: &Path,
|
|
17
|
+
pub fn new(_path: &Path, _uuid:&str) -> Result<FtsIndex, FtsError> {
|
|
18
18
|
unimplemented!("Contact Data Treehouse to enable full text search")
|
|
19
19
|
}
|
|
20
20
|
|
{maplib-0.18.14/lib/maplib/src/mapping → maplib-0.18.18/lib/maplib/src/model}/constant_terms.rs
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
use crate::
|
|
2
|
-
use crate::
|
|
1
|
+
use crate::model::errors::MappingError;
|
|
2
|
+
use crate::model::{MappingColumnType, RDFNodeState};
|
|
3
3
|
use templates::ast::{ConstantTerm, ConstantTermOrList, PType};
|
|
4
4
|
|
|
5
5
|
use oxrdf::{NamedNode, Term};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
use super::Model;
|
|
2
|
-
use crate::
|
|
3
|
-
use crate::
|
|
2
|
+
use crate::model::errors::MappingError;
|
|
3
|
+
use crate::model::MapOptions;
|
|
4
4
|
use std::collections::HashMap;
|
|
5
5
|
use templates::ast::{
|
|
6
6
|
Argument, ConstantTerm, ConstantTermOrList, Instance, ListExpanderType, PType, Parameter,
|
|
@@ -10,7 +10,7 @@ use templates::constants::{DEFAULT_PREFIX, OTTR_IRI, OTTR_TRIPLE};
|
|
|
10
10
|
use tracing::warn;
|
|
11
11
|
|
|
12
12
|
use crate::errors::MaplibError;
|
|
13
|
-
use crate::
|
|
13
|
+
use crate::model::expansion::validation::infer_type_from_column;
|
|
14
14
|
use oxrdf::{NamedNode, Variable};
|
|
15
15
|
use polars::prelude::{col, DataFrame, DataType, IntoLazy};
|
|
16
16
|
use templates::MappingColumnType;
|
|
@@ -133,7 +133,7 @@ impl Display for MappingError {
|
|
|
133
133
|
write!(f, "Template error: {x}")
|
|
134
134
|
}
|
|
135
135
|
MappingError::TriplestoreError(x) => {
|
|
136
|
-
write!(f, "Error storing
|
|
136
|
+
write!(f, "Error storing model results in triplestore: {x}")
|
|
137
137
|
}
|
|
138
138
|
MappingError::IriParseError(x) => {
|
|
139
139
|
write!(f, "IRI parse error: {x}")
|
|
@@ -2,9 +2,9 @@ pub mod validation;
|
|
|
2
2
|
|
|
3
3
|
use super::{MapOptions, Model, OTTRTripleInstance, StaticColumn};
|
|
4
4
|
use crate::errors::MaplibError;
|
|
5
|
-
use crate::
|
|
6
|
-
use crate::
|
|
7
|
-
use crate::
|
|
5
|
+
use crate::model::constant_terms::{constant_blank_node_to_series, constant_to_expr};
|
|
6
|
+
use crate::model::errors::MappingError;
|
|
7
|
+
use crate::model::expansion::validation::validate;
|
|
8
8
|
use oxrdf::vocab::rdf;
|
|
9
9
|
use oxrdf::{NamedNode, Variable};
|
|
10
10
|
use polars::prelude::{
|
|
@@ -4,9 +4,9 @@ pub mod errors;
|
|
|
4
4
|
pub mod expansion;
|
|
5
5
|
|
|
6
6
|
use crate::errors::MaplibError;
|
|
7
|
-
use crate::
|
|
7
|
+
use crate::model::errors::MappingError;
|
|
8
8
|
use cimxml::export::{cim_xml_write, FullModelDetails};
|
|
9
|
-
use datalog::inference::infer;
|
|
9
|
+
use datalog::inference::{infer, InferenceResult};
|
|
10
10
|
use datalog::parser::parse_datalog_ruleset;
|
|
11
11
|
use oxrdf::NamedNode;
|
|
12
12
|
use oxrdfio::RdfFormat;
|
|
@@ -22,9 +22,10 @@ use templates::dataset::TemplateDataset;
|
|
|
22
22
|
use templates::document::document_from_str;
|
|
23
23
|
use templates::MappingColumnType;
|
|
24
24
|
use triplestore::sparql::errors::SparqlError;
|
|
25
|
-
use triplestore::sparql::{QueryResult, QuerySettings};
|
|
25
|
+
use triplestore::sparql::{QueryResult, QuerySettings, UpdateResult};
|
|
26
26
|
use triplestore::{IndexingOptions, NewTriples, Triplestore};
|
|
27
27
|
|
|
28
|
+
use crate::prefixes::get_default_prefixes;
|
|
28
29
|
use datalog::ast::DatalogRuleset;
|
|
29
30
|
use representation::dataset::NamedGraph;
|
|
30
31
|
use tracing::instrument;
|
|
@@ -35,6 +36,7 @@ pub struct Model {
|
|
|
35
36
|
pub blank_node_counter: usize,
|
|
36
37
|
pub default_template_counter: usize,
|
|
37
38
|
pub indexing: IndexingOptions,
|
|
39
|
+
pub prefixes: HashMap<String, NamedNode>,
|
|
38
40
|
}
|
|
39
41
|
|
|
40
42
|
#[derive(Clone, Default)]
|
|
@@ -70,6 +72,7 @@ impl Model {
|
|
|
70
72
|
template_dataset: Option<&TemplateDataset>,
|
|
71
73
|
storage_folder: Option<String>,
|
|
72
74
|
indexing: Option<IndexingOptions>,
|
|
75
|
+
prefixes: Option<HashMap<String, NamedNode>>,
|
|
73
76
|
) -> Result<Model, MaplibError> {
|
|
74
77
|
let use_disk = storage_folder.is_some();
|
|
75
78
|
let indexing = if use_disk {
|
|
@@ -86,6 +89,10 @@ impl Model {
|
|
|
86
89
|
} else {
|
|
87
90
|
TemplateDataset::new_empty()?
|
|
88
91
|
};
|
|
92
|
+
let mut use_prefixes = get_default_prefixes();
|
|
93
|
+
if let Some(prefixes) = prefixes {
|
|
94
|
+
use_prefixes.extend(prefixes)
|
|
95
|
+
};
|
|
89
96
|
Ok(Model {
|
|
90
97
|
template_dataset,
|
|
91
98
|
triplestore: Triplestore::new(storage_folder, Some(indexing.clone()))
|
|
@@ -93,6 +100,7 @@ impl Model {
|
|
|
93
100
|
blank_node_counter: 0,
|
|
94
101
|
default_template_counter: 0,
|
|
95
102
|
indexing,
|
|
103
|
+
prefixes: use_prefixes,
|
|
96
104
|
})
|
|
97
105
|
}
|
|
98
106
|
|
|
@@ -101,34 +109,35 @@ impl Model {
|
|
|
101
109
|
recursive: bool,
|
|
102
110
|
storage_folder: Option<String>,
|
|
103
111
|
) -> Result<Model, MaplibError> {
|
|
104
|
-
let dataset =
|
|
105
|
-
|
|
106
|
-
Model::new(Some(&dataset), storage_folder, None)
|
|
112
|
+
let dataset = TemplateDataset::from_folder(path, recursive, Some(&get_default_prefixes()))
|
|
113
|
+
.map_err(MaplibError::TemplateError)?;
|
|
114
|
+
Model::new(Some(&dataset), storage_folder, None, None)
|
|
107
115
|
}
|
|
108
116
|
|
|
109
117
|
pub fn from_file<P: AsRef<Path>>(
|
|
110
118
|
path: P,
|
|
111
119
|
storage_folder: Option<String>,
|
|
112
120
|
) -> Result<Model, MaplibError> {
|
|
113
|
-
let dataset = TemplateDataset::from_file(path
|
|
114
|
-
|
|
121
|
+
let dataset = TemplateDataset::from_file(path, Some(&get_default_prefixes()))
|
|
122
|
+
.map_err(MaplibError::TemplateError)?;
|
|
123
|
+
Model::new(Some(&dataset), storage_folder, None, None)
|
|
115
124
|
}
|
|
116
125
|
|
|
117
126
|
pub fn from_str(s: &str, storage_folder: Option<String>) -> Result<Model, MaplibError> {
|
|
118
|
-
let doc = document_from_str(s)?;
|
|
127
|
+
let doc = document_from_str(s, Some(&get_default_prefixes()))?;
|
|
119
128
|
let dataset =
|
|
120
129
|
TemplateDataset::from_documents(vec![doc]).map_err(MaplibError::TemplateError)?;
|
|
121
|
-
Model::new(Some(&dataset), storage_folder, None)
|
|
130
|
+
Model::new(Some(&dataset), storage_folder, None, None)
|
|
122
131
|
}
|
|
123
132
|
|
|
124
133
|
pub fn from_strs(ss: Vec<&str>, storage_folder: Option<String>) -> Result<Model, MaplibError> {
|
|
125
134
|
let mut docs = vec![];
|
|
126
135
|
for s in ss {
|
|
127
|
-
let doc = document_from_str(s)?;
|
|
136
|
+
let doc = document_from_str(s, Some(&get_default_prefixes()))?;
|
|
128
137
|
docs.push(doc);
|
|
129
138
|
}
|
|
130
139
|
let dataset = TemplateDataset::from_documents(docs).map_err(MaplibError::TemplateError)?;
|
|
131
|
-
Model::new(Some(&dataset), storage_folder, None)
|
|
140
|
+
Model::new(Some(&dataset), storage_folder, None, None)
|
|
132
141
|
}
|
|
133
142
|
|
|
134
143
|
pub fn add_template(&mut self, template: Template) -> Result<(), MaplibError> {
|
|
@@ -140,7 +149,7 @@ impl Model {
|
|
|
140
149
|
|
|
141
150
|
#[instrument(skip_all)]
|
|
142
151
|
pub fn add_templates_from_string(&mut self, s: &str) -> Result<Option<NamedNode>, MaplibError> {
|
|
143
|
-
let doc = document_from_str(s).map_err(MaplibError::TemplateError)?;
|
|
152
|
+
let doc = document_from_str(s, Some(&self.prefixes)).map_err(MaplibError::TemplateError)?;
|
|
144
153
|
let mut dataset =
|
|
145
154
|
TemplateDataset::from_documents(vec![doc]).map_err(MaplibError::TemplateError)?;
|
|
146
155
|
let return_template_iri = if !dataset.templates.is_empty() {
|
|
@@ -179,6 +188,19 @@ impl Model {
|
|
|
179
188
|
.map_err(MaplibError::TriplestoreError)
|
|
180
189
|
}
|
|
181
190
|
|
|
191
|
+
#[allow(clippy::too_many_arguments)]
|
|
192
|
+
pub fn read_template(&mut self, p: &Path) -> Result<(), MaplibError> {
|
|
193
|
+
let mut dataset = TemplateDataset::from_file(p, Some(&self.prefixes))
|
|
194
|
+
.map_err(MaplibError::TemplateError)?;
|
|
195
|
+
self.template_dataset
|
|
196
|
+
.prefix_map
|
|
197
|
+
.extend(dataset.prefix_map.drain());
|
|
198
|
+
for t in dataset.templates {
|
|
199
|
+
self.add_template(t)?
|
|
200
|
+
}
|
|
201
|
+
Ok(())
|
|
202
|
+
}
|
|
203
|
+
|
|
182
204
|
#[allow(clippy::too_many_arguments)]
|
|
183
205
|
pub fn reads(
|
|
184
206
|
&mut self,
|
|
@@ -208,6 +230,7 @@ impl Model {
|
|
|
208
230
|
streaming: bool,
|
|
209
231
|
include_transient: bool,
|
|
210
232
|
max_rows: Option<usize>,
|
|
233
|
+
debug_no_results: bool,
|
|
211
234
|
) -> Result<QueryResult, MaplibError> {
|
|
212
235
|
let query_settings = QuerySettings {
|
|
213
236
|
include_transient,
|
|
@@ -215,7 +238,15 @@ impl Model {
|
|
|
215
238
|
strict_project: false,
|
|
216
239
|
};
|
|
217
240
|
self.triplestore
|
|
218
|
-
.query(
|
|
241
|
+
.query(
|
|
242
|
+
query,
|
|
243
|
+
parameters,
|
|
244
|
+
streaming,
|
|
245
|
+
&query_settings,
|
|
246
|
+
graph,
|
|
247
|
+
Some(&self.prefixes),
|
|
248
|
+
debug_no_results,
|
|
249
|
+
)
|
|
219
250
|
.map_err(|x| x.into())
|
|
220
251
|
}
|
|
221
252
|
|
|
@@ -227,14 +258,23 @@ impl Model {
|
|
|
227
258
|
streaming: bool,
|
|
228
259
|
include_transient: bool,
|
|
229
260
|
max_rows: Option<usize>,
|
|
230
|
-
|
|
261
|
+
debug_no_results: bool,
|
|
262
|
+
) -> Result<UpdateResult, MaplibError> {
|
|
231
263
|
let query_settings = QuerySettings {
|
|
232
264
|
include_transient,
|
|
233
265
|
max_rows,
|
|
234
266
|
strict_project: false,
|
|
235
267
|
};
|
|
236
268
|
self.triplestore
|
|
237
|
-
.update(
|
|
269
|
+
.update(
|
|
270
|
+
update,
|
|
271
|
+
parameters,
|
|
272
|
+
streaming,
|
|
273
|
+
&query_settings,
|
|
274
|
+
graph,
|
|
275
|
+
Some(&self.prefixes),
|
|
276
|
+
debug_no_results,
|
|
277
|
+
)
|
|
238
278
|
.map_err(|x| x.into())
|
|
239
279
|
}
|
|
240
280
|
|
|
@@ -343,6 +383,7 @@ impl Model {
|
|
|
343
383
|
only_shapes,
|
|
344
384
|
deactivate_shapes,
|
|
345
385
|
dry_run,
|
|
386
|
+
Some(self.prefixes.clone()),
|
|
346
387
|
);
|
|
347
388
|
res.map_err(|x| x.into())
|
|
348
389
|
}
|
|
@@ -396,13 +437,14 @@ impl Model {
|
|
|
396
437
|
graph: Option<&NamedGraph>,
|
|
397
438
|
include_transient: bool,
|
|
398
439
|
max_rows: Option<usize>,
|
|
399
|
-
|
|
440
|
+
debug_no_results: bool,
|
|
441
|
+
) -> Result<InferenceResult, MaplibError> {
|
|
400
442
|
if rulesets.is_empty() {
|
|
401
443
|
return Err(MaplibError::MissingDatalogRuleset);
|
|
402
444
|
}
|
|
403
445
|
let mut ruleset: Option<DatalogRuleset> = None;
|
|
404
446
|
for r in rulesets {
|
|
405
|
-
let new_ruleset = parse_datalog_ruleset(&r, None)
|
|
447
|
+
let new_ruleset = parse_datalog_ruleset(&r, None, Some(&self.prefixes))
|
|
406
448
|
.map_err(|x| MaplibError::DatalogSyntaxError(x.to_string()))?;
|
|
407
449
|
if let Some(orig_ruleset) = &mut ruleset {
|
|
408
450
|
orig_ruleset.extend(new_ruleset);
|
|
@@ -419,6 +461,7 @@ impl Model {
|
|
|
419
461
|
max_results,
|
|
420
462
|
include_transient,
|
|
421
463
|
max_rows,
|
|
464
|
+
debug_no_results,
|
|
422
465
|
);
|
|
423
466
|
Ok(res.map_err(|x| MaplibError::DatalogError(x))?)
|
|
424
467
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
use oxrdf::NamedNode;
|
|
2
|
+
use std::collections::HashMap;
|
|
3
|
+
use templates::constants::{
|
|
4
|
+
OTTR_PREFIX, OTTR_PREFIX_IRI, OWL_PREFIX, OWL_PREFIX_IRI, RDFS_PREFIX, RDFS_PREFIX_IRI,
|
|
5
|
+
RDF_PREFIX, RDF_PREFIX_IRI, SHACL_PREFIX, SHACL_PREFIX_IRI, XSD_PREFIX, XSD_PREFIX_IRI,
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
pub fn get_default_prefixes() -> HashMap<String, NamedNode> {
|
|
9
|
+
let predefined = [
|
|
10
|
+
(RDFS_PREFIX, RDFS_PREFIX_IRI),
|
|
11
|
+
(RDF_PREFIX, RDF_PREFIX_IRI),
|
|
12
|
+
(XSD_PREFIX, XSD_PREFIX_IRI),
|
|
13
|
+
(OTTR_PREFIX, OTTR_PREFIX_IRI),
|
|
14
|
+
(OWL_PREFIX, OWL_PREFIX_IRI),
|
|
15
|
+
(SHACL_PREFIX, SHACL_PREFIX_IRI),
|
|
16
|
+
];
|
|
17
|
+
HashMap::from_iter(
|
|
18
|
+
predefined
|
|
19
|
+
.into_iter()
|
|
20
|
+
.map(|(x, y)| (x.to_string(), NamedNode::new_unchecked(y))),
|
|
21
|
+
)
|
|
22
|
+
}
|
|
@@ -12,6 +12,7 @@ use pyo3::prelude::*;
|
|
|
12
12
|
use pyo3::types::PyList;
|
|
13
13
|
use pyo3::IntoPyObjectExt;
|
|
14
14
|
use representation::cats::LockedCats;
|
|
15
|
+
use representation::debug::DebugOutputs;
|
|
15
16
|
use representation::formatting::{format_columns, format_native_columns};
|
|
16
17
|
use representation::multitype::compress_actual_multitypes;
|
|
17
18
|
use representation::python::PySolutionMappings;
|
|
@@ -84,6 +85,7 @@ pub fn to_py_df(
|
|
|
84
85
|
pub fn df_to_py_df(
|
|
85
86
|
mut df: DataFrame,
|
|
86
87
|
rdf_node_states: HashMap<String, RDFNodeState>,
|
|
88
|
+
debug_outputs: Option<DebugOutputs>,
|
|
87
89
|
pushdown_paths: Option<Vec<Context>>,
|
|
88
90
|
include_datatypes: bool,
|
|
89
91
|
py: Python,
|
|
@@ -102,11 +104,12 @@ pub fn df_to_py_df(
|
|
|
102
104
|
let pyarrow = PyModule::import(py, "pyarrow")?;
|
|
103
105
|
let polars = PyModule::import(py, "polars")?;
|
|
104
106
|
let py_df = to_py_df(&chunk, names.as_slice(), py, &pyarrow, &polars)?;
|
|
105
|
-
if include_datatypes {
|
|
107
|
+
if include_datatypes || debug_outputs.is_some() {
|
|
106
108
|
Py::new(
|
|
107
109
|
py,
|
|
108
110
|
PySolutionMappings {
|
|
109
111
|
mappings: py_df.into_any(),
|
|
112
|
+
debug: debug_outputs,
|
|
110
113
|
rdf_node_states,
|
|
111
114
|
pushdown_paths,
|
|
112
115
|
},
|
|
@@ -5,7 +5,7 @@ use crate::type_constraints::{
|
|
|
5
5
|
use oxrdf::vocab::rdfs;
|
|
6
6
|
use oxrdf::{Term, Variable};
|
|
7
7
|
use rayon::iter::{IntoParallelIterator, ParallelIterator};
|
|
8
|
-
use representation::cats::
|
|
8
|
+
use representation::cats::LockedCats;
|
|
9
9
|
use representation::polars_to_rdf::column_as_terms;
|
|
10
10
|
use representation::solution_mapping::SolutionMappings;
|
|
11
11
|
use spargebra::algebra::{Expression, Function, GraphPattern};
|
|
@@ -4,7 +4,7 @@ use representation::subtypes::{is_literal_subtype, OWL_REAL};
|
|
|
4
4
|
use representation::BaseRDFNodeType;
|
|
5
5
|
use spargebra::algebra::{Expression, Function};
|
|
6
6
|
use std::cmp::PartialEq;
|
|
7
|
-
use std::collections::
|
|
7
|
+
use std::collections::HashMap;
|
|
8
8
|
|
|
9
9
|
#[derive(Debug, Clone, PartialEq)]
|
|
10
10
|
pub enum ConstraintBaseRDFNodeType {
|
|
@@ -41,9 +41,7 @@ impl ConstraintExpr {
|
|
|
41
41
|
ConstraintExpr::Bottom => false,
|
|
42
42
|
ConstraintExpr::Top => true,
|
|
43
43
|
ConstraintExpr::Constraint(c) => match c.as_ref() {
|
|
44
|
-
ConstraintBaseRDFNodeType::IRI =>
|
|
45
|
-
t == &ConstraintBaseRDFNodeType::IRI
|
|
46
|
-
}
|
|
44
|
+
ConstraintBaseRDFNodeType::IRI => t == &ConstraintBaseRDFNodeType::IRI,
|
|
47
45
|
ConstraintBaseRDFNodeType::BlankNode => t == &ConstraintBaseRDFNodeType::BlankNode,
|
|
48
46
|
ConstraintBaseRDFNodeType::Literal(l_ctr) => {
|
|
49
47
|
if let ConstraintBaseRDFNodeType::Literal(l) = t {
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
use super::{
|
|
2
|
-
CatEncs, CatType, Cats, EncodedTriples
|
|
3
|
-
};
|
|
1
|
+
use super::{CatEncs, CatType, Cats, EncodedTriples};
|
|
4
2
|
use crate::cats::LockedCats;
|
|
5
3
|
use crate::solution_mapping::{BaseCatState, EagerSolutionMappings};
|
|
6
4
|
use crate::{BaseRDFNodeType, RDFNodeState, OBJECT_COL_NAME, SUBJECT_COL_NAME};
|
|
@@ -10,7 +8,6 @@ use polars::prelude::{col, lit, IntoLazy, Series};
|
|
|
10
8
|
use std::collections::HashMap;
|
|
11
9
|
use std::hash::BuildHasherDefault;
|
|
12
10
|
use std::sync::Arc;
|
|
13
|
-
use rayon::iter::ParallelIterator;
|
|
14
11
|
|
|
15
12
|
impl CatEncs {
|
|
16
13
|
pub fn new_empty() -> CatEncs {
|
|
@@ -305,7 +302,7 @@ pub fn encode_triples(
|
|
|
305
302
|
};
|
|
306
303
|
|
|
307
304
|
let enc_trip = EncodedTriples {
|
|
308
|
-
df:sm.mappings,
|
|
305
|
+
df: sm.mappings,
|
|
309
306
|
subject,
|
|
310
307
|
subject_local_cat_uuid: subject_local_cat_uuid.clone(),
|
|
311
308
|
object,
|
|
@@ -6,10 +6,10 @@ use nohash_hasher::NoHashHasher;
|
|
|
6
6
|
use polars::datatypes::PlSmallStr;
|
|
7
7
|
use polars::error::PolarsResult;
|
|
8
8
|
use polars::prelude::{col, Column, IntoColumn, IntoLazy, LazyFrame, Series};
|
|
9
|
+
use rayon::iter::{IntoParallelIterator, IntoParallelRefIterator, ParallelIterator};
|
|
9
10
|
use std::collections::HashMap;
|
|
10
11
|
use std::hash::BuildHasherDefault;
|
|
11
12
|
use std::sync::Arc;
|
|
12
|
-
use rayon::iter::{IntoParallelIterator, IntoParallelRefIterator, ParallelIterator};
|
|
13
13
|
|
|
14
14
|
#[derive(Debug, Clone)]
|
|
15
15
|
pub struct CatReEnc {
|
|
@@ -181,48 +181,48 @@ pub fn re_encode(
|
|
|
181
181
|
.into_par_iter()
|
|
182
182
|
.map(|mut x| {
|
|
183
183
|
let mut enc = x.encoded_triples;
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
} else {
|
|
189
|
-
None
|
|
190
|
-
}
|
|
184
|
+
let subj_encs = if let Some(s_uuid) = &enc.subject_local_cat_uuid {
|
|
185
|
+
if let Some(s_map) = re_enc_map.get(s_uuid) {
|
|
186
|
+
if let Some(s) = &enc.subject {
|
|
187
|
+
s_map.get(s)
|
|
191
188
|
} else {
|
|
192
189
|
None
|
|
193
190
|
}
|
|
194
191
|
} else {
|
|
195
192
|
None
|
|
196
|
-
};
|
|
197
|
-
if let Some(subj_encs) = subj_encs {
|
|
198
|
-
let mut renc_col = subj_encs
|
|
199
|
-
.clone()
|
|
200
|
-
.re_encode_column(enc.df.column(SUBJECT_COL_NAME).unwrap().clone(), false)
|
|
201
|
-
.unwrap();
|
|
202
|
-
renc_col.rename(PlSmallStr::from_str(SUBJECT_COL_NAME));
|
|
203
|
-
enc.df.with_column(renc_col).unwrap();
|
|
204
193
|
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
194
|
+
} else {
|
|
195
|
+
None
|
|
196
|
+
};
|
|
197
|
+
if let Some(subj_encs) = subj_encs {
|
|
198
|
+
let mut renc_col = subj_encs
|
|
199
|
+
.clone()
|
|
200
|
+
.re_encode_column(enc.df.column(SUBJECT_COL_NAME).unwrap().clone(), false)
|
|
201
|
+
.unwrap();
|
|
202
|
+
renc_col.rename(PlSmallStr::from_str(SUBJECT_COL_NAME));
|
|
203
|
+
enc.df.with_column(renc_col).unwrap();
|
|
204
|
+
}
|
|
205
|
+
let obj_encs = if let Some(o_uuid) = &enc.object_local_cat_uuid {
|
|
206
|
+
if let Some(o_map) = re_enc_map.get(o_uuid) {
|
|
207
|
+
if let Some(o) = &enc.object {
|
|
208
|
+
o_map.get(o)
|
|
212
209
|
} else {
|
|
213
210
|
None
|
|
214
211
|
}
|
|
215
212
|
} else {
|
|
216
213
|
None
|
|
217
|
-
};
|
|
218
|
-
if let Some(obj_encs) = obj_encs {
|
|
219
|
-
let mut renc_col = obj_encs
|
|
220
|
-
.clone()
|
|
221
|
-
.re_encode_column(enc.df.column(OBJECT_COL_NAME).unwrap().clone(), false)
|
|
222
|
-
.unwrap();
|
|
223
|
-
renc_col.rename(PlSmallStr::from_str(OBJECT_COL_NAME));
|
|
224
|
-
enc.df.with_column(renc_col).unwrap();
|
|
225
214
|
}
|
|
215
|
+
} else {
|
|
216
|
+
None
|
|
217
|
+
};
|
|
218
|
+
if let Some(obj_encs) = obj_encs {
|
|
219
|
+
let mut renc_col = obj_encs
|
|
220
|
+
.clone()
|
|
221
|
+
.re_encode_column(enc.df.column(OBJECT_COL_NAME).unwrap().clone(), false)
|
|
222
|
+
.unwrap();
|
|
223
|
+
renc_col.rename(PlSmallStr::from_str(OBJECT_COL_NAME));
|
|
224
|
+
enc.df.with_column(renc_col).unwrap();
|
|
225
|
+
}
|
|
226
226
|
|
|
227
227
|
x.encoded_triples = enc;
|
|
228
228
|
x
|