GDD-Nantes / FedShop

Code for FedShop: The Federated Shop Benchmark
GNU General Public License v3.0
8 stars 0 forks source link

RSA for q07 seems wrong #72

Open hartig opened 1 week ago

hartig commented 1 week ago

Query q07 consists of a BGP (with three triple patterns), followed by two OPTIONAL clauses. However, the RSAs for this query contain only the OPTIONAL clauses. For instance, consider /GDD/RSFB/experiments/bsbm/benchmark/evaluation/arq/q07/instance_0/batch_0/attempt_0/service.sparql, which looks as follows.

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rev: <http://purl.org/stuff/rev#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX bsbm: <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/vocabulary/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX owl: <http://www.w3.org/2002/07/owl#>

SELECT DISTINCT ?productLabel ?offer ?price ?vendor ?vendorTitle ?review ?revTitle ?reviewer ?revName ?rating1 ?rating2 WHERE { 
    VALUES ( ?bgp1 ?bgp2 ) { ( <http://localhost:34205/sparql/?default-graph-uri=nan> <http://localhost:34205/sparql/?default-graph-uri=http://www.ratingsite2.fr/> ) }
    OPTIONAL {
        SERVICE ?bgp1 {
            ?localProduct rdf:type bsbm:Product .
            # const bsbm:Product107874
            ?localProduct owl:sameAs bsbm:Product107874 .
            ?localProduct rdfs:label ?productLabel .
            ?offer bsbm:product ?offerProduct .
            ?offerProduct  owl:sameAs bsbm:Product107874 .  
            ?offer bsbm:price ?price .
            ?offer bsbm:vendor ?vendor .
            ?vendor rdfs:label ?vendorTitle .
            ?vendor bsbm:country <http://downlode.org/rdf/iso-3166/countries#FR> .
            ?offer bsbm:validTo ?date .

            # const "2008-08-27T00:00:00"^^xsd:dateTime < ?date 
            FILTER (?date > "2008-08-27T00:00:00"^^xsd:dateTime )
        }
    }
    OPTIONAL {
        SERVICE ?bgp2 {
            ?localProduct rdf:type bsbm:Product .
            # const bsbm:Product107874
            ?localProduct owl:sameAs bsbm:Product107874 .
            ?localProduct rdfs:label ?productLabel .
            ?review bsbm:reviewFor ?reviewProduct .
            ?reviewProduct owl:sameAs bsbm:Product107874 .
            ?review rev:reviewer ?reviewer .
            ?reviewer foaf:name ?revName .
            ?review dc:title ?revTitle .
            OPTIONAL { ?review bsbm:rating1 ?rating1 . }
            OPTIONAL { ?review bsbm:rating2 ?rating2 . } 
        }
    }
}

This seems incorrect to me. The non-optional BGP should be in a SERVICE clause of its own that is not within an OPTIONAL and that should be assigned to every federation member that has the corresponding product (such as bsbm:Product107874 in the case of the query above).