maplib 0.18.13__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.13 → maplib-0.18.18}/Cargo.lock +6 -25
- {maplib-0.18.13 → maplib-0.18.18}/Cargo.toml +1 -2
- {maplib-0.18.13 → maplib-0.18.18}/PKG-INFO +1 -1
- {maplib-0.18.13 → maplib-0.18.18}/lib/datalog/src/inference.rs +6 -4
- {maplib-0.18.13 → maplib-0.18.18}/lib/datalog/src/lib.rs +1 -0
- {maplib-0.18.13 → 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.13 → maplib-0.18.18}/lib/fts/src/lib.rs +1 -1
- {maplib-0.18.13 → maplib-0.18.18}/lib/maplib/src/errors.rs +1 -1
- {maplib-0.18.13 → maplib-0.18.18}/lib/maplib/src/lib.rs +2 -1
- {maplib-0.18.13/lib/maplib/src/mapping → maplib-0.18.18/lib/maplib/src/model}/constant_terms.rs +2 -2
- {maplib-0.18.13/lib/maplib/src/mapping → maplib-0.18.18/lib/maplib/src/model}/default.rs +5 -7
- {maplib-0.18.13/lib/maplib/src/mapping → maplib-0.18.18/lib/maplib/src/model}/errors.rs +1 -1
- {maplib-0.18.13/lib/maplib/src/mapping → maplib-0.18.18/lib/maplib/src/model}/expansion/validation.rs +1 -1
- {maplib-0.18.13/lib/maplib/src/mapping → maplib-0.18.18/lib/maplib/src/model}/expansion.rs +15 -16
- maplib-0.18.13/lib/maplib/src/mapping.rs → maplib-0.18.18/lib/maplib/src/model.rs +62 -27
- maplib-0.18.18/lib/maplib/src/prefixes.rs +22 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/pydf_io/src/to_python.rs +4 -1
- {maplib-0.18.13 → maplib-0.18.18}/lib/query_processing/src/pushdowns.rs +1 -1
- {maplib-0.18.13 → maplib-0.18.18}/lib/query_processing/src/type_constraints.rs +2 -4
- {maplib-0.18.13 → maplib-0.18.18}/lib/report_mapping/src/lib.rs +1 -1
- {maplib-0.18.13 → maplib-0.18.18}/lib/representation/src/cats/encode.rs +2 -5
- {maplib-0.18.13 → maplib-0.18.18}/lib/representation/src/cats/re_encode.rs +31 -31
- {maplib-0.18.13 → 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.13 → maplib-0.18.18}/lib/representation/src/lib.rs +1 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/representation/src/python.rs +11 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/shacl/src/lib.rs +2 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/spargebra/README.md +1 -1
- {maplib-0.18.13 → maplib-0.18.18}/lib/spargebra/src/parser.rs +26 -6
- {maplib-0.18.13 → maplib-0.18.18}/lib/spargebra/src/query.rs +9 -4
- {maplib-0.18.13 → maplib-0.18.18}/lib/spargebra/src/update.rs +9 -4
- {maplib-0.18.13 → maplib-0.18.18}/lib/templates/Cargo.toml +4 -2
- {maplib-0.18.13 → maplib-0.18.18}/lib/templates/src/ast.rs +5 -26
- {maplib-0.18.13 → maplib-0.18.18}/lib/templates/src/dataset/errors.rs +2 -6
- {maplib-0.18.13 → maplib-0.18.18}/lib/templates/src/dataset.rs +24 -21
- maplib-0.18.18/lib/templates/src/document.rs +23 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/templates/src/lib.rs +0 -4
- maplib-0.18.18/lib/templates/src/parsing.rs +473 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/templates/src/python.rs +9 -14
- {maplib-0.18.13 → maplib-0.18.18}/lib/triplestore/src/dblf.rs +3 -1
- {maplib-0.18.13 → maplib-0.18.18}/lib/triplestore/src/query_solutions.rs +15 -5
- {maplib-0.18.13 → 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.13 → maplib-0.18.18}/lib/triplestore/src/sparql/delete.rs +9 -9
- {maplib-0.18.13 → maplib-0.18.18}/lib/triplestore/src/sparql/lazy_graph_patterns/join.rs +4 -3
- {maplib-0.18.13 → maplib-0.18.18}/lib/triplestore/src/sparql/lazy_graph_patterns/path.rs +2 -2
- {maplib-0.18.13 → maplib-0.18.18}/lib/triplestore/src/sparql/lazy_graph_patterns/pvalues.rs +1 -1
- {maplib-0.18.13 → maplib-0.18.18}/lib/triplestore/src/sparql/lazy_graph_patterns/triple.rs +1 -3
- {maplib-0.18.13 → maplib-0.18.18}/lib/triplestore/src/sparql/lazy_graph_patterns.rs +2 -2
- {maplib-0.18.13 → maplib-0.18.18}/lib/triplestore/src/sparql.rs +110 -110
- {maplib-0.18.13 → maplib-0.18.18}/maplib/__init__.py +5 -0
- {maplib-0.18.13/py_maplib → maplib-0.18.18}/maplib/__init__.pyi +54 -7
- {maplib-0.18.13 → 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.13 → maplib-0.18.18}/py_maplib/Cargo.toml +3 -2
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/maplib/__init__.py +5 -0
- {maplib-0.18.13 → maplib-0.18.18/py_maplib}/maplib/__init__.pyi +54 -7
- {maplib-0.18.13 → 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.13 → maplib-0.18.18}/py_maplib/src/lib.rs +192 -72
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/src/shacl.rs +4 -2
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/tests/test_integration.py +87 -0
- maplib-0.18.18/py_maplib/tests/test_stottr.py +974 -0
- maplib-0.18.18/py_maplib/tests/testdata/templates.ttl +10 -0
- maplib-0.18.13/lib/templates/src/document.rs +0 -16
- maplib-0.18.13/lib/templates/src/parsing/errors.rs +0 -31
- maplib-0.18.13/lib/templates/src/parsing/nom_parsing.rs +0 -1112
- maplib-0.18.13/lib/templates/src/parsing/parser_test.rs +0 -1369
- maplib-0.18.13/lib/templates/src/parsing/parsing_ast.rs +0 -114
- maplib-0.18.13/lib/templates/src/parsing.rs +0 -27
- maplib-0.18.13/lib/templates/src/resolver.rs +0 -365
- maplib-0.18.13/py_maplib/tests/test_stottr.py +0 -981
- {maplib-0.18.13 → maplib-0.18.18}/LICENSE +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/README.md +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/cimxml/Cargo.toml +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/cimxml/src/export.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/cimxml/src/lib.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/datalog/Cargo.toml +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/datalog/src/ast.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/file_io/Cargo.toml +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/file_io/src/lib.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/fts/Cargo.toml +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/maplib/Cargo.toml +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/pydf_io/Cargo.toml +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/pydf_io/LICENSE +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/pydf_io/README.md +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/pydf_io/licensing/POLARS_LICENSE +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/pydf_io/src/lib.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/pydf_io/src/to_rust.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/query_processing/Cargo.toml +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/query_processing/LICENSE +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/query_processing/README.md +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/query_processing/src/aggregates.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/query_processing/src/cats.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/query_processing/src/constants.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/query_processing/src/errors.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/query_processing/src/exists_helper.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/query_processing/src/expressions/comparisons.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/query_processing/src/expressions/functions.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/query_processing/src/expressions/operations.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/query_processing/src/expressions.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/query_processing/src/find_query_variables.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/query_processing/src/graph_patterns/cats.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/query_processing/src/graph_patterns/group.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/query_processing/src/graph_patterns/join.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/query_processing/src/graph_patterns/order.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/query_processing/src/graph_patterns/union.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/query_processing/src/graph_patterns/values.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/query_processing/src/graph_patterns.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/query_processing/src/lib.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/report_mapping/Cargo.toml +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/representation/Cargo.toml +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/representation/LICENSE +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/representation/README.md +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/representation/src/base_rdf_type.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/representation/src/cats/decode.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/representation/src/cats/globalize.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/representation/src/cats/image.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/representation/src/dataset.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/representation/src/errors.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/representation/src/formatting.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/representation/src/literals.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/representation/src/multitype.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/representation/src/polars_to_rdf.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/representation/src/query_context.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/representation/src/rdf_state.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/representation/src/rdf_to_polars.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/representation/src/rdf_type.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/representation/src/solution_mapping.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/representation/src/subtypes.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/shacl/Cargo.toml +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/shacl/src/errors.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/shacl/src/storage.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/spargebra/Cargo.toml +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/spargebra/LICENSE +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/spargebra/src/algebra.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/spargebra/src/lib.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/spargebra/src/query_context.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/spargebra/src/remove_sugar.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/spargebra/src/term.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/spargebra/src/treehouse.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/templates/src/compatible.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/templates/src/constants.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/templates/src/subtypes_ext.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/triplestore/Cargo.toml +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/triplestore/src/cats.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/triplestore/src/errors.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/triplestore/src/io_funcs.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/triplestore/src/lib.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/triplestore/src/native_parquet_write.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/triplestore/src/sparql/errors.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/triplestore/src/sparql/insert.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/triplestore/src/sparql/lazy_aggregate.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/triplestore/src/sparql/lazy_expressions.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/triplestore/src/sparql/lazy_graph_patterns/distinct.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/triplestore/src/sparql/lazy_graph_patterns/extend.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/triplestore/src/sparql/lazy_graph_patterns/filter.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/triplestore/src/sparql/lazy_graph_patterns/group.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/triplestore/src/sparql/lazy_graph_patterns/left_join.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/triplestore/src/sparql/lazy_graph_patterns/minus.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/triplestore/src/sparql/lazy_graph_patterns/order_by.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/triplestore/src/sparql/lazy_graph_patterns/project.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/triplestore/src/sparql/lazy_graph_patterns/triples_ordering.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/triplestore/src/sparql/lazy_graph_patterns/union.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/triplestore/src/sparql/lazy_graph_patterns/values.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/triplestore/src/sparql/lazy_order.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/triplestore/src/sparql/rewrite/rewrite_cse.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/triplestore/src/sparql/rewrite/rewrite_pushdown.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/triplestore/src/sparql/rewrite.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/triplestore/src/storage.rs +1 -1
- {maplib-0.18.13 → maplib-0.18.18}/lib/triplestore/src/triples_read.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/triplestore/src/triples_write/fast_ntriples.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/triplestore/src/triples_write/serializers.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/triplestore/src/triples_write.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/utils/Cargo.toml +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/utils/src/lib.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/lib/utils/src/polars.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/maplib/py.typed +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/LICENSE +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/README.md +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/maplib/.gitignore +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/maplib/py.typed +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/src/error.rs +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/tests/.gitignore +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/tests/__init__.py +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/tests/out.ttl +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/tests/requirements.txt +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/tests/test_basics.py +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/tests/test_blank_nodes_multi.py +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/tests/test_data_validation.py +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/tests/test_exceptions.py +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/tests/test_multi_expressions.py +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/tests/test_pizza_example.py +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/tests/test_programmatic_pizza_example.py +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/tests/test_rdf_parser.py +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/tests/test_read_write.py +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/tests/test_validate_iris.py +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/tests/testdata/expected_easy_case.ttl +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/tests/testdata/iterated_property_path_constant_object_query.csv +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/tests/testdata/iterated_property_path_constant_subject_query.csv +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/tests/testdata/iterated_property_path_query.csv +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/tests/testdata/iterated_property_path_query_with_bug.csv +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/tests/testdata/larger_ordered_query.csv +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/tests/testdata/larger_query.csv +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/tests/testdata/multi_concat.csv +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/tests/testdata/multi_datatype_join_query.csv +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/tests/testdata/multi_datatype_join_query_two_vars.csv +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/tests/testdata/multi_datatype_leftjoin_query.csv +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/tests/testdata/multi_datatype_query.csv +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/tests/testdata/multi_datatype_query_sorting.csv +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/tests/testdata/multi_datatype_union_query.csv +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/tests/testdata/multi_datatype_union_query_native_df.parquet +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/tests/testdata/multi_datatype_union_sort_desc1_query.csv +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/tests/testdata/multi_datatype_union_sort_query.csv +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/tests/testdata/multi_many_comp.csv +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/tests/testdata/property_path_query.csv +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/tests/testdata/rdf_parser/date_panic.nt +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/tests/testdata/read_ntriples.csv +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/tests/testdata/read_ntriples.nt +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/tests/testdata/read_ntriples2.csv +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/tests/testdata/simple_construct_query_nothing.csv +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/tests/testdata/simple_construct_query_something.csv +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/tests/testdata/simple_insert_query_nothing.csv +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/tests/testdata/simple_insert_query_something.csv +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/tests/testdata/simple_property_path_query.csv +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/tests/testdata/simple_query.csv +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/py_maplib/tests/testdata/stringfuncs.csv +0 -0
- {maplib-0.18.13 → maplib-0.18.18}/pyproject.toml +0 -0
|
@@ -1478,12 +1478,6 @@ dependencies = [
|
|
|
1478
1478
|
"libmimalloc-sys",
|
|
1479
1479
|
]
|
|
1480
1480
|
|
|
1481
|
-
[[package]]
|
|
1482
|
-
name = "minimal-lexical"
|
|
1483
|
-
version = "0.2.1"
|
|
1484
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1485
|
-
checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
|
|
1486
|
-
|
|
1487
1481
|
[[package]]
|
|
1488
1482
|
name = "miniz_oxide"
|
|
1489
1483
|
version = "0.8.9"
|
|
@@ -1526,16 +1520,6 @@ version = "0.2.0"
|
|
|
1526
1520
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1527
1521
|
checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451"
|
|
1528
1522
|
|
|
1529
|
-
[[package]]
|
|
1530
|
-
name = "nom"
|
|
1531
|
-
version = "7.1.3"
|
|
1532
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1533
|
-
checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a"
|
|
1534
|
-
dependencies = [
|
|
1535
|
-
"memchr",
|
|
1536
|
-
"minimal-lexical",
|
|
1537
|
-
]
|
|
1538
|
-
|
|
1539
1523
|
[[package]]
|
|
1540
1524
|
name = "now"
|
|
1541
1525
|
version = "0.1.3"
|
|
@@ -2467,10 +2451,11 @@ dependencies = [
|
|
|
2467
2451
|
|
|
2468
2452
|
[[package]]
|
|
2469
2453
|
name = "py_maplib"
|
|
2470
|
-
version = "0.18.
|
|
2454
|
+
version = "0.18.18"
|
|
2471
2455
|
dependencies = [
|
|
2472
2456
|
"chrono",
|
|
2473
2457
|
"cimxml",
|
|
2458
|
+
"datalog",
|
|
2474
2459
|
"maplib",
|
|
2475
2460
|
"mimalloc",
|
|
2476
2461
|
"oxrdf",
|
|
@@ -3529,13 +3514,15 @@ checksum = "df7f62577c25e07834649fc3b39fafdc597c0a3527dc1c60129201ccfcbaa50c"
|
|
|
3529
3514
|
name = "templates"
|
|
3530
3515
|
version = "0.1.0"
|
|
3531
3516
|
dependencies = [
|
|
3532
|
-
"
|
|
3517
|
+
"oxilangtag",
|
|
3518
|
+
"oxiri",
|
|
3533
3519
|
"oxrdf",
|
|
3520
|
+
"peg",
|
|
3534
3521
|
"pyo3",
|
|
3535
3522
|
"representation",
|
|
3523
|
+
"spargebra",
|
|
3536
3524
|
"thiserror",
|
|
3537
3525
|
"tracing",
|
|
3538
|
-
"unic-char-range",
|
|
3539
3526
|
"walkdir",
|
|
3540
3527
|
]
|
|
3541
3528
|
|
|
@@ -3842,12 +3829,6 @@ version = "1.19.0"
|
|
|
3842
3829
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3843
3830
|
checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb"
|
|
3844
3831
|
|
|
3845
|
-
[[package]]
|
|
3846
|
-
name = "unic-char-range"
|
|
3847
|
-
version = "0.9.0"
|
|
3848
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3849
|
-
checksum = "0398022d5f700414f6b899e10b8348231abf9173fa93144cbc1a43b9793c1fbc"
|
|
3850
|
-
|
|
3851
3832
|
[[package]]
|
|
3852
3833
|
name = "unicode-ident"
|
|
3853
3834
|
version = "1.0.19"
|
|
@@ -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"
|
|
@@ -25,7 +25,6 @@ uuid = { version = "1.16.0", features = [
|
|
|
25
25
|
"fast-rng", # Use a faster (but still sufficiently random) RNG
|
|
26
26
|
] }
|
|
27
27
|
thiserror = "2.0.12"
|
|
28
|
-
nom = { version = "7.1.3" }
|
|
29
28
|
peg = "0.8"
|
|
30
29
|
rand = "0.9.1"
|
|
31
30
|
oxilangtag = "0.1.5"
|
|
@@ -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.13/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;
|
|
@@ -111,8 +111,7 @@ impl Model {
|
|
|
111
111
|
|
|
112
112
|
patterns.push(Instance {
|
|
113
113
|
list_expander: list_expander.clone(),
|
|
114
|
-
|
|
115
|
-
prefixed_template_name: Some("ottr:Triple".to_string()),
|
|
114
|
+
template_iri: NamedNode::new_unchecked(OTTR_TRIPLE),
|
|
116
115
|
argument_list: vec![
|
|
117
116
|
Argument {
|
|
118
117
|
list_expand: false,
|
|
@@ -143,8 +142,7 @@ impl Model {
|
|
|
143
142
|
self.default_template_counter += 1;
|
|
144
143
|
let template = Template {
|
|
145
144
|
signature: Signature {
|
|
146
|
-
|
|
147
|
-
template_prefixed_name: None,
|
|
145
|
+
iri: NamedNode::new(template_name.clone()).unwrap(),
|
|
148
146
|
parameter_list: params,
|
|
149
147
|
annotation_list: None,
|
|
150
148
|
},
|
|
@@ -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::{
|
|
@@ -22,8 +22,7 @@ use std::collections::{HashMap, HashSet};
|
|
|
22
22
|
use std::ops::Sub;
|
|
23
23
|
use std::time::Instant;
|
|
24
24
|
use templates::ast::{
|
|
25
|
-
ConstantTerm, ConstantTermOrList,
|
|
26
|
-
StottrTerm,
|
|
25
|
+
ConstantTerm, ConstantTermOrList, Instance, ListExpanderType, PType, Signature, StottrTerm,
|
|
27
26
|
};
|
|
28
27
|
use templates::constants::OTTR_TRIPLE;
|
|
29
28
|
use templates::MappingColumnType;
|
|
@@ -69,7 +68,7 @@ impl Model {
|
|
|
69
68
|
let now = Instant::now();
|
|
70
69
|
|
|
71
70
|
let target_template = self.resolve_template(template)?.clone();
|
|
72
|
-
let target_template_name = target_template.signature.
|
|
71
|
+
let target_template_name = target_template.signature.iri.as_str().to_string();
|
|
73
72
|
let MapOptions {
|
|
74
73
|
graph,
|
|
75
74
|
validate_iris,
|
|
@@ -130,7 +129,7 @@ impl Model {
|
|
|
130
129
|
));
|
|
131
130
|
}
|
|
132
131
|
if let Some(template) = self.template_dataset.get(name) {
|
|
133
|
-
if template.signature.
|
|
132
|
+
if template.signature.iri.as_str() == OTTR_TRIPLE {
|
|
134
133
|
if let Some(df) = df {
|
|
135
134
|
Ok((
|
|
136
135
|
vec![OTTRTripleInstance {
|
|
@@ -173,12 +172,12 @@ impl Model {
|
|
|
173
172
|
.enumerate()
|
|
174
173
|
.map(|(i, (instance, series_vec))| {
|
|
175
174
|
let target_template = if let Some(target_template) =
|
|
176
|
-
self.template_dataset.get(instance.
|
|
175
|
+
self.template_dataset.get(instance.template_iri.as_str())
|
|
177
176
|
{
|
|
178
177
|
target_template
|
|
179
178
|
} else {
|
|
180
179
|
return Err(MappingError::TemplateNotFound(
|
|
181
|
-
instance.
|
|
180
|
+
instance.template_iri.to_string(),
|
|
182
181
|
));
|
|
183
182
|
};
|
|
184
183
|
if let Some(RemapResult {
|
|
@@ -202,7 +201,7 @@ impl Model {
|
|
|
202
201
|
layer + 1,
|
|
203
202
|
i,
|
|
204
203
|
blank_node_counter,
|
|
205
|
-
instance.
|
|
204
|
+
instance.template_iri.as_str(),
|
|
206
205
|
Some(instance_df),
|
|
207
206
|
&target_template.signature,
|
|
208
207
|
instance_dynamic_columns,
|
|
@@ -327,9 +326,9 @@ fn fill_nulls_with_defaults(
|
|
|
327
326
|
mut lf: LazyFrame,
|
|
328
327
|
current_types: &mut HashMap<String, MappingColumnType>,
|
|
329
328
|
c: &str,
|
|
330
|
-
default: &
|
|
329
|
+
default: &ConstantTermOrList,
|
|
331
330
|
) -> Result<LazyFrame, MappingError> {
|
|
332
|
-
if default.
|
|
331
|
+
if default.has_blank_node() {
|
|
333
332
|
let df = lf.collect().unwrap();
|
|
334
333
|
if df.column(c).unwrap().is_null().any() {
|
|
335
334
|
todo!();
|
|
@@ -337,7 +336,7 @@ fn fill_nulls_with_defaults(
|
|
|
337
336
|
return Ok(df.lazy());
|
|
338
337
|
}
|
|
339
338
|
}
|
|
340
|
-
let (expr, _, mct) = constant_to_expr(&default
|
|
339
|
+
let (expr, _, mct) = constant_to_expr(&default, &None)?;
|
|
341
340
|
let is_none = if let MappingColumnType::Flat(inner) = current_types.get(c).unwrap() {
|
|
342
341
|
inner.is_none()
|
|
343
342
|
} else {
|
|
@@ -835,13 +834,13 @@ fn create_remapped(
|
|
|
835
834
|
fn add_default_value(
|
|
836
835
|
static_columns: &mut HashMap<String, StaticColumn>,
|
|
837
836
|
name: &str,
|
|
838
|
-
default: &
|
|
837
|
+
default: &ConstantTermOrList,
|
|
839
838
|
) {
|
|
840
839
|
static_columns.insert(
|
|
841
840
|
name.to_string(),
|
|
842
841
|
StaticColumn {
|
|
843
|
-
constant_term: default.
|
|
844
|
-
ptype: Some(default.
|
|
842
|
+
constant_term: default.clone(),
|
|
843
|
+
ptype: Some(default.ptype()),
|
|
845
844
|
},
|
|
846
845
|
);
|
|
847
846
|
}
|
|
@@ -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,19 +149,11 @@ 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() {
|
|
147
|
-
Some(
|
|
148
|
-
dataset
|
|
149
|
-
.templates
|
|
150
|
-
.first()
|
|
151
|
-
.unwrap()
|
|
152
|
-
.signature
|
|
153
|
-
.template_name
|
|
154
|
-
.clone(),
|
|
155
|
-
)
|
|
156
|
+
Some(dataset.templates.first().unwrap().signature.iri.clone())
|
|
156
157
|
} else {
|
|
157
158
|
None
|
|
158
159
|
};
|
|
@@ -187,6 +188,19 @@ impl Model {
|
|
|
187
188
|
.map_err(MaplibError::TriplestoreError)
|
|
188
189
|
}
|
|
189
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
|
+
|
|
190
204
|
#[allow(clippy::too_many_arguments)]
|
|
191
205
|
pub fn reads(
|
|
192
206
|
&mut self,
|
|
@@ -216,6 +230,7 @@ impl Model {
|
|
|
216
230
|
streaming: bool,
|
|
217
231
|
include_transient: bool,
|
|
218
232
|
max_rows: Option<usize>,
|
|
233
|
+
debug_no_results: bool,
|
|
219
234
|
) -> Result<QueryResult, MaplibError> {
|
|
220
235
|
let query_settings = QuerySettings {
|
|
221
236
|
include_transient,
|
|
@@ -223,7 +238,15 @@ impl Model {
|
|
|
223
238
|
strict_project: false,
|
|
224
239
|
};
|
|
225
240
|
self.triplestore
|
|
226
|
-
.query(
|
|
241
|
+
.query(
|
|
242
|
+
query,
|
|
243
|
+
parameters,
|
|
244
|
+
streaming,
|
|
245
|
+
&query_settings,
|
|
246
|
+
graph,
|
|
247
|
+
Some(&self.prefixes),
|
|
248
|
+
debug_no_results,
|
|
249
|
+
)
|
|
227
250
|
.map_err(|x| x.into())
|
|
228
251
|
}
|
|
229
252
|
|
|
@@ -235,14 +258,23 @@ impl Model {
|
|
|
235
258
|
streaming: bool,
|
|
236
259
|
include_transient: bool,
|
|
237
260
|
max_rows: Option<usize>,
|
|
238
|
-
|
|
261
|
+
debug_no_results: bool,
|
|
262
|
+
) -> Result<UpdateResult, MaplibError> {
|
|
239
263
|
let query_settings = QuerySettings {
|
|
240
264
|
include_transient,
|
|
241
265
|
max_rows,
|
|
242
266
|
strict_project: false,
|
|
243
267
|
};
|
|
244
268
|
self.triplestore
|
|
245
|
-
.update(
|
|
269
|
+
.update(
|
|
270
|
+
update,
|
|
271
|
+
parameters,
|
|
272
|
+
streaming,
|
|
273
|
+
&query_settings,
|
|
274
|
+
graph,
|
|
275
|
+
Some(&self.prefixes),
|
|
276
|
+
debug_no_results,
|
|
277
|
+
)
|
|
246
278
|
.map_err(|x| x.into())
|
|
247
279
|
}
|
|
248
280
|
|
|
@@ -351,6 +383,7 @@ impl Model {
|
|
|
351
383
|
only_shapes,
|
|
352
384
|
deactivate_shapes,
|
|
353
385
|
dry_run,
|
|
386
|
+
Some(self.prefixes.clone()),
|
|
354
387
|
);
|
|
355
388
|
res.map_err(|x| x.into())
|
|
356
389
|
}
|
|
@@ -404,13 +437,14 @@ impl Model {
|
|
|
404
437
|
graph: Option<&NamedGraph>,
|
|
405
438
|
include_transient: bool,
|
|
406
439
|
max_rows: Option<usize>,
|
|
407
|
-
|
|
440
|
+
debug_no_results: bool,
|
|
441
|
+
) -> Result<InferenceResult, MaplibError> {
|
|
408
442
|
if rulesets.is_empty() {
|
|
409
443
|
return Err(MaplibError::MissingDatalogRuleset);
|
|
410
444
|
}
|
|
411
445
|
let mut ruleset: Option<DatalogRuleset> = None;
|
|
412
446
|
for r in rulesets {
|
|
413
|
-
let new_ruleset = parse_datalog_ruleset(&r, None)
|
|
447
|
+
let new_ruleset = parse_datalog_ruleset(&r, None, Some(&self.prefixes))
|
|
414
448
|
.map_err(|x| MaplibError::DatalogSyntaxError(x.to_string()))?;
|
|
415
449
|
if let Some(orig_ruleset) = &mut ruleset {
|
|
416
450
|
orig_ruleset.extend(new_ruleset);
|
|
@@ -427,6 +461,7 @@ impl Model {
|
|
|
427
461
|
max_results,
|
|
428
462
|
include_transient,
|
|
429
463
|
max_rows,
|
|
464
|
+
debug_no_results,
|
|
430
465
|
);
|
|
431
466
|
Ok(res.map_err(|x| MaplibError::DatalogError(x))?)
|
|
432
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 {
|