prograph 1.3.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- prograph-1.3.3/LICENSE +201 -0
- prograph-1.3.3/NOTICE +10 -0
- prograph-1.3.3/PKG-INFO +281 -0
- prograph-1.3.3/README.md +156 -0
- prograph-1.3.3/prograph/__init__.py +36 -0
- prograph-1.3.3/prograph/__main__.py +5 -0
- prograph-1.3.3/prograph/_version.py +375 -0
- prograph-1.3.3/prograph/cli/__init__.py +1 -0
- prograph-1.3.3/prograph/cli/_iri_utils.py +124 -0
- prograph-1.3.3/prograph/cli/emit_genie_space.py +107 -0
- prograph-1.3.3/prograph/cli/generate_views.py +140 -0
- prograph-1.3.3/prograph/cli/main.py +420 -0
- prograph-1.3.3/prograph/cli/schema_inferrer.py +746 -0
- prograph-1.3.3/prograph/cli/ttl_loader.py +289 -0
- prograph-1.3.3/prograph/cli/upload_genie_space.py +84 -0
- prograph-1.3.3/prograph/config/__init__.py +27 -0
- prograph-1.3.3/prograph/config/yaml_config.py +848 -0
- prograph-1.3.3/prograph/demos/__init__.py +14 -0
- prograph-1.3.3/prograph/demos/turbofan/README.md +74 -0
- prograph-1.3.3/prograph/demos/turbofan/SCENARIO.md +209 -0
- prograph-1.3.3/prograph/demos/turbofan/__init__.py +75 -0
- prograph-1.3.3/prograph/demos/turbofan/create_tables.sql +206 -0
- prograph-1.3.3/prograph/demos/turbofan/data/engine-instances.ttl +1123 -0
- prograph-1.3.3/prograph/demos/turbofan/data/sensor-timeseries.csv +90 -0
- prograph-1.3.3/prograph/demos/turbofan/demo.py +162 -0
- prograph-1.3.3/prograph/demos/turbofan/genie_qa_notebook.py +434 -0
- prograph-1.3.3/prograph/demos/turbofan/graph.yaml +1098 -0
- prograph-1.3.3/prograph/demos/turbofan/instance_graph_demo.py +32 -0
- prograph-1.3.3/prograph/demos/turbofan/load.py +223 -0
- prograph-1.3.3/prograph/demos/turbofan/mapping.r2rml.ttl +991 -0
- prograph-1.3.3/prograph/demos/turbofan/ontology/engine-maintenance.ttl +606 -0
- prograph-1.3.3/prograph/demos/turbofan/payload-shapes.ttl +33 -0
- prograph-1.3.3/prograph/demos/turbofan/queries/example-queries.sparql +215 -0
- prograph-1.3.3/prograph/demos/turbofan/shapes.ttl +75 -0
- prograph-1.3.3/prograph/demos/turbofan/tables.py +106 -0
- prograph-1.3.3/prograph/demos/turbofan/turbofan_schema.py +393 -0
- prograph-1.3.3/prograph/demos/turbofan/validation_demo.py +153 -0
- prograph-1.3.3/prograph/describe.py +231 -0
- prograph-1.3.3/prograph/endpoint/__init__.py +12 -0
- prograph-1.3.3/prograph/endpoint/app.py +722 -0
- prograph-1.3.3/prograph/endpoint/cli.py +280 -0
- prograph-1.3.3/prograph/endpoint/credentials.py +240 -0
- prograph-1.3.3/prograph/endpoint/engines.py +418 -0
- prograph-1.3.3/prograph/endpoint/negotiate.py +101 -0
- prograph-1.3.3/prograph/endpoint/results.py +181 -0
- prograph-1.3.3/prograph/endpoint/service.py +31 -0
- prograph-1.3.3/prograph/engine.py +2718 -0
- prograph-1.3.3/prograph/execution.py +455 -0
- prograph-1.3.3/prograph/executors/__init__.py +6 -0
- prograph-1.3.3/prograph/executors/base.py +11 -0
- prograph-1.3.3/prograph/executors/databricks_sql_executor.py +51 -0
- prograph-1.3.3/prograph/executors/duckdb_executor.py +24 -0
- prograph-1.3.3/prograph/executors/mysql_executor.py +20 -0
- prograph-1.3.3/prograph/executors/oracle_executor.py +24 -0
- prograph-1.3.3/prograph/executors/pandas_executor.py +72 -0
- prograph-1.3.3/prograph/executors/postgresql_executor.py +35 -0
- prograph-1.3.3/prograph/executors/spark_executor.py +88 -0
- prograph-1.3.3/prograph/executors/sqlserver_executor.py +35 -0
- prograph-1.3.3/prograph/extras/__init__.py +1 -0
- prograph-1.3.3/prograph/extras/graphql/__init__.py +33 -0
- prograph-1.3.3/prograph/extras/graphql/execute.py +25 -0
- prograph-1.3.3/prograph/extras/graphql/schema.py +314 -0
- prograph-1.3.3/prograph/extras/instance_graph.py +559 -0
- prograph-1.3.3/prograph/genie/__init__.py +83 -0
- prograph-1.3.3/prograph/genie/databricks_uploader.py +306 -0
- prograph-1.3.3/prograph/genie/deploy.py +393 -0
- prograph-1.3.3/prograph/genie/formats.py +414 -0
- prograph-1.3.3/prograph/genie/instruction_generator.py +375 -0
- prograph-1.3.3/prograph/genie/sample_query_generator.py +256 -0
- prograph-1.3.3/prograph/genie/shacl_views.py +318 -0
- prograph-1.3.3/prograph/genie/space_emitter.py +329 -0
- prograph-1.3.3/prograph/genie/view_generator.py +628 -0
- prograph-1.3.3/prograph/genie/view_writer.py +172 -0
- prograph-1.3.3/prograph/graph/__init__.py +1 -0
- prograph-1.3.3/prograph/graph/ansi_session.py +348 -0
- prograph-1.3.3/prograph/graph/databricks_sql_graph.py +300 -0
- prograph-1.3.3/prograph/graph/drivers.py +143 -0
- prograph-1.3.3/prograph/graph/duckdb_graph.py +68 -0
- prograph-1.3.3/prograph/graph/mysql_graph.py +38 -0
- prograph-1.3.3/prograph/graph/oracle_graph.py +285 -0
- prograph-1.3.3/prograph/graph/pandas_graph.py +343 -0
- prograph-1.3.3/prograph/graph/postgresql_graph.py +644 -0
- prograph-1.3.3/prograph/graph/spark_graph.py +556 -0
- prograph-1.3.3/prograph/graph/sql_graph.py +83 -0
- prograph-1.3.3/prograph/graph/sqlserver_graph.py +72 -0
- prograph-1.3.3/prograph/hints.py +95 -0
- prograph-1.3.3/prograph/logging.py +550 -0
- prograph-1.3.3/prograph/mcp/__init__.py +29 -0
- prograph-1.3.3/prograph/mcp/__main__.py +180 -0
- prograph-1.3.3/prograph/mcp/bootstrap.py +98 -0
- prograph-1.3.3/prograph/mcp/server.py +601 -0
- prograph-1.3.3/prograph/mcp/sparql.py +397 -0
- prograph-1.3.3/prograph/mcp/tools.py +504 -0
- prograph-1.3.3/prograph/nlp/__init__.py +79 -0
- prograph-1.3.3/prograph/nlp/client.py +305 -0
- prograph-1.3.3/prograph/nlp/databricks_tools.py +369 -0
- prograph-1.3.3/prograph/nlp/graph_context.py +313 -0
- prograph-1.3.3/prograph/nlp/interface.py +652 -0
- prograph-1.3.3/prograph/nlp/prompts/__init__.py +19 -0
- prograph-1.3.3/prograph/nlp/prompts/examples.py +258 -0
- prograph-1.3.3/prograph/nlp/prompts/system.py +239 -0
- prograph-1.3.3/prograph/nlp/providers/__init__.py +14 -0
- prograph-1.3.3/prograph/nlp/providers/anthropic.py +274 -0
- prograph-1.3.3/prograph/nlp/providers/databricks.py +312 -0
- prograph-1.3.3/prograph/nlp/providers/openai.py +203 -0
- prograph-1.3.3/prograph/nlp/schema_context.py +78 -0
- prograph-1.3.3/prograph/ontology/__init__.py +53 -0
- prograph-1.3.3/prograph/ontology/alignment.py +542 -0
- prograph-1.3.3/prograph/ontology/hierarchy.py +310 -0
- prograph-1.3.3/prograph/ontology/imports.py +587 -0
- prograph-1.3.3/prograph/ontology/layer.py +991 -0
- prograph-1.3.3/prograph/ontology/skos.py +61 -0
- prograph-1.3.3/prograph/owl/__init__.py +27 -0
- prograph-1.3.3/prograph/owl/defined_classes.py +323 -0
- prograph-1.3.3/prograph/parameters.py +242 -0
- prograph-1.3.3/prograph/parser/__init__.py +1 -0
- prograph-1.3.3/prograph/parser/cypher/CypherLexer.py +836 -0
- prograph-1.3.3/prograph/parser/cypher/CypherListener.py +966 -0
- prograph-1.3.3/prograph/parser/cypher/CypherParser.py +10854 -0
- prograph-1.3.3/prograph/parser/cypher/CypherVisitor.py +543 -0
- prograph-1.3.3/prograph/parser/cypher/__init__.py +1 -0
- prograph-1.3.3/prograph/parser/sparql/SparqlLexer.py +801 -0
- prograph-1.3.3/prograph/parser/sparql/SparqlParser.py +10146 -0
- prograph-1.3.3/prograph/parser/sparql/SparqlParserListener.py +1056 -0
- prograph-1.3.3/prograph/parser/sparql/SparqlParserVisitor.py +593 -0
- prograph-1.3.3/prograph/parser/sparql/__init__.py +8 -0
- prograph-1.3.3/prograph/plan/__init__.py +3 -0
- prograph-1.3.3/prograph/plan/ir/__init__.py +1 -0
- prograph-1.3.3/prograph/plan/ir/casts.py +338 -0
- prograph-1.3.3/prograph/plan/ir/consistency.py +397 -0
- prograph-1.3.3/prograph/plan/ir/construct.py +90 -0
- prograph-1.3.3/prograph/plan/ir/cost.py +234 -0
- prograph-1.3.3/prograph/plan/ir/cypher_answer.py +1081 -0
- prograph-1.3.3/prograph/plan/ir/cypher_apoc.py +717 -0
- prograph-1.3.3/prograph/plan/ir/cypher_apoc_convert.py +505 -0
- prograph-1.3.3/prograph/plan/ir/cypher_apoc_date.py +845 -0
- prograph-1.3.3/prograph/plan/ir/cypher_apoc_map.py +496 -0
- prograph-1.3.3/prograph/plan/ir/cypher_apoc_meta.py +384 -0
- prograph-1.3.3/prograph/plan/ir/cypher_apoc_path.py +597 -0
- prograph-1.3.3/prograph/plan/ir/cypher_apoc_procedures.py +163 -0
- prograph-1.3.3/prograph/plan/ir/cypher_apoc_text.py +785 -0
- prograph-1.3.3/prograph/plan/ir/cypher_front.py +5474 -0
- prograph-1.3.3/prograph/plan/ir/cypher_functions.py +565 -0
- prograph-1.3.3/prograph/plan/ir/cypher_lists.py +935 -0
- prograph-1.3.3/prograph/plan/ir/cypher_maps.py +370 -0
- prograph-1.3.3/prograph/plan/ir/cypher_mixed.py +604 -0
- prograph-1.3.3/prograph/plan/ir/cypher_ontology.py +226 -0
- prograph-1.3.3/prograph/plan/ir/cypher_procedures.py +191 -0
- prograph-1.3.3/prograph/plan/ir/cypher_runtime_errors.py +107 -0
- prograph-1.3.3/prograph/plan/ir/cypher_temporal.py +1357 -0
- prograph-1.3.3/prograph/plan/ir/cypher_temporal_arith.py +339 -0
- prograph-1.3.3/prograph/plan/ir/cypher_values.py +546 -0
- prograph-1.3.3/prograph/plan/ir/cypher_write.py +612 -0
- prograph-1.3.3/prograph/plan/ir/dataset.py +643 -0
- prograph-1.3.3/prograph/plan/ir/dates.py +102 -0
- prograph-1.3.3/prograph/plan/ir/entry.py +992 -0
- prograph-1.3.3/prograph/plan/ir/expr.py +260 -0
- prograph-1.3.3/prograph/plan/ir/facts.py +1171 -0
- prograph-1.3.3/prograph/plan/ir/fresh.py +291 -0
- prograph-1.3.3/prograph/plan/ir/freshness.py +625 -0
- prograph-1.3.3/prograph/plan/ir/identity.py +797 -0
- prograph-1.3.3/prograph/plan/ir/java_datetime.py +265 -0
- prograph-1.3.3/prograph/plan/ir/java_regex.py +391 -0
- prograph-1.3.3/prograph/plan/ir/join_order.py +39 -0
- prograph-1.3.3/prograph/plan/ir/key_checks.py +433 -0
- prograph-1.3.3/prograph/plan/ir/keys.py +454 -0
- prograph-1.3.3/prograph/plan/ir/lower.py +5323 -0
- prograph-1.3.3/prograph/plan/ir/ops.py +619 -0
- prograph-1.3.3/prograph/plan/ir/owl_rl.py +1119 -0
- prograph-1.3.3/prograph/plan/ir/owl_rl_rules.py +725 -0
- prograph-1.3.3/prograph/plan/ir/profiles.py +694 -0
- prograph-1.3.3/prograph/plan/ir/ql.py +987 -0
- prograph-1.3.3/prograph/plan/ir/rdfs.py +342 -0
- prograph-1.3.3/prograph/plan/ir/rewrite.py +1782 -0
- prograph-1.3.3/prograph/plan/ir/saturate.py +339 -0
- prograph-1.3.3/prograph/plan/ir/semantics.py +103 -0
- prograph-1.3.3/prograph/plan/ir/slot.py +509 -0
- prograph-1.3.3/prograph/plan/ir/sparql_front.py +3418 -0
- prograph-1.3.3/prograph/plan/ir/strings.py +534 -0
- prograph-1.3.3/prograph/plan/ir/term_functions.py +274 -0
- prograph-1.3.3/prograph/plan/ir/terms.py +84 -0
- prograph-1.3.3/prograph/plan/ir/xpath_regex.py +264 -0
- prograph-1.3.3/prograph/plan/run_record.py +65 -0
- prograph-1.3.3/prograph/plan/sql/__init__.py +21 -0
- prograph-1.3.3/prograph/plan/sql/dialect.py +3726 -0
- prograph-1.3.3/prograph/plan/sql/mysql_serializer.py +103 -0
- prograph-1.3.3/prograph/plan/sql/names.py +65 -0
- prograph-1.3.3/prograph/plan/sql/oracle_serializer.py +306 -0
- prograph-1.3.3/prograph/plan/sql/pg_serializer.py +501 -0
- prograph-1.3.3/prograph/plan/sql/rel_algebra.py +781 -0
- prograph-1.3.3/prograph/plan/sql/sql_serializer.py +1419 -0
- prograph-1.3.3/prograph/plan/sql/sqlserver_serializer.py +603 -0
- prograph-1.3.3/prograph/provenance.py +222 -0
- prograph-1.3.3/prograph/r2rml/__init__.py +48 -0
- prograph-1.3.3/prograph/r2rml/catalog.py +259 -0
- prograph-1.3.3/prograph/r2rml/compile.py +372 -0
- prograph-1.3.3/prograph/r2rml/direct.py +140 -0
- prograph-1.3.3/prograph/r2rml/export.py +495 -0
- prograph-1.3.3/prograph/r2rml/model.py +180 -0
- prograph-1.3.3/prograph/r2rml/parser.py +546 -0
- prograph-1.3.3/prograph/r2rml/schema.py +120 -0
- prograph-1.3.3/prograph/read_only.py +122 -0
- prograph-1.3.3/prograph/results.py +157 -0
- prograph-1.3.3/prograph/rules/__init__.py +168 -0
- prograph-1.3.3/prograph/rules/__main__.py +32 -0
- prograph-1.3.3/prograph/schema/__init__.py +60 -0
- prograph-1.3.3/prograph/schema/change_set.py +50 -0
- prograph-1.3.3/prograph/schema/collations.py +198 -0
- prograph-1.3.3/prograph/schema/compile_schema.py +388 -0
- prograph-1.3.3/prograph/schema/context.py +845 -0
- prograph-1.3.3/prograph/schema/examples.py +234 -0
- prograph-1.3.3/prograph/schema/iri.py +817 -0
- prograph-1.3.3/prograph/schema/literals.py +94 -0
- prograph-1.3.3/prograph/schema/lpg_view.py +617 -0
- prograph-1.3.3/prograph/schema/mapping.py +1803 -0
- prograph-1.3.3/prograph/schema/maps_schema.py +40 -0
- prograph-1.3.3/prograph/schema/naming.py +77 -0
- prograph-1.3.3/prograph/schema/query_sources.py +59 -0
- prograph-1.3.3/prograph/schema/rows.py +215 -0
- prograph-1.3.3/prograph/schema/source_map.py +1103 -0
- prograph-1.3.3/prograph/schema/store_view.py +459 -0
- prograph-1.3.3/prograph/schema/types.py +569 -0
- prograph-1.3.3/prograph/schema/xsd.py +569 -0
- prograph-1.3.3/prograph/shacl/__init__.py +30 -0
- prograph-1.3.3/prograph/shacl/dqv.py +58 -0
- prograph-1.3.3/prograph/shacl/generate.py +255 -0
- prograph-1.3.3/prograph/shacl/report.py +138 -0
- prograph-1.3.3/prograph/shacl/validator.py +164 -0
- prograph-1.3.3/prograph/store.py +1737 -0
- prograph-1.3.3/prograph/utils/__init__.py +6 -0
- prograph-1.3.3/prograph/utils/exceptions.py +308 -0
- prograph-1.3.3/prograph/utils/helpers.py +126 -0
- prograph-1.3.3/prograph/warnings.py +46 -0
- prograph-1.3.3/prograph/writes.py +369 -0
- prograph-1.3.3/prograph.egg-info/PKG-INFO +281 -0
- prograph-1.3.3/prograph.egg-info/SOURCES.txt +273 -0
- prograph-1.3.3/prograph.egg-info/dependency_links.txt +1 -0
- prograph-1.3.3/prograph.egg-info/entry_points.txt +3 -0
- prograph-1.3.3/prograph.egg-info/requires.txt +124 -0
- prograph-1.3.3/prograph.egg-info/top_level.txt +1 -0
- prograph-1.3.3/pyproject.toml +251 -0
- prograph-1.3.3/setup.cfg +4 -0
- prograph-1.3.3/tests/test_arrow_batches.py +123 -0
- prograph-1.3.3/tests/test_arrow_results.py +187 -0
- prograph-1.3.3/tests/test_batches_stream.py +99 -0
- prograph-1.3.3/tests/test_changelog_headings.py +20 -0
- prograph-1.3.3/tests/test_columns_with_no_natural_datatype.py +56 -0
- prograph-1.3.3/tests/test_concurrent_engine.py +56 -0
- prograph-1.3.3/tests/test_databricks_async_statement.py +143 -0
- prograph-1.3.3/tests/test_databricks_batches.py +42 -0
- prograph-1.3.3/tests/test_databricks_empty_answer.py +195 -0
- prograph-1.3.3/tests/test_docs_configuration.py +45 -0
- prograph-1.3.3/tests/test_docs_examples.py +312 -0
- prograph-1.3.3/tests/test_docs_links.py +90 -0
- prograph-1.3.3/tests/test_docs_llms.py +33 -0
- prograph-1.3.3/tests/test_docs_w3c_counts.py +148 -0
- prograph-1.3.3/tests/test_never_run_44b.py +819 -0
- prograph-1.3.3/tests/test_never_run_44b_ontology.py +556 -0
- prograph-1.3.3/tests/test_ontology_report.py +242 -0
- prograph-1.3.3/tests/test_owned_store.py +147 -0
- prograph-1.3.3/tests/test_pinned_versions.py +77 -0
- prograph-1.3.3/tests/test_query_cancel.py +322 -0
- prograph-1.3.3/tests/test_result_invariants.py +76 -0
- prograph-1.3.3/tests/test_return_type.py +155 -0
- prograph-1.3.3/tests/test_row_reading.py +45 -0
- prograph-1.3.3/tests/test_saturation_report.py +102 -0
- prograph-1.3.3/tests/test_schema_update.py +514 -0
- prograph-1.3.3/tests/test_source_not_readable.py +80 -0
- prograph-1.3.3/tests/test_spark_settings_unreadable.py +125 -0
- prograph-1.3.3/tests/test_spark_string_literals.py +34 -0
- prograph-1.3.3/tests/test_sql_contract.py +622 -0
- prograph-1.3.3/tests/test_sql_contract_databricks_text.py +42 -0
- prograph-1.3.3/tests/test_sql_contract_databricks_text_cypher.py +29 -0
- prograph-1.3.3/tests/test_unsupported_languages.py +51 -0
- prograph-1.3.3/tests/test_warehouse_round_trips.py +171 -0
prograph-1.3.3/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 Brice Giesbrecht
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
prograph-1.3.3/NOTICE
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
ProGraph
|
|
2
|
+
Copyright 2026 Brice Giesbrecht
|
|
3
|
+
|
|
4
|
+
This product includes software developed by Brice Giesbrecht.
|
|
5
|
+
|
|
6
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
you may not use this file except in compliance with the License.
|
|
8
|
+
You may obtain a copy of the License at
|
|
9
|
+
|
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
prograph-1.3.3/PKG-INFO
ADDED
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: prograph
|
|
3
|
+
Version: 1.3.3
|
|
4
|
+
Summary: A multi-language graph query engine for Python with multiple execution backends
|
|
5
|
+
License-Expression: Apache-2.0
|
|
6
|
+
Project-URL: Homepage, https://gitlab.com/briceg/prograph
|
|
7
|
+
Project-URL: Documentation, https://gitlab.com/briceg/prograph/-/blob/stable/1.3/docs/README.md
|
|
8
|
+
Project-URL: Source, https://gitlab.com/briceg/prograph
|
|
9
|
+
Project-URL: Issues, https://gitlab.com/briceg/prograph/-/issues
|
|
10
|
+
Project-URL: Changelog, https://gitlab.com/briceg/prograph/-/blob/stable/1.3/docs/changelog.md
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Topic :: Database
|
|
18
|
+
Requires-Python: >=3.11
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
License-File: LICENSE
|
|
21
|
+
License-File: NOTICE
|
|
22
|
+
Requires-Dist: antlr4-python3-runtime>=4.13.0
|
|
23
|
+
Requires-Dist: structlog>=24.0.0
|
|
24
|
+
Requires-Dist: pyyaml>=6.0.0
|
|
25
|
+
Requires-Dist: pyarrow>=20
|
|
26
|
+
Requires-Dist: rdflib>=7.0.0
|
|
27
|
+
Provides-Extra: dev
|
|
28
|
+
Requires-Dist: pytest==9.0.3; extra == "dev"
|
|
29
|
+
Requires-Dist: pytest-bdd==8.1.0; extra == "dev"
|
|
30
|
+
Requires-Dist: pytest-cov==7.1.0; extra == "dev"
|
|
31
|
+
Requires-Dist: pytest-xdist==3.8.0; extra == "dev"
|
|
32
|
+
Requires-Dist: duckdb==1.5.6; extra == "dev"
|
|
33
|
+
Requires-Dist: pyarrow==24.0.0; extra == "dev"
|
|
34
|
+
Requires-Dist: pandas==2.3.3; extra == "dev"
|
|
35
|
+
Requires-Dist: pyspark==4.1.3; extra == "dev"
|
|
36
|
+
Requires-Dist: numpy==2.4.5; extra == "dev"
|
|
37
|
+
Requires-Dist: mcp==1.27.1; extra == "dev"
|
|
38
|
+
Requires-Dist: rdflib==7.6.0; extra == "dev"
|
|
39
|
+
Requires-Dist: pyoxigraph==0.5.13; extra == "dev"
|
|
40
|
+
Requires-Dist: pyshacl==0.31.0; extra == "dev"
|
|
41
|
+
Requires-Dist: owlrl==7.1.4; extra == "dev"
|
|
42
|
+
Requires-Dist: antlr4-python3-runtime==4.13.2; extra == "dev"
|
|
43
|
+
Requires-Dist: structlog==25.5.0; extra == "dev"
|
|
44
|
+
Requires-Dist: pyyaml==6.0.3; extra == "dev"
|
|
45
|
+
Requires-Dist: adbc-driver-postgresql==1.12.0; extra == "dev"
|
|
46
|
+
Requires-Dist: adbc-driver-manager==1.12.0; extra == "dev"
|
|
47
|
+
Requires-Dist: oracledb==26.0.1; extra == "dev"
|
|
48
|
+
Requires-Dist: pyodbc==5.3.0; extra == "dev"
|
|
49
|
+
Requires-Dist: mysql-connector-python==9.7.0; extra == "dev"
|
|
50
|
+
Requires-Dist: databricks-sql-connector==4.2.6; extra == "dev"
|
|
51
|
+
Requires-Dist: graphql-core==3.2.13; extra == "dev"
|
|
52
|
+
Requires-Dist: black>=23.0.0; extra == "dev"
|
|
53
|
+
Requires-Dist: isort>=5.12.0; extra == "dev"
|
|
54
|
+
Requires-Dist: mypy>=1.0.0; extra == "dev"
|
|
55
|
+
Requires-Dist: flake8>=6.0.0; extra == "dev"
|
|
56
|
+
Requires-Dist: sqlglot==28.7.0; extra == "dev"
|
|
57
|
+
Requires-Dist: fastapi==0.136.1; extra == "dev"
|
|
58
|
+
Requires-Dist: uvicorn==0.47.0; extra == "dev"
|
|
59
|
+
Requires-Dist: python-multipart==0.0.29; extra == "dev"
|
|
60
|
+
Requires-Dist: httpx==0.28.1; extra == "dev"
|
|
61
|
+
Provides-Extra: pandas
|
|
62
|
+
Requires-Dist: pandas<3,>=2.0.0; extra == "pandas"
|
|
63
|
+
Provides-Extra: duckdb
|
|
64
|
+
Requires-Dist: duckdb<3,>=1.5.3; extra == "duckdb"
|
|
65
|
+
Requires-Dist: pandas<3,>=2.0.0; extra == "duckdb"
|
|
66
|
+
Provides-Extra: postgresql
|
|
67
|
+
Requires-Dist: adbc-driver-postgresql>=1.12; extra == "postgresql"
|
|
68
|
+
Provides-Extra: oracle
|
|
69
|
+
Requires-Dist: oracledb>=26.0.1; extra == "oracle"
|
|
70
|
+
Provides-Extra: spark
|
|
71
|
+
Requires-Dist: pyspark>=4.1.0; extra == "spark"
|
|
72
|
+
Provides-Extra: ontology
|
|
73
|
+
Provides-Extra: shacl
|
|
74
|
+
Requires-Dist: pyshacl>=0.31.0; extra == "shacl"
|
|
75
|
+
Provides-Extra: r2rml
|
|
76
|
+
Provides-Extra: logging
|
|
77
|
+
Requires-Dist: structlog>=24.0.0; extra == "logging"
|
|
78
|
+
Provides-Extra: nlp
|
|
79
|
+
Requires-Dist: openai>=1.0.0; extra == "nlp"
|
|
80
|
+
Provides-Extra: nlp-databricks
|
|
81
|
+
Requires-Dist: openai>=1.0.0; extra == "nlp-databricks"
|
|
82
|
+
Requires-Dist: databricks-sdk>=0.20.0; extra == "nlp-databricks"
|
|
83
|
+
Provides-Extra: nlp-langchain
|
|
84
|
+
Requires-Dist: openai>=1.0.0; extra == "nlp-langchain"
|
|
85
|
+
Requires-Dist: databricks-langchain>=0.1.0; extra == "nlp-langchain"
|
|
86
|
+
Requires-Dist: langchain>=0.1.0; extra == "nlp-langchain"
|
|
87
|
+
Provides-Extra: ui
|
|
88
|
+
Requires-Dist: fastapi>=0.109.0; extra == "ui"
|
|
89
|
+
Requires-Dist: jinja2>=3.1.0; extra == "ui"
|
|
90
|
+
Requires-Dist: uvicorn>=0.27.0; extra == "ui"
|
|
91
|
+
Requires-Dist: python-multipart>=0.0.6; extra == "ui"
|
|
92
|
+
Provides-Extra: endpoint
|
|
93
|
+
Requires-Dist: fastapi>=0.109.0; extra == "endpoint"
|
|
94
|
+
Requires-Dist: uvicorn>=0.27.0; extra == "endpoint"
|
|
95
|
+
Requires-Dist: python-multipart>=0.0.6; extra == "endpoint"
|
|
96
|
+
Requires-Dist: duckdb<3,>=1.5.3; extra == "endpoint"
|
|
97
|
+
Requires-Dist: pandas<3,>=2.0.0; extra == "endpoint"
|
|
98
|
+
Provides-Extra: databricks
|
|
99
|
+
Requires-Dist: databricks-sql-connector>=4.9; extra == "databricks"
|
|
100
|
+
Requires-Dist: databricks-sdk>=0.40.0; extra == "databricks"
|
|
101
|
+
Provides-Extra: databricks-rt
|
|
102
|
+
Requires-Dist: databricks-sql-connector[kernel]>=4.9.0; extra == "databricks-rt"
|
|
103
|
+
Requires-Dist: databricks-sdk>=0.40.0; extra == "databricks-rt"
|
|
104
|
+
Provides-Extra: cli
|
|
105
|
+
Requires-Dist: pandas<3,>=2.0.0; extra == "cli"
|
|
106
|
+
Provides-Extra: graphql
|
|
107
|
+
Requires-Dist: graphql-core<3.3,>=3.2; extra == "graphql"
|
|
108
|
+
Provides-Extra: mcp
|
|
109
|
+
Requires-Dist: mcp<2,>=1.27; extra == "mcp"
|
|
110
|
+
Requires-Dist: duckdb<3,>=1.5.3; extra == "mcp"
|
|
111
|
+
Requires-Dist: pandas<3,>=2.0.0; extra == "mcp"
|
|
112
|
+
Requires-Dist: openai>=1.0.0; extra == "mcp"
|
|
113
|
+
Provides-Extra: genie
|
|
114
|
+
Requires-Dist: databricks-sdk>=0.40.0; extra == "genie"
|
|
115
|
+
Requires-Dist: databricks-sql-connector>=3.0.0; extra == "genie"
|
|
116
|
+
Requires-Dist: rdflib>=7.0.0; extra == "genie"
|
|
117
|
+
Requires-Dist: pandas<3,>=2.0.0; extra == "genie"
|
|
118
|
+
Requires-Dist: pyyaml>=6.0; extra == "genie"
|
|
119
|
+
Provides-Extra: test-sql
|
|
120
|
+
Requires-Dist: adbc-driver-postgresql>=1.12; extra == "test-sql"
|
|
121
|
+
Requires-Dist: mysql-connector-python>=8.0; extra == "test-sql"
|
|
122
|
+
Requires-Dist: oracledb>=26.0.1; extra == "test-sql"
|
|
123
|
+
Requires-Dist: pyodbc>=5.0; extra == "test-sql"
|
|
124
|
+
Dynamic: license-file
|
|
125
|
+
|
|
126
|
+
# ProGraph
|
|
127
|
+
|
|
128
|
+
ProGraph answers SPARQL 1.1 queries over tables you already have. You give it
|
|
129
|
+
a mapping (R2RML or YAML) from tables to RDF terms; each query is translated
|
|
130
|
+
to one SQL statement that your database runs. Nothing is copied or loaded:
|
|
131
|
+
the data stays where it is, and ProGraph does not write to your tables.
|
|
132
|
+
|
|
133
|
+
## Install
|
|
134
|
+
|
|
135
|
+
Python 3.11 or later:
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
pip install "prograph[duckdb]"
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Extras, from `pyproject.toml`; install the ones you use.
|
|
142
|
+
|
|
143
|
+
| Extra | Adds |
|
|
144
|
+
|---|---|
|
|
145
|
+
| `duckdb` | DuckDB and pandas: the default engine over DataFrames, and DuckDB databases |
|
|
146
|
+
| `pandas` | pandas 2 |
|
|
147
|
+
| `postgresql` | the ADBC PostgreSQL driver |
|
|
148
|
+
| `oracle` | `oracledb` |
|
|
149
|
+
| `spark` | PySpark 4.1 or later |
|
|
150
|
+
| `databricks` | the Databricks SQL connector and SDK |
|
|
151
|
+
| `databricks-rt` | the connector's kernel path, for Lakehouse RT warehouses |
|
|
152
|
+
| `shacl` | pyshacl, for `engine.validate_shapes()` |
|
|
153
|
+
| `endpoint` | the SPARQL Protocol server, `prograph serve` |
|
|
154
|
+
| `mcp` | the MCP server and the model client its `ask` tool uses |
|
|
155
|
+
| `cli` | `prograph load-ttl` and `prograph infer-schema` |
|
|
156
|
+
| `nlp`, `nlp-databricks`, `nlp-langchain` | the natural-language interface |
|
|
157
|
+
| `genie` | the Databricks Genie integration |
|
|
158
|
+
| `logging`, `ui`, `graphql` | structlog; the web UI; GraphQL (experimental) |
|
|
159
|
+
|
|
160
|
+
MySQL and SQL Server have no extra: install `mysql-connector-python` or
|
|
161
|
+
`pyodbc` yourself (SQL Server also needs the ODBC Driver 18).
|
|
162
|
+
|
|
163
|
+
## Quickstart
|
|
164
|
+
|
|
165
|
+
A DuckDB table, a YAML mapping and one query:
|
|
166
|
+
|
|
167
|
+
```python
|
|
168
|
+
import duckdb
|
|
169
|
+
from prograph import ProGraph
|
|
170
|
+
from prograph.config import load_config
|
|
171
|
+
|
|
172
|
+
con = duckdb.connect()
|
|
173
|
+
con.execute("CREATE TABLE people (id INTEGER, name VARCHAR, age INTEGER)")
|
|
174
|
+
con.execute("INSERT INTO people VALUES (1, 'Alice', 30), (2, 'Bob', 25)")
|
|
175
|
+
|
|
176
|
+
open("graph.yaml", "w").write("""
|
|
177
|
+
version: "1.0"
|
|
178
|
+
graph: {name: people}
|
|
179
|
+
sources:
|
|
180
|
+
people: {table: people}
|
|
181
|
+
nodes:
|
|
182
|
+
- label: Person
|
|
183
|
+
source: people
|
|
184
|
+
id_column: id
|
|
185
|
+
iri_template: "http://example.org/person/{id}"
|
|
186
|
+
class_iri: "http://example.org/Person"
|
|
187
|
+
properties: {name: name, age: age}
|
|
188
|
+
rdf: {vocab_iri: "http://example.org/", auto_generate: true}
|
|
189
|
+
""")
|
|
190
|
+
engine = ProGraph(schema=load_config("graph.yaml").to_schema(), connection=con)
|
|
191
|
+
|
|
192
|
+
engine.execute("""
|
|
193
|
+
PREFIX ex: <http://example.org/>
|
|
194
|
+
SELECT ?name ?age WHERE { ?p a ex:Person ; ex:name ?name ; ex:age ?age . FILTER(?age > 26) }
|
|
195
|
+
""", language="sparql", return_type="list")
|
|
196
|
+
# [{'name': 'Alice', 'age': 30}]
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
`ProGraph.from_r2rml(path, connection=con)` reads an R2RML mapping instead.
|
|
200
|
+
More: [quickstart](https://gitlab.com/briceg/prograph/-/blob/stable/1.3/docs/sparql/quickstart.md), [map your tables](https://gitlab.com/briceg/prograph/-/blob/stable/1.3/docs/sparql/mapping.md),
|
|
201
|
+
[R2RML tutorial](https://gitlab.com/briceg/prograph/-/blob/stable/1.3/docs/start/r2rml-tutorial.md).
|
|
202
|
+
|
|
203
|
+
## Reasoning
|
|
204
|
+
|
|
205
|
+
Pass an ontology (`ontology=`) and reasoning is on. The RDFS core is always on
|
|
206
|
+
with an ontology. `profile="ql"`, the default, answers OWL 2 QL by rewriting the
|
|
207
|
+
query: nothing is stored. `profile="rl"` with an owned store (`store=`)
|
|
208
|
+
materializes OWL 2 RL facts into ProGraph's own tables, never yours; a query
|
|
209
|
+
reads them only where every mapped table is provably unchanged since the run
|
|
210
|
+
that made them. An ontology and data that contradict each other raise
|
|
211
|
+
`InconsistentOntologyError` unless `inconsistency="report"`. `owl:imports`
|
|
212
|
+
is read from local files only. See [OWL and ontology](https://gitlab.com/briceg/prograph/-/blob/stable/1.3/docs/guides/owl-and-ontology.md)
|
|
213
|
+
and [OWL 2 RL](https://gitlab.com/briceg/prograph/-/blob/stable/1.3/docs/reference/owl-rl.md).
|
|
214
|
+
|
|
215
|
+
## Backends
|
|
216
|
+
|
|
217
|
+
| Backend | Install | SPARQL | Owned store, `profile="rl"` |
|
|
218
|
+
|---|---|---|---|
|
|
219
|
+
| DuckDB, over pandas DataFrames or a DuckDB database | `duckdb` | yes | yes |
|
|
220
|
+
| PostgreSQL (also Lakebase, over ADBC) | `postgresql` | yes | yes |
|
|
221
|
+
| Spark (a SparkSession) | `spark` | yes | yes, with Delta Lake |
|
|
222
|
+
| Databricks SQL warehouse | `databricks` | yes | yes |
|
|
223
|
+
| Oracle | `oracle` | yes | no |
|
|
224
|
+
| MySQL 8.0+ | `mysql-connector-python` | yes | no |
|
|
225
|
+
| SQL Server | `pyodbc` | yes | no |
|
|
226
|
+
|
|
227
|
+
PostgreSQL, MySQL, SQL Server and Oracle are checked behind DuckDB,
|
|
228
|
+
Databricks and Spark: a fault found only on one of them waits for a later
|
|
229
|
+
pass. What differs per backend: [backends](https://gitlab.com/briceg/prograph/-/blob/stable/1.3/docs/guides/backends.md),
|
|
230
|
+
[what differs by backend](https://gitlab.com/briceg/prograph/-/blob/stable/1.3/docs/reference/backend-differences.md).
|
|
231
|
+
|
|
232
|
+
## Cypher
|
|
233
|
+
|
|
234
|
+
Cypher queries run on every engine, with no option: `engine.execute(query, language="cypher")`.
|
|
235
|
+
|
|
236
|
+
- **Mapping.** Cypher needs a YAML mapping: an R2RML mapping has no property-graph
|
|
237
|
+
view and raises `PropertyGraphViewError`; query it with SPARQL.
|
|
238
|
+
- **Ontology.** Cypher applies the ontology's class and property hierarchies only
|
|
239
|
+
(subclass, sub-property, equivalent class and property). The first Cypher query on an
|
|
240
|
+
engine whose ontology states other axioms (domain and range, inverses, symmetric and
|
|
241
|
+
transitive properties, `owl:sameAs`, RL facts, individuals) warns once
|
|
242
|
+
(`CypherOntologyWarning`); SPARQL applies them.
|
|
243
|
+
- **Writes.** `CREATE`, `SET`, `REMOVE`, `DELETE` and `MERGE` write into the owned store
|
|
244
|
+
(`store=`), never a mapped table; with no store they raise `CypherWriteRefusedError`. A
|
|
245
|
+
label a table maps, or an inferred superclass of one, or a label the ontology makes a
|
|
246
|
+
subclass of another, is refused.
|
|
247
|
+
- **Nodes.** A node is the map `{id, labels, properties}`; its `id` is its IRI, and so are
|
|
248
|
+
`id(n)` and `elementId(n)`. A node mapping's key columns are properties under their column
|
|
249
|
+
names (`n.id`). A property no mapping declares is null.
|
|
250
|
+
- **Speed.** A Cypher plan runs as translated, without the rewrites SPARQL plans get. A
|
|
251
|
+
pattern that a second `MATCH` joins back to nodes the first bound (`MATCH (a)-[:KNOWS]->(b)
|
|
252
|
+
MATCH (a)-[:LIKES]->(p)<-[:LIKES]-(b)`) can take minutes on large tables: its joins run
|
|
253
|
+
in the order written, over every type a relationship's table gives. On LDBC SF1, 3 of 200
|
|
254
|
+
Cypher queries ran past 2 minutes on DuckDB; one of them, written in SPARQL, took half a
|
|
255
|
+
second. Write such a query in SPARQL until this is fixed.
|
|
256
|
+
- **Checked.** The openCypher TCK gave 0 wrong answers across the scenarios run for 1.3.0:
|
|
257
|
+
2,880 on DuckDB and on Spark; 2,658 on PostgreSQL, where 222 more are refused by name
|
|
258
|
+
(values of several types in one column, lists of lists, paths held as values); 2,849 of the
|
|
259
|
+
2,880 on a Databricks SQL warehouse, where the other 31 hold values it has no type for (TIME,
|
|
260
|
+
TIME WITH TIME ZONE, nanoseconds). Of the TCK's 3,897 scenarios,
|
|
261
|
+
314 are not built (refused by name) and the rest expect an error or a setup the test
|
|
262
|
+
harness cannot load. MySQL, SQL Server and Oracle run Cypher unchecked.
|
|
263
|
+
- Natural-language `ask` writes SPARQL by default, or Cypher (`language="cypher"`); it never writes data.
|
|
264
|
+
|
|
265
|
+
See [Choosing a language](https://gitlab.com/briceg/prograph/-/blob/stable/1.3/docs/start/choosing-a-language.md) and the
|
|
266
|
+
[conformance choices](https://gitlab.com/briceg/prograph/-/blob/stable/1.3/docs/conformance/choices.md).
|
|
267
|
+
|
|
268
|
+
## Endpoint, MCP and ask
|
|
269
|
+
|
|
270
|
+
`prograph serve --config graph.yaml` serves the SPARQL 1.1 Protocol; with
|
|
271
|
+
`--mcp` it also serves MCP tools at `/mcp`, including `ask`, which turns a
|
|
272
|
+
question into SPARQL (or Cypher) with a model, runs it, and retries with the error if it
|
|
273
|
+
fails. See [the endpoint](https://gitlab.com/briceg/prograph/-/blob/stable/1.3/docs/guides/sparql-endpoint.md) and
|
|
274
|
+
[agents](https://gitlab.com/briceg/prograph/-/blob/stable/1.3/docs/guides/agents.md).
|
|
275
|
+
|
|
276
|
+
## More
|
|
277
|
+
|
|
278
|
+
- [Documentation](https://gitlab.com/briceg/prograph/-/blob/stable/1.3/docs/README.md), and the [primer](https://gitlab.com/briceg/prograph/-/blob/stable/1.3/docs/primer.md)
|
|
279
|
+
- [llms.txt](https://gitlab.com/briceg/prograph/-/blob/stable/1.3/llms.txt), a reference for LLMs and agents
|
|
280
|
+
- [Changelog](https://gitlab.com/briceg/prograph/-/blob/stable/1.3/docs/changelog.md)
|
|
281
|
+
- [Licence](https://gitlab.com/briceg/prograph/-/blob/stable/1.3/LICENSE): Apache-2.0
|
prograph-1.3.3/README.md
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
# ProGraph
|
|
2
|
+
|
|
3
|
+
ProGraph answers SPARQL 1.1 queries over tables you already have. You give it
|
|
4
|
+
a mapping (R2RML or YAML) from tables to RDF terms; each query is translated
|
|
5
|
+
to one SQL statement that your database runs. Nothing is copied or loaded:
|
|
6
|
+
the data stays where it is, and ProGraph does not write to your tables.
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
Python 3.11 or later:
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
pip install "prograph[duckdb]"
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Extras, from `pyproject.toml`; install the ones you use.
|
|
17
|
+
|
|
18
|
+
| Extra | Adds |
|
|
19
|
+
|---|---|
|
|
20
|
+
| `duckdb` | DuckDB and pandas: the default engine over DataFrames, and DuckDB databases |
|
|
21
|
+
| `pandas` | pandas 2 |
|
|
22
|
+
| `postgresql` | the ADBC PostgreSQL driver |
|
|
23
|
+
| `oracle` | `oracledb` |
|
|
24
|
+
| `spark` | PySpark 4.1 or later |
|
|
25
|
+
| `databricks` | the Databricks SQL connector and SDK |
|
|
26
|
+
| `databricks-rt` | the connector's kernel path, for Lakehouse RT warehouses |
|
|
27
|
+
| `shacl` | pyshacl, for `engine.validate_shapes()` |
|
|
28
|
+
| `endpoint` | the SPARQL Protocol server, `prograph serve` |
|
|
29
|
+
| `mcp` | the MCP server and the model client its `ask` tool uses |
|
|
30
|
+
| `cli` | `prograph load-ttl` and `prograph infer-schema` |
|
|
31
|
+
| `nlp`, `nlp-databricks`, `nlp-langchain` | the natural-language interface |
|
|
32
|
+
| `genie` | the Databricks Genie integration |
|
|
33
|
+
| `logging`, `ui`, `graphql` | structlog; the web UI; GraphQL (experimental) |
|
|
34
|
+
|
|
35
|
+
MySQL and SQL Server have no extra: install `mysql-connector-python` or
|
|
36
|
+
`pyodbc` yourself (SQL Server also needs the ODBC Driver 18).
|
|
37
|
+
|
|
38
|
+
## Quickstart
|
|
39
|
+
|
|
40
|
+
A DuckDB table, a YAML mapping and one query:
|
|
41
|
+
|
|
42
|
+
```python
|
|
43
|
+
import duckdb
|
|
44
|
+
from prograph import ProGraph
|
|
45
|
+
from prograph.config import load_config
|
|
46
|
+
|
|
47
|
+
con = duckdb.connect()
|
|
48
|
+
con.execute("CREATE TABLE people (id INTEGER, name VARCHAR, age INTEGER)")
|
|
49
|
+
con.execute("INSERT INTO people VALUES (1, 'Alice', 30), (2, 'Bob', 25)")
|
|
50
|
+
|
|
51
|
+
open("graph.yaml", "w").write("""
|
|
52
|
+
version: "1.0"
|
|
53
|
+
graph: {name: people}
|
|
54
|
+
sources:
|
|
55
|
+
people: {table: people}
|
|
56
|
+
nodes:
|
|
57
|
+
- label: Person
|
|
58
|
+
source: people
|
|
59
|
+
id_column: id
|
|
60
|
+
iri_template: "http://example.org/person/{id}"
|
|
61
|
+
class_iri: "http://example.org/Person"
|
|
62
|
+
properties: {name: name, age: age}
|
|
63
|
+
rdf: {vocab_iri: "http://example.org/", auto_generate: true}
|
|
64
|
+
""")
|
|
65
|
+
engine = ProGraph(schema=load_config("graph.yaml").to_schema(), connection=con)
|
|
66
|
+
|
|
67
|
+
engine.execute("""
|
|
68
|
+
PREFIX ex: <http://example.org/>
|
|
69
|
+
SELECT ?name ?age WHERE { ?p a ex:Person ; ex:name ?name ; ex:age ?age . FILTER(?age > 26) }
|
|
70
|
+
""", language="sparql", return_type="list")
|
|
71
|
+
# [{'name': 'Alice', 'age': 30}]
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
`ProGraph.from_r2rml(path, connection=con)` reads an R2RML mapping instead.
|
|
75
|
+
More: [quickstart](https://gitlab.com/briceg/prograph/-/blob/stable/1.3/docs/sparql/quickstart.md), [map your tables](https://gitlab.com/briceg/prograph/-/blob/stable/1.3/docs/sparql/mapping.md),
|
|
76
|
+
[R2RML tutorial](https://gitlab.com/briceg/prograph/-/blob/stable/1.3/docs/start/r2rml-tutorial.md).
|
|
77
|
+
|
|
78
|
+
## Reasoning
|
|
79
|
+
|
|
80
|
+
Pass an ontology (`ontology=`) and reasoning is on. The RDFS core is always on
|
|
81
|
+
with an ontology. `profile="ql"`, the default, answers OWL 2 QL by rewriting the
|
|
82
|
+
query: nothing is stored. `profile="rl"` with an owned store (`store=`)
|
|
83
|
+
materializes OWL 2 RL facts into ProGraph's own tables, never yours; a query
|
|
84
|
+
reads them only where every mapped table is provably unchanged since the run
|
|
85
|
+
that made them. An ontology and data that contradict each other raise
|
|
86
|
+
`InconsistentOntologyError` unless `inconsistency="report"`. `owl:imports`
|
|
87
|
+
is read from local files only. See [OWL and ontology](https://gitlab.com/briceg/prograph/-/blob/stable/1.3/docs/guides/owl-and-ontology.md)
|
|
88
|
+
and [OWL 2 RL](https://gitlab.com/briceg/prograph/-/blob/stable/1.3/docs/reference/owl-rl.md).
|
|
89
|
+
|
|
90
|
+
## Backends
|
|
91
|
+
|
|
92
|
+
| Backend | Install | SPARQL | Owned store, `profile="rl"` |
|
|
93
|
+
|---|---|---|---|
|
|
94
|
+
| DuckDB, over pandas DataFrames or a DuckDB database | `duckdb` | yes | yes |
|
|
95
|
+
| PostgreSQL (also Lakebase, over ADBC) | `postgresql` | yes | yes |
|
|
96
|
+
| Spark (a SparkSession) | `spark` | yes | yes, with Delta Lake |
|
|
97
|
+
| Databricks SQL warehouse | `databricks` | yes | yes |
|
|
98
|
+
| Oracle | `oracle` | yes | no |
|
|
99
|
+
| MySQL 8.0+ | `mysql-connector-python` | yes | no |
|
|
100
|
+
| SQL Server | `pyodbc` | yes | no |
|
|
101
|
+
|
|
102
|
+
PostgreSQL, MySQL, SQL Server and Oracle are checked behind DuckDB,
|
|
103
|
+
Databricks and Spark: a fault found only on one of them waits for a later
|
|
104
|
+
pass. What differs per backend: [backends](https://gitlab.com/briceg/prograph/-/blob/stable/1.3/docs/guides/backends.md),
|
|
105
|
+
[what differs by backend](https://gitlab.com/briceg/prograph/-/blob/stable/1.3/docs/reference/backend-differences.md).
|
|
106
|
+
|
|
107
|
+
## Cypher
|
|
108
|
+
|
|
109
|
+
Cypher queries run on every engine, with no option: `engine.execute(query, language="cypher")`.
|
|
110
|
+
|
|
111
|
+
- **Mapping.** Cypher needs a YAML mapping: an R2RML mapping has no property-graph
|
|
112
|
+
view and raises `PropertyGraphViewError`; query it with SPARQL.
|
|
113
|
+
- **Ontology.** Cypher applies the ontology's class and property hierarchies only
|
|
114
|
+
(subclass, sub-property, equivalent class and property). The first Cypher query on an
|
|
115
|
+
engine whose ontology states other axioms (domain and range, inverses, symmetric and
|
|
116
|
+
transitive properties, `owl:sameAs`, RL facts, individuals) warns once
|
|
117
|
+
(`CypherOntologyWarning`); SPARQL applies them.
|
|
118
|
+
- **Writes.** `CREATE`, `SET`, `REMOVE`, `DELETE` and `MERGE` write into the owned store
|
|
119
|
+
(`store=`), never a mapped table; with no store they raise `CypherWriteRefusedError`. A
|
|
120
|
+
label a table maps, or an inferred superclass of one, or a label the ontology makes a
|
|
121
|
+
subclass of another, is refused.
|
|
122
|
+
- **Nodes.** A node is the map `{id, labels, properties}`; its `id` is its IRI, and so are
|
|
123
|
+
`id(n)` and `elementId(n)`. A node mapping's key columns are properties under their column
|
|
124
|
+
names (`n.id`). A property no mapping declares is null.
|
|
125
|
+
- **Speed.** A Cypher plan runs as translated, without the rewrites SPARQL plans get. A
|
|
126
|
+
pattern that a second `MATCH` joins back to nodes the first bound (`MATCH (a)-[:KNOWS]->(b)
|
|
127
|
+
MATCH (a)-[:LIKES]->(p)<-[:LIKES]-(b)`) can take minutes on large tables: its joins run
|
|
128
|
+
in the order written, over every type a relationship's table gives. On LDBC SF1, 3 of 200
|
|
129
|
+
Cypher queries ran past 2 minutes on DuckDB; one of them, written in SPARQL, took half a
|
|
130
|
+
second. Write such a query in SPARQL until this is fixed.
|
|
131
|
+
- **Checked.** The openCypher TCK gave 0 wrong answers across the scenarios run for 1.3.0:
|
|
132
|
+
2,880 on DuckDB and on Spark; 2,658 on PostgreSQL, where 222 more are refused by name
|
|
133
|
+
(values of several types in one column, lists of lists, paths held as values); 2,849 of the
|
|
134
|
+
2,880 on a Databricks SQL warehouse, where the other 31 hold values it has no type for (TIME,
|
|
135
|
+
TIME WITH TIME ZONE, nanoseconds). Of the TCK's 3,897 scenarios,
|
|
136
|
+
314 are not built (refused by name) and the rest expect an error or a setup the test
|
|
137
|
+
harness cannot load. MySQL, SQL Server and Oracle run Cypher unchecked.
|
|
138
|
+
- Natural-language `ask` writes SPARQL by default, or Cypher (`language="cypher"`); it never writes data.
|
|
139
|
+
|
|
140
|
+
See [Choosing a language](https://gitlab.com/briceg/prograph/-/blob/stable/1.3/docs/start/choosing-a-language.md) and the
|
|
141
|
+
[conformance choices](https://gitlab.com/briceg/prograph/-/blob/stable/1.3/docs/conformance/choices.md).
|
|
142
|
+
|
|
143
|
+
## Endpoint, MCP and ask
|
|
144
|
+
|
|
145
|
+
`prograph serve --config graph.yaml` serves the SPARQL 1.1 Protocol; with
|
|
146
|
+
`--mcp` it also serves MCP tools at `/mcp`, including `ask`, which turns a
|
|
147
|
+
question into SPARQL (or Cypher) with a model, runs it, and retries with the error if it
|
|
148
|
+
fails. See [the endpoint](https://gitlab.com/briceg/prograph/-/blob/stable/1.3/docs/guides/sparql-endpoint.md) and
|
|
149
|
+
[agents](https://gitlab.com/briceg/prograph/-/blob/stable/1.3/docs/guides/agents.md).
|
|
150
|
+
|
|
151
|
+
## More
|
|
152
|
+
|
|
153
|
+
- [Documentation](https://gitlab.com/briceg/prograph/-/blob/stable/1.3/docs/README.md), and the [primer](https://gitlab.com/briceg/prograph/-/blob/stable/1.3/docs/primer.md)
|
|
154
|
+
- [llms.txt](https://gitlab.com/briceg/prograph/-/blob/stable/1.3/llms.txt), a reference for LLMs and agents
|
|
155
|
+
- [Changelog](https://gitlab.com/briceg/prograph/-/blob/stable/1.3/docs/changelog.md)
|
|
156
|
+
- [Licence](https://gitlab.com/briceg/prograph/-/blob/stable/1.3/LICENSE): Apache-2.0
|