maplib 0.19.3__tar.gz → 0.19.9__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.19.3 → maplib-0.19.9}/Cargo.lock +5 -4
- {maplib-0.19.3 → maplib-0.19.9}/Cargo.toml +1 -0
- {maplib-0.19.3 → maplib-0.19.9}/PKG-INFO +1 -1
- {maplib-0.19.3 → maplib-0.19.9}/lib/datalog/src/inference.rs +1 -2
- maplib-0.19.9/lib/datalog/src/python.rs +19 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/fts/src/lib.rs +2 -2
- {maplib-0.19.3 → maplib-0.19.9}/lib/maplib/Cargo.toml +1 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/maplib/src/lib.rs +0 -1
- {maplib-0.19.3 → maplib-0.19.9}/lib/maplib/src/model/constant_terms.rs +1 -1
- {maplib-0.19.3 → maplib-0.19.9}/lib/maplib/src/model/default.rs +3 -3
- {maplib-0.19.3 → maplib-0.19.9}/lib/maplib/src/model/expansion.rs +20 -7
- {maplib-0.19.3 → maplib-0.19.9}/lib/maplib/src/model.rs +8 -3
- {maplib-0.19.3 → maplib-0.19.9}/lib/pydf_io/src/to_python.rs +1 -1
- {maplib-0.19.3 → maplib-0.19.9}/lib/query_processing/src/errors.rs +2 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/query_processing/src/expressions/functions.rs +1 -1
- {maplib-0.19.3 → maplib-0.19.9}/lib/query_processing/src/expressions.rs +74 -30
- {maplib-0.19.3 → maplib-0.19.9}/lib/representation/src/base_rdf_type.rs +4 -3
- {maplib-0.19.3 → maplib-0.19.9}/lib/representation/src/cats/decode.rs +11 -2
- {maplib-0.19.3 → maplib-0.19.9}/lib/representation/src/cats/encode.rs +5 -5
- {maplib-0.19.3 → maplib-0.19.9}/lib/representation/src/cats/globalize.rs +2 -1
- {maplib-0.19.3 → maplib-0.19.9}/lib/representation/src/cats/image.rs +38 -16
- maplib-0.19.9/lib/representation/src/cats/maps/in_memory.rs +619 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/representation/src/cats/maps/on_disk.rs +3 -2
- {maplib-0.19.3 → maplib-0.19.9}/lib/representation/src/cats/maps.rs +8 -6
- {maplib-0.19.3 → maplib-0.19.9}/lib/representation/src/cats/re_encode.rs +15 -10
- {maplib-0.19.3 → maplib-0.19.9}/lib/representation/src/cats.rs +11 -6
- {maplib-0.19.3/lib/templates → maplib-0.19.9/lib/representation}/src/constants.rs +6 -1
- {maplib-0.19.3 → maplib-0.19.9}/lib/representation/src/lib.rs +2 -0
- {maplib-0.19.3/lib/maplib → maplib-0.19.9/lib/representation}/src/prefixes.rs +3 -4
- {maplib-0.19.3 → maplib-0.19.9}/lib/spargebra/src/parser.rs +0 -1
- {maplib-0.19.3 → maplib-0.19.9}/lib/templates/src/ast.rs +217 -40
- {maplib-0.19.3 → maplib-0.19.9}/lib/templates/src/dataset.rs +63 -1
- {maplib-0.19.3 → maplib-0.19.9}/lib/templates/src/lib.rs +0 -1
- {maplib-0.19.3 → maplib-0.19.9}/lib/templates/src/python.rs +2 -2
- {maplib-0.19.3 → maplib-0.19.9}/lib/triplestore/Cargo.toml +1 -1
- {maplib-0.19.3 → maplib-0.19.9}/lib/triplestore/src/errors.rs +6 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/triplestore/src/lib.rs +23 -8
- {maplib-0.19.3 → maplib-0.19.9}/lib/triplestore/src/sparql/insert.rs +14 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/triplestore/src/sparql/lazy_graph_patterns/graph.rs +1 -1
- {maplib-0.19.3 → maplib-0.19.9}/lib/triplestore/src/storage/deduplication.rs +1 -1
- {maplib-0.19.3 → maplib-0.19.9}/lib/triplestore/src/storage/so_index.rs +7 -4
- {maplib-0.19.3 → maplib-0.19.9}/lib/triplestore/src/storage.rs +75 -48
- {maplib-0.19.3 → maplib-0.19.9}/lib/triplestore/src/triples_read.rs +3 -1
- maplib-0.19.9/lib/triplestore/src/triples_write/pretty_turtle.rs +753 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/triplestore/src/triples_write/serializers.rs +1 -1
- {maplib-0.19.3 → maplib-0.19.9}/lib/triplestore/src/triples_write.rs +5 -1
- maplib-0.19.9/maplib/__init__.py +90 -0
- {maplib-0.19.3 → maplib-0.19.9}/maplib/__init__.pyi +197 -169
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/Cargo.toml +1 -1
- maplib-0.19.9/py_maplib/maplib/__init__.py +90 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/maplib/__init__.pyi +197 -169
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/src/lib.rs +126 -49
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/tests/test_basics.py +29 -5
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/tests/test_integration.py +20 -3
- maplib-0.19.9/py_maplib/tests/test_pretty_turtle.py +78 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/tests/test_programmatic_pizza_example.py +15 -10
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/tests/test_stottr.py +3 -2
- maplib-0.19.9/py_maplib/tests/testdata/read_lists.ttl +8 -0
- maplib-0.19.9/py_maplib/tests/testdata/write_turtle_newlines_bug.nt +8 -0
- maplib-0.19.3/lib/datalog/src/python.rs +0 -19
- maplib-0.19.3/lib/representation/src/cats/maps/in_memory.rs +0 -185
- maplib-0.19.3/lib/triplestore/src/triples_write/pretty_turtle.rs +0 -161
- maplib-0.19.3/maplib/__init__.py +0 -75
- maplib-0.19.3/py_maplib/maplib/__init__.py +0 -75
- {maplib-0.19.3 → maplib-0.19.9}/LICENSE +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/README.md +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/cimxml/Cargo.toml +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/cimxml/src/export.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/cimxml/src/lib.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/datalog/Cargo.toml +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/datalog/src/ast.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/datalog/src/lib.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/datalog/src/parser.rs +2 -2
- {maplib-0.19.3 → maplib-0.19.9}/lib/file_io/Cargo.toml +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/file_io/src/lib.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/fts/Cargo.toml +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/maplib/src/errors.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/maplib/src/model/errors.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/maplib/src/model/expansion/validation.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/pydf_io/Cargo.toml +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/pydf_io/LICENSE +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/pydf_io/README.md +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/pydf_io/licensing/POLARS_LICENSE +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/pydf_io/src/lib.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/pydf_io/src/to_rust.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/query_processing/Cargo.toml +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/query_processing/LICENSE +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/query_processing/README.md +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/query_processing/src/aggregates.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/query_processing/src/cats.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/query_processing/src/constants.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/query_processing/src/exists_helper.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/query_processing/src/expressions/comparisons.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/query_processing/src/expressions/operations.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/query_processing/src/find_query_variables.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/query_processing/src/graph_patterns/cats.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/query_processing/src/graph_patterns/group.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/query_processing/src/graph_patterns/join.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/query_processing/src/graph_patterns/order.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/query_processing/src/graph_patterns/union.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/query_processing/src/graph_patterns/values.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/query_processing/src/graph_patterns.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/query_processing/src/lib.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/query_processing/src/pushdowns.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/query_processing/src/type_constraints.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/report_mapping/Cargo.toml +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/report_mapping/src/lib.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/representation/Cargo.toml +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/representation/LICENSE +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/representation/README.md +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/representation/src/dataset.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/representation/src/debug.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/representation/src/errors.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/representation/src/formatting.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/representation/src/literals.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/representation/src/multitype.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/representation/src/polars_to_rdf.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/representation/src/python.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/representation/src/query_context.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/representation/src/rdf_state.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/representation/src/rdf_to_polars.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/representation/src/rdf_type.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/representation/src/solution_mapping.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/representation/src/subtypes.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/shacl/Cargo.toml +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/shacl/src/errors.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/shacl/src/lib.rs +1 -1
- {maplib-0.19.3 → maplib-0.19.9}/lib/shacl/src/storage.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/spargebra/Cargo.toml +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/spargebra/LICENSE +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/spargebra/README.md +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/spargebra/src/algebra.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/spargebra/src/lib.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/spargebra/src/query.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/spargebra/src/query_context.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/spargebra/src/remove_sugar.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/spargebra/src/term.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/spargebra/src/treehouse.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/spargebra/src/update.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/templates/Cargo.toml +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/templates/src/compatible.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/templates/src/dataset/errors.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/templates/src/document.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/templates/src/parsing.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/templates/src/python/owl.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/templates/src/python/rdf.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/templates/src/python/rdfs.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/templates/src/python/xsd.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/templates/src/subtypes_ext.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/triplestore/src/cats.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/triplestore/src/dblf.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/triplestore/src/io_funcs.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/triplestore/src/native_parquet_write.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/triplestore/src/query_solutions.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/triplestore/src/rdfs_inferencing.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/triplestore/src/sparql/debug.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/triplestore/src/sparql/delete.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/triplestore/src/sparql/errors.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/triplestore/src/sparql/lazy_aggregate.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/triplestore/src/sparql/lazy_expressions.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/triplestore/src/sparql/lazy_graph_patterns/distinct.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/triplestore/src/sparql/lazy_graph_patterns/extend.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/triplestore/src/sparql/lazy_graph_patterns/filter.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/triplestore/src/sparql/lazy_graph_patterns/group.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/triplestore/src/sparql/lazy_graph_patterns/join.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/triplestore/src/sparql/lazy_graph_patterns/left_join.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/triplestore/src/sparql/lazy_graph_patterns/minus.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/triplestore/src/sparql/lazy_graph_patterns/order_by.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/triplestore/src/sparql/lazy_graph_patterns/path.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/triplestore/src/sparql/lazy_graph_patterns/project.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/triplestore/src/sparql/lazy_graph_patterns/pvalues.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/triplestore/src/sparql/lazy_graph_patterns/triple.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/triplestore/src/sparql/lazy_graph_patterns/triples_ordering.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/triplestore/src/sparql/lazy_graph_patterns/union.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/triplestore/src/sparql/lazy_graph_patterns/values.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/triplestore/src/sparql/lazy_graph_patterns.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/triplestore/src/sparql/lazy_order.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/triplestore/src/sparql/rewrite/rewrite_cse.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/triplestore/src/sparql/rewrite/rewrite_pushdown.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/triplestore/src/sparql/rewrite.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/triplestore/src/sparql.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/triplestore/src/triples_write/fast_ntriples.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/utils/Cargo.toml +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/utils/src/lib.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/lib/utils/src/polars.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/maplib/adding_triples.py +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/maplib/py.typed +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/maplib/template_generator/__init__.py +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/maplib/template_generator/generate.py +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/maplib/template_generator/ordering.py +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/LICENSE +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/README.md +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/maplib/.gitignore +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/maplib/adding_triples.py +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/maplib/py.typed +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/maplib/template_generator/__init__.py +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/maplib/template_generator/generate.py +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/maplib/template_generator/ordering.py +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/src/error.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/src/shacl.rs +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/tests/.gitignore +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/tests/__init__.py +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/tests/out.ttl +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/tests/requirements.txt +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/tests/test_blank_nodes_multi.py +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/tests/test_data_validation.py +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/tests/test_exceptions.py +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/tests/test_multi_expressions.py +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/tests/test_named_graphs.py +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/tests/test_pizza_example.py +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/tests/test_rdf_parser.py +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/tests/test_read_write.py +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/tests/test_validate_iris.py +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/tests/testdata/expected_easy_case.ttl +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/tests/testdata/iterated_property_path_constant_object_query.csv +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/tests/testdata/iterated_property_path_constant_subject_query.csv +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/tests/testdata/iterated_property_path_query.csv +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/tests/testdata/iterated_property_path_query_with_bug.csv +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/tests/testdata/larger_ordered_query.csv +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/tests/testdata/larger_query.csv +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/tests/testdata/multi_concat.csv +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/tests/testdata/multi_datatype_join_query.csv +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/tests/testdata/multi_datatype_join_query_two_vars.csv +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/tests/testdata/multi_datatype_leftjoin_query.csv +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/tests/testdata/multi_datatype_query.csv +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/tests/testdata/multi_datatype_query_sorting.csv +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/tests/testdata/multi_datatype_union_query.csv +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/tests/testdata/multi_datatype_union_query_native_df.parquet +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/tests/testdata/multi_datatype_union_sort_desc1_query.csv +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/tests/testdata/multi_datatype_union_sort_query.csv +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/tests/testdata/multi_many_comp.csv +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/tests/testdata/property_path_query.csv +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/tests/testdata/rdf_parser/date_panic.nt +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/tests/testdata/read_ntriples.csv +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/tests/testdata/read_ntriples.nt +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/tests/testdata/read_ntriples2.csv +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/tests/testdata/simple_construct_query_nothing.csv +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/tests/testdata/simple_construct_query_something.csv +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/tests/testdata/simple_insert_query_nothing.csv +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/tests/testdata/simple_insert_query_something.csv +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/tests/testdata/simple_property_path_query.csv +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/tests/testdata/simple_query.csv +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/tests/testdata/stringfuncs.csv +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/py_maplib/tests/testdata/templates.ttl +0 -0
- {maplib-0.19.3 → maplib-0.19.9}/pyproject.toml +0 -0
|
@@ -32,9 +32,9 @@ dependencies = [
|
|
|
32
32
|
|
|
33
33
|
[[package]]
|
|
34
34
|
name = "aho-corasick"
|
|
35
|
-
version = "1.1.
|
|
35
|
+
version = "1.1.4"
|
|
36
36
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
37
|
-
checksum = "
|
|
37
|
+
checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301"
|
|
38
38
|
dependencies = [
|
|
39
39
|
"memchr",
|
|
40
40
|
]
|
|
@@ -1414,6 +1414,7 @@ dependencies = [
|
|
|
1414
1414
|
"oxrdfio",
|
|
1415
1415
|
"polars",
|
|
1416
1416
|
"pyo3",
|
|
1417
|
+
"query_processing",
|
|
1417
1418
|
"rayon",
|
|
1418
1419
|
"representation",
|
|
1419
1420
|
"rstest",
|
|
@@ -2451,7 +2452,7 @@ dependencies = [
|
|
|
2451
2452
|
|
|
2452
2453
|
[[package]]
|
|
2453
2454
|
name = "py_maplib"
|
|
2454
|
-
version = "0.19.
|
|
2455
|
+
version = "0.19.9"
|
|
2455
2456
|
dependencies = [
|
|
2456
2457
|
"chrono",
|
|
2457
2458
|
"cimxml",
|
|
@@ -3793,11 +3794,11 @@ dependencies = [
|
|
|
3793
3794
|
name = "triplestore"
|
|
3794
3795
|
version = "0.5.0"
|
|
3795
3796
|
dependencies = [
|
|
3797
|
+
"aho-corasick",
|
|
3796
3798
|
"file_io",
|
|
3797
3799
|
"fts",
|
|
3798
3800
|
"itoa",
|
|
3799
3801
|
"memmap2",
|
|
3800
|
-
"nohash-hasher",
|
|
3801
3802
|
"oxrdf",
|
|
3802
3803
|
"oxrdfio",
|
|
3803
3804
|
"oxttl",
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
use crate::inference::InferenceResult;
|
|
2
|
+
use pyo3::{pyclass, pymethods, PyResult};
|
|
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, _uuid
|
|
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
|
|
|
@@ -31,7 +31,7 @@ impl FtsIndex {
|
|
|
31
31
|
unimplemented!("Contact Data Treehouse to enable full text search")
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
pub fn commit(&mut self, _drop_writer:bool) -> Result<(), FtsError> {
|
|
34
|
+
pub fn commit(&mut self, _drop_writer: bool) -> Result<(), FtsError> {
|
|
35
35
|
unimplemented!("Contact Data Treehouse to enable full text search")
|
|
36
36
|
}
|
|
37
37
|
|
|
@@ -14,6 +14,7 @@ shacl = { path = "../shacl" }
|
|
|
14
14
|
representation = { path = "../representation" }
|
|
15
15
|
datalog = {path = "../datalog"}
|
|
16
16
|
cimxml = {path = "../cimxml"}
|
|
17
|
+
query_processing = {path ="../query_processing"}
|
|
17
18
|
|
|
18
19
|
rayon = { workspace = true }
|
|
19
20
|
oxrdf = { workspace = true }
|
|
@@ -8,13 +8,13 @@ use polars::prelude::{
|
|
|
8
8
|
};
|
|
9
9
|
use rayon::iter::ParallelIterator;
|
|
10
10
|
use rayon::prelude::IntoParallelIterator;
|
|
11
|
+
use representation::constants::{OTTR_BLANK_NODE, OTTR_IRI};
|
|
11
12
|
use representation::rdf_to_polars::{
|
|
12
13
|
polars_literal_values_to_series, rdf_named_node_to_polars_literal_value,
|
|
13
14
|
rdf_term_to_polars_expr,
|
|
14
15
|
};
|
|
15
16
|
use representation::BaseRDFNodeType;
|
|
16
17
|
use std::ops::Deref;
|
|
17
|
-
use templates::constants::{OTTR_BLANK_NODE, OTTR_IRI};
|
|
18
18
|
|
|
19
19
|
const BLANK_NODE_SERIES_NAME: &str = "blank_node_series";
|
|
20
20
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
use super::Model;
|
|
2
2
|
use crate::model::errors::MappingError;
|
|
3
3
|
use crate::model::MapOptions;
|
|
4
|
+
use representation::constants::{DEFAULT_PREFIX_IRI, OTTR_IRI, OTTR_TRIPLE};
|
|
4
5
|
use std::collections::HashMap;
|
|
5
6
|
use templates::ast::{
|
|
6
7
|
Argument, ConstantTerm, ConstantTermOrList, Instance, ListExpanderType, PType, Parameter,
|
|
7
8
|
Signature, StottrTerm, Template,
|
|
8
9
|
};
|
|
9
|
-
use templates::constants::{DEFAULT_PREFIX, OTTR_IRI, OTTR_TRIPLE};
|
|
10
10
|
use tracing::warn;
|
|
11
11
|
|
|
12
12
|
use crate::errors::MaplibError;
|
|
@@ -121,7 +121,7 @@ impl Model {
|
|
|
121
121
|
list_expand: false,
|
|
122
122
|
term: StottrTerm::ConstantTerm(ConstantTermOrList::ConstantTerm(
|
|
123
123
|
ConstantTerm::Iri(
|
|
124
|
-
NamedNode::new(format!("{
|
|
124
|
+
NamedNode::new(format!("{DEFAULT_PREFIX_IRI}{c}"))
|
|
125
125
|
.map_err(MappingError::IriParseError)?,
|
|
126
126
|
),
|
|
127
127
|
)),
|
|
@@ -137,7 +137,7 @@ impl Model {
|
|
|
137
137
|
|
|
138
138
|
let template_name = format!(
|
|
139
139
|
"{}default_template_{}",
|
|
140
|
-
|
|
140
|
+
DEFAULT_PREFIX_IRI, &self.default_template_counter
|
|
141
141
|
);
|
|
142
142
|
self.default_template_counter += 1;
|
|
143
143
|
let template = Template {
|
|
@@ -12,6 +12,7 @@ use polars::prelude::{
|
|
|
12
12
|
NamedFrom, Series,
|
|
13
13
|
};
|
|
14
14
|
use rayon::iter::{IndexedParallelIterator, ParallelDrainRange, ParallelIterator};
|
|
15
|
+
use representation::constants::OTTR_TRIPLE;
|
|
15
16
|
use representation::dataset::NamedGraph;
|
|
16
17
|
use representation::multitype::split_df_multicols;
|
|
17
18
|
use representation::rdf_to_polars::rdf_named_node_to_polars_literal_value;
|
|
@@ -24,14 +25,13 @@ use std::time::Instant;
|
|
|
24
25
|
use templates::ast::{
|
|
25
26
|
ConstantTerm, ConstantTermOrList, Instance, ListExpanderType, PType, Signature, StottrTerm,
|
|
26
27
|
};
|
|
27
|
-
use templates::constants::OTTR_TRIPLE;
|
|
28
28
|
use templates::MappingColumnType;
|
|
29
29
|
use tracing::debug;
|
|
30
|
+
use query_processing::expressions::non_multi_col_is_null_workaround;
|
|
30
31
|
use triplestore::TriplesToAdd;
|
|
31
32
|
|
|
32
33
|
const LIST_COL: &str = "list";
|
|
33
34
|
const FIRST_COL: &str = "first";
|
|
34
|
-
|
|
35
35
|
const REST_COL: &str = "rest";
|
|
36
36
|
|
|
37
37
|
impl Model {
|
|
@@ -253,7 +253,9 @@ impl Model {
|
|
|
253
253
|
predicate,
|
|
254
254
|
} in ok_triples
|
|
255
255
|
{
|
|
256
|
-
let
|
|
256
|
+
let subject_multi = subject_type.is_multi();
|
|
257
|
+
let object_multi = object_type.is_multi();
|
|
258
|
+
let has_multi = subject_multi || object_multi;
|
|
257
259
|
|
|
258
260
|
let mut types = HashMap::from([
|
|
259
261
|
(SUBJECT_COL_NAME.to_string(), subject_type),
|
|
@@ -270,23 +272,34 @@ impl Model {
|
|
|
270
272
|
} else {
|
|
271
273
|
vec![(df, types)]
|
|
272
274
|
};
|
|
273
|
-
for (df, mut
|
|
274
|
-
let (subject_type, subject_state) =
|
|
275
|
+
for (mut df, mut part_types) in dfs {
|
|
276
|
+
let (subject_type, subject_state) = part_types
|
|
275
277
|
.remove(SUBJECT_COL_NAME)
|
|
276
278
|
.unwrap()
|
|
277
279
|
.map
|
|
278
280
|
.into_iter()
|
|
279
281
|
.next()
|
|
280
282
|
.unwrap();
|
|
281
|
-
let (object_type, object_state) =
|
|
283
|
+
let (object_type, object_state) = part_types
|
|
282
284
|
.remove(OBJECT_COL_NAME)
|
|
283
285
|
.unwrap()
|
|
284
286
|
.map
|
|
285
287
|
.into_iter()
|
|
286
288
|
.next()
|
|
287
289
|
.unwrap();
|
|
290
|
+
// Splitting by multi introduces nulls
|
|
291
|
+
if has_multi {
|
|
292
|
+
let mut lf = df.lazy();
|
|
293
|
+
if subject_multi {
|
|
294
|
+
lf = lf.filter(non_multi_col_is_null_workaround(col(SUBJECT_COL_NAME), &subject_type).not())
|
|
295
|
+
}
|
|
296
|
+
if object_multi {
|
|
297
|
+
lf = lf.filter(non_multi_col_is_null_workaround(col(OBJECT_COL_NAME), &object_type).not())
|
|
298
|
+
}
|
|
299
|
+
df = lf.collect().unwrap();
|
|
300
|
+
}
|
|
288
301
|
let predicate_state = if predicate.is_none() {
|
|
289
|
-
let (_, s) =
|
|
302
|
+
let (_, s) = part_types
|
|
290
303
|
.remove(PREDICATE_COL_NAME)
|
|
291
304
|
.unwrap()
|
|
292
305
|
.map
|
|
@@ -25,9 +25,9 @@ use triplestore::sparql::errors::SparqlError;
|
|
|
25
25
|
use triplestore::sparql::{QueryResult, QuerySettings, UpdateResult};
|
|
26
26
|
use triplestore::{IndexingOptions, NewTriples, Triplestore};
|
|
27
27
|
|
|
28
|
-
use crate::prefixes::get_default_prefixes;
|
|
29
28
|
use datalog::ast::DatalogRuleset;
|
|
30
29
|
use representation::dataset::NamedGraph;
|
|
30
|
+
use representation::prefixes::get_default_prefixes;
|
|
31
31
|
use tracing::instrument;
|
|
32
32
|
|
|
33
33
|
pub struct Model {
|
|
@@ -79,7 +79,7 @@ impl Model {
|
|
|
79
79
|
if let Some(indexing) = indexing {
|
|
80
80
|
indexing
|
|
81
81
|
} else {
|
|
82
|
-
IndexingOptions::
|
|
82
|
+
IndexingOptions::default()
|
|
83
83
|
}
|
|
84
84
|
} else {
|
|
85
85
|
indexing.unwrap_or_default()
|
|
@@ -313,9 +313,14 @@ impl Model {
|
|
|
313
313
|
buffer: &mut W,
|
|
314
314
|
graph: &NamedGraph,
|
|
315
315
|
rdf_format: RdfFormat,
|
|
316
|
+
prefixes: Option<&HashMap<String, NamedNode>>,
|
|
316
317
|
) -> Result<(), MaplibError> {
|
|
318
|
+
let mut use_prefixes = self.prefixes.clone();
|
|
319
|
+
if let Some(prefixes) = prefixes {
|
|
320
|
+
use_prefixes.extend(prefixes.clone());
|
|
321
|
+
}
|
|
317
322
|
self.triplestore
|
|
318
|
-
.write_triples(buffer, rdf_format, graph)
|
|
323
|
+
.write_triples(buffer, rdf_format, graph, &use_prefixes)
|
|
319
324
|
.map_err(MaplibError::TriplestoreError)?;
|
|
320
325
|
Ok(())
|
|
321
326
|
}
|
|
@@ -104,7 +104,7 @@ pub fn df_to_py_df(
|
|
|
104
104
|
let pyarrow = PyModule::import(py, "pyarrow")?;
|
|
105
105
|
let polars = PyModule::import(py, "polars")?;
|
|
106
106
|
let py_df = to_py_df(&chunk, names.as_slice(), py, &pyarrow, &polars)?;
|
|
107
|
-
if include_datatypes
|
|
107
|
+
if include_datatypes {
|
|
108
108
|
Py::new(
|
|
109
109
|
py,
|
|
110
110
|
PySolutionMappings {
|
|
@@ -16,4 +16,6 @@ pub enum QueryProcessingError {
|
|
|
16
16
|
BadNumberOfFunctionArguments(Function, usize, String),
|
|
17
17
|
#[error("Maximum estimated rows `{}` in result exceeds configured maximum `{}`. You may have a cross join in your query, please double check. Alternatively, try setting the max_rows parameter to a higher value. Left columns: `{}` Right columns: `{}`", .0, .1, .2, .3)]
|
|
18
18
|
MaxRowsReached(usize, usize, String, String),
|
|
19
|
+
#[error("The function `{}` is not implemented yet", .0)]
|
|
20
|
+
UnimplementedFunction(String),
|
|
19
21
|
}
|
|
@@ -935,7 +935,7 @@ pub fn func_expression(
|
|
|
935
935
|
.rdf_node_types
|
|
936
936
|
.insert(outer_context.as_str().to_string(), t_new);
|
|
937
937
|
} else {
|
|
938
|
-
|
|
938
|
+
return Err(QueryProcessingError::UnimplementedFunction(nn.to_string()));
|
|
939
939
|
}
|
|
940
940
|
}
|
|
941
941
|
Function::StrBefore | Function::StrAfter => {
|
|
@@ -159,15 +159,37 @@ pub fn binary_expression(
|
|
|
159
159
|
.get(right_context.as_str())
|
|
160
160
|
.unwrap();
|
|
161
161
|
if left_type.is_none() || right_type.is_none() {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
162
|
+
if matches!(
|
|
163
|
+
expression,
|
|
164
|
+
Expression::Equal(..)
|
|
165
|
+
| Expression::Less(..)
|
|
166
|
+
| Expression::Greater(..)
|
|
167
|
+
| Expression::GreaterOrEqual(..)
|
|
168
|
+
| Expression::LessOrEqual(..)
|
|
169
|
+
| Expression::And(..)
|
|
170
|
+
| Expression::Or(..)
|
|
171
|
+
) {
|
|
172
|
+
let bool = BaseRDFNodeType::Literal(xsd::BOOLEAN.into_owned());
|
|
173
|
+
solution_mappings.mappings = solution_mappings.mappings.with_column(
|
|
174
|
+
lit(LiteralValue::untyped_null())
|
|
175
|
+
.cast(bool.default_input_polars_data_type())
|
|
176
|
+
.alias(outer_context.as_str()),
|
|
177
|
+
);
|
|
178
|
+
solution_mappings.rdf_node_types.insert(
|
|
179
|
+
outer_context.as_str().to_string(),
|
|
180
|
+
bool.into_default_input_rdf_node_state(),
|
|
181
|
+
);
|
|
182
|
+
} else {
|
|
183
|
+
solution_mappings.mappings = solution_mappings.mappings.with_column(
|
|
184
|
+
lit(LiteralValue::untyped_null())
|
|
185
|
+
.cast(BaseRDFNodeType::None.default_input_polars_data_type())
|
|
186
|
+
.alias(outer_context.as_str()),
|
|
187
|
+
);
|
|
188
|
+
solution_mappings.rdf_node_types.insert(
|
|
189
|
+
outer_context.as_str().to_string(),
|
|
190
|
+
BaseRDFNodeType::None.into_default_input_rdf_node_state(),
|
|
191
|
+
);
|
|
192
|
+
}
|
|
171
193
|
solution_mappings =
|
|
172
194
|
drop_inner_contexts(solution_mappings, &vec![left_context, right_context]);
|
|
173
195
|
return Ok(solution_mappings);
|
|
@@ -342,23 +364,27 @@ pub fn bound(
|
|
|
342
364
|
pub fn expr_is_null_workaround(expr: Expr, rdf_node_type: &RDFNodeState) -> Expr {
|
|
343
365
|
if !rdf_node_type.is_multi() {
|
|
344
366
|
let b = rdf_node_type.get_base_type().unwrap();
|
|
345
|
-
|
|
346
|
-
BaseRDFNodeType::Literal(l) => {
|
|
347
|
-
if l.as_ref() == rdf::LANG_STRING {
|
|
348
|
-
expr.struct_()
|
|
349
|
-
.field_by_name(LANG_STRING_VALUE_FIELD)
|
|
350
|
-
.is_null()
|
|
351
|
-
} else {
|
|
352
|
-
expr.is_null()
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
_ => expr.is_null(),
|
|
356
|
-
}
|
|
367
|
+
non_multi_col_is_null_workaround(expr, b)
|
|
357
368
|
} else {
|
|
358
369
|
create_all_types_null_expression(expr, rdf_node_type.get_sorted_types())
|
|
359
370
|
}
|
|
360
371
|
}
|
|
361
372
|
|
|
373
|
+
pub fn non_multi_col_is_null_workaround(expr: Expr, base_rdf_node_type: &BaseRDFNodeType) -> Expr {
|
|
374
|
+
match base_rdf_node_type {
|
|
375
|
+
BaseRDFNodeType::Literal(l) => {
|
|
376
|
+
if l.as_ref() == rdf::LANG_STRING {
|
|
377
|
+
expr.struct_()
|
|
378
|
+
.field_by_name(LANG_STRING_VALUE_FIELD)
|
|
379
|
+
.is_null()
|
|
380
|
+
} else {
|
|
381
|
+
expr.is_null()
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
_ => expr.is_null(),
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
|
|
362
388
|
pub fn if_expression(
|
|
363
389
|
mut solution_mappings: SolutionMappings,
|
|
364
390
|
left_context: &Context,
|
|
@@ -369,14 +395,31 @@ pub fn if_expression(
|
|
|
369
395
|
) -> Result<SolutionMappings, QueryProcessingError> {
|
|
370
396
|
//
|
|
371
397
|
let mut exploded: Vec<_> = create_compatible_cats(
|
|
372
|
-
vec![
|
|
373
|
-
|
|
374
|
-
|
|
398
|
+
vec![
|
|
399
|
+
Some(col(middle_context.as_str())),
|
|
400
|
+
Some(col(right_context.as_str())),
|
|
401
|
+
],
|
|
402
|
+
vec![
|
|
403
|
+
Some(
|
|
404
|
+
solution_mappings
|
|
405
|
+
.rdf_node_types
|
|
406
|
+
.get(middle_context.as_str())
|
|
407
|
+
.unwrap()
|
|
408
|
+
.clone(),
|
|
409
|
+
),
|
|
410
|
+
Some(
|
|
411
|
+
solution_mappings
|
|
412
|
+
.rdf_node_types
|
|
413
|
+
.get(right_context.as_str())
|
|
414
|
+
.unwrap()
|
|
415
|
+
.clone(),
|
|
416
|
+
),
|
|
417
|
+
],
|
|
375
418
|
global_cats,
|
|
376
419
|
)
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
420
|
+
.into_iter()
|
|
421
|
+
.map(|x| x.unwrap())
|
|
422
|
+
.collect();
|
|
380
423
|
assert_eq!(exploded.len(), 2);
|
|
381
424
|
|
|
382
425
|
let right_exploded = exploded.pop().unwrap();
|
|
@@ -413,9 +456,10 @@ pub fn if_expression(
|
|
|
413
456
|
})
|
|
414
457
|
.alias(outer_context.as_str()),
|
|
415
458
|
);
|
|
416
|
-
solution_mappings
|
|
417
|
-
.
|
|
418
|
-
|
|
459
|
+
solution_mappings.rdf_node_types.insert(
|
|
460
|
+
outer_context.as_str().to_string(),
|
|
461
|
+
RDFNodeState::from_map(base_type_map),
|
|
462
|
+
);
|
|
419
463
|
solution_mappings = drop_inner_contexts(
|
|
420
464
|
solution_mappings,
|
|
421
465
|
&vec![left_context, middle_context, right_context],
|
|
@@ -196,7 +196,7 @@ impl BaseRDFNodeType {
|
|
|
196
196
|
} else if matches!(self, BaseRDFNodeType::IRI | BaseRDFNodeType::BlankNode) {
|
|
197
197
|
DataType::UInt32
|
|
198
198
|
} else if let BaseRDFNodeType::Literal(l) = self {
|
|
199
|
-
literal_type(l.as_ref(), &BaseCatState::
|
|
199
|
+
literal_type(l.as_ref(), &BaseCatState::CategoricalNative(false, None), false)
|
|
200
200
|
} else {
|
|
201
201
|
unreachable!("Should never happen")
|
|
202
202
|
}
|
|
@@ -212,9 +212,11 @@ fn literal_type(
|
|
|
212
212
|
xsd::UNSIGNED_INT => DataType::UInt32,
|
|
213
213
|
xsd::UNSIGNED_LONG => DataType::UInt64,
|
|
214
214
|
xsd::UNSIGNED_SHORT => DataType::UInt16,
|
|
215
|
+
xsd::UNSIGNED_BYTE => DataType::UInt8,
|
|
215
216
|
xsd::INTEGER | xsd::LONG => DataType::Int64,
|
|
216
217
|
xsd::INT => DataType::Int32,
|
|
217
218
|
xsd::SHORT => DataType::Int16,
|
|
219
|
+
xsd::BYTE => DataType::Int8,
|
|
218
220
|
xsd::DOUBLE | xsd::DECIMAL => DataType::Float64,
|
|
219
221
|
xsd::FLOAT => DataType::Float32,
|
|
220
222
|
xsd::BOOLEAN => DataType::Boolean,
|
|
@@ -223,8 +225,7 @@ fn literal_type(
|
|
|
223
225
|
DataType::Struct(polars_lang_fields(base_cat_state))
|
|
224
226
|
} else {
|
|
225
227
|
match base_cat_state {
|
|
226
|
-
BaseCatState::CategoricalNative(
|
|
227
|
-
BaseCatState::String | BaseCatState::NonString => DataType::String,
|
|
228
|
+
BaseCatState::String | BaseCatState::NonString | BaseCatState::CategoricalNative(..) => DataType::String,
|
|
228
229
|
}
|
|
229
230
|
}
|
|
230
231
|
}
|
|
@@ -20,12 +20,21 @@ impl CatEncs {
|
|
|
20
20
|
new_ser
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
pub fn maybe_decode_string(&self, u: &u32) -> Option
|
|
23
|
+
pub fn maybe_decode_string(&self, u: &u32) -> Option<Cow<'_, str>> {
|
|
24
24
|
self.maps.maybe_decode(u)
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
impl Cats {
|
|
29
|
+
pub fn maybe_decode_of_type(&self, u:&u32, bt:&BaseRDFNodeType) -> Option<Cow<'_, str>> {
|
|
30
|
+
let ct = CatType::from_base_rdf_node_type(bt);
|
|
31
|
+
if let Some(cat_encs) = self.cat_map.get(&ct) {
|
|
32
|
+
cat_encs.maybe_decode_string(u)
|
|
33
|
+
} else {
|
|
34
|
+
None
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
29
38
|
pub fn decode_iri_u32s(&self, us: &[u32], local_cats: Option<LockedCats>) -> Vec<NamedNode> {
|
|
30
39
|
us.iter()
|
|
31
40
|
.map(|x| self.decode_iri_u32(x, local_cats.clone()))
|
|
@@ -135,7 +144,7 @@ impl Cats {
|
|
|
135
144
|
break;
|
|
136
145
|
}
|
|
137
146
|
}
|
|
138
|
-
Some(
|
|
147
|
+
Some(s.expect("Expect all cats to resolve"))
|
|
139
148
|
} else {
|
|
140
149
|
None
|
|
141
150
|
};
|
|
@@ -10,14 +10,14 @@ use std::collections::HashMap;
|
|
|
10
10
|
use std::path::Path;
|
|
11
11
|
|
|
12
12
|
impl CatEncs {
|
|
13
|
-
pub fn new_empty(path: Option<&Path
|
|
13
|
+
pub fn new_empty(path: Option<&Path>, bt: &BaseRDFNodeType) -> CatEncs {
|
|
14
14
|
CatEncs {
|
|
15
|
-
maps: CatMaps::new_empty(path),
|
|
15
|
+
maps: CatMaps::new_empty(path, bt),
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
pub fn new_singular(value: &str, u: u32, path: Option<&Path
|
|
20
|
-
let maps = CatMaps::new_singular(value, u, path);
|
|
19
|
+
pub fn new_singular(value: &str, u: u32, path: Option<&Path>, bt: &BaseRDFNodeType) -> CatEncs {
|
|
20
|
+
let maps = CatMaps::new_singular(value, u, path, bt);
|
|
21
21
|
CatEncs { maps }
|
|
22
22
|
}
|
|
23
23
|
|
|
@@ -112,7 +112,7 @@ impl Cats {
|
|
|
112
112
|
};
|
|
113
113
|
|
|
114
114
|
let enc = self.get_encs(t).pop();
|
|
115
|
-
let mut new_enc = CatEncs::new_empty(path);
|
|
115
|
+
let mut new_enc = CatEncs::new_empty(path, t);
|
|
116
116
|
let strch = series.str().unwrap();
|
|
117
117
|
let encoded_global: Vec<_> = strch
|
|
118
118
|
.iter()
|
|
@@ -27,7 +27,8 @@ impl Cats {
|
|
|
27
27
|
for ct in cat_triples {
|
|
28
28
|
let t = CatType::IRI;
|
|
29
29
|
if !self.cat_map.contains_key(&t) {
|
|
30
|
-
self.cat_map
|
|
30
|
+
self.cat_map
|
|
31
|
+
.insert(t.clone(), CatEncs::new_empty(path, &BaseRDFNodeType::IRI));
|
|
31
32
|
}
|
|
32
33
|
let enc = self.cat_map.get_mut(&t).unwrap();
|
|
33
34
|
let pred = ct.predicate.as_str().to_string();
|
|
@@ -2,7 +2,7 @@ use super::{reencode_solution_mappings, CatEncs, CatType};
|
|
|
2
2
|
use super::{CatReEnc, Cats};
|
|
3
3
|
use crate::cats::LockedCats;
|
|
4
4
|
use crate::solution_mapping::{BaseCatState, EagerSolutionMappings};
|
|
5
|
-
use crate::{BaseRDFNodeType, RDFNodeState};
|
|
5
|
+
use crate::{BaseRDFNodeType, RDFNodeState, LANG_STRING_LANG_FIELD, LANG_STRING_VALUE_FIELD};
|
|
6
6
|
use nohash_hasher::NoHashHasher;
|
|
7
7
|
use std::collections::{HashMap, HashSet};
|
|
8
8
|
use std::hash::BuildHasherDefault;
|
|
@@ -21,20 +21,40 @@ impl Cats {
|
|
|
21
21
|
let t = sm.rdf_node_types.get(c).unwrap();
|
|
22
22
|
for (bt, bs) in &t.map {
|
|
23
23
|
if let BaseCatState::CategoricalNative(_, local) = bs {
|
|
24
|
-
let
|
|
25
|
-
|
|
24
|
+
let mut sers = vec![];
|
|
25
|
+
if bt.is_lang_string() {
|
|
26
|
+
let ser1 = sm.mappings
|
|
26
27
|
.column(c)
|
|
27
28
|
.unwrap()
|
|
28
29
|
.struct_()
|
|
29
30
|
.unwrap()
|
|
30
|
-
.field_by_name(
|
|
31
|
+
.field_by_name(LANG_STRING_VALUE_FIELD)
|
|
32
|
+
.unwrap();
|
|
33
|
+
sers.push(ser1);
|
|
34
|
+
let ser2 = sm.mappings
|
|
35
|
+
.column(c)
|
|
36
|
+
.unwrap()
|
|
37
|
+
.struct_()
|
|
38
|
+
.unwrap()
|
|
39
|
+
.field_by_name(LANG_STRING_LANG_FIELD)
|
|
40
|
+
.unwrap();
|
|
41
|
+
sers.push(ser2);
|
|
42
|
+
} else if t.is_multi() {
|
|
43
|
+
let ser = sm.mappings
|
|
44
|
+
.column(c)
|
|
31
45
|
.unwrap()
|
|
46
|
+
.struct_()
|
|
47
|
+
.unwrap()
|
|
48
|
+
.field_by_name(&bt.field_col_name())
|
|
49
|
+
.unwrap();
|
|
50
|
+
sers.push(ser);
|
|
32
51
|
} else {
|
|
33
|
-
sm.mappings
|
|
52
|
+
let ser = sm.mappings
|
|
34
53
|
.column(c)
|
|
35
54
|
.unwrap()
|
|
36
55
|
.as_materialized_series()
|
|
37
|
-
.clone()
|
|
56
|
+
.clone();
|
|
57
|
+
sers.push(ser);
|
|
38
58
|
};
|
|
39
59
|
if !s.contains_key(bt) {
|
|
40
60
|
s.insert(bt.clone(), HashSet::new());
|
|
@@ -48,16 +68,18 @@ impl Cats {
|
|
|
48
68
|
None
|
|
49
69
|
};
|
|
50
70
|
let ss = s.get_mut(bt).unwrap();
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
71
|
+
for ser in sers {
|
|
72
|
+
let new_ss = ser
|
|
73
|
+
.u32()
|
|
74
|
+
.unwrap()
|
|
75
|
+
.into_iter()
|
|
76
|
+
.filter(|x| x.is_some())
|
|
77
|
+
.map(|x| x.unwrap());
|
|
78
|
+
if let Some(local_rev_map) = local_rev_map {
|
|
79
|
+
ss.extend(new_ss.filter(|x| !local_rev_map.maps.contains_u32(x)));
|
|
80
|
+
} else {
|
|
81
|
+
ss.extend(new_ss);
|
|
82
|
+
}
|
|
61
83
|
}
|
|
62
84
|
}
|
|
63
85
|
}
|