<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-37266203</id><updated>2012-02-16T16:24:28.204-08:00</updated><category term='owl'/><category term='xml'/><category term='semanticweb'/><category term='sxml'/><category term='spin'/><category term='n3'/><category term='sparql'/><category term='topbraid'/><title type='text'>Ascension Semantica</title><subtitle type='html'>The intent of this blog is to document my knowledge journey as I learn my way around the tools and techniques of the semantic technology field. Lessons learned and occasional reflection can be found here. If I do drift into blabber about my bad hair day, my sick cat, politics, etc -please somebody come slap me.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://ascensionsemantica.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37266203/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://ascensionsemantica.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Darth Semanticus</name><uri>http://www.blogger.com/profile/00180357492091898641</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://yacob.org/semantica/vader4.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>22</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-37266203.post-2747410875430530272</id><published>2010-04-22T18:37:00.000-07:00</published><updated>2010-04-22T19:29:12.242-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='owl'/><title type='text'>When OWL 2 QCRs Don't Qualify</title><content type='html'>&lt;div style="text-align: justify;"&gt;Was bitten hard by this one recently, leading me to have to refactor a fair amount of work.  In TopBraid Composer I've enjoyed using the OWL2 Qualified Cardinality Restrictions in subclass constraints in the form:&lt;/div&gt;&lt;br /&gt;&lt;pre&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  my:property exactly 1 my:Class&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;which I liked mostly for the brevity of the syntax -which I thought was shorthand for:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  my:property all my:Class&lt;br /&gt;&amp;nbsp;&amp;nbsp;my:property exactly 1&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;But its &lt;b&gt;&lt;i&gt;not&lt;/i&gt;&lt;/b&gt;.  The semantics of the first is &lt;i&gt;"the class may have &lt;b&gt;any number&lt;/b&gt; of my:property properties, but one of the many must be of type my:Class"&lt;/i&gt;.  While the semantics of the second form reads &lt;i&gt;"the class has &lt;b&gt;only one&lt;/b&gt; my:property property and its value must be a my:Class type"&lt;/i&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Seems obvious now. Live and learn (and refactor)...&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37266203-2747410875430530272?l=ascensionsemantica.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ascensionsemantica.blogspot.com/feeds/2747410875430530272/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37266203&amp;postID=2747410875430530272' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37266203/posts/default/2747410875430530272'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37266203/posts/default/2747410875430530272'/><link rel='alternate' type='text/html' href='http://ascensionsemantica.blogspot.com/2010/04/when-owl-2-qcrs-dont-qualify.html' title='When OWL 2 QCRs Don&apos;t Qualify'/><author><name>Darth Semanticus</name><uri>http://www.blogger.com/profile/00180357492091898641</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://yacob.org/semantica/vader4.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37266203.post-6534420664899058864</id><published>2009-11-19T19:41:00.000-08:00</published><updated>2009-11-21T15:32:19.831-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='n3'/><category scheme='http://www.blogger.com/atom/ns#' term='sparql'/><category scheme='http://www.blogger.com/atom/ns#' term='sxml'/><category scheme='http://www.blogger.com/atom/ns#' term='spin'/><category scheme='http://www.blogger.com/atom/ns#' term='xml'/><title type='text'>A Bad, Bad SPARQL Pattern &amp; A Good smf:trace</title><content type='html'>I should have known better...&lt;br /&gt;&lt;br /&gt;Whats wrong with the following:&lt;pre&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  SELECT ?a ?b ?c ?d&lt;br /&gt;  WHERE {&lt;br /&gt;    ?subject :child ?a,?b,?c,?d .&lt;br /&gt;    ?a a :A .&lt;br /&gt;    ?b a :B .&lt;br /&gt;    ?c a :C .&lt;br /&gt;    ?d a :D .&lt;br /&gt;       ⋮&lt;br /&gt;  }&lt;/span&gt;&lt;/pre&gt;it is equivalent to:&lt;pre&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  SELECT ?a ?b ?c ?d&lt;br /&gt;  WHERE {&lt;br /&gt;    ?subject :child ?a .&lt;br /&gt;    ?subject :child ?b .&lt;br /&gt;    ?subject :child ?c .&lt;br /&gt;    ?subject :child ?d .&lt;br /&gt;    ?a a :A .&lt;br /&gt;    ?b a :B .&lt;br /&gt;    ?c a :C .&lt;br /&gt;    ?d a :D .&lt;br /&gt;       ⋮&lt;br /&gt; }&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div style="text-align: justify;"&gt;the answer is "performance". The evaluation may run forever as the SPARQL engine attempts to try every permutation (random each time it seems) of ?a ?b ?c ?d obtained in the :child statements, that will match the type restrictions.  The fix:&lt;/div&gt;&lt;pre&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  SELECT ?a ?b ?c ?d&lt;br /&gt;  WHERE {&lt;br /&gt;    ?subject :child ?a .&lt;br /&gt;    ?a a :A .&lt;br /&gt;    ?subject :child ?b .&lt;br /&gt;    ?b a :B .&lt;br /&gt;    ?subject :child ?c .&lt;br /&gt;    ?c a :C .&lt;br /&gt;    ?subject :child ?d .&lt;br /&gt;    ?d a :D .&lt;br /&gt;       ⋮&lt;br /&gt;  }&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div style="text-align: justify;"&gt;Perhaps less elegant by some measures but expressed this way the immediate type test of each variable reduces the remaining list of properties that need be checked in the pattern.  This is the "check as you go" vs the initial "grab first and check later" approach which will cause your computer to overheat and shut off before evaluation ever completes (assuming at least a hundred instances). &lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Just how bad is it?  Painfully bad.  Using the &lt;a href="http://composing-the-semantic-web.blogspot.com/2009/11/sparql-debugger-and-profiler.html"&gt;SPARQL Profiler&lt;/a&gt; feature in TBC 3.2 I set up a comparison test of the two patterns queried over a &lt;i&gt;single&lt;/i&gt; instance with 7 :child properties.  In the original "grab first check later" pattern the profiler reported 91,760,824 finds over the same number of triples.  In the "check as you go" pattern the profiler reported only 76 finds over the same number of triples required.  How many orders of magnitude difference is that?  In my real world problem I had several hundred instances and and a dozen :child nodes.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;I ran into this while mapping an XML file imported into TopBraid Composer (TBC) which is automatically converted into RDF under the "Semantic XML" model.  With the RDF representation you can then map the SXML representation into your target model.  Previously I had been through this exercise with SPARQLMotion support, but this time around I wanted to try it with SPIN following the Holger Knublauch's "&lt;a href="http://composing-the-semantic-web.blogspot.com/2009/08/ontology-mapping-with-spin-templates.html"&gt;Ontology Mapping with SPIN Templates&lt;/a&gt;" blog entry.  &lt;b&gt;&lt;i&gt;Really&lt;/i&gt;&lt;/b&gt; neat stuff once I got the SPARQL patterns right.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Along the way I also discovered &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="color:#000099;"&gt;smf:trace&lt;/span&gt;&lt;/span&gt; while trying to figure out where the performance bottleneck was.  Initially I had thought it was the &lt;a href="http://ascensionsemantica.blogspot.com/2009/09/new-spin-cycle.html"&gt;SPIN functions&lt;/a&gt; that I was using, but spin:trace allowed me to quickly realize that the functions were quite performant and the the culprit at all.  smf:trace works like smf:buildURI and smf:buildString but echos your string into the error log.  Use smf:trace with a dummy assignment in a LET statement within a WHERE clause of a SPARQL expression as per:&lt;/div&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;div style="border: 2px solid black; padding: 5px 20px 5px 5px; overflow: auto; font-family: verdana; background-color: rgb(238, 238, 221); font-size: 11px; position: relative; width: 360px;"&gt;   LET ( ?foo := smf:trace( "myFunction: {?result}" ) ) &lt;/div&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;div style="text-align: justify;"&gt;So moral of the story:  how you would write N3 triples nice and concisely in an ontology body is not always the best way to express the same statements in a SPARQL query body.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37266203-6534420664899058864?l=ascensionsemantica.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ascensionsemantica.blogspot.com/feeds/6534420664899058864/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37266203&amp;postID=6534420664899058864' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37266203/posts/default/6534420664899058864'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37266203/posts/default/6534420664899058864'/><link rel='alternate' type='text/html' href='http://ascensionsemantica.blogspot.com/2009/11/bad-bad-sparql-pattern-good-spintrace.html' title='A Bad, Bad SPARQL Pattern &amp; A Good smf:trace'/><author><name>Darth Semanticus</name><uri>http://www.blogger.com/profile/00180357492091898641</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://yacob.org/semantica/vader4.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37266203.post-5631173557930587033</id><published>2009-11-07T05:14:00.000-08:00</published><updated>2009-11-09T08:24:29.391-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='topbraid'/><category scheme='http://www.blogger.com/atom/ns#' term='semanticweb'/><title type='text'>New TBC Feature - Group by Namespace</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_WxoMYIXW62w/Sveu7Q30jSI/AAAAAAAAACk/bsqsC-GIHYM/s1600-h/GroupedPropertiesExpanded.png"&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_WxoMYIXW62w/SvVy8-wPBKI/AAAAAAAAACM/lApn8eXCRMY/s1600-h/GroupedProperties.png"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;" src="http://2.bp.blogspot.com/_WxoMYIXW62w/SvVy8-wPBKI/AAAAAAAAACM/lApn8eXCRMY/s400/GroupedProperties.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5401349720063804578" /&gt;&lt;/a&gt;&lt;div style="text-align: justify;"&gt;One of the greatest strengths of TopBraid Composer (TBC) that sets it apart from other ontology tools, is its ability to easily work with and manage collections of ontologies.  When it is so easy to work with independent ontologies you'll find yourself going modular quite naturally.  And why not? Modularity is a fundamental programming organization principle that you've used for years, decades even, that makes reuse possible.  Who writes monolithic programs anymore?  The same goes with ontology composition.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;So when the capability is at your fingertips again you'll find yourself using it.  The unintended consequence however will be a proliferation of namespaces. Typically, but not necessarily, at the level of one namespace per ontology file.  As you get even more advanced in ontology asset management, you'll begin to split content, under a single namespace, across several files. &lt;i&gt;Remember, namspaces and baseURIs are not one in the same.&lt;/i&gt;  &lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "&gt;&lt;img src="http://3.bp.blogspot.com/_WxoMYIXW62w/Sveu7Q30jSI/AAAAAAAAACk/bsqsC-GIHYM/s400/GroupedPropertiesExpanded.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5401978611218812194" style="float: left; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; cursor: pointer; width: 143px; height: 327px; " /&gt;&lt;/span&gt;&lt;div style="text-align: justify;"&gt;With lots of namespaces in play searching for a particular class or property takes increasing effort.  Either from longer lists to scroll through or from longer lists of search results to sort through when a search string shows up as a pattern in more and more names over your inventory.  Here is where the new feature "Group by Namespace" comes to the rescue.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "&gt;&lt;/span&gt;&lt;div style="text-align: justify;"&gt;In the lower left corner of the TBC "Classes" and "Properties" views, on the left side of the search input area, you will find now an icon of three stacked items &lt;br/&gt;(&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_WxoMYIXW62w/SvetrK7Tn7I/AAAAAAAAACU/-hfuo1om99Q/s1600-h/GroupedClassesIcon.png"&gt;&lt;img src="http://1.bp.blogspot.com/_WxoMYIXW62w/SvetrK7Tn7I/AAAAAAAAACU/-hfuo1om99Q/s400/GroupedClassesIcon.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5401977235233284018" style="cursor: pointer; width: 24px; height: 20px; vertical-align: text-bottom;" /&gt;&lt;/a&gt; and &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_WxoMYIXW62w/Svety4ZS0qI/AAAAAAAAACc/lHzcsifL7Rs/s1600-h/GroupedPropertiesIcon.png"&gt;&lt;img src="http://3.bp.blogspot.com/_WxoMYIXW62w/Svety4ZS0qI/AAAAAAAAACc/lHzcsifL7Rs/s400/GroupedPropertiesIcon.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5401977367697740450" style="cursor: pointer; width: 24px; height: 20px;  vertical-align: text-bottom;" /&gt;&lt;/a&gt;).  By default the classes and properties are listed in alphabetical order, with hierarchy for the subclass and subproperty trees. Click this icon and the organization will change to where a list of namespace prefixes are shown at the root level.  Each namespace prefix acts now like a folder that contains a flat, but still alphabetic, list of the  properties or classes defined under that namespace.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;This may not seem like a such a great convenience at first, but when you work with hundreds or even thousands of items under tens and tens of namespaces the feature's utility quickly comes to light.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37266203-5631173557930587033?l=ascensionsemantica.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ascensionsemantica.blogspot.com/feeds/5631173557930587033/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37266203&amp;postID=5631173557930587033' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37266203/posts/default/5631173557930587033'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37266203/posts/default/5631173557930587033'/><link rel='alternate' type='text/html' href='http://ascensionsemantica.blogspot.com/2009/11/new-tbc-feature-group-by-namespace.html' title='New TBC Feature - Group by Namespace'/><author><name>Darth Semanticus</name><uri>http://www.blogger.com/profile/00180357492091898641</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://yacob.org/semantica/vader4.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_WxoMYIXW62w/SvVy8-wPBKI/AAAAAAAAACM/lApn8eXCRMY/s72-c/GroupedProperties.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37266203.post-5781187209042277690</id><published>2009-10-27T11:24:00.000-07:00</published><updated>2009-10-27T11:57:28.799-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sparql'/><title type='text'>Counting on SPARQL Aggregates</title><content type='html'>&lt;div style="text-align: justify;"&gt;This is largely a note to myself so I can remember the syntax for a &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;DISTINCT&lt;/span&gt; count which is somewhat unintuitive. The regular syntax to get a count:&lt;/div&gt;&lt;pre&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  SELECT (count(?foo) AS ?count)&lt;br /&gt;  WHERE { ... }&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div&gt;However, this will not be a unique count of the ?foo items.  To make the count &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;DISTINCT&lt;/span&gt; the syntax is:&lt;/div&gt;&lt;div&gt;&lt;pre&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  SELECT (count(DISTINCT ?foo) AS ?count)&lt;br /&gt;  WHERE { ... }&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold; "&gt;Not:&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;pre&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  SELECT DISTINCT (count(?foo) AS ?count)&lt;br /&gt;  WHERE { ... }&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;where the &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;DISTINCT&lt;/span&gt; in this case has no impact whatsoever.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;The use of the "&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;AS&lt;/span&gt;" keyboard is itself unintuitive as it breaks the norm for how variable assignment is expressed in the &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;WHERE&lt;/span&gt; clause. In fact I think it would be good to drop it and keep the SPARQL vocabulary minimal.  The only use of "&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;AS&lt;/span&gt;" that I've encountered is to assign a variable in a &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;SELECT&lt;/span&gt; statement in the form:&lt;/div&gt;&lt;pre&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  SELECT (count(?foo) AS ?count) ...&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div&gt;The oddity here is that the variable ?count is assigned on the right hand side of the operator, "&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;AS&lt;/span&gt;", instead of the left hand side as we've gotten used to with &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;LET functions&lt;/span&gt;.  Why not use &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;LET&lt;/span&gt; here as well? For example:&lt;/div&gt;&lt;pre&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  SELECT LET(?count := count(?foo)) ...&lt;/span&gt;&lt;/pre&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37266203-5781187209042277690?l=ascensionsemantica.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ascensionsemantica.blogspot.com/feeds/5781187209042277690/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37266203&amp;postID=5781187209042277690' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37266203/posts/default/5781187209042277690'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37266203/posts/default/5781187209042277690'/><link rel='alternate' type='text/html' href='http://ascensionsemantica.blogspot.com/2009/10/counting-on-sparql-aggregates.html' title='Counting on SPARQL Aggregates'/><author><name>Darth Semanticus</name><uri>http://www.blogger.com/profile/00180357492091898641</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://yacob.org/semantica/vader4.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37266203.post-1862704511404427383</id><published>2009-09-30T22:22:00.000-07:00</published><updated>2009-10-15T18:35:51.774-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sparql'/><category scheme='http://www.blogger.com/atom/ns#' term='spin'/><title type='text'>A New SPIN Cycle</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_WxoMYIXW62w/Ssa72eZ2GrI/AAAAAAAAABc/5kjC1y1NcPs/s1600-h/SPIN-logo.png"&gt;&lt;img style="margin: 0px 10px 10px 0px; text-align: center; float: left; cursor: pointer; width: 199px; height: 146px;" src="http://4.bp.blogspot.com/_WxoMYIXW62w/Ssa72eZ2GrI/AAAAAAAAABc/5kjC1y1NcPs/s320/SPIN-logo.png" alt="" id="BLOGGER_PHOTO_ID_5388200548744174258" border="0" /&gt;&lt;/a&gt;&lt;div style="text-align: justify;"&gt;My first &lt;a href="http://spinrdf.org/"&gt;SPIN&lt;/a&gt; cycle was about 10 months ago in the first part of December.  It was short lived as I had to dive deep into other things quickly and the new concepts that I was struggling with then didn't get the chance to sink in before their memory would begin to fade.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;At that time I was struck by SPIN's potential and the promise of having a semantic rule language that applied a language that I already knew and evoked daily -SPARQL. Working previously with SWRL had left a bad taste in my mouth for rule languages.  Nothing against &lt;a href="http://www.w3.org/Submission/SWRL/"&gt;SWRL&lt;/a&gt; itself, it was the engines that processed it that seemed to be the problem. They were disappointingly slow to say the least.  Just to detect simple "uncle" relationships in a small family tree the engines would take tens of minutes if they didn't crash altogether. The logician in me was drawn toward rule based specifications, but the pragmatist in me was left wondering why use rules when you could get the same information a thousand times faster with a SPARQL query?&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;It didn't occur to me to put the two together (not that I could have), fortunately it did occur to the very capable &lt;a href="http://composing-the-semantic-web.blogspot.com/"&gt;Holger Knublauch&lt;/a&gt;.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_WxoMYIXW62w/StDjaUs6lXI/AAAAAAAAACE/iO9q7Cl8K-o/s1600-h/smFuncExample.png"&gt;&lt;img src="http://2.bp.blogspot.com/_WxoMYIXW62w/StDjaUs6lXI/AAAAAAAAACE/iO9q7Cl8K-o/s400/smFuncExample.png" alt="" id="BLOGGER_PHOTO_ID_5391058795335685490" style="margin: 0px 0px 10px 10px; float: right; cursor: pointer; width: 254px; height: 300px;" border="0" /&gt;&lt;/a&gt;&lt;div style="text-align: justify;"&gt;While I did not use SPIN during the intervening months, I did use it indirectly in setting up SPARQLMotion web services. To make a SPARQLMotion script accessible as a web service you first define a SPIN function, incoming arguments, then point the function at a SPARQLMotion return module.  Reapproaching SPIN at the end of September I found that the function side of it was already familiar, and &lt;a href="http://www.topquadrant.com/products/TB_Composer.html"&gt;TopBraid Composer&lt;/a&gt; has evolved nicely to make working with SPIN a more natural experience.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;SPIN now comes with a small library of useful functions in addition to the XPath (&lt;b&gt;fn:&lt;/b&gt;) and ARQ (&lt;b&gt;afn:&lt;/b&gt;) &lt;a href="http://jena.sourceforge.net/ARQ/library-function.html"&gt;SPARQL functions&lt;/a&gt; that Jena supports as well as the &lt;a href="http://www.topquadrant.com/products/SPARQLMotion_docs/SPARQLMotion_functions.html"&gt;SPARQLMotion functions&lt;/a&gt; (&lt;b&gt;smf:&lt;/b&gt;).  These functions serve the most common types of operations that you would encounter and provide the basic building blocks that you would need to build new functions in SPIN.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Consider the scenario that I found myself in recently where I wanted to convert only the first character of a string to uppercase.  &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;fn:upper-case&lt;/b&gt;&lt;/span&gt; was the closest thing available but it operates on the entire string. Not to worry, a few lines of SPARQL can handle it:&lt;br /&gt;&lt;blockquote style=""&gt;&lt;br /&gt;&lt;div style="border: 2px solid black; padding: 5px 20px 5px 5px; overflow: auto; font-family: verdana; background-color: rgb(238, 238, 221); font-size: 11px; position: relative; width: 360px;"&gt;   ?resource rdfs:label ?label .&lt;br /&gt;LET (?lcFirstChar := smf:regex(?label, "^(.).*$", "$1")) .&lt;br /&gt;LET (?ucFirstChar := fn:upper-case(?lcFirstChar)) .&lt;br /&gt;LET (?newLabel := smf:regex(?label, "^(.)", ?ucFirstChar)) . &lt;/div&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;This gets the job done but I didn't fancy copying and pasting the lines over and over again each time I need them in some new query. Here's where SPIN functions come in.  With SPIN functions you can take useful fragments of SPARQL expressions from a &lt;b&gt;WHERE&lt;/b&gt; clause and turn them into parameterized functions that you can simply use anywhere.  The above can be defined in a new SPIN function as seen in this TopBraid screenshot:&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_WxoMYIXW62w/SsbKfQbEOII/AAAAAAAAABk/vzW9tVpHTw0/s1600-h/ucFirst.png"&gt;&lt;img src="http://2.bp.blogspot.com/_WxoMYIXW62w/SsbKfQbEOII/AAAAAAAAABk/vzW9tVpHTw0/s400/ucFirst.png" alt="" id="BLOGGER_PHOTO_ID_5388216642528622722" style="border: 1px solid black; margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 378px; height: 400px;" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Note that in the &lt;b&gt;spin:body&lt;/b&gt; the &lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;&lt;b&gt;?arg1&lt;/b&gt;&lt;/span&gt; is a special variable in spin that corresponds to the first function argument.  We may now apply the function in a &lt;b&gt;LET&lt;/b&gt; statement in any SPARQL block as per:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;div style="border: 2px solid black; padding: 5px 20px 5px 5px; overflow: auto; font-family: verdana; background-color: rgb(238, 238, 221); font-size: 11px; position: relative; width: 360px;"&gt;   LET ( ?newLabel := myFunc:ucFirst( ?label ) ) &lt;/div&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;It gets even better. The family of available SPARQL functions are useful up to a point, but shortly you may find that you need a little more horsepower.  Enter JavaScript and SPINX for extension languages.  JavaScript can be applied to write function bodies that operate on variables passed in from a SPARQL &lt;b&gt;WHERE&lt;/b&gt; clause.  Lets try the &lt;b&gt;ucFirst&lt;/b&gt; again, but this time to write the complement for lowercasing &lt;b&gt;lcFirst&lt;/b&gt;:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_WxoMYIXW62w/SscyMEQhkWI/AAAAAAAAABs/MvNVkiUQGZg/s1600-h/lcFirst.png"&gt;&lt;img src="http://3.bp.blogspot.com/_WxoMYIXW62w/SscyMEQhkWI/AAAAAAAAABs/MvNVkiUQGZg/s400/lcFirst.png" alt="" id="BLOGGER_PHOTO_ID_5388330662054957410" style="border: 1px solid black; margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 366px;" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;On the SPARQL side the syntax is unchanged:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;div style="border: 2px solid black; padding: 5px 20px 5px 5px; overflow: auto; font-family: verdana; background-color: rgb(238, 238, 221); font-size: 11px; position: relative; width: 360px;"&gt;   LET ( ?newLabel := myFunc:lcFirst( ?label ) ) &lt;/div&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;div style="text-align: justify;"&gt;In principle any scripting language may be applied in SPIN functions for which there is a &lt;a href="https://scripting.dev.java.net/"&gt;JSR-223 scripting engine available&lt;/a&gt;. Note that I've been using the namespace "myFunc:" in these examples.  It is the intention that developers would maintain the spin functions that they develop in an ontology just for functions.  In this way creating a reusable library of functions that can be imported into new ontologies as needed.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37266203-1862704511404427383?l=ascensionsemantica.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ascensionsemantica.blogspot.com/feeds/1862704511404427383/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37266203&amp;postID=1862704511404427383' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37266203/posts/default/1862704511404427383'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37266203/posts/default/1862704511404427383'/><link rel='alternate' type='text/html' href='http://ascensionsemantica.blogspot.com/2009/09/new-spin-cycle.html' title='A New SPIN Cycle'/><author><name>Darth Semanticus</name><uri>http://www.blogger.com/profile/00180357492091898641</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://yacob.org/semantica/vader4.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_WxoMYIXW62w/Ssa72eZ2GrI/AAAAAAAAABc/5kjC1y1NcPs/s72-c/SPIN-logo.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37266203.post-2557438566970836107</id><published>2007-08-12T21:39:00.000-07:00</published><updated>2007-08-12T21:41:34.994-07:00</updated><title type='text'>When not to use XML</title><content type='html'>Discovered the hard way that "xml" as the start of a namespace prefix (e.g. xmlfoo:) is a no-no. Apparently "xml" as a prefix within a namespace prefix is off limits -causes Jena errors.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37266203-2557438566970836107?l=ascensionsemantica.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ascensionsemantica.blogspot.com/feeds/2557438566970836107/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37266203&amp;postID=2557438566970836107' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37266203/posts/default/2557438566970836107'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37266203/posts/default/2557438566970836107'/><link rel='alternate' type='text/html' href='http://ascensionsemantica.blogspot.com/2007/08/when-not-to-use-xml.html' title='When not to use XML'/><author><name>Darth Semanticus</name><uri>http://www.blogger.com/profile/00180357492091898641</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://yacob.org/semantica/vader4.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37266203.post-6100931190305935223</id><published>2007-08-05T19:10:00.000-07:00</published><updated>2007-08-05T19:11:07.623-07:00</updated><title type='text'>Always run consistency checks...</title><content type='html'>Always.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37266203-6100931190305935223?l=ascensionsemantica.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ascensionsemantica.blogspot.com/feeds/6100931190305935223/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37266203&amp;postID=6100931190305935223' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37266203/posts/default/6100931190305935223'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37266203/posts/default/6100931190305935223'/><link rel='alternate' type='text/html' href='http://ascensionsemantica.blogspot.com/2007/08/always-run-consistency-checks.html' title='Always run consistency checks...'/><author><name>Darth Semanticus</name><uri>http://www.blogger.com/profile/00180357492091898641</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://yacob.org/semantica/vader4.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37266203.post-1044922278905024924</id><published>2007-08-05T19:05:00.000-07:00</published><updated>2007-08-05T19:10:30.336-07:00</updated><title type='text'>Jena No Likey XML 1.1??</title><content type='html'>Having some headaches with Jena loading XML 1.1 based ontologies this evening.  The underlying SAX parser is XML 1.1 capable but it seems that the parser is not instantiated with XML 1.1 options turned on.&lt;br /&gt;&lt;br /&gt;Searching the net I'm not finding much discussion on the topic which leaves me wondering if I'm the first to arrive at this point.  Does anyone know if there is a way, short of rebuilding Jena itself, to get Jena to load XML 1.1 based models?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37266203-1044922278905024924?l=ascensionsemantica.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ascensionsemantica.blogspot.com/feeds/1044922278905024924/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37266203&amp;postID=1044922278905024924' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37266203/posts/default/1044922278905024924'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37266203/posts/default/1044922278905024924'/><link rel='alternate' type='text/html' href='http://ascensionsemantica.blogspot.com/2007/08/jena-no-likey-xml-11.html' title='Jena No Likey XML 1.1??'/><author><name>Darth Semanticus</name><uri>http://www.blogger.com/profile/00180357492091898641</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://yacob.org/semantica/vader4.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37266203.post-9193538837318689395</id><published>2007-06-28T10:50:00.000-07:00</published><updated>2007-06-28T11:26:53.925-07:00</updated><title type='text'>Ontologies do NOT import namespace prefix mappings</title><content type='html'>For quite a while I was lead to believe that namespace prefix mappings were imported into an ontology and were "known" and reusable by the importing ontology.  While this is true for seemingly everything else: classes, properties, individuals, statements, it is not so for namespace prefix mappings.&lt;br /&gt;&lt;br /&gt;Why?  Well, namespace prefixes are an XML concept while the rest are ontology (RDF/OWL) concepts.  TopBraid Composer also misdirected me a bit by reusing the same "shading means imported" paradigm used for classes and the like as it did for namespaces.  For namespaces, shading does mean that they have come from an imported source, you just can't make use of them -they are presented for informative purposes only.  If you do want to use a namespace from the import list, "Clone" it with the "Clone" button, this makes a local copy.&lt;br /&gt;&lt;br /&gt;If you don't, TBC is smart enough to make some guesses to resolve unknown prefixes, but when it can't it uses a "j.#"  (i.e. j.0, j.1, j.2 ...) as a place holder (really its Jena doing this).&lt;br /&gt;&lt;br /&gt;Live and learn...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37266203-9193538837318689395?l=ascensionsemantica.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ascensionsemantica.blogspot.com/feeds/9193538837318689395/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37266203&amp;postID=9193538837318689395' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37266203/posts/default/9193538837318689395'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37266203/posts/default/9193538837318689395'/><link rel='alternate' type='text/html' href='http://ascensionsemantica.blogspot.com/2007/06/ontologies-do-not-import-namespace.html' title='Ontologies do NOT import namespace prefix mappings'/><author><name>Darth Semanticus</name><uri>http://www.blogger.com/profile/00180357492091898641</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://yacob.org/semantica/vader4.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37266203.post-2508915146710144717</id><published>2007-04-24T07:02:00.000-07:00</published><updated>2007-04-24T07:20:27.097-07:00</updated><title type='text'>TBC: Indirect Instances</title><content type='html'>Finally!&lt;br /&gt;&lt;br /&gt;For months my coworker has had a neat feature enabled in his TopBraid Composer where from a parent class the instance count of child, subchild, etc are indicated at the parent level in parenthesis.  This is a nice feature because it saves you from drilling down class trees to find where your instances are.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://yacob.org/semantica/ShowIndirectInstances.png"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://yacob.org/semantica/ShowIndirectInstances.png" alt="" border="0" /&gt;&lt;/a&gt;Only problem was he couldn't recall how he enabled the feature and it wasn't an option in the Window &gt; Preferences &gt; TopBraid Composer list. I stumbled into it under the "Instances" window options. Its the last option with the label "Show indirect instances":&lt;br /&gt;&lt;br /&gt;This feature definitely reduces my instance hunting time, modeling life just got easier.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37266203-2508915146710144717?l=ascensionsemantica.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ascensionsemantica.blogspot.com/feeds/2508915146710144717/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37266203&amp;postID=2508915146710144717' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37266203/posts/default/2508915146710144717'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37266203/posts/default/2508915146710144717'/><link rel='alternate' type='text/html' href='http://ascensionsemantica.blogspot.com/2007/04/tbc-indirect-instances.html' title='TBC: Indirect Instances'/><author><name>Darth Semanticus</name><uri>http://www.blogger.com/profile/00180357492091898641</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://yacob.org/semantica/vader4.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37266203.post-4138941213274799390</id><published>2007-04-11T14:21:00.000-07:00</published><updated>2007-04-12T12:21:47.515-07:00</updated><title type='text'>SeRQL Query for all Resources w/o Some Relationship</title><content type='html'>After a few tries I managed to form a SeRQL query that would give me resources of a given type that did &lt;span style="font-style: italic;"&gt;not&lt;/span&gt; have a given relationship:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;select distinct&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;localName(A)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;from&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;{A} rdf:type {foo:AClass}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;where not exists (&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  select A&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  from&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  {A} foo:hasBar {B}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;using namespace ...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Still, it seems this could be more simply expressed, what I was initially expecting was something more concise such as:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt;select distinct&lt;/span&gt;&lt;br /&gt; &lt;span style="font-family: courier new;"&gt;localName(A)&lt;/span&gt;&lt;br /&gt; &lt;span style="font-family: courier new;"&gt;from&lt;/span&gt;&lt;br /&gt; &lt;span style="font-family: courier new;"&gt;{A} rdf:type {foo:AClass},&lt;br /&gt;![{A} foo:hasBar {B}]&lt;br /&gt;&lt;/span&gt; &lt;span style="font-family: courier new;"&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt;using namespace ...&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37266203-4138941213274799390?l=ascensionsemantica.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ascensionsemantica.blogspot.com/feeds/4138941213274799390/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37266203&amp;postID=4138941213274799390' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37266203/posts/default/4138941213274799390'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37266203/posts/default/4138941213274799390'/><link rel='alternate' type='text/html' href='http://ascensionsemantica.blogspot.com/2007/04/serql-querry-for-all-resources-wo-some.html' title='SeRQL Query for all Resources w/o Some Relationship'/><author><name>Darth Semanticus</name><uri>http://www.blogger.com/profile/00180357492091898641</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://yacob.org/semantica/vader4.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37266203.post-4200712845855442072</id><published>2007-04-03T10:59:00.000-07:00</published><updated>2007-05-28T10:35:08.082-07:00</updated><title type='text'>The Case for Anti-Triples</title><content type='html'>A super convenient feature of TopBraid Composer is the capability to manage and manipulate triples.  You can drag a statement from one resource and copy onto another, or a selected group.  This saves lots of repetitive work.  Yet another reason TBC is my favorite ontology editor.&lt;br /&gt;&lt;br /&gt;It is so convenient and you quickly become so dependent on the feature that you start wishing that you could remove triples from a group of resources in the same way.  Triples are always additive in these scenarios, they can only add information and not remove it.  Thus the need for an anti-triple, a triple that represents anti-information.&lt;br /&gt;&lt;br /&gt;This could simply be a triple that is flagged to have a negative sign, so when dropped onto a resource it remove an occurrence of itself -or the pattern it represents. Thought of another way, when a triple meets an anti-triple in an ontological space, they annihilate each other.&lt;br /&gt;&lt;br /&gt;I'm thinking of anti-triples as an editing paradigm of convenience of course.  For instance a triple could be dropped onto a resource with the "-" key held down to take the deletion action.&lt;br /&gt;&lt;br /&gt;Of course Anti-Triples recognized in a future OWL revisions could lead to anti-ontologies of a anti-knowledge, which would no doubt be abused by black-hats for information espionage and evil doing.  Eventually getting fully out of hand by a mad scientist bent on the uncreation of the Semantic Web lest our hero reaches the glowing red off button in the control room in the base of the hollowed out volcano which has just decided to conveniently erupt.&lt;br /&gt;&lt;br /&gt;Time to write a screen play... maybe the Semantic Web will lead to a revival of all the cheezey "net" movies and television shows of the late 90s.  Will semantics make the net-cheeze-flicks any more intelligent this time around?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37266203-4200712845855442072?l=ascensionsemantica.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ascensionsemantica.blogspot.com/feeds/4200712845855442072/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37266203&amp;postID=4200712845855442072' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37266203/posts/default/4200712845855442072'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37266203/posts/default/4200712845855442072'/><link rel='alternate' type='text/html' href='http://ascensionsemantica.blogspot.com/2007/04/case-for-anti-triples.html' title='The Case for Anti-Triples'/><author><name>Darth Semanticus</name><uri>http://www.blogger.com/profile/00180357492091898641</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://yacob.org/semantica/vader4.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37266203.post-7397861892487237863</id><published>2007-04-03T09:45:00.000-07:00</published><updated>2007-04-24T07:52:54.223-07:00</updated><title type='text'>TBC Tip: Form Clicks for Productivity</title><content type='html'>I've learned quite a lot about TBC since my last post in January and have a backlog of tips and techniques to record here, no doubt I've already forgotten a few, but they should come back to mind eventually.&lt;br /&gt;&lt;br /&gt;A trick I've learned only this week helps when working with Class and Resource Forms.  When in a Form view, an alternative to pulling down and selecting the "Add empty row" menu item one can simply double click on the property label.  For example when adding subclass constraints you may double click the "rdfs:subClassOf" label and an empty row appears.  This saves some mouse work, still I'd like to see the "Insert" key do the same.&lt;br /&gt;&lt;br /&gt;Another trick can simplify adding new properties to a form.  In addition to dragging and dropping a property onto a form, you can right-click the form background and receive a list of applicable properties.  Depending where you click on the form (Annotation, Axiom, or Other Properties sections) you get a context sensitive list of properties.&lt;br /&gt;&lt;br /&gt;Less mousing around, more modeling, good stuff!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37266203-7397861892487237863?l=ascensionsemantica.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ascensionsemantica.blogspot.com/feeds/7397861892487237863/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37266203&amp;postID=7397861892487237863' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37266203/posts/default/7397861892487237863'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37266203/posts/default/7397861892487237863'/><link rel='alternate' type='text/html' href='http://ascensionsemantica.blogspot.com/2007/04/tip-tbc-form-clicks-for-productivity.html' title='TBC Tip: Form Clicks for Productivity'/><author><name>Darth Semanticus</name><uri>http://www.blogger.com/profile/00180357492091898641</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://yacob.org/semantica/vader4.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37266203.post-7303826960935058622</id><published>2007-04-03T06:41:00.000-07:00</published><updated>2007-04-03T09:45:45.857-07:00</updated><title type='text'>SPARQLets!</title><content type='html'>A neat feature of TopBraid Composer is the ability to save SPARQL queries in your ontology, as a "sparql:query" string type.  These queries will then appear in "Query Library" tab where they can be invoked by simple mouse clicks. The inferred results can also be asserted and saved back into the model.&lt;br /&gt;&lt;br /&gt;The stored queries are bound to a particular ontology though. I'd like to have a capability to store general queries in a "bookmark" like form that could be invoked against any ontology. This would be analogous to &lt;a href="http://en.wikipedia.org/wiki/Bookmarklet"&gt;Bookmarklets&lt;/a&gt;  (Bookmarks of Javascript Applets), thus &lt;span style="font-style: italic;"&gt;SPARQlets!&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span&gt;For next week - &lt;span style="font-style: italic;"&gt;SPARQLets that say "ni!"&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37266203-7303826960935058622?l=ascensionsemantica.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ascensionsemantica.blogspot.com/feeds/7303826960935058622/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37266203&amp;postID=7303826960935058622' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37266203/posts/default/7303826960935058622'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37266203/posts/default/7303826960935058622'/><link rel='alternate' type='text/html' href='http://ascensionsemantica.blogspot.com/2007/04/sparqlets.html' title='SPARQLets!'/><author><name>Darth Semanticus</name><uri>http://www.blogger.com/profile/00180357492091898641</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://yacob.org/semantica/vader4.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37266203.post-4907360537009961608</id><published>2007-01-05T15:07:00.000-08:00</published><updated>2008-12-08T21:23:16.530-08:00</updated><title type='text'>Dropping Triples</title><content type='html'>Discovered another neat labor saving &lt;a href="http://topbraidcomposer.com/"&gt;TopBraid Composer &lt;/a&gt;feature.  Lets say you create a new property, apply it to an instance with some value, then need to repeat for oodles more instances of the same class, or may apply over various classes. Select the instances that you want to update and drag them in the Basket.&lt;br /&gt;&lt;br /&gt;Now go to Window &gt; Show View &gt; Triples.  The Triples window will appear, then check the ontology you want to work with, click the first "triple" icon, and navigate to and select the instance where you have already applied the property that you want to copy.  Once you have a list of all triples where that instance is the subject shall appear.&lt;br /&gt;&lt;br /&gt;Now the neat part.  Select the triple(s) that you want to apply to instances in your basket, and simply drag and drop them on.  A prompt will appear to ask if you want to apply the triple to the all individuals in the basket, making them the subject, click "Yes" and voila! You've just saved yourself a lot of repetition.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;Neat feature #2:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I've been seeing the not-so-intuitive &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_WxoMYIXW62w/RZ7iMplBmOI/AAAAAAAAAAM/50Y3MByPnQw/s1600-h/find_references.png"&gt;&lt;img style="cursor: pointer;" src="http://4.bp.blogspot.com/_WxoMYIXW62w/RZ7iMplBmOI/AAAAAAAAAAM/50Y3MByPnQw/s320/find_references.png" alt="" id="BLOGGER_PHOTO_ID_5016695741884766434" align="inline" border="0" /&gt;&lt;/a&gt; icon around, wondering what it was and never using it. Now its my favorite feature. Visually I thought it looked like something was being downloaded or saved. Its a reference finder, maybe binoculars would be a better mnemonic, I can't suggest anything sensible that makes for a better "reference" image.  Select a property, class or instance, double click it to load it into a form. Then hit the "Find references" button, a tab will open in the lower pane with the label "Reference" and shows you call cases where that entity shows up in a triple.&lt;br /&gt;&lt;br /&gt;Very handy if you're considering deleting an item, check first if it is referenced anywhere.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37266203-4907360537009961608?l=ascensionsemantica.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ascensionsemantica.blogspot.com/feeds/4907360537009961608/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37266203&amp;postID=4907360537009961608' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37266203/posts/default/4907360537009961608'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37266203/posts/default/4907360537009961608'/><link rel='alternate' type='text/html' href='http://ascensionsemantica.blogspot.com/2007/01/dropping-triples.html' title='Dropping Triples'/><author><name>Darth Semanticus</name><uri>http://www.blogger.com/profile/00180357492091898641</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://yacob.org/semantica/vader4.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_WxoMYIXW62w/RZ7iMplBmOI/AAAAAAAAAAM/50Y3MByPnQw/s72-c/find_references.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37266203.post-6759454123133399844</id><published>2006-12-20T22:30:00.000-08:00</published><updated>2007-04-24T07:51:55.032-07:00</updated><title type='text'>TBC: Name Completion with Ctrl+Space</title><content type='html'>Learned another TopBraid Composer trick: when filling out form fields, you can type Ctrl+Space bar to do name completion, very handy.  Of course dragging and dropping classes into the slot areas works as well.&lt;br /&gt;&lt;br /&gt;Probably lots more tips waiting for me if I read the manual one day...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37266203-6759454123133399844?l=ascensionsemantica.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ascensionsemantica.blogspot.com/feeds/6759454123133399844/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37266203&amp;postID=6759454123133399844' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37266203/posts/default/6759454123133399844'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37266203/posts/default/6759454123133399844'/><link rel='alternate' type='text/html' href='http://ascensionsemantica.blogspot.com/2006/12/tbc-name-completion-with-ctrlspace.html' title='TBC: Name Completion with Ctrl+Space'/><author><name>Darth Semanticus</name><uri>http://www.blogger.com/profile/00180357492091898641</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://yacob.org/semantica/vader4.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37266203.post-3338904878590142464</id><published>2006-12-15T13:15:00.000-08:00</published><updated>2006-12-15T13:27:22.434-08:00</updated><title type='text'>HowTo: Remember Your Power Chord</title><content type='html'>Not a semantic tech topic, but a note to self on how to be a better computer user and save much pain and anguish.  A coworker rescued me last night when I had left my laptop's power chord in the office when returning to my hotel. I've done this a number of times, the worst case undoubtedly in 2003 when I discovered at the airport that I had left my power cable behind and had no time to retrieve it before making a 3+ week international journey. A great friend who had a key to my house dashed off, found the chord (amongst many similar chords), sped off to the airport and saved the day. I thought that would be enough to teach me never to forget my chord again... it wasn't.&lt;br /&gt;&lt;br /&gt;But now, I think I've hit upon a nearly fool proof way to always remember it:&lt;br /&gt;&lt;dir&gt;&lt;span style="font-style: italic;"&gt;Pack the chord first.&lt;/span&gt;&lt;br /&gt;Pack the chord &lt;span style="font-style: italic;"&gt;before&lt;/span&gt; you pack up the laptop.&lt;br /&gt;&lt;/dir&gt;The risk is then that you might get distracted before packing the laptop itself.  The obviously too lite computer bag is sure to remind you, so risk mitigated.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37266203-3338904878590142464?l=ascensionsemantica.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ascensionsemantica.blogspot.com/feeds/3338904878590142464/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37266203&amp;postID=3338904878590142464' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37266203/posts/default/3338904878590142464'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37266203/posts/default/3338904878590142464'/><link rel='alternate' type='text/html' href='http://ascensionsemantica.blogspot.com/2006/12/howto-remember-your-power-chord.html' title='HowTo: Remember Your Power Chord'/><author><name>Darth Semanticus</name><uri>http://www.blogger.com/profile/00180357492091898641</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://yacob.org/semantica/vader4.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37266203.post-3127517068978702517</id><published>2006-12-13T21:20:00.000-08:00</published><updated>2006-12-13T21:36:08.769-08:00</updated><title type='text'>Class Labels &amp; Window Wrangling</title><content type='html'>Learned some new tricks with TopBraid Composer and Eclipse.&lt;br /&gt;&lt;br /&gt;When you create a new class or subclass in TBC, at the bottom of the wizard window there will be &lt;span style="font-size:85%;"&gt;&lt;span style="font-family: courier new;"&gt;rdfs:label&lt;/span&gt;&lt;/span&gt; under the "Property" column and an empty cell in the "Initial Value" column. Check the &lt;span style="font-size:85%;"&gt;&lt;span style="font-family: courier new;"&gt;rdfs:label&lt;/span&gt;&lt;/span&gt; checkbox and in the "Initial Value" column put {name}. This sets the default value for future class creations as well.  {name} will automagically copy the class name into the &lt;span style="font-size:85%;"&gt;&lt;span style="font-family: courier new;"&gt;rdfs:label&lt;/span&gt;&lt;/span&gt; field after you click "Ok".&lt;br /&gt;&lt;br /&gt;Somehow I managed to make my "Classes" window a tab of my "Navigator" window, and also managed to make my "Basket" window pane a tab within the pane to its left. Restoring the tab into a separate window pane is not intuitive.  The way to do it is to hold down your left mouse button and drag the window to the edge of eclipse (left-right, or top-bottom) until a black arrow head appears.  When this arrow head appears, you can release the mouse button and the window is returned as either a vertical split or horizontal split depending on where you dragged the window to.  This also works in other places where you see tabs, such as for source files. Move a source tab in the same way and vertically split the pane, then seeing both windows side by side.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37266203-3127517068978702517?l=ascensionsemantica.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ascensionsemantica.blogspot.com/feeds/3127517068978702517/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37266203&amp;postID=3127517068978702517' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37266203/posts/default/3127517068978702517'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37266203/posts/default/3127517068978702517'/><link rel='alternate' type='text/html' href='http://ascensionsemantica.blogspot.com/2006/12/class-labels-window-wrangling.html' title='Class Labels &amp; Window Wrangling'/><author><name>Darth Semanticus</name><uri>http://www.blogger.com/profile/00180357492091898641</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://yacob.org/semantica/vader4.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37266203.post-697579566823410158</id><published>2006-12-08T14:34:00.000-08:00</published><updated>2006-12-09T05:02:32.149-08:00</updated><title type='text'>A Trisket, A Trasket, A Little Semantic Basket</title><content type='html'>Spent some time writing my first eclipse plug-in following the steps on the TopBraid Composer (TBC) &lt;a href="http://topbraidcomposer.com/pluginDevelopment.html"&gt;Plug-in Development Guide&lt;/a&gt;, fun stuff!  Plus I learned my new favorite eclipse command &lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;Ctrl+Shift+M&lt;/span&gt;&lt;/span&gt; which will automatically add the import for an unresolved class (keep your mouse over the class when hitting the sequence).&lt;br /&gt;&lt;br /&gt;So I used the CreateInstanceAction skeleton and added my own JenaFu to find the resources I wanted from the loaded model, then printed the resources to System.out. It soon dawned on my that the snazier thing to do would be to send the resources to the "Basket" instead. Some inquiries to the TBC folks uncovered that the needed &lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;BasketView&lt;/span&gt;&lt;/span&gt; class was not exported from the jar in TBC 1.3, but they did export it in the &lt;a href="http://topbraidcomposer.com/tbc-1.4.0.html"&gt;1.4 release&lt;/a&gt; that came out today. Thanks guys!&lt;br /&gt;&lt;br /&gt;The tweaks needed:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;import org.topbraidcomposer.ui.views.basket.BasketView;&lt;br /&gt;  :&lt;br /&gt;IWorkbench wb = org.eclipse.ui.PlatformUI.getWorkbench();&lt;br /&gt;IWorkbenchWindow wbw = wb.getActiveWorkbenchWindow();&lt;br /&gt;IWorkbenchPage wbp = wbw.getActivePage();&lt;br /&gt;  :&lt;br /&gt;try {&lt;br /&gt;  BasketView basket = (BasketView)wbp.showView("org.topbraidcomposer.ui.views.basket");&lt;br /&gt;    :&lt;br /&gt;  while (iter.hasNext) {&lt;br /&gt;    basket.add( (Resource)iter.next() );&lt;br /&gt;  }&lt;br /&gt;    :&lt;br /&gt;}&lt;br /&gt;catch(PartInitException ex) {&lt;br /&gt;  :&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Some gotchas:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;1) &lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;wb.getActiveWorkbenchWindow();&lt;/span&gt;&lt;/span&gt; will return null if it is not invoked within a "UI Thread". So if these basket sending lines are in the "&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;AbstractChange&lt;/span&gt;&lt;/span&gt;" class, or in another class that's called by the &lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;AbstractChange&lt;/span&gt;&lt;/span&gt; class, then you're in a UI Thread and it bombs.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;2)&lt;/span&gt; code put &lt;span style="font-style: italic;"&gt;after&lt;/span&gt; the &lt;span style="font-size:85%;"&gt;&lt;span class="style2"  style="font-family:courier new;"&gt;TB.getSession().getChangeEngine().execute(change);&lt;/span&gt;&lt;/span&gt; will be executed &lt;span style="font-style: italic;"&gt;before&lt;/span&gt; the&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;/span&gt; line. Really.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;3)&lt;/span&gt; you don't actually need the &lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;AbstractChange&lt;/span&gt;&lt;/span&gt; class and the corresponding &lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;TB...execute(change);&lt;/span&gt;&lt;/span&gt; line unless you've &lt;span style="font-style: italic;"&gt;modified&lt;/span&gt; the loaded model.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;4)&lt;/span&gt; if you &lt;span style="font-style: italic;"&gt;do&lt;/span&gt; modify the model and want to send items to the basket, then invoke the &lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;TB...execute(change);&lt;/span&gt;&lt;/span&gt; line with an extra argument as per:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Runnable andThen = new Runnable() {&lt;br /&gt;  public void run() {&lt;br /&gt;   sendFoundStatementsToBasket();&lt;br /&gt;  }&lt;br /&gt;};&lt;br /&gt;TB.getSession().getChangeEngine().execute(change, andThen);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;or with an anonymous runnable as the 2nd arg.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37266203-697579566823410158?l=ascensionsemantica.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ascensionsemantica.blogspot.com/feeds/697579566823410158/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37266203&amp;postID=697579566823410158' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37266203/posts/default/697579566823410158'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37266203/posts/default/697579566823410158'/><link rel='alternate' type='text/html' href='http://ascensionsemantica.blogspot.com/2006/12/send-your-resources-to-basket.html' title='A Trisket, A Trasket, A Little Semantic Basket'/><author><name>Darth Semanticus</name><uri>http://www.blogger.com/profile/00180357492091898641</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://yacob.org/semantica/vader4.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37266203.post-2992487321483411569</id><published>2006-11-26T14:52:00.000-08:00</published><updated>2006-11-26T15:03:15.740-08:00</updated><title type='text'>del.icio.us dreams</title><content type='html'>It struck me today that I could use the "notes" field for annotation. For example, if I tag restaurants or parks that I want to visit, I can write my reviews of them later. A reminder to myself for whether or not I would want to return. Or I could also tag such sites with "good", "bad", but this is not expressive enough.&lt;br /&gt;&lt;br /&gt;The notes field likely has some length limitation that wouldn't allow for much annotation, perhaps it can store a URL back to blog page that would have a more in-depth annotation.&lt;br /&gt;&lt;br /&gt;What I'd &lt;span style="font-style:italic;"&gt;really&lt;/span&gt; like from del.icio.us would be a way to relate tags with my own properties. While dreaming, why not go all the way and extend the tag editor to a full OWL class editor?&lt;br /&gt;&lt;br /&gt;If you're going to dream, dream big. Time to look for the del.icio.us feedback form...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37266203-2992487321483411569?l=ascensionsemantica.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ascensionsemantica.blogspot.com/feeds/2992487321483411569/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37266203&amp;postID=2992487321483411569' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37266203/posts/default/2992487321483411569'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37266203/posts/default/2992487321483411569'/><link rel='alternate' type='text/html' href='http://ascensionsemantica.blogspot.com/2006/11/delicious-dreams.html' title='del.icio.us dreams'/><author><name>Darth Semanticus</name><uri>http://www.blogger.com/profile/00180357492091898641</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://yacob.org/semantica/vader4.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37266203.post-3023559377847898944</id><published>2006-11-13T07:55:00.000-08:00</published><updated>2006-11-13T13:35:12.063-08:00</updated><title type='text'>Early SPARQL Impressions</title><content type='html'>I postponed blogging this, then had to relearn this morning how I did it &lt;span style="font-style: italic;"&gt;-shame!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Spent my first significant amount of time with &lt;a href="http://www.w3.org/TR/rdf-sparql-query/"&gt;SPARQL&lt;/a&gt; in the middle of last week and had to struggle with it a bit before getting the hang of it. I seem to get more (initially) out of struggling than reading through documentation -but will do that later for the advanced syntax.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://topbraidcomposer.com/"&gt;TopBraid Composer&lt;/a&gt; has a decent SPARQL interface, very handy and has enough smarts that it is aware of local prefixes, they need not be specified via PREFIX. I wish it had a little more sanity checking though, it doesn't complain if you SELECT a variable that is never defined in the WHERE, it silently returns an empty list of results.  Some of my typos got through in that way leading me to think I had malformed WHERE syntax.&lt;br /&gt;&lt;br /&gt;I've got to find out what "." really means, right now I view it as a pipe where the result set from the first part of a condition are fed into the next.  That is each successive predicate operates only on the set found by the preceding predicate.  No space is needed after the "." and the end of the predicate string, and the dot after the final predicate is optional.&lt;br /&gt;&lt;br /&gt;This took me a number of tries, How to find the rdfs:labels of instances of some subclass:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;SELECT ?label&lt;br /&gt;WHERE {&lt;br /&gt; ?sub rdfs:subClassOf foo:Bar .&lt;br /&gt; ?inst  rdf:type ?sub .&lt;br /&gt; ?inst rdfs:label ?label&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Which I read as bottom-to-top as &lt;span style="font-style: italic;"&gt;"find all labels, of all instances, of all subclasses of foo:Bar"&lt;/span&gt;. Or top-to-bottom as &lt;span style="font-style: italic;"&gt;"find all subclasses of foo:Bar, then find all instances of the subclasses, then all the labels of the instances"&lt;/span&gt;. Maybe there is a cdecl for SPARLQ.&lt;br /&gt;&lt;br /&gt;The Jena SPARQL page has a &lt;a href="http://jena.sourceforge.net/ARQ/Tutorial/"&gt;tutorial&lt;/a&gt; along with a list to other tutorials.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37266203-3023559377847898944?l=ascensionsemantica.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ascensionsemantica.blogspot.com/feeds/3023559377847898944/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37266203&amp;postID=3023559377847898944' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37266203/posts/default/3023559377847898944'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37266203/posts/default/3023559377847898944'/><link rel='alternate' type='text/html' href='http://ascensionsemantica.blogspot.com/2006/11/early-sparql-impressions.html' title='Early SPARQL Impressions'/><author><name>Darth Semanticus</name><uri>http://www.blogger.com/profile/00180357492091898641</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://yacob.org/semantica/vader4.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37266203.post-116286616111320674</id><published>2006-11-06T18:07:00.000-08:00</published><updated>2006-11-06T19:00:10.523-08:00</updated><title type='text'>First Post</title><content type='html'>&lt;span style="font-style: italic;"&gt;The birth of the semantic web had Tim Burners Lee been a less than benevolent overlord and had an Emporer Palpatine / Darth Sidious split persona:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;TBL: &lt;/span&gt;&lt;span style="font-style: italic;"&gt;Syntactic Web.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;Syntactic Web:&lt;/span&gt;&lt;span style="font-style: italic;"&gt; Yes Master?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;TBL:&lt;/span&gt;&lt;span style="font-style: italic;"&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;&lt;span style="font-size:78%;"&gt;r&lt;/span&gt;&lt;span style="font-size:85%;"&gt;r&lt;/span&gt;&lt;span style="font-size:100%;"&gt;r&lt;span style="font-size:130%;"&gt;r&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;R&lt;/span&gt;RRiiiiIIIIIIiiiiissse.....&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37266203-116286616111320674?l=ascensionsemantica.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ascensionsemantica.blogspot.com/feeds/116286616111320674/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37266203&amp;postID=116286616111320674' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37266203/posts/default/116286616111320674'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37266203/posts/default/116286616111320674'/><link rel='alternate' type='text/html' href='http://ascensionsemantica.blogspot.com/2006/11/first-post.html' title='First Post'/><author><name>Darth Semanticus</name><uri>http://www.blogger.com/profile/00180357492091898641</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://yacob.org/semantica/vader4.jpg'/></author><thr:total>0</thr:total></entry></feed>
