maplib 0.19.5__tar.gz → 0.19.10__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.5 → maplib-0.19.10}/Cargo.lock +16 -7
- {maplib-0.19.5 → maplib-0.19.10}/Cargo.toml +3 -0
- {maplib-0.19.5 → maplib-0.19.10}/PKG-INFO +1 -1
- {maplib-0.19.5 → maplib-0.19.10}/lib/maplib/Cargo.toml +1 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/maplib/src/model/expansion.rs +25 -6
- {maplib-0.19.5 → maplib-0.19.10}/lib/maplib/src/model.rs +39 -1
- {maplib-0.19.5 → maplib-0.19.10}/lib/pydf_io/src/to_python.rs +1 -1
- {maplib-0.19.5 → maplib-0.19.10}/lib/query_processing/src/expressions.rs +47 -21
- {maplib-0.19.5 → maplib-0.19.10}/lib/representation/src/base_rdf_type.rs +8 -3
- {maplib-0.19.5 → maplib-0.19.10}/lib/representation/src/cats/decode.rs +11 -2
- {maplib-0.19.5 → maplib-0.19.10}/lib/representation/src/cats/encode.rs +5 -5
- {maplib-0.19.5 → maplib-0.19.10}/lib/representation/src/cats/globalize.rs +2 -1
- {maplib-0.19.5 → maplib-0.19.10}/lib/representation/src/cats/image.rs +42 -16
- maplib-0.19.10/lib/representation/src/cats/maps/in_memory.rs +619 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/representation/src/cats/maps/on_disk.rs +3 -2
- {maplib-0.19.5 → maplib-0.19.10}/lib/representation/src/cats/maps.rs +8 -6
- {maplib-0.19.5 → maplib-0.19.10}/lib/representation/src/cats/re_encode.rs +18 -10
- {maplib-0.19.5 → maplib-0.19.10}/lib/representation/src/cats.rs +11 -6
- {maplib-0.19.5 → maplib-0.19.10}/lib/representation/src/constants.rs +6 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/representation/src/prefixes.rs +4 -3
- {maplib-0.19.5 → maplib-0.19.10}/lib/representation/src/rdf_to_polars.rs +7 -3
- {maplib-0.19.5 → maplib-0.19.10}/lib/spargebra/src/parser.rs +0 -1
- {maplib-0.19.5 → maplib-0.19.10}/lib/triplestore/Cargo.toml +3 -1
- {maplib-0.19.5 → maplib-0.19.10}/lib/triplestore/src/errors.rs +10 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/triplestore/src/lib.rs +5 -0
- maplib-0.19.10/lib/triplestore/src/map_json.rs +388 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/triplestore/src/sparql/insert.rs +14 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/triplestore/src/sparql/lazy_graph_patterns/graph.rs +1 -1
- {maplib-0.19.5 → maplib-0.19.10}/lib/triplestore/src/storage/deduplication.rs +1 -1
- {maplib-0.19.5 → maplib-0.19.10}/lib/triplestore/src/storage.rs +79 -47
- {maplib-0.19.5 → maplib-0.19.10}/lib/triplestore/src/triples_read.rs +3 -1
- maplib-0.19.10/lib/triplestore/src/triples_write/pretty_turtle.rs +764 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/triplestore/src/triples_write.rs +8 -1
- maplib-0.19.10/maplib/__init__.py +90 -0
- {maplib-0.19.5 → maplib-0.19.10}/maplib/__init__.pyi +218 -169
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/Cargo.toml +1 -1
- maplib-0.19.10/py_maplib/maplib/__init__.py +90 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/maplib/__init__.pyi +218 -169
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/src/lib.rs +149 -47
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/tests/test_basics.py +22 -1
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/tests/test_integration.py +20 -3
- maplib-0.19.10/py_maplib/tests/test_json.py +152 -0
- maplib-0.19.10/py_maplib/tests/test_pretty_turtle.py +78 -0
- maplib-0.19.10/py_maplib/tests/testdata/jsons/1.json +22 -0
- maplib-0.19.10/py_maplib/tests/testdata/jsons/2.json +27 -0
- maplib-0.19.10/py_maplib/tests/testdata/jsons/3.json +89 -0
- maplib-0.19.10/py_maplib/tests/testdata/read_lists.ttl +8 -0
- maplib-0.19.10/py_maplib/tests/testdata/write_turtle_newlines_bug.nt +8 -0
- maplib-0.19.5/lib/representation/src/cats/maps/in_memory.rs +0 -185
- maplib-0.19.5/lib/triplestore/src/triples_write/pretty_turtle.rs +0 -161
- maplib-0.19.5/maplib/__init__.py +0 -75
- maplib-0.19.5/py_maplib/maplib/__init__.py +0 -75
- {maplib-0.19.5 → maplib-0.19.10}/LICENSE +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/README.md +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/cimxml/Cargo.toml +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/cimxml/src/export.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/cimxml/src/lib.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/datalog/Cargo.toml +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/datalog/src/ast.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/datalog/src/inference.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/datalog/src/lib.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/datalog/src/parser.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/datalog/src/python.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/file_io/Cargo.toml +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/file_io/src/lib.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/fts/Cargo.toml +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/fts/src/lib.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/maplib/src/errors.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/maplib/src/lib.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/maplib/src/model/constant_terms.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/maplib/src/model/default.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/maplib/src/model/errors.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/maplib/src/model/expansion/validation.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/pydf_io/Cargo.toml +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/pydf_io/LICENSE +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/pydf_io/README.md +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/pydf_io/licensing/POLARS_LICENSE +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/pydf_io/src/lib.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/pydf_io/src/to_rust.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/query_processing/Cargo.toml +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/query_processing/LICENSE +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/query_processing/README.md +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/query_processing/src/aggregates.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/query_processing/src/cats.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/query_processing/src/constants.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/query_processing/src/errors.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/query_processing/src/exists_helper.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/query_processing/src/expressions/comparisons.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/query_processing/src/expressions/functions.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/query_processing/src/expressions/operations.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/query_processing/src/find_query_variables.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/query_processing/src/graph_patterns/cats.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/query_processing/src/graph_patterns/group.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/query_processing/src/graph_patterns/join.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/query_processing/src/graph_patterns/order.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/query_processing/src/graph_patterns/union.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/query_processing/src/graph_patterns/values.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/query_processing/src/graph_patterns.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/query_processing/src/lib.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/query_processing/src/pushdowns.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/query_processing/src/type_constraints.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/report_mapping/Cargo.toml +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/report_mapping/src/lib.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/representation/Cargo.toml +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/representation/LICENSE +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/representation/README.md +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/representation/src/dataset.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/representation/src/debug.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/representation/src/errors.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/representation/src/formatting.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/representation/src/lib.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/representation/src/literals.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/representation/src/multitype.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/representation/src/polars_to_rdf.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/representation/src/python.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/representation/src/query_context.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/representation/src/rdf_state.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/representation/src/rdf_type.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/representation/src/solution_mapping.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/representation/src/subtypes.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/shacl/Cargo.toml +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/shacl/src/errors.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/shacl/src/lib.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/shacl/src/storage.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/spargebra/Cargo.toml +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/spargebra/LICENSE +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/spargebra/README.md +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/spargebra/src/algebra.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/spargebra/src/lib.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/spargebra/src/query.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/spargebra/src/query_context.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/spargebra/src/remove_sugar.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/spargebra/src/term.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/spargebra/src/treehouse.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/spargebra/src/update.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/templates/Cargo.toml +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/templates/src/ast.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/templates/src/compatible.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/templates/src/dataset/errors.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/templates/src/dataset.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/templates/src/document.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/templates/src/lib.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/templates/src/parsing.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/templates/src/python/owl.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/templates/src/python/rdf.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/templates/src/python/rdfs.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/templates/src/python/xsd.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/templates/src/python.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/templates/src/subtypes_ext.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/triplestore/src/cats.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/triplestore/src/dblf.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/triplestore/src/io_funcs.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/triplestore/src/native_parquet_write.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/triplestore/src/query_solutions.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/triplestore/src/rdfs_inferencing.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/triplestore/src/sparql/debug.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/triplestore/src/sparql/delete.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/triplestore/src/sparql/errors.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/triplestore/src/sparql/lazy_aggregate.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/triplestore/src/sparql/lazy_expressions.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/triplestore/src/sparql/lazy_graph_patterns/distinct.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/triplestore/src/sparql/lazy_graph_patterns/extend.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/triplestore/src/sparql/lazy_graph_patterns/filter.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/triplestore/src/sparql/lazy_graph_patterns/group.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/triplestore/src/sparql/lazy_graph_patterns/join.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/triplestore/src/sparql/lazy_graph_patterns/left_join.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/triplestore/src/sparql/lazy_graph_patterns/minus.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/triplestore/src/sparql/lazy_graph_patterns/order_by.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/triplestore/src/sparql/lazy_graph_patterns/path.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/triplestore/src/sparql/lazy_graph_patterns/project.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/triplestore/src/sparql/lazy_graph_patterns/pvalues.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/triplestore/src/sparql/lazy_graph_patterns/triple.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/triplestore/src/sparql/lazy_graph_patterns/triples_ordering.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/triplestore/src/sparql/lazy_graph_patterns/union.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/triplestore/src/sparql/lazy_graph_patterns/values.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/triplestore/src/sparql/lazy_graph_patterns.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/triplestore/src/sparql/lazy_order.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/triplestore/src/sparql/rewrite/rewrite_cse.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/triplestore/src/sparql/rewrite/rewrite_pushdown.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/triplestore/src/sparql/rewrite.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/triplestore/src/sparql.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/triplestore/src/storage/so_index.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/triplestore/src/triples_write/fast_ntriples.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/triplestore/src/triples_write/serializers.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/utils/Cargo.toml +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/utils/src/lib.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/lib/utils/src/polars.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/maplib/adding_triples.py +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/maplib/py.typed +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/maplib/template_generator/__init__.py +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/maplib/template_generator/generate.py +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/maplib/template_generator/ordering.py +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/LICENSE +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/README.md +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/maplib/.gitignore +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/maplib/adding_triples.py +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/maplib/py.typed +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/maplib/template_generator/__init__.py +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/maplib/template_generator/generate.py +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/maplib/template_generator/ordering.py +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/src/error.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/src/shacl.rs +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/tests/.gitignore +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/tests/__init__.py +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/tests/out.ttl +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/tests/requirements.txt +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/tests/test_blank_nodes_multi.py +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/tests/test_data_validation.py +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/tests/test_exceptions.py +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/tests/test_multi_expressions.py +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/tests/test_named_graphs.py +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/tests/test_pizza_example.py +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/tests/test_programmatic_pizza_example.py +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/tests/test_rdf_parser.py +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/tests/test_read_write.py +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/tests/test_stottr.py +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/tests/test_validate_iris.py +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/tests/testdata/expected_easy_case.ttl +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/tests/testdata/iterated_property_path_constant_object_query.csv +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/tests/testdata/iterated_property_path_constant_subject_query.csv +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/tests/testdata/iterated_property_path_query.csv +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/tests/testdata/iterated_property_path_query_with_bug.csv +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/tests/testdata/larger_ordered_query.csv +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/tests/testdata/larger_query.csv +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/tests/testdata/multi_concat.csv +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/tests/testdata/multi_datatype_join_query.csv +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/tests/testdata/multi_datatype_join_query_two_vars.csv +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/tests/testdata/multi_datatype_leftjoin_query.csv +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/tests/testdata/multi_datatype_query.csv +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/tests/testdata/multi_datatype_query_sorting.csv +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/tests/testdata/multi_datatype_union_query.csv +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/tests/testdata/multi_datatype_union_query_native_df.parquet +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/tests/testdata/multi_datatype_union_sort_desc1_query.csv +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/tests/testdata/multi_datatype_union_sort_query.csv +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/tests/testdata/multi_many_comp.csv +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/tests/testdata/property_path_query.csv +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/tests/testdata/rdf_parser/date_panic.nt +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/tests/testdata/read_ntriples.csv +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/tests/testdata/read_ntriples.nt +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/tests/testdata/read_ntriples2.csv +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/tests/testdata/simple_construct_query_nothing.csv +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/tests/testdata/simple_construct_query_something.csv +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/tests/testdata/simple_insert_query_nothing.csv +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/tests/testdata/simple_insert_query_something.csv +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/tests/testdata/simple_property_path_query.csv +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/tests/testdata/simple_query.csv +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/tests/testdata/stringfuncs.csv +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/py_maplib/tests/testdata/templates.ttl +0 -0
- {maplib-0.19.5 → maplib-0.19.10}/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.10"
|
|
2455
2456
|
dependencies = [
|
|
2456
2457
|
"chrono",
|
|
2457
2458
|
"cimxml",
|
|
@@ -3171,15 +3172,15 @@ dependencies = [
|
|
|
3171
3172
|
|
|
3172
3173
|
[[package]]
|
|
3173
3174
|
name = "serde_json"
|
|
3174
|
-
version = "1.0.
|
|
3175
|
+
version = "1.0.149"
|
|
3175
3176
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3176
|
-
checksum = "
|
|
3177
|
+
checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86"
|
|
3177
3178
|
dependencies = [
|
|
3178
3179
|
"itoa",
|
|
3179
3180
|
"memchr",
|
|
3180
|
-
"ryu",
|
|
3181
3181
|
"serde",
|
|
3182
3182
|
"serde_core",
|
|
3183
|
+
"zmij",
|
|
3183
3184
|
]
|
|
3184
3185
|
|
|
3185
3186
|
[[package]]
|
|
@@ -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",
|
|
@@ -3808,6 +3809,8 @@ dependencies = [
|
|
|
3808
3809
|
"rayon",
|
|
3809
3810
|
"representation",
|
|
3810
3811
|
"ryu",
|
|
3812
|
+
"serde_json",
|
|
3813
|
+
"simd-json",
|
|
3811
3814
|
"sparesults",
|
|
3812
3815
|
"spargebra",
|
|
3813
3816
|
"sprs",
|
|
@@ -4494,6 +4497,12 @@ version = "0.5.2"
|
|
|
4494
4497
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
4495
4498
|
checksum = "2f06ae92f42f5e5c42443fd094f245eb656abf56dd7cce9b8b263236565e00f2"
|
|
4496
4499
|
|
|
4500
|
+
[[package]]
|
|
4501
|
+
name = "zmij"
|
|
4502
|
+
version = "1.0.16"
|
|
4503
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
4504
|
+
checksum = "dfcd145825aace48cff44a8844de64bf75feec3080e0aa5cdbde72961ae51a65"
|
|
4505
|
+
|
|
4497
4506
|
[[package]]
|
|
4498
4507
|
name = "zstd"
|
|
4499
4508
|
version = "0.13.3"
|
|
@@ -32,6 +32,9 @@ fundu = "2.0.1"
|
|
|
32
32
|
memmap2 = "0.9.5"
|
|
33
33
|
sprs = "0.11.3"
|
|
34
34
|
walkdir = "2.5.0"
|
|
35
|
+
aho-corasick = "1.1.4"
|
|
36
|
+
simd-json = { version = "0.17.0", features = ["serde_json"] }
|
|
37
|
+
serde_json = {version = "1.0.149"}
|
|
35
38
|
|
|
36
39
|
tracing = { version = "0.1", features = [ "log" ] }
|
|
37
40
|
tracing-subscriber = { version = "0.3.19", features = [ "env-filter" ] }
|
|
@@ -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 }
|
|
@@ -11,6 +11,7 @@ use polars::prelude::{
|
|
|
11
11
|
by_name, col, lit, Column, DataFrame, DataType, Expr, IntoColumn, IntoLazy, LazyFrame,
|
|
12
12
|
NamedFrom, Series,
|
|
13
13
|
};
|
|
14
|
+
use query_processing::expressions::non_multi_col_is_null_workaround;
|
|
14
15
|
use rayon::iter::{IndexedParallelIterator, ParallelDrainRange, ParallelIterator};
|
|
15
16
|
use representation::constants::OTTR_TRIPLE;
|
|
16
17
|
use representation::dataset::NamedGraph;
|
|
@@ -31,7 +32,6 @@ 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,40 @@ 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(
|
|
295
|
+
non_multi_col_is_null_workaround(col(SUBJECT_COL_NAME), &subject_type)
|
|
296
|
+
.not(),
|
|
297
|
+
)
|
|
298
|
+
}
|
|
299
|
+
if object_multi {
|
|
300
|
+
lf = lf.filter(
|
|
301
|
+
non_multi_col_is_null_workaround(col(OBJECT_COL_NAME), &object_type)
|
|
302
|
+
.not(),
|
|
303
|
+
)
|
|
304
|
+
}
|
|
305
|
+
df = lf.collect().unwrap();
|
|
306
|
+
}
|
|
288
307
|
let predicate_state = if predicate.is_none() {
|
|
289
|
-
let (_, s) =
|
|
308
|
+
let (_, s) = part_types
|
|
290
309
|
.remove(PREDICATE_COL_NAME)
|
|
291
310
|
.unwrap()
|
|
292
311
|
.map
|
|
@@ -15,6 +15,7 @@ use representation::solution_mapping::EagerSolutionMappings;
|
|
|
15
15
|
use representation::RDFNodeState;
|
|
16
16
|
use shacl::{validate, ValidationReport};
|
|
17
17
|
use std::collections::HashMap;
|
|
18
|
+
use std::fs;
|
|
18
19
|
use std::io::Write;
|
|
19
20
|
use std::path::Path;
|
|
20
21
|
use templates::ast::{ConstantTermOrList, PType, Template};
|
|
@@ -29,6 +30,7 @@ use datalog::ast::DatalogRuleset;
|
|
|
29
30
|
use representation::dataset::NamedGraph;
|
|
30
31
|
use representation::prefixes::get_default_prefixes;
|
|
31
32
|
use tracing::instrument;
|
|
33
|
+
use triplestore::errors::TriplestoreError;
|
|
32
34
|
|
|
33
35
|
pub struct Model {
|
|
34
36
|
pub template_dataset: TemplateDataset,
|
|
@@ -167,6 +169,37 @@ impl Model {
|
|
|
167
169
|
Ok(return_template_iri)
|
|
168
170
|
}
|
|
169
171
|
|
|
172
|
+
#[instrument(skip_all)]
|
|
173
|
+
pub fn map_json_path(
|
|
174
|
+
&mut self,
|
|
175
|
+
path: &Path,
|
|
176
|
+
prefix: &NamedNode,
|
|
177
|
+
graph: &NamedGraph,
|
|
178
|
+
transient: bool,
|
|
179
|
+
) -> Result<(), MaplibError> {
|
|
180
|
+
let mut u8s =
|
|
181
|
+
fs::read(path).map_err(|x| TriplestoreError::ReadJSONFileError(x.to_string()))?;
|
|
182
|
+
|
|
183
|
+
self.triplestore
|
|
184
|
+
.map_json(&mut u8s, prefix, graph, transient)
|
|
185
|
+
.map_err(MaplibError::TriplestoreError)
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
#[instrument(skip_all)]
|
|
189
|
+
pub fn map_json_string(
|
|
190
|
+
&mut self,
|
|
191
|
+
mut p: String,
|
|
192
|
+
prefix: &NamedNode,
|
|
193
|
+
graph: &NamedGraph,
|
|
194
|
+
transient: bool,
|
|
195
|
+
) -> Result<(), MaplibError> {
|
|
196
|
+
//Safety: we are never reading this vec back to a string
|
|
197
|
+
let u8s = unsafe { p.as_mut_vec() };
|
|
198
|
+
self.triplestore
|
|
199
|
+
.map_json(u8s, prefix, graph, transient)
|
|
200
|
+
.map_err(MaplibError::TriplestoreError)
|
|
201
|
+
}
|
|
202
|
+
|
|
170
203
|
#[allow(clippy::too_many_arguments)]
|
|
171
204
|
#[instrument(skip_all)]
|
|
172
205
|
pub fn read_triples(
|
|
@@ -313,9 +346,14 @@ impl Model {
|
|
|
313
346
|
buffer: &mut W,
|
|
314
347
|
graph: &NamedGraph,
|
|
315
348
|
rdf_format: RdfFormat,
|
|
349
|
+
prefixes: Option<&HashMap<String, NamedNode>>,
|
|
316
350
|
) -> Result<(), MaplibError> {
|
|
351
|
+
let mut use_prefixes = self.prefixes.clone();
|
|
352
|
+
if let Some(prefixes) = prefixes {
|
|
353
|
+
use_prefixes.extend(prefixes.clone());
|
|
354
|
+
}
|
|
317
355
|
self.triplestore
|
|
318
|
-
.write_triples(buffer, rdf_format, graph)
|
|
356
|
+
.write_triples(buffer, rdf_format, graph, &use_prefixes)
|
|
319
357
|
.map_err(MaplibError::TriplestoreError)?;
|
|
320
358
|
Ok(())
|
|
321
359
|
}
|
|
@@ -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 {
|
|
@@ -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,
|
|
@@ -196,7 +196,11 @@ 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(
|
|
199
|
+
literal_type(
|
|
200
|
+
l.as_ref(),
|
|
201
|
+
&BaseCatState::CategoricalNative(false, None),
|
|
202
|
+
false,
|
|
203
|
+
)
|
|
200
204
|
} else {
|
|
201
205
|
unreachable!("Should never happen")
|
|
202
206
|
}
|
|
@@ -225,8 +229,9 @@ fn literal_type(
|
|
|
225
229
|
DataType::Struct(polars_lang_fields(base_cat_state))
|
|
226
230
|
} else {
|
|
227
231
|
match base_cat_state {
|
|
228
|
-
BaseCatState::
|
|
229
|
-
|
|
232
|
+
BaseCatState::String
|
|
233
|
+
| BaseCatState::NonString
|
|
234
|
+
| BaseCatState::CategoricalNative(..) => DataType::String,
|
|
230
235
|
}
|
|
231
236
|
}
|
|
232
237
|
}
|
|
@@ -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,44 @@ 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
|
|
27
|
+
.mappings
|
|
26
28
|
.column(c)
|
|
27
29
|
.unwrap()
|
|
28
30
|
.struct_()
|
|
29
31
|
.unwrap()
|
|
30
|
-
.field_by_name(
|
|
32
|
+
.field_by_name(LANG_STRING_VALUE_FIELD)
|
|
33
|
+
.unwrap();
|
|
34
|
+
sers.push(ser1);
|
|
35
|
+
let ser2 = sm
|
|
36
|
+
.mappings
|
|
37
|
+
.column(c)
|
|
38
|
+
.unwrap()
|
|
39
|
+
.struct_()
|
|
40
|
+
.unwrap()
|
|
41
|
+
.field_by_name(LANG_STRING_LANG_FIELD)
|
|
42
|
+
.unwrap();
|
|
43
|
+
sers.push(ser2);
|
|
44
|
+
} else if t.is_multi() {
|
|
45
|
+
let ser = sm
|
|
46
|
+
.mappings
|
|
47
|
+
.column(c)
|
|
31
48
|
.unwrap()
|
|
49
|
+
.struct_()
|
|
50
|
+
.unwrap()
|
|
51
|
+
.field_by_name(&bt.field_col_name())
|
|
52
|
+
.unwrap();
|
|
53
|
+
sers.push(ser);
|
|
32
54
|
} else {
|
|
33
|
-
sm
|
|
55
|
+
let ser = sm
|
|
56
|
+
.mappings
|
|
34
57
|
.column(c)
|
|
35
58
|
.unwrap()
|
|
36
59
|
.as_materialized_series()
|
|
37
|
-
.clone()
|
|
60
|
+
.clone();
|
|
61
|
+
sers.push(ser);
|
|
38
62
|
};
|
|
39
63
|
if !s.contains_key(bt) {
|
|
40
64
|
s.insert(bt.clone(), HashSet::new());
|
|
@@ -48,16 +72,18 @@ impl Cats {
|
|
|
48
72
|
None
|
|
49
73
|
};
|
|
50
74
|
let ss = s.get_mut(bt).unwrap();
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
75
|
+
for ser in sers {
|
|
76
|
+
let new_ss = ser
|
|
77
|
+
.u32()
|
|
78
|
+
.unwrap()
|
|
79
|
+
.into_iter()
|
|
80
|
+
.filter(|x| x.is_some())
|
|
81
|
+
.map(|x| x.unwrap());
|
|
82
|
+
if let Some(local_rev_map) = local_rev_map {
|
|
83
|
+
ss.extend(new_ss.filter(|x| !local_rev_map.maps.contains_u32(x)));
|
|
84
|
+
} else {
|
|
85
|
+
ss.extend(new_ss);
|
|
86
|
+
}
|
|
61
87
|
}
|
|
62
88
|
}
|
|
63
89
|
}
|