fluree / core

Fluree releases and public bug reports
0 stars 0 forks source link

[Nexus] Leverage `dataset()` API on QS #103

Open aaj3f opened 2 months ago

aaj3f commented 2 months ago

Description

db and server now make it possible to use fromNamed and from (with multiple ledger aliases) in order to federate queries across multiple dbs at once. Internally, this uses the dataset() API in db to virtually merge the dbs in question.

Nexus QS needs to be updated to similarly enable this behavior, so that a user can issue queries like

...
    "from-named": ["db/one", "db/two"],
    "select": ["?username", "?artists", "?name"],
    "where": [
        ["graph", "db/one",
            {
                "@id": "ex:andrew",
                "username": "?username",
                "favArtists": "?artists"
            }
        ],
        ["graph", "db/two",
            {
                "@id": "?artists",
                "name": "?name"
            }
        ]
    ],
...
...
    "from": ["db/one", "db/two"],
    "select": ["?id", "?name"],
    "where": {
        "@id": "?id",
        "name": "?name"
    },
...

This also needs to leverage t parameters in ledger aliases to specify the ledger at a particular moment in time. See Brian's PR here: https://github.com/fluree/server/pull/56

Implementation Details

Consider that the dataset() API has been written to allow dbs to be merged for querying without both of those dbs being registered on the same conn. This is critical for Nexus's use of two different conn objects for IPFS and non-IPFS datasets. This ticket should be tested against the scenario where an IPFS db and an fs db are queried against using dataset()

aaj3f commented 2 months ago

This should wait until fluree/core#79 so that this set of capabilities can be tested w/ IPFS datasets