chrontext.chrontext
The hybrid query engine of chrontext. Initialize Engine using: - A SPARQL Database: either in the form of a SPARQL endpoint or an embedded Oxigraph SPARQL database - A Timeseries Database: one of the supported databases: Google Cloud BigQuery or OPC UA HA
Construct a new hybrid query engine.
Specify exactly one of sparql_endpoint
and sparql_embedded_oxigraph
.
Specify exactly one of timeseries_bigquery_db
and timeseries_opcua_db
Parameters
- sparql_endpoint: A SPARQL endpoint (a URL)
- sparql_embedded_oxigraph: An embedded oxigraph SPARQL database, see
SparqlEmbeddedOxigraph
. - timeseries_bigquery_db: A BigQuery database containing timeseries data, see:
TimeseriesBigQueryDatabase
- timeseries_opcua_db: A OPC UA HA endpoint containing timeseries data, see:
TimeseriesOPCUADatabase
TimeseriesTable, which maps an SQL table to the chrontext predicates, so that they can be queried as part of a virtual knowledge graph.
Create a new TimeseriesTable, which maps an SQL table to the chrontext predicates.
Parameters
- **resource_name: Name of the resource. This is the object of the
ct**: hasResource
-property. - schema: In BigQuery, this is the data set id, otherwise the name of the database schema.
- time_series_table: Table containing timeseries data.
- **value_column: Column containing the values. This is the object of the
ct**: hasValue
-property. - **timestamp_column: Column containing the timestamps. This is the object of the
ct**: hasTimestamp
-property. - **identifier_column: Column containing the identity of the timeseries. This is the object of the
ct**: hasExternalId
-property. - year_column: Optionally the column containing the year of the timestamp, used for parititioning.
- month_column: Optionally the column containing the day of the timestamp, used for parititioning.
- day_column: Optionally the column containing the day of the timestamp, used for parititioning.
BigQuery containing timeseries data.
Create a new mapping to a BigQuery database containing timeseries data.
Parameters
- tables: The referenced tables.
- key: Path to service account JSON key with credentials.
OPC UA History Access Endpoint.
Embedded oxigraph SPARQL database, stored in a local folder.
Initialize from NTriples or open an embedded SPARQL oxigraph from a path. If you want to re-initialize the database, simply delete the folder.
Parameters
- ntriples_file: The path of the NTriples (.nt) file that should be loaded into the embedded database.
- path: The path (a folder) where the embedded oxigraph should be stored.