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.1.tar.gz (10.6 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.1-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gldb-1.2.1.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for gldb-1.2.1.tar.gz
Algorithm Hash digest
SHA256 b79c832c5e64d0fd029a84891cb7ba64eaaa146fbd5442ad984b82572834fecc
MD5 337fda73617653077e78ce63ba5586fc
BLAKE2b-256 1f68632134b5774105567f5b02a7d65d854c77a83b0d18c85f83f21cf08449f2

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for gldb-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e8c68c104268575ab3c85b3c885b68cec10d89c2b1bd5e77667e12c3ae716204
MD5 8f72c5d9792ba31ce2e8e27c730fbbd0
BLAKE2b-256 a5227b07c5a1d52f488415f1f65b385ea831460f9ba39e77f6dea8f11d4237e9

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