Welcome to the Óbidos User Guide. This document provides instructions on how to interact with the Óbidos Northbound API and utilize its Hybrid ETL and data sharing features.
Óbidos allows users to group multiple distributed data sources (like TCIA, S3, or HDFS) into a single virtual entity called a ReplicaSet. Instead of writing complex queries targeting specific storage backend paths, users can issue simple, unified SQL queries against the abstract ReplicaSetID. The Óbidos Southbound API dynamically rewrites these queries into execution-ready SQL tailored for Apache Drill.
First, create a ReplicaSet grouping the diverse data sources you want to query.
Endpoint: POST /replicasets?userID={userID}
Payload:
{
"replicaSetID": "rs_query",
"dataSources": [
"tcia://collection1",
"s3://bucket1"
]
}You can now issue a query against your created ReplicaSet by sending a POST request to the /query/{replicaSetID} endpoint.
Use the ReplicaSetID as the target table name in your SQL FROM clause.
Endpoint: POST /query/rs_query
Payload (Raw Body):
SELECT * FROM rs_query WHERE Modality='CT'When the request is received, the QueryTransformationLayer performs the following steps:
- Resolution: It looks up
rs_queryand retrieves the underlying data source pointers (tcia://collection1ands3://bucket1). - Translation: It translates the URI schemes into Drill-compatible workspace tables (e.g.,
dfs.tcia.collection1anddfs.s3.bucket1). - Rewriting: It seamlessly substitutes the abstract
rs_queryreference in your SQL string with a combinedUNION ALLsubquery structure representing the physical data sources.
Resulting Apache Drill Query:
SELECT * FROM (
SELECT * FROM dfs.tcia.`collection1`
UNION ALL
SELECT * FROM dfs.s3.`bucket1`
) AS rs_query WHERE Modality='CT'This rewritten query is then executed natively on Apache Drill, allowing for federated SQL querying across your unstructured and semi-structured datasets without the need to manually unify the ETL process!
Óbidos features a disk-backed persistent repository and a sophisticated indexing engine powered by Apache Lucene. Metadata extracted from virtual proxies is automatically indexed for high-performance full-text search.
Endpoint: GET /search?q={query}
Example:
curl "http://localhost:8080/search?q=Modality:CT"Returns a list of source URIs matching the criteria.
To optimize storage and network usage, Óbidos utilizes a Lazy ETL approach. Data sources are initially registered as lightweight virtual proxies (metadata only). The heavy binary data (e.g., DICOM files) is only pulled into the local repository on-demand.
Endpoint: POST /sources/load?uri={sourceURI}
Example:
curl -X POST "http://localhost:8080/sources/load?uri=s3://bucket1"Triggers the physical download and updates the proxy status to LOADED.
Óbidos supports federated data sharing between different deployments. Researchers can "pull" abstract ReplicaSets from other organizations to reuse their curated dataset pointers without needing to repeat the ETL process.
Endpoint: POST /federation/pull/:rsId?peer={peerURL}
Example:
curl -X POST "http://localhost:8080/federation/pull/rs_cancer_study?peer=http://peer-obidos:8080"Endpoint: POST /federation/share/:rsId?peer={peerURL}
Example:
curl -X POST "http://localhost:8080/federation/share/rs_local_01?peer=http://remote-obidos:8080"