<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://www.townx.org" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>townx - Describing (finding) subjects which don&amp;#039;t have a particular predicate in SPARQL - Comments</title>
 <link>http://www.townx.org/blog/elliot/describing-finding-subjects-which-dont-have-particular-predicate-sparql</link>
 <description>Comments for &quot;Describing (finding) subjects which don&#039;t have a particular predicate in SPARQL&quot;</description>
 <language>en</language>
<item>
 <title>Realized i kept missing the</title>
 <link>http://www.townx.org/blog/elliot/describing-finding-subjects-which-dont-have-particular-predicate-sparql#comment-39499</link>
 <description>&lt;p&gt;Realized i kept missing the f in the &#039;rdf&#039; string....ops. Thanks for this&lt;/p&gt;</description>
 <pubDate>Fri, 29 May 2009 09:52:27 -0500</pubDate>
 <dc:creator>Free imac</dc:creator>
 <guid isPermaLink="false">comment 39499 at http://www.townx.org</guid>
</item>
<item>
 <title>new to sparql</title>
 <link>http://www.townx.org/blog/elliot/describing-finding-subjects-which-dont-have-particular-predicate-sparql#comment-39097</link>
 <description>&lt;p&gt;I am familiar with stand sql, i am looking at the syntax for &lt;span class=&quot;caps&quot;&gt;SPARQL &lt;/span&gt;and it seems more flexible. Looks like you have more powerful expressions for filtering. Nice&lt;/p&gt;</description>
 <pubDate>Wed, 08 Apr 2009 00:39:46 -0500</pubDate>
 <dc:creator>Music Lyrics Now</dc:creator>
 <guid isPermaLink="false">comment 39097 at http://www.townx.org</guid>
</item>
<item>
 <title>Describing (finding) subjects which don&#039;t have a particular predicate in SPARQL</title>
 <link>http://www.townx.org/blog/elliot/describing-finding-subjects-which-dont-have-particular-predicate-sparql</link>
 <description>&lt;p&gt;If you want to do something like a &lt;span class=&quot;caps&quot;&gt;SQL NOT &lt;/span&gt;in &lt;a href=&quot;http://www.w3.org/TR/rdf-sparql-query/&quot;&gt;&lt;span class=&quot;caps&quot;&gt;SPARQL&lt;/span&gt;&lt;/a&gt;, here&#039;s what the query looks like:&lt;/p&gt;



&lt;pre&gt;
PREFIX rs: &amp;lt;http://schemas.talis.com/2006/recordstore/schema#&amp;gt;
PREFIX rdf: &amp;lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#&amp;gt;

DESCRIBE ?tenancy {
  ?tenancy rdf:type rs:Tenancy .
  OPTIONAL { ?tenancy rs:platformStoreUri ?o } .
  FILTER ( !bound(?o) )
}
&lt;/pre&gt;



&lt;p&gt;Here I&#039;m looking for subjects with rdf type of &lt;a href=&quot;http://schemas.talis.com/2006/recordstore/schema#Tenancy&quot; title=&quot;http://schemas.talis.com/2006/recordstore/schema#Tenancy&quot;&gt;http://schemas.talis.com/2006/recordstore/schema#Tenancy&lt;/a&gt;, which don&#039;t have a &lt;a href=&quot;http://schemas.talis.com/2006/recordstore/schema#platformStoreUri&quot; title=&quot;http://schemas.talis.com/2006/recordstore/schema#platformStoreUri&quot;&gt;http://schemas.talis.com/2006/recordstore/schema#platformStoreUri&lt;/a&gt; predicate. The important bit is that you make the predicate which could potentially not be &quot;set&quot; OPTIONAL; and add a &lt;span class=&quot;caps&quot;&gt;FILTER &lt;/span&gt;which only includes subjects where the predicate is bound to a value. This effectively screens out any subjects where the predicate has not been added to the subject. This pattern is basically &lt;strong&gt;Negation as Failure&lt;/strong&gt; (according to the &lt;span class=&quot;caps&quot;&gt;SPARQL &lt;/span&gt;recommendation), which derives from logic programming. Feels a bit like being back at university.&lt;/p&gt;</description>
 <comments>http://www.townx.org/blog/elliot/describing-finding-subjects-which-dont-have-particular-predicate-sparql#comments</comments>
 <category domain="http://www.townx.org/tech">tech</category>
 <category domain="http://www.townx.org/howtos">howtos</category>
 <pubDate>Tue, 07 Apr 2009 04:37:11 -0500</pubDate>
 <dc:creator>elliot</dc:creator>
 <guid isPermaLink="false">773 at http://www.townx.org</guid>
</item>
</channel>
</rss>
