Federation query

Dear all,

I am trying to execute a federated query on two local TTL file using Stardog (SERVICE key work).
However, the SPARQL endpoint is not correct.
the following query is
select * where {
Service http://localhost:5820/exemple1/addressBookB.ttl
{
?s ?f ?l
}
Service http://localhost:5820/exemple1/addressBookA.ttl
{
?l ?d ?e
}
}

the error that i have received is 'Internal Server Error'

Any advice
Best Regards
Elio HBEICH

You need to reference a SPARQL endpoint in your service queries and not the files. The files you're trying to query aren't available at the urls you're references anyway but that's not really relevant here.

So you need to create to separate databases, say example1 and example2 and load them with addressBookB.ttl and addressBookA.ttl

$> stardog-admin db create -n example1 addressBookA.ttl
$> stardog-admin db create -n example2 addressBookB.ttl

Now you can query across the two databases

select * where {
    service <http://localhost:5820/exemple1>
    {
        ?s ?f ?l
    }
    service <http://localhost:5820/exemple2>
    {
        ?l ?d ?e
    }
}

I seem to remember there might be a shortcut url if the other database is on the same server where you wouldn't need to include the server name and port but I can't remember it off the top of my head.

It seems as thought you might be confusing how SERVICE and now some triple stores implement FROM where the url is dereferenced but I should mention that Stardog doesn't not dereference URIs in FROM statements.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.