<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>webr3.org &#187; Mathematics</title>
	<atom:link href="http://webr3.org/blog/tag/mathematics/feed/" rel="self" type="application/rss+xml" />
	<link>http://webr3.org/blog</link>
	<description>brain&#039;s on fire!</description>
	<lastBuildDate>Tue, 19 Jul 2011 15:38:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>RDF: Named Graphs -vs- Graph Literals</title>
		<link>http://webr3.org/blog/semantic-web/rdf-named-graphs-vs-graph-literals/</link>
		<comments>http://webr3.org/blog/semantic-web/rdf-named-graphs-vs-graph-literals/#comments</comments>
		<pubDate>Wed, 29 Dec 2010 16:15:56 +0000</pubDate>
		<dc:creator>nathan</dc:creator>
				<category><![CDATA[semantic web]]></category>
		<category><![CDATA[Algebraic graph theory]]></category>
		<category><![CDATA[author]]></category>
		<category><![CDATA[Discrete mathematics]]></category>
		<category><![CDATA[Graph]]></category>
		<category><![CDATA[Graph theory]]></category>
		<category><![CDATA[Mathematics]]></category>
		<category><![CDATA[Metadata]]></category>
		<category><![CDATA[N-Triples]]></category>
		<category><![CDATA[rdf]]></category>
		<category><![CDATA[Topological graph theory]]></category>

		<guid isPermaLink="false">http://webr3.org/blog/?p=429</guid>
		<description><![CDATA[An overview of Named Graphs and Graph Literals and the distinctions between them.
Named Graphs
"Named Graph" is possibly the most misleading term used in the semantic web, when somebody says "this is a Named Graph" the temptation is to think "uri-x is the name for this distinct set of triples", however, that couldn't be further from [...]]]></description>
			<content:encoded><![CDATA[<p>An overview of Named Graphs and Graph Literals and the distinctions between them.</p>
<h3>Named Graphs</h3>
<p>"Named Graph" is possibly the most misleading term used in the semantic web, when somebody says "this is a Named Graph" the temptation is to think "uri-x is the name for this distinct set of triples", however, that couldn't be further from the truth.</p>
<p>The truth, is that "uri-x is a name for some set of triples", it is by no means the only name, and it certainly does not refer to a distinct set of triples. Named Graphs provide exactly the same abstraction as URIs, you give a name (uri) to a resource (graph), and the representation of that graph (the triples) can change at any time, that is, you can <em>only</em> ever reference the "named graph" in it's current state, and never any of it's previous states.</p>
<p>Thus, when you start to describe a named graphs by including it's URI in statements, you are not describing the set of triples at a certain time, nor the representation, rather you are making statements about the abstract concept of the graph, that concept which remains consistent over time.</p>
<p>To illustrate, let's make up a simple named graph, NG, which contains a set of Triples x, and then make a couple of simple statements about NG to say that it was created by #bob, that's it's trusted, and that it contains 23 triples.</p>
<p><code>  Graph &lt;NG> { x }</p>
<p>  &lt;NG> a :TrustedGraph ;<br />
    :triple_count 23 ;<br />
    :author &lt;#bob> .</code></p>
<p>The trouble is, x is a variable set of triples, at any instance it may refer to literally <em>any</em> set of triples, even an empty set. The statements which meant it was a "TrustedGraph" may be removed or invalidated, the number of triples in the graph can change at any time, and bob may be dead for the last 1000 years with the graph updated by several hundred different authors since. Additionally, the Named Graphs are an abstraction layer on top of, and out with, the RDF data model.</p>
<p>It's safe (and imo wise) to think of named graphs as little more than cardboard boxes, you've no idea what is actually inside them till you look, and anything written on, or about, the boxes, could easily be wrong.</p>
<p>Essentially, much like "cool URIs don't change", to use named graph in any temporally varying environment (like the web or an "rdf store") you need a "named graphs don't change".</p>
<h3>Graph Literals</h3>
<p>Graph Literals are just that, they literally are the graph, the distinct, non temporally varying, set of triples, in place. A Graph literal <em>is</em> "this distinct set of triples".</p>
<p>To illustrate, let's make up a simple graph { :a :b :c } then make a couple of simple statements about that graph, to say that it was created by #bob, that it's trusted, and that it contains 1 triple.</p>
<p><code>  { :a :b :c } a :TrustedGraph ;<br />
   :triple_count 1 ;<br />
   :author &lt;#bob> .</code></p>
<p>As you can see this is entirely unlike the named graph example from earlier, the statements are as valid tomorrow as they are today, and they're all within the RDF data model.</p>
<p>Further, we can now truly "name" the graph by giving it a URI, we can also attach temporal information to it, in fact because we're still in RDF, we can make any statement we want to add trust / provenance or any other useful information - we are unconstrained. For example:</p>
<p><code>  { :a :b :c } a :TrustedGraph ;<br />
   :triple_count 1 ;<br />
   :author &lt;#bob> ;<br />
   :uri "http://example.org/whatever" ;<br />
   :retrieved "2010-12-29T16:03:12"^^xsd:dateTime ;<br />
   :signature [ :assertedBy &lt;#dave> ; :sig "FD345..." ] .</code></p>
<p>Thus, we can lock the state of any resource at any given time in side a graph literal and then augment it with as much additional information as we want, and we can search through time to see the state of "http://example.org/whatever" on this date or that date, compare, contrast and ultimately do whatever we please.</p>
<p>Further still, graph literals allow us to create Patch and Diff for RDF graphs, to describe rules and inferences in RDF, and much more.</p>
<p>So, unlike named graphs which are like holding a cardboard box and wondering what's inside, graph literals are like holding the contents themselves, you literally are holding the graph.</p>
<h3>Named Graphs -vs- Graph Literals</h3>
<p>I'm unsure which way the RDF community (and WG) will head with this, but given the above, I can assure that there's no doubt in my mind as to which of the two I think should be incorporated in to the RDF standard.</p>
]]></content:encoded>
			<wfw:commentRss>http://webr3.org/blog/semantic-web/rdf-named-graphs-vs-graph-literals/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Maybe we don&#039;t need Named Graphs</title>
		<link>http://webr3.org/blog/semantic-web/maybe-we-dont-need-named-graphs/</link>
		<comments>http://webr3.org/blog/semantic-web/maybe-we-dont-need-named-graphs/#comments</comments>
		<pubDate>Sun, 16 May 2010 15:48:27 +0000</pubDate>
		<dc:creator>nathan</dc:creator>
				<category><![CDATA[linked data]]></category>
		<category><![CDATA[semantic web]]></category>
		<category><![CDATA[ACL]]></category>
		<category><![CDATA[ACL processor]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[Graph]]></category>
		<category><![CDATA[Graph theory]]></category>
		<category><![CDATA[Mathematics]]></category>
		<category><![CDATA[Online social networking]]></category>
		<category><![CDATA[rdf]]></category>
		<category><![CDATA[RDFLib]]></category>
		<category><![CDATA[Reference]]></category>
		<category><![CDATA[Resource]]></category>
		<category><![CDATA[Resource Description Framework]]></category>
		<category><![CDATA[Semantically-Interlinked Online Communities]]></category>
		<category><![CDATA[SPARQL]]></category>
		<category><![CDATA[Tim Berners-Lee]]></category>
		<category><![CDATA[Uniform Resource Identifier]]></category>
		<category><![CDATA[web server]]></category>
		<category><![CDATA[web server administrators]]></category>
		<category><![CDATA[web servers]]></category>
		<category><![CDATA[Web services]]></category>
		<category><![CDATA[Web standards]]></category>
		<category><![CDATA[World Wide Web]]></category>

		<guid isPermaLink="false">http://webr3.org/blog/?p=332</guid>
		<description><![CDATA[In this post I'll put forward an argument that perhaps the "web of linked data", and thus RDF(2)/OWL(2), doesn't need any concept of Named Graphs.
This is quite a dry subject, and I could be wrong (in fact in some ways I want to be proved wrong, this is how we learn), but do read on [...]]]></description>
			<content:encoded><![CDATA[<p>In this post I'll put forward an argument that perhaps the "web of linked data", and thus RDF(2)/OWL(2), doesn't need any concept of Named Graphs.</p>
<p>This is quite a dry subject, and I could be wrong (in fact in some ways I want to be proved wrong, this is how we learn), but do read on if you're interested.</p>
<h3>Example</h3>
<p>Over the past few months I've hit on a number of occasions where I was convinced I needed Named Graphs in order to address the task at hand.</p>
<p>A notable example is the scenario where using WebAccessControl and the ACL ontology, a system would have to figure out just who should be given access to a resource, and who should be denied.</p>
<p>In this example I'll cover the notion of ACL for "groups" in a linked data world.</p>
<p>The task at hand is to allow access if:<br />
<code>the graph serialized within the document obtained by dereferencing the URI of the group states the &lt;webid#me> is a member.</code></p>
<p>Otherwise written as:<br />
<code>if we dereference &lt;groups#admin> does the graph returned include the following { &lt;groups#admin> sioc:has_member &lt;webid#me> }</code></p>
<p>Or in SPARQL:</p>
<pre>ASK
GRAPH &lt;groups> {
  &lt;groups#admin> sioc:has_member &lt;webid#me>
}</pre>
<p>In this example we *do not* want to dereference the users webid to see if the graph returned specifies that { &lt;webid#me> sioc:member_of &lt;groups#admin> } , or indeed consider the open world possibilities that another yet unknown graph could assert that the user is a member of our admin group, as that would breach security.</p>
<h4>The ACL</h4>
<p>To proceed with the example, consider the following ACL:</p>
<pre>[] a acl:Authorization ;
	acl:accessTo &lt;https://example.org/sensitive> ;
 	acl:agentClass :mygroup ;
 	acl:mode acl:Read .

:mygroup owl:equivalentClass [
 	a owl:Restriction ;
 	owl:hasValue &lt;groups#admin> ;
 	owl:onProperty [ owl:inverseOf sioc:has_member ];
 	] .
</pre>
<h4>The Problem</h4>
<p>The problem proposed by this ACL is that any of the following four sets of triples would infer that &lt;webid#me> would qualify as an instance of :mygroup (or a member of &lt;groups#admin> if you prefer).</p>
<ul>
<li>
<pre>&lt;webid#me> sioc:member_of &lt;groups#admin> .</pre>
<li>
<pre>&lt;webid#me> _:x &lt;groups#admin> .
_:x owl:inverseOf sioc:has_member .</pre>
</li>
<li>
<pre>&lt;groups#admin> sioc:has_member &lt;webid#me> .</pre>
</li>
<li>
<pre>&lt;groups#admin> _:y &lt;webid#me> .
_:y owl:inverseOf sioc:member_of .</pre>
</li>
</ul>
<p>In other words, the ACL does not specify a "Named Graph" to query, and at the moment, no way exists to specify with (OWL or RDF) which "Named Graph" to query / trust.</p>
<p>This, point in case, is one example where I saw the need for Named Graphs in RDF and OWL.</p>
<h4>Another way of looking at it</h4>
<p>You will have noticed the notion of "Named Graphs" creeping in above, seems like a logical thing to say, especially when you consider that to process this ACL and grant access you'd probably use SPARQL, and specify a Named Graph to query over. However, much of what follows arose because I'd decided not to use SPARQL, and rather to code an ACL processor in my preferred language.</p>
<p>If you consider the situation, the ACL processor which decides if access should be granted or not, must implicitly "trust" the document which contains the serialized ACL graph. That is to say, that it must by extension trust any resources pointed to by said ACL, and if it doesn't then the ACL isn't fit for the purpose.</p>
<p>It's also important to note that "trust" is context specific, in this case we trust the resources pointed to by the ACL for the purpose of WebAccessControl.</p>
<p>One could then pretty quickly conclude that in this scenario the ACL processor already know's how to process the ACL, it must only use resources it trusts, therefore it must only  allow access if <code>the graph serialized within the document obtained by dereferencing the URI of the group states the &lt;webid#me> is a member.</code> </p>
<p>(because &lt;groups#admin> is specified in the ACL, and thus by extension, trusted)</p>
<h4>Named Graphs in SPARQL</h4>
<p>The aforementioned logic would also apply if I was using SPARQL to process the ACL, it would equate to the ACL processor asking:</p>
<pre>ASK
GRAPH &lt;groups> {
  &lt;groups#admin> sioc:has_member &lt;webid#me>
}</pre>
<p>But again this is very context specific to the example, let's consider for a moment that the URI for the group could have been a non-fragment URI, &lt;groups/admin> for example.</p>
<p>This leads us to an important problem, when we dereference &lt;groups/admin> it would have to 303 See Other through to a different URI, let's say &lt;data/groups/admin> - which would then mean that the Named Graph to be used was &lt;data/groups/admin> - this URI, you may note, we do not know when we are writing our ACL; so if we ASKed the above SPARQL, the results would always come back negative, since their is no GRAPH &lt;groups>.</p>
<p>The URI of the Named Graph issue is compounded by modern web servers and publishing practises, because &lt;data/groups/admin> could easily be content negotiated (or rewritten), thus giving various final URI's of &lt;data/groups/admin> or &lt;data/groups/admin.rdf> or &lt;data/groups/admin.ttl> or &lt;data/groups/admin.n3> and so forth. One could quite easily (and often does) end up with the same Graph repeated multiple times within a quad store, all under "different" "Named Graphs".</p>
<p>I'll expand on a possible way of addressing this problem further on.</p>
<h4>Directionality</h4>
<p>Previously I mentioned that the ACL processor didn't have a problem with the above ACL, because it by nature trusted all resources which were mentioned in the ACL graph. However, again this is very context specific.</p>
<p>Let's consider for a moment an inverted ACL, where we want to allow access if:<br />
<code>the graph serialized within the document obtained by dereferencing the URI of the users <strong>webid</strong> states that &lt;webid#me> is a sioc:member_of &lt;groups#admin>.</code></p>
<p>We don't know the users webid ahead of time when we write the ACL, so again we have no way of writing how to trust a resource - it is critical to note that even if RDF(2) did support the concept of Named Graphs, it still wouldn't address the situation because we wouldn't know the Named Graph ahead of time, in order to trust it!</p>
<p>If we now consider the following ACL:</p>
<pre>[] a acl:Authorization ;
	acl:accessTo &lt;https://example.org/sensitive> ;
 	acl:agentClass :mygroup ;
 	acl:mode acl:Read .

:mygroup owl:equivalentClass [
 	a owl:Restriction ;
 	owl:hasValue &lt;groups#admin> ;
 	owl:onProperty sioc:member_of;
 	] .
</pre>
<p>The outcome of our previous logic concludes that again we should be querying the "trusted" resource &lt;groups#admin>, which gives us another problem, that's not the resource we want to be asking in this scenario.</p>
<p>The only thing that remains, and I'll later argue the only thing that ever matters in a web of linked data, is direction.</p>
<p>If we analyse the first ACL closer, we can see that we ultimately used the direction inferred by the presence of owl:inverseOf to place &lt;groups#admin> in the subject position, rather than the value/object position it could have been in, indicated by the presence of owl:hasValue. (bare with me).</p>
<p>In this example, we can use the strong semantics of owl:hasValue (and lack of owl:inverseOf) to place &lt;groups#admin> in the value/object position, and thus our ACL processor can come to the outcome we want, which is to look for the a triple with the meaning { &lt;webid#access> sioc:member_of &lt;groups#admin> }, and that means dereferencing the URI in the subject position, in other words asking the graph serialized in the document returned by GETting &lt;webid> if it contains such a triple.</p>
<p>I've applied some understanding to OWL that quite simply isn't there though, as I earlier stated both ACL examples could easily equate to looking for any one of those four sets of triples.</p>
<p>However, this is the point - machine understanding of data is in the domain of the machine, the application doing the processing. And "truth" or "trust" is entirely context specific.</p>
<p>I'm increasingly convinced that the combined context of the data in a graph and the context under which that graph is being queried, specifies or infers in which direction you want to be reading, and directionality can be determined with linked data by dereferencing whichever uri you place on the left / in the subject position.</p>
<p>I recently found that Tim Berners-Lee wrote about this in a blog post entitled <a href="http://dig.csail.mit.edu/breadcrumbs/node/72">Backward and Forward links in RDF just as important</a>:</p>
<blockquote><p>One meme of RDF ethos is that the direction one choses for a given property is arbitrary: it doesn't matter whether one defines "parent" or "child"; "employee" or "employer". This philosophy (from the Enquire design of 1980) is that one should not favor one way over another. One day, you may be interested in following the link one way, another day, or somene else, the other way.</p></blockquote>
<p>Key here is the sentence "One day, you may be interested in following the link one way, another day, or somene else, the other way.", and that is exactly what all these examples are doing, following a link one way, or the other way.</p>
<p>To conclude this part, in every scenario thus far where I've thought I needed Named Graphs, it turns out that I in-fact needed directionality - and because I'm dealing with Linked Data, whatever I place in the subject position defines the URI which I need to dereference, and ultimately the Graph(s) which are considered when resolving the answer to the question being ASKed.</p>
<p>I'd thus suggest that "Named Graphs", do not exist in a web of data, they are needed in N3 and when using rules, because all data is often in a single file, however that is not the case for Linked Data, where we dereference.</p>
<h3>Back to SPARQL and Named Graphs</h3>
<p>Previously I mentioned the complications with the way we currently use named graphs in SPARQL and in our quad stores, where the URI we end up using could literally be, anything; and often we get duplicate data under different graphs.</p>
<p>To address this, I'd suggest that what we should be storing as the graph ?g value, is not some made up "named graph" but rather: <code>the dereferenced URI which we initially requested</code>.</p>
<ul>
<li>in the case of &lt;group#admins> this would be &lt;group>.
<li>in the case of &lt;group/admins> this would be &lt;group/admins></li>
</ul>
<p>To clarify, *never* the URI that a GET request finally resolves to, and *always* the initial dereferenced URI we requested.</p>
<p>The above ensure that we'd never have duplicate data in our quad stores again, that SPARQL queries including a FROM clause always dereferenced, that publishers and web server administrators were free to relocate and restructure their data, and ultimately make for a much nicer, healthier web of data.</p>
<p>Cool URIs don't change, and they wouldn't, just because the final document serializing a graph may move to a different URI, doesn't mean the original URI has to change.</p>
<h3>Conclusion</h3>
<p>Apologies for the length of the post, but I figured everything needed covered, in context. Simply put we need to focus less on Named Graphs (which IMHO aren't needed) and focus more on directionality. Every problem I've encountered thus far is covered by what Tim said years ago: "One day, you may be interested in following the link one way, another day, or somene else, the other way."</p>
<p>Comments?</p>
]]></content:encoded>
			<wfw:commentRss>http://webr3.org/blog/semantic-web/maybe-we-dont-need-named-graphs/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Web of Data illustrated, meet Bob.</title>
		<link>http://webr3.org/blog/general/web-of-data-illustrated-meet-bob/</link>
		<comments>http://webr3.org/blog/general/web-of-data-illustrated-meet-bob/#comments</comments>
		<pubDate>Sat, 08 May 2010 14:43:22 +0000</pubDate>
		<dc:creator>nathan</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[Cross-platform software]]></category>
		<category><![CDATA[Data management]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[IBM software]]></category>
		<category><![CDATA[linked data]]></category>
		<category><![CDATA[Mathematics]]></category>
		<category><![CDATA[Negation]]></category>
		<category><![CDATA[REST]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Subdomain]]></category>
		<category><![CDATA[Technology/Internet]]></category>

		<guid isPermaLink="false">http://webr3.org/blog/?p=325</guid>
		<description><![CDATA[
Something to try
Next time you start an application, why not create a subdomain for your data tier, create a script for each SQL query and call it via HTTP (honestly you won't notice a speed difference), similarly expose all static files your system uses on the same (or a different) sub domain. Here's the advantages:

You [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-328" title="bob" src="http://webr3.org/blog/wp-content/uploads/2010/05/bob1.jpg" alt="bob" width="738" height="2230" /></p>
<h2>Something to try</h2>
<p>Next time you start an application, why not create a subdomain for your data tier, create a script for each SQL query and call it via HTTP (honestly you won't notice a speed difference), similarly expose all static files your system uses on the same (or a different) sub domain. Here's the advantages:</p>
<ol>
<li>You can scale without changing your application</li>
<li>You can swap servers without changing your application</li>
<li>You can move data around your server and take advantage of all the HTTP servers features.</li>
<li>You can cache your resources and utilize HTTP caching.</li>
<li>You can distribute or relocation your application anywhere on the net without worrying about data.</li>
<li>You can migrate over to different data systems (swap database vendors etc) without changing your application.</li>
<li>You can call every resource on the web in the same manner, from APIs through to linked data and all in between.</li>
<li>You're critical SQL and data mapping code will be fully abstracted and in self contained files (ultra easy to edit, bug fix, maintain).</li>
<li>You can take advantage of HTTP logging, and HTTP status codes instead of custom exceptions.</li>
<li>You have a ready made RESTful API in to your data tier, so you can hook on other applications, or open it up to third parties, or the entire net.</li>
</ol>
<p>So much more, all by one simple step - and that's only the first half of the cartoon ;)</p>
]]></content:encoded>
			<wfw:commentRss>http://webr3.org/blog/general/web-of-data-illustrated-meet-bob/feed/</wfw:commentRss>
		<slash:comments>52</slash:comments>
		</item>
		<item>
		<title>Virtuoso 6, SPARQL + GEO, Sample Queries</title>
		<link>http://webr3.org/blog/linked-data/virtuoso-6-sparqlgeo-and-linked-data/</link>
		<comments>http://webr3.org/blog/linked-data/virtuoso-6-sparqlgeo-and-linked-data/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 23:24:40 +0000</pubDate>
		<dc:creator>nathan</dc:creator>
				<category><![CDATA[linked data]]></category>
		<category><![CDATA[virtuoso]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[Edinburgh]]></category>
		<category><![CDATA[Filter]]></category>
		<category><![CDATA[FOAF]]></category>
		<category><![CDATA[Group action]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[London]]></category>
		<category><![CDATA[Mathematics]]></category>
		<category><![CDATA[New York City]]></category>
		<category><![CDATA[Oxford]]></category>
		<category><![CDATA[RDBMS]]></category>
		<category><![CDATA[rdf]]></category>
		<category><![CDATA[RDF Schema]]></category>
		<category><![CDATA[semantic web]]></category>
		<category><![CDATA[SPARQL]]></category>
		<category><![CDATA[text search]]></category>
		<category><![CDATA[United Kingdom]]></category>
		<category><![CDATA[World Wide Web]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[York]]></category>

		<guid isPermaLink="false">http://webr3.org/blog/?p=183</guid>
		<description><![CDATA[Along side a whole host of improvements, the latest version of Virtuoso (Virtuoso 6) has added support for Geo data! One small sentence, one huge leap for mankind; it's vastly importany IMHO because it brings a new kind of link to Linked Data; a location based one.
Very brief intro: SPARQL is a fantastic query language [...]]]></description>
			<content:encoded><![CDATA[<p>Along side a whole host of improvements, the latest version of Virtuoso (<a href="http://bit.ly/dgbAXS">Virtuoso 6</a>) has added support for Geo data! One small sentence, one huge leap for mankind; it's vastly importany IMHO because it brings a new kind of link to Linked Data; a location based one.</p>
<p>Very brief intro: SPARQL is a fantastic query language which works over RDF and thus Linked Data, Virtuoso amongst other things has a powerful QuadStore which can be queried via SPARQL, and Virtuoso's implementation of SPARQL + the extensive suite of extensions they have implemented makes it the most usable and powerful query langauge available (again, in my honest opinion). In short this combination was enough to make me drop normal RDBMS systems and never look back.</p>
<p>Rather than rambling on about how fantastic it is though; here are some Virtuoso specific sample SPARQL (+GEO) queries, which should hopefully wet your appetite and give you some inclination of what can be done.</p>
<h2>Basic Geo Lookups</h2>
<p><strong>Things within 20km of New York City : <a href="http://bit.ly/9IBiVW" target="_blank">RESULTS</a></strong><br />
<code>  SELECT DISTINCT ?resource ?label ?location<br />
  WHERE<br />
  {<br />
    &lt;http://dbpedia.org/resource/New_York_City> geo:geometry ?sourceGEO .<br />
    ?resource geo:geometry ?location ; rdfs:label ?label .<br />
    FILTER( bif:st_intersects( ?location, ?sourceGEO, 20 ) ) .<br />
    FILTER( lang(?label) = "en" )<br />
  }</code></p>
<p><strong>Distance between New York City and London, England : <a href="http://bit.ly/bYNfWO" target="_blank">RESULTS</a></strong><br />
<code>  SELECT (bif:st_distance(?nyl,?ll)) as ?distanceBetweenNewYorkCityAndLondon<br />
  WHERE<br />
  {<br />
    &lt;http://dbpedia.org/resource/New_York_City> geo:geometry ?nyl .<br />
    &lt;http://dbpedia.org/resource/London> geo:geometry ?ll .<br />
  }<br />
 </code></p>
<h2>Querying Time and Space</h2>
<p><strong>All Educational Institutions within 10km of Oxford, UK; ordered by date of establishment : <a href="http://bit.ly/biZEHA" target="_blank">RESULTS</a></strong><br />
<code>SELECT DISTINCT ?thing as ?uri ?thingLabel as ?name ?date as ?established ?matchGEO as ?location<br />
WHERE<br />
{<br />
&lt;http://dbpedia.org/resource/Oxford&gt; geo:geometry ?sourceGEO .<br />
?resource geo:geometry ?matchGEO .<br />
FILTER( bif:st_intersects( ?matchGEO, ?sourceGEO, 5 ) ) .<br />
?thing ?somelink ?resource ; &lt;http://dbpedia.org/ontology/established&gt; ?date ; rdfs:label ?thingLabel . FILTER( lang(?thingLabel) = "en" )<br />
} ORDER BY asc( ?date )<br />
</code><br />
<strong>Historical cross section of events related to Edinburgh and the surrounding area (within 30km) during the 19th century : <a href="http://bit.ly/dfZU43" target="_blank">RESULTS</a></strong><br />
<code>SELECT DISTINCT ?thing ?thingLabel ?dateMeaningLabel ?date ?matchGEO WHERE {<br />
{<br />
SELECT DISTINCT ?thing ?matchGEO<br />
WHERE<br />
{<br />
&lt;http://dbpedia.org/resource/Edinburgh&gt; geo:geometry ?sourceGEO .<br />
?resource geo:geometry ?matchGEO .<br />
FILTER( bif:st_intersects( ?matchGEO, ?sourceGEO, 30 ) ) .<br />
?thing ?somelink ?resource<br />
}<br />
}<br />
{?property rdf:type owl:DatatypeProperty ; rdfs:range xsd:date } .<br />
?thing ?dateMeaning ?date . FILTER( ?dateMeaning in( ?property ) ) . FILTER( ?date &gt;= xsd:gYear("1800") &amp;&amp; ?date &lt;= xsd:gYear("1900") )<br />
?dateMeaning rdfs:label ?dateMeaningLabel . FILTER( lang(?dateMeaningLabel) = "en" ) .<br />
?thing rdfs:label ?thingLabel . FILTER( lang(?thingLabel) = "en" )<br />
} ORDER BY asc( ?date )</code></p>
<h2>Transitivity and Inference (v5 compatible)</h2>
<p><strong>Finding the shortest route between two "things" (HTML and XML in the example) : <a href="http://bit.ly/cJjsBL" target="_blank">RESULTS</a></strong><br />
<code>SELECT ?route ?jump WHERE<br />
{<br />
 { SELECT ?x ?y WHERE { ?x foaf:page ?xpage ; ?predicate ?y . filter( isURI(?y) ) } }<br />
 OPTION ( TRANSITIVE, T_DISTINCT, T_SHORTEST_ONLY, t_in(?x), t_out(?y), t_max(10), t_step('path_id') as ?path, t_step(?x) as ?route, t_step('step_no') AS ?jump )<br />
 . FILTER ( ?y = &lt;http://dbpedia.org/resource/HTML> &#038;& ?x = &lt;http://dbpedia.org/resource/XML> )<br />
}<br />
</code></p>
<p><strong>..and all routes between the two "things" : <a href="http://bit.ly/cQV4AW" target="_blank">RESULTS</a></strong><br />
<code>SELECT ?route ?path ?jump WHERE<br />
{<br />
 { SELECT ?x ?y WHERE { ?x foaf:page ?xpage ; ?predicate ?y . filter( isURI(?y) ) } }<br />
 OPTION ( TRANSITIVE, T_NO_CYCLES, t_in(?x), t_out(?y), t_max(5), t_step('path_id') as ?path, t_step(?x) as ?route, t_step('step_no') AS ?jump )<br />
 . FILTER ( ?y = &lt;http://dbpedia.org/resource/HTML> &#038;& ?x = &lt;http://dbpedia.org/resource/XML> )<br />
}</code></p>
<p><strong>Traversing Ontologies and (Sub)Classes; all subclasses of Person down the hierarchy  : <a href="http://bit.ly/aZ0oOM">RESULTS</a></strong><br />
<code>SELECT DISTINCT ?x WHERE<br />
{<br />
 { SELECT ?x ?y WHERE { ?x rdfs:subClassOf ?y } }<br />
 OPTION ( TRANSITIVE, T_DISTINCT, t_in(?x), t_out(?y), t_step('path_id') as ?path, t_step(?x) as ?route, t_step('step_no') AS ?jump, T_DIRECTION 2 )<br />
 FILTER ( ?y = &lt;http://dbpedia.org/ontology/Person> )<br />
}</code></p>
<h2>Free text search, scores and IRI Ranks (v5 compatible)</h2>
<p><strong>Searching over labels, with text match scores and additional ranks for each iri / resource  : <a href="http://bit.ly/bMNweO">RESULTS</a></strong><br />
<code>SELECT ?s ?page ?label ?textScore (<LONG::IRI_RANK>(?s)) as ?iriRank WHERE {<br />
  ?s foaf:page ?page ; rdfs:label ?label . FILTER( lang(?label) = "en" ) .<br />
  ?label bif:contains 'adobe and flash' option (score ?textScore ) .<br />
}</code></p>
<p><strong>Virtuoso 6.1 (Open Source Edition) released. For features &#038; bug fix details see: <a href="http://bit.ly/dgbAXS">link</a></strong></p>
<p><img src="http://webr3.org/blog/wp-content/uploads/2010/02/spo.jpg" alt="spo" title="spo" width="600" height="250" class="alignnone size-full wp-image-226" /></p>
]]></content:encoded>
			<wfw:commentRss>http://webr3.org/blog/linked-data/virtuoso-6-sparqlgeo-and-linked-data/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

