Ivo Velitchkov
Ivo Velitchkov

Reputation: 2431

Excluding triples based on substring

I have a graph created by sponging web pages. I'm trying to write a query to exclude all triples where the subject is a web page. I can get these triples simply by

FILTER (STRENDS((STR(?i)), "html"))

but what's the best way to exclude them. Basically I need all {?s ?p ?o} minus the subset {?i ?p ?o}.

Upvotes: 0

Views: 106

Answers (1)

AndyS
AndyS

Reputation: 16700

This

SELECT *
{ ?s ?p ?o 
  FILTER ( ! STRENDS( STR(?s), "html") )
}

filters the outcome the pattern.

Upvotes: 2

Related Questions