2

I would like to know what are the triples that are in a repository but that are not included in other repository.

But for doing this, I would need to reference the two repositories in a federated query.

I'm using Allegrograph.

Stanislav Kralin
  • 11,070
  • 4
  • 35
  • 58
Paulo
  • 73
  • 4

2 Answers2

2

Example on FactForge (i. e., using SPARQL 1.1 federated queries, not Allegrograph's federated stores):

PREFIX dbo: <http://dbpedia.org/ontology/>
PREFIX dbr: <http://dbpedia.org/resource/>

CONSTRUCT { ?s ?p ?o }
    {
    VALUES (?s) {(dbr:Yekaterinburg)}   
    ?s ?p ?o. 
    MINUS
        {
        SERVICE <http://dbpedia.org/sparql>
            {
            VALUES (?s) {(dbr:Yekaterinburg)}
            ?s ?p ?o
            } 
        }  
    } 

Obviously, one can't subtract DBpedia from DBpedia Live in this way, at least one resultset should be relatively small. It seems that Allegrograph's federated stores couldn't help in such substraction task. Probably you should divide your triples into named graphs, not into separate stores.

Stanislav Kralin
  • 11,070
  • 4
  • 35
  • 58
1

With AllegroGraph there are 2 ways this can be achieved:

(1) AllegroGraph allows you to federate multiple local and/or remote triple stores into a single virtual store which can then be queried as a single triple store.

(2) You can use SPARQL 1.1 federated queries which use the SERVICE keyword. Here is an example from the Learning SPARQL book:

PREFIX gp: <http://wifo5-04.informatik.uni-mannheim.de/gutendata/resource/people/>

SELECT ?dbpProperty ?dbpValue ?gutenProperty ?gutenValue
WHERE
{
  SERVICE <http://DBpedia.org/sparql>
  {
    <http://dbpedia.org/resource/Joseph_Hocking> ?dbpProperty ?dbpValue .
  }
  SERVICE <http://wifo5-04.informatik.uni-mannheim.de/gutendata/sparql>
  {
    gp:Hocking_Joseph ?gutenProperty ?gutenValue .
  }
} 
Henriette Harmse
  • 4,167
  • 1
  • 13
  • 22