ekglib

dataset

Helpers and types for representing datasets used by ekglib tools and pipelines.

These utilities are typically consumed by higher-level parsers and exporters rather than used directly.

Main Functions

CLI Integration

The CLI parameter reads from environment variable EKG_DATASET_CODE if set.

Dataset Export

Usage

from ekglib.dataset import export_dataset, export_graph
from ekglib.sparql import SPARQLEndpoint
from ekglib.s3 import S3ObjectStore
from rdflib import URIRef

# Export dataset from SPARQL to S3
success = export_dataset(
    sparql_endpoint=sparql_endpoint,
    s3_endpoint=s3_endpoint,
    data_source_code="my-source",
    graph_iri=URIRef("https://kg.example.com/graph/123")
)

# Export in-memory graph to S3
success = export_graph(
    graph=my_graph,
    s3_file_name="output.ttl.gz",
    s3_endpoint=s3_endpoint,
    data_source_code="my-source"
)