Virtuoso Open-Source Wiki
Virtuoso Open-Source, OpenLink Data Spaces, and OpenLink Ajax Toolkit
Advanced Search
Help?
Location: / Dashboard / Main / VirtTipsAndTricksGuide / VirtTipsAndTricksSPARQL11FeaturesExamplesCollection / VirtTipsAndTricksGuideSPARQLNOTEXISTS

Virtuoso SPARQL 1.1. NOT EXISTS and MINUS

What?

This guide contains Virtuoso SPARQL 1.1. NOT EXISTS and MINUS Usage example queries which you can run against any SPARQL endpoint that supports SPARQL 1.1 and the ability to allow a verified user perform INSERT operations.

Why?

NOT EXISTS and MINUS give a flexible way of check for an absence of a given pattern or exclude possible solutions.

How?

Here are some examples showcasing Virtuoso's support for this functionality:

NOT EXISTS

#  Basic usage
SELECT COUNT(*) 
WHERE 
  {
    ?s ?p "Novosibirsk"  FILTER NOT EXISTS { ?s ?p "???????????" } 
  }

MINUS

SELECT COUNT(*) 
WHERE 
  { 
    { ?s ?p "Novosibirsk" } MINUS { ?s ?p "???????????" }
  }

Related

Powered By Virtuoso