Skip to main content

Generic linked database approach to manage RDF and raw data together.

Project description

generic-linked-database

Tests Status codecov pyvers Status

An approach to integrate multiple databases behind a unified interface. At least on database is intended to be an RDF database for metadata storage, the others are raw data storages like SQL or noSQL databases.

Quickstart

Installation

Install the package:

pip install gldb

Example

An example exists as Jupyter Notebook in docs/examples/. You may also try it online with Google Colab:

Open Quickstart Notebook

Design

Abstractions

The package provides the following abstractions:

  • GenericLinkedDatabase: The unified interface to interact with the semantic metadata and raw data storage
  • RDFStore: The interface to interact with the semantic metadata storage
  • RawDataStore: The interface to interact with the raw data storage
  • DataStoreManager: The manager to interact with the different data stores
  • Query: The interface to interact with the different data stores
  • RDFStoreQuery: The interface to interact with the semantic metadata storage
  • RawDataStoreQuery: The interface to interact with the raw data storage

Class Diagram

classDiagram
    class GenericLinkedDatabase {
        <<abstract>>
        +StoreManager store_manager
        +linked_upload(filename)
        +execute_query(store_name, query)
    }

    class DataStoreManager {
        +stores: Dict
        +add_store(store_name, store)
        +get_store(store_name)
        +execute_query(store_name, query)
        +upload_file(store_name, filename)
    }

    class DataStore {
        <<abstract>>
        +execute_query(query)
        +upload_file(filename)
    }

    class RDFStore {
        <<abstract>>
        +execute_query(query) QueryResult
        +upload_file(filename)
    }

    class RawDataStore {
        <<abstract>>
        +execute_query(query) QueryResult
        +upload_file(filename)
    }

    class Query {
        +description: str
        <<abstract>>
        +execute(*args, **kwargs) QueryResult
    }

    class QueryResult {
        query: Query
        result: Any
    }

    class RDFStoreQuery {
        <<abstract>>
    }

    class RawDataStoreQuery {
        <<abstract>>
    }
    
    class SparqlQuery {
        +sparql_query: str
        +execute(graph: rdflib.Graph) QueryResult
    }

    %% Relationships
    GenericLinkedDatabase --> DataStoreManager
    GenericLinkedDatabase --> Query
    DataStoreManager --> DataStore
    DataStore <|-- RDFStore
    DataStore <|-- RawDataStore
    Query <|-- RDFStoreQuery
    Query <|-- RawDataStoreQuery
    RDFStoreQuery <|-- SparqlQuery : implements

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gldb-1.2.0.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gldb-1.2.0-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

Details for the file gldb-1.2.0.tar.gz.

File metadata

  • Download URL: gldb-1.2.0.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.16

File hashes

Hashes for gldb-1.2.0.tar.gz
Algorithm Hash digest
SHA256 0654c981090de373227505ae788aca16978cbe32a9f0a7a5df5758cd04ebd8d2
MD5 6a2b5f5163efdf8178fc8f1ef4e082ce
BLAKE2b-256 85a3b708fdb7e01c4e7eb48c4b033a2405b094e5c1ee6666d908b8c2fd308c3a

See more details on using hashes here.

File details

Details for the file gldb-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: gldb-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 13.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.16

File hashes

Hashes for gldb-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9fd1c642e70890a67b4d19d070a479beafe3ebf3a7283263ddf22574b769a214
MD5 3b80be7ba3258260f3f20cb3c536536b
BLAKE2b-256 75762cae2ab687fb35ebdc07e4b44fd93509bcd77d2535c3dd63ca6c9df1e8c4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page