lOlive
lOlive

Reputation: 233

Multiple MINUS clause in a sparql query

I am trying to run the following SPARQL query on the public endpoint of DBPedia:

select distinct ?o ?olabel where { 
        { select distinct ?s where { 
        ?s   <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>/<http://www.w3.org/2000/01/rdf-schema#subClassOf>{,6}  <http://dbpedia.org/ontology/FictionalCharacter> 
        .  ?s <http://dbpedia.org/property/creator> ?oo  } limit 100000 } 
  .  ?s <http://dbpedia.org/property/creator> ?o 
  MINUS { ?o   <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>/<http://www.w3.org/2000/01/rdf-schema#subClassOf>{,6}  <http://dbpedia.org/class/yago/Communicator109610660>} 
#  MINUS { ?o   <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>/<http://www.w3.org/2000/01/rdf-schema#subClassOf>{,6}  <http://dbpedia.org/class/yago/Creator109614315>}  
  . ?o <http://www.w3.org/2000/01/rdf-schema#label> ?olabel . FILTER (lang(?olabel)=''||lang(?olabel)='en')  
} LIMIT 100

It works ok. But then I uncomment the commented line. And then the query fails.

From what I understand, multiple MINUS clauses are authorized in SPARQL.

Can anyone give me pieces of advice to rewrite my query so the multiple MINUS clauses are taken into account by DBPedia?

Upvotes: 2

Views: 392

Answers (1)

bobdc
bobdc

Reputation: 51

One of the nice things about standards is that we can look things up in the specifications, so after looking at productions 66, 56, and 54 at https://www.w3.org/TR/sparql11-query/#grammar I can confirm that multiple MINUS clauses are allowed by the standard.

Upvotes: 1

Related Questions