Skip to content

Commit 96e0bd6

Browse files
committed
Enhance README.md with updated code examples for semantic search, data metrics calculation, and temporal queries; improve formatting for clarity.
1 parent 57f154e commit 96e0bd6

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,13 +1015,15 @@ For more detailed information, see our comprehensive documentation:
10151015
- [Performance Optimization](docs/performance_optimization.md)
10161016

10171017
# Search provenance records semantically (now works correctly with all record types)
1018+
```python
10181019
results = provenance.semantic_search(
10191020
"schema validation",
10201021
limit=5,
10211022
include_record_types=["verification", "annotation", "transformation"]
10221023
)
1023-
1024+
```
10241025
# Calculate enhanced data metrics (improved to include source records)
1026+
```python
10251027
metrics = provenance.calculate_data_metrics(
10261028
data_id="cleaned_data",
10271029
include_source_records=True, # Properly include source records
@@ -1034,8 +1036,9 @@ complexity = metrics["complexity"]["complexity_score"]
10341036
print(f"Data impact score: {impact_score:.2f}")
10351037
print(f"Processing depth: {complexity['max_depth']}")
10361038
print(f"Source count: {complexity['source_count']}")
1037-
1039+
```
10381040
# Advanced temporal query with precise date filtering
1041+
```python
10391042
import datetime
10401043
quarterly_records = provenance.temporal_query(
10411044
start_time=datetime.datetime(2023, 1, 1),
@@ -1057,6 +1060,7 @@ export_stats = provenance.export_to_car(
10571060
print(f"Exported {export_stats['record_count']} records with root CID: {export_stats['root_cid']}")
10581061

10591062
# Import from CAR file with integrity verification
1063+
10601064
new_provenance = EnhancedProvenanceManager(enable_ipld_storage=True)
10611065
import_stats = new_provenance.import_from_car(
10621066
car_path="provenance.car",
@@ -1066,12 +1070,11 @@ import_stats = new_provenance.import_from_car(
10661070

10671071
print(f"Imported {import_stats['record_count']} records and {import_stats['edge_count']} edges")
10681072
```
1069-
10701073
## Query Optimization Metrics and Visualization
10711074

10721075
The rag_query_optimizer module provides comprehensive metrics collection and visualization capabilities to analyze and improve GraphRAG query performance.
1073-
10741076
```python
1077+
10751078
from ipfs_datasets_py.rag_query_optimizer import (
10761079
UnifiedGraphRAGQueryOptimizer,
10771080
QueryMetricsCollector,

0 commit comments

Comments
 (0)