Monday, July 31, 2006
For the Confirmed RDF Query Geek
BIG, FAT, STINKING SOFTWARE has a download of the Mr Sparkle screensaver for OS X.
Sunday, July 30, 2006
Look Twice
An interesting post, "Windows XP, Our New Favorite Legacy Operating System" discusses the ramifications of 5 years without a new version of Windows and subliminal logos (I'll never look at an "Ex" the same way).
We are all focusing on OS X releases (and how Vista is copying OS X) during that time but I haven't found anywhere focusing on the progress of 5 years of Linux development.
We are all focusing on OS X releases (and how Vista is copying OS X) during that time but I haven't found anywhere focusing on the progress of 5 years of Linux development.
Bandwagon
JRDF is now on Google code well the name and the description. The code isn't there yet. It seems quite minimal and there's no web hosting. Overall, I'm not sure what advantage it has over Sourceforge - except for reliability.
What would really good if the Googleplex did continuous builds.
What would really good if the Googleplex did continuous builds.
Wednesday, July 26, 2006
Relational SPARQL in JRDF
JRDF can now do the following relational operations on RDF: project, restrict, union, semi-difference, natural join, anti-join, full and left outer join. It does most of the good things like retaining relations all the way through so it can perform the operations without ordering restrictions. However, the query engine doesn't do any optimization yet. It also doesn't have to deal with duplicates so there's no need for DISTINCT and UNION is predictable. The SPARQL grammar is a subset of the current one and it only supports SELECT, join (.), UNION and OPTIONAL. There are also no null values.
There's also a Swing based GUI (that's a bit like Twinkle) that allows the submission of SPARQL queries and renders them in tabular fashion.
I'm thinking that I might add a difference operator (-) and produce an OPTIONAL like query that is not order dependent. I had initially planned to use minimum union (outerunion and tuple subsumption (removing rows with more null values)). However, it does seem that the existing full outerjoin will work with tuple subsumption too - although it does look like more work.
There's also some interesting aspects of the grammar too.
Due to time constraints the level of code quality isn't quite up to what I'm happy with so at the moment there's no release and there's probably still bugs left to squash. For the truely keen the current source code is available in Subversion.
There's also a Swing based GUI (that's a bit like Twinkle) that allows the submission of SPARQL queries and renders them in tabular fashion.
I'm thinking that I might add a difference operator (-) and produce an OPTIONAL like query that is not order dependent. I had initially planned to use minimum union (outerunion and tuple subsumption (removing rows with more null values)). However, it does seem that the existing full outerjoin will work with tuple subsumption too - although it does look like more work.
There's also some interesting aspects of the grammar too.
Due to time constraints the level of code quality isn't quite up to what I'm happy with so at the moment there's no release and there's probably still bugs left to squash. For the truely keen the current source code is available in Subversion.
Turnabout is not fair play
He Who Cast the First Stone Probably Didn’t "Although volunteers tried to respond to each other’s touches with equal force, they typically responded with about 40 percent more force than they had just experienced. Each time a volunteer was touched, he touched back harder, which led the other volunteer to touch back even harder. What began as a game of soft touches quickly became a game of moderate pokes and then hard prods, even though both volunteers were doing their level best to respond in kind...Neither realized that the escalation was the natural byproduct of a neurological quirk that causes the pain we receive to seem more painful than the pain we produce, so we usually give more pain than we have received."
Tuesday, July 25, 2006
Thursday, July 20, 2006
Goggle vs Semantic Web
Google exec challenges Berners-Lee "At the end of the keynote, however, things took a different turn. Google Director of Search and AAAI Fellow Peter Norvig was the first to the microphone during the Q&A session, and he took the opportunity to raise a few points.
"What I get a lot is: 'Why are you against the Semantic Web?' I am not against the Semantic Web. But from Google's point of view, there are a few things you need to overcome, incompetence being the first," Norvig said. Norvig clarified that it was not Berners-Lee or his group that he was referring to as incompetent, but the general user."
Related: Google Base -- summing up.
"What I get a lot is: 'Why are you against the Semantic Web?' I am not against the Semantic Web. But from Google's point of view, there are a few things you need to overcome, incompetence being the first," Norvig said. Norvig clarified that it was not Berners-Lee or his group that he was referring to as incompetent, but the general user."
Related: Google Base -- summing up.
Wednesday, July 19, 2006
Test Driving Interface Usage
One of the neat things (or drawbacks) with Generics in Java is that the left hand side of an assignment can't always be treated separately to the right hand side because of type inferencing.
A simple example is Collections.emptySet(). By itself it will produce an empty set of Objects. If the left hand side defines a Set of Integers (or you use a cast) then that's what it will return.
Unexpectedly, this makes it possible to enforce an interface on the left hand side of an assignment without using something like Checkstyle or other ways of enforcing coding conventions.
The answer seems to be to create a generic object factory which wraps using reflection to create an object. The simplest API would be something like:
<T> T create(Class<T> concreteClass, Object... values).
To create an empty ArrayList and an ArrayList with a default capacity of 255 you would write:
List list = creator.create(ArrayList.class);
List list = creator.create(ArrayList.class, 255);
This allows you to create expectations such that a call to create must return an interface. Using EasyMock test code is something like (from memory):
List list = createMock(List.class);
creator.create(ArrayList.class);
creatorControl.andReturn(list);
The following creates an exception as it causes the wrong type to be created (an ArrayList not a List):
ArrayList list = creator.create(ArrayList.class)
When the API is this simple it can become quite difficult to work out which constructor should be called. The simplest, at least initially, is to fail when there are multiple constructors of the same length or to create a more complicated API where you specify the constructor types. You could also have more complicated behaviour like calling the most specific constructor, where there are multiple matches for the given objects, could create a more sophisticated version. Starting with the constructor arguments and matching against the objects seems like a quicker implementation than trying to match the objects against the constructors.
A simple example is Collections.emptySet(). By itself it will produce an empty set of Objects. If the left hand side defines a Set of Integers (or you use a cast) then that's what it will return.
Unexpectedly, this makes it possible to enforce an interface on the left hand side of an assignment without using something like Checkstyle or other ways of enforcing coding conventions.
The answer seems to be to create a generic object factory which wraps using reflection to create an object. The simplest API would be something like:
<T> T create(Class<T> concreteClass, Object... values).
To create an empty ArrayList and an ArrayList with a default capacity of 255 you would write:
List list = creator.create(ArrayList.class);
List list = creator.create(ArrayList.class, 255);
This allows you to create expectations such that a call to create must return an interface. Using EasyMock test code is something like (from memory):
List list = createMock(List.class);
creator.create(ArrayList.class);
creatorControl.andReturn(list);
The following creates an exception as it causes the wrong type to be created (an ArrayList not a List):
ArrayList list = creator.create(ArrayList.class)
When the API is this simple it can become quite difficult to work out which constructor should be called. The simplest, at least initially, is to fail when there are multiple constructors of the same length or to create a more complicated API where you specify the constructor types. You could also have more complicated behaviour like calling the most specific constructor, where there are multiple matches for the given objects, could create a more sophisticated version. Starting with the constructor arguments and matching against the objects seems like a quicker implementation than trying to match the objects against the constructors.
Monday, July 17, 2006
Native Vice
Achieving Quality
Technology: Can You Automate Software Quality? "A lot of the debate has been focused on testing. Total Quality, however, would suggest that although testing is necessary, it's not sufficient. Testing focuses on inspection, not on prevention. To over-simplify, you test in hopes of demonstrating that the software has no defects (because you have a good high-quality development process), not to detect the defects that are present, but should not be there (because you don't have a good high quality development process). After several years of significant effort, the code my client was developing (and testing) still isn't of the high quality they are looking for. So we decided to go back, start from some basics, and look again at the issue of software quality."
Goes through the processes to ensure quality software: code quality (using TDD), functional quality (giving the customer what they want), non-functional quality (security, privacy, compliance, etc), deployment and production quality, and maintenance.
"This probably seems like a lot of additional work for the development organization. And it is. But the costs of defective code in the production environment (both direct, in terms of sustaining engineering, and indirect, in terms of lost revenue and reputation) was becoming significant. Management felt it had no choice but to focus on improved quality, and turn to the productivity issues later. So far, despite the added burden of all these quality–related activities (many of which already took place, but simply weren't very effective) we have not seen a slowdown in software availability. Some teams are actually moving faster than before, despite the new work they have to perform, because they spend much less time and effort on remediation and last-minute adjustments to code to fix issues that only show up as the code is transitioned to production."
Goes through the processes to ensure quality software: code quality (using TDD), functional quality (giving the customer what they want), non-functional quality (security, privacy, compliance, etc), deployment and production quality, and maintenance.
"This probably seems like a lot of additional work for the development organization. And it is. But the costs of defective code in the production environment (both direct, in terms of sustaining engineering, and indirect, in terms of lost revenue and reputation) was becoming significant. Management felt it had no choice but to focus on improved quality, and turn to the productivity issues later. So far, despite the added burden of all these quality–related activities (many of which already took place, but simply weren't very effective) we have not seen a slowdown in software availability. Some teams are actually moving faster than before, despite the new work they have to perform, because they spend much less time and effort on remediation and last-minute adjustments to code to fix issues that only show up as the code is transitioned to production."
Saturday, July 15, 2006
Frankly, my dear, I don't give a damn
Mapping Rete algorithm to FOL and then to RDF/N3 "There is already a well established precedent with Python/N3/RDF reasoners (Euler, CWM, and Pychinko). FuXi used to rely on Pychinko, but I decided to write a Rete implementation for N3/RDF from scratch - trying to leverage the host language idioms (hashing, mappings, containers, etc..) as much as possible for areas where it could make a difference in rule evaluation and compilation.
What I have so far is more Rete-based than a pure Rete implementation, but the difference comes mostly from the impedance between the representation components in the original algorithm (which are very influenced by FOL and Knowledge Representation in general) and those in the semantic web technology stack."
The goes on to describe how the mapping from Semantic Web concepts to concepts used in the Rete algorithm (tokens, object type, alpha, beta, and terminal nodes). Some comments, RDF a hole to no where.
What I have so far is more Rete-based than a pure Rete implementation, but the difference comes mostly from the impedance between the representation components in the original algorithm (which are very influenced by FOL and Knowledge Representation in general) and those in the semantic web technology stack."
The goes on to describe how the mapping from Semantic Web concepts to concepts used in the Rete algorithm (tokens, object type, alpha, beta, and terminal nodes). Some comments, RDF a hole to no where.
Wednesday, July 12, 2006
Incase this happens again
Getting a fresh checkout of JRDF and caused the following error:
"svn: Can't open file '.../.svn/tmp/text-base/NadicJoinImpl.java.svn-base': No such file or directory"
Which then suggets to run cleanup. Which causes this message:
"svn: Can't copy '.../.svn/tmp/text-base/DyadicJoinImpl.java.svn-base' to '.../DyadicJoinImpl.java.1.tmp': No such file or directory"
So I'm unable to checkout or cleanup and everything is in a locked state.
The problem was that there were two files NadicJoinImpl.java and NAdicJoinImpl.java and OS X is a case insensitive filesystem. The solution is to remove one of the offending files.
In my case: "svn delete https://svn.sourceforge.net/svnroot/jrdf/.../NAdicJoinImpl.java -m "I hate subversion""
"svn: Can't open file '.../.svn/tmp/text-base/NadicJoinImpl.java.svn-base': No such file or directory"
Which then suggets to run cleanup. Which causes this message:
"svn: Can't copy '.../.svn/tmp/text-base/DyadicJoinImpl.java.svn-base' to '.../DyadicJoinImpl.java.1.tmp': No such file or directory"
So I'm unable to checkout or cleanup and everything is in a locked state.
The problem was that there were two files NadicJoinImpl.java and NAdicJoinImpl.java and OS X is a case insensitive filesystem. The solution is to remove one of the offending files.
In my case: "svn delete https://svn.sourceforge.net/svnroot/jrdf/.../NAdicJoinImpl.java -m "I hate subversion""
Sunday, July 09, 2006
Encapsulation for Design by Contract
The Three Reasons for Data Encapsulation "It’s not that data encapsulation does not separate interface from implementation, or that separating interface from implementation is unimportant. It’s just that this is by far the least important reason for data encapsulation...Data encapsulation allows programmers to enforce class invariants, preconditions, and postconditions."
"The I in API stands for interface, and interfaces are for people, not just machines. APIs can be complex, confusing things. The less there is of it, the better. The smaller and simpler the API is, the easier it is to learn and use; the more likely it is that the API will be used correctly."
"The I in API stands for interface, and interfaces are for people, not just machines. APIs can be complex, confusing things. The less there is of it, the better. The smaller and simpler the API is, the easier it is to learn and use; the more likely it is that the API will be used correctly."
Rationalizing Relational and OO
Moving forward with relational: looking for objects in the relational model, Chris Date finds they were there all the time. "The question is how to integrate the good ideas of object-oriented database with relational ideas. The wonderful thing is, it turns out you don't have to do anything to the relational model. Absolutely nothing. The relational model is so solid and so robust..."
"The key notion underlying The Manifesto is thus the equation: domain = object class. A domain, or an object class, is a data type that is encapsulated, which means that the only way you can operate on values of that type is through operators that are defined for the type. You don't actually see the way the data is represented. That's not relevant. You only know that there are certain functions you can perform. It might be a primitive system-defined data type. More generally, it's going to be a user-defined data type. The values of these data types can be arbitrarily complex."
"The values in row and column slots can then be anything you like. They can be simple integers. They can be strings. They can be arrays. They can be books. They can be engineering drawings. They can be videos... They can be anything you like - as long as you can define the data type. In fact, I believe do one of the reasons we're hearing so much hype about object-oriented is because of a failure on the part of the relational vendors to step up to the mark. They haven't supported the relational model. If they had, we wouldn't be having these silly arguments now."
"In my opinion, there are precisely two good ideas. One is the data type concept - user-defined data use of arbitrary complexity, with encapsulation and user-defined functions. The other is inheritance. For example, in a geometric database you might have an object class called polygons, and one called rectangles, where rectangles are a subclass of polygons because every rectangle is a polygon. Therefore it follows that everything that works for polygons automatically works for rectangles too."
"If under the covers, the representation changes - if polygons are represented by a sequence of points for the vertices, and rectangles are represented by just the bottom left and the top right corner or something like that - the code to implement the operator has to change too, but that's implementation. From the model's point of view, if you have a function called area that returns the area of a polygon, automatically it means that you can invoke the area function on a rectangle and get the right answer. Under the covers, it may be desirable to reimplement that function. I don't care. That's implementation."
"The key notion underlying The Manifesto is thus the equation: domain = object class. A domain, or an object class, is a data type that is encapsulated, which means that the only way you can operate on values of that type is through operators that are defined for the type. You don't actually see the way the data is represented. That's not relevant. You only know that there are certain functions you can perform. It might be a primitive system-defined data type. More generally, it's going to be a user-defined data type. The values of these data types can be arbitrarily complex."
"The values in row and column slots can then be anything you like. They can be simple integers. They can be strings. They can be arrays. They can be books. They can be engineering drawings. They can be videos... They can be anything you like - as long as you can define the data type. In fact, I believe do one of the reasons we're hearing so much hype about object-oriented is because of a failure on the part of the relational vendors to step up to the mark. They haven't supported the relational model. If they had, we wouldn't be having these silly arguments now."
"In my opinion, there are precisely two good ideas. One is the data type concept - user-defined data use of arbitrary complexity, with encapsulation and user-defined functions. The other is inheritance. For example, in a geometric database you might have an object class called polygons, and one called rectangles, where rectangles are a subclass of polygons because every rectangle is a polygon. Therefore it follows that everything that works for polygons automatically works for rectangles too."
"If under the covers, the representation changes - if polygons are represented by a sequence of points for the vertices, and rectangles are represented by just the bottom left and the top right corner or something like that - the code to implement the operator has to change too, but that's implementation. From the model's point of view, if you have a function called area that returns the area of a polygon, automatically it means that you can invoke the area function on a rectangle and get the right answer. Under the covers, it may be desirable to reimplement that function. I don't care. That's implementation."
Environment is Inherited
The Ghost in Your Genes "At the heart of this new field is a simple but contentious idea – that genes have a 'memory'. That the lives of your grandparents – the air they breathed, the food they ate, even the things they saw – can directly affect you, decades later, despite your never experiencing these things yourself. And that what you do in your lifetime could in turn affect your grandchildren.
The conventional view is that DNA carries all our heritable information and that nothing an individual does in their lifetime will be biologically passed to their children. To many scientists, epigenetics amounts to a heresy, calling into question the accepted view of the DNA sequence – a cornerstone on which modern biology sits."
"And Reik's work has gone further, showing that these switches themselves can be inherited. This means that a 'memory' of an event could be passed through generations. A simple environmental effect could switch genes on or off – and this change could be inherited."
So you're fat because your grandparents were in a famine. A recent article in Nature suggests that vitamins taken during pregancy have a permanent effect on subsequent offspring. It certainly should place more responsibility on future parents - doing drugs or whatever may affect your children even if you stopped before having them. Epigenetics on Wikipedia.
When Set isn't Enough
Why isn't there an interface for LinkedHashSet? There's one for SortedSet. It seems that only if there are more methods is there another interface. What about different semantics and performance charateristics like ordering? What makes one characteristic worthy of an interface and not another? Maybe interfaces aren't descriptive enough?
Friday, July 07, 2006
The Future is a little Brighter
David links to a posting he forwarded from the Kowari developers list (original post here) from Amit Kapoor about the future of Kowari: "The Topaz Foundation (http://www.topazproject.org) is very pleased to forward the email, from Michael H. Wallach (Senior Counsel, Northrop Grumman) to Richard Fontana...We trust that this letter will end any confusion with respect to the future status of Kowari, which has been secured, and that the community will now be able to focus on making Kowari one of the most vibrant open source projects."
"Northrop Grumman respects the rights that users of open source Kowari software receive under the MPL. Northrop Grumman intends that open source Kowari software, licensed under the MPL, is and will remain free, open source software.
Moreover, Northrop Grumman has no objection to the continued appropriate use of the "Kowari" name by developers participating in the Kowari open source project."
"Northrop Grumman respects the rights that users of open source Kowari software receive under the MPL. Northrop Grumman intends that open source Kowari software, licensed under the MPL, is and will remain free, open source software.
Moreover, Northrop Grumman has no objection to the continued appropriate use of the "Kowari" name by developers participating in the Kowari open source project."
Three More SW Applications
- FOAF to hCard via SPARQL "So I used the scutterplan from the FOAFBulletinBoard, going 2 steps, producing 17382 statements, containing I think it was 2035 foaf:Person nodes...To the results I applied sparql2hcard.xsl using xsltproc, script was sparql-hcard.sh (I do hope this was the latest SPARQL XML results format...), producing these hCards." XLST, querying - sounds like descriptors.
- Timeline "...a DHTML-based AJAXy widget for visualizing time-based events. It is like Google Maps for time-based information."
- iris: open your eyes to the future of the desktop "Iris is a java open source source integrated desktop environment including email, calendar, file browser, web browser, chat, and a data mining toolkit (clustering, indexing, and lots more)." Uses Jena.
JRuby now does Rails**
"** We are able to generate and run the cookbook demo from rolling with rails tutorial (http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html) with what we have and all appears to work. With this said, it is likely that there are several aspects of rails that are not working correctly. See docs/README.rails for known issues/instructions in release."
JRuby "WEBrick runs...Ruby on Rails runs on top of WEBrick (and generation scripts work)**"
Time for a free lunch:
"I believe I've found a 'free lunch' in Ruby on rails. Oh, it's not always free. If I need to do two-phased commit or hardcore object relational mapping, this lunch may cost me more than I'm willing to pay. But often enough, it's for all practical purposes free.
* I can train a team of Rails developers faster than I can teach a new Java developer Spring plus Hibernate plus whatever web mvc you want plus all of the other frameworks and tools Java developers have to know.
* I can build my applications much faster than I could before.
* For many applications, the latency in the database is the overriding concern, so I don't even notice differences in performance.
* I can trivially expose web services, letting other applications, potentially written in other languages, quickly access my Rails services.
Now, I know that some will tell me that the lunch really isn't free. But you can tell that to my customers that pay a fraction of the price they'd pay for a Java application, and get something that's easier to maintain, just as fast, and on an earlier schedule. From that exec's perspective, the lunch is free."
JRuby "WEBrick runs...Ruby on Rails runs on top of WEBrick (and generation scripts work)**"
Time for a free lunch:
"I believe I've found a 'free lunch' in Ruby on rails. Oh, it's not always free. If I need to do two-phased commit or hardcore object relational mapping, this lunch may cost me more than I'm willing to pay. But often enough, it's for all practical purposes free.
* I can train a team of Rails developers faster than I can teach a new Java developer Spring plus Hibernate plus whatever web mvc you want plus all of the other frameworks and tools Java developers have to know.
* I can build my applications much faster than I could before.
* For many applications, the latency in the database is the overriding concern, so I don't even notice differences in performance.
* I can trivially expose web services, letting other applications, potentially written in other languages, quickly access my Rails services.
Now, I know that some will tell me that the lunch really isn't free. But you can tell that to my customers that pay a fraction of the price they'd pay for a Java application, and get something that's easier to maintain, just as fast, and on an earlier schedule. From that exec's perspective, the lunch is free."
Identifying with the Web
URIs and the Myth of Resource Identity "Another way to put it is that the authoritative descriptive information that I publish licenses the use of my URI in certain models. This is analogous to publishing some interfaces for an object in an object oriented system. You can never be sure that I won't (monotonically) publish an additional interface at some point in the future, just as you cannot be sure I won't publish more descriptive information about me..."
"On the other hand, even if it is not possible to completely describe a resource, it may be possible to unambiguously identify that resource, in the sense of conveying what resource it is, as distinct from all other possible resources.
For example, if I provide descriptive information telling you that the URI http://t-d-b.org?http://dbooth.org/2005/dbooth/ identifies all-and-only the actual, living person with email address dbooth@hp.com as of 1-Jan-2005, that is sufficient to unambiguously identify me, distinct from all other possible resources."
"The ability to uniquely identify a resource -- in the sense of conveying the distinction between this resource and all other resources -- is important because it enables others to publish additional descriptive information about the resource, beyond what the URI owner provides. The Semantic Web is all about the network effect created by the use of URIs as universal identifiers. When a URI's resource is uniquely identified, it enables "anyone to say anything" about that resource[4].
"If a URI's resource is not uniquely identified -- if others must rely solely on authoritative descriptive information about that resource -- then those who wish to make statements about it run the risk that they may have guessed wrong about what resource the URI owner was intending to identify. This hampers others' ability to make statements about that resource, thus diminishing the value of that URI. This is analogous to connecting, to the telephone network, a telephone that nobody wants to call: it consumes resources without contributing anything to the network effect."
Via, URIs and the Myth of Resource Identity.
Related to, Why Different Things are the Same and Architecture of the World Wide Web, Volume One.
"On the other hand, even if it is not possible to completely describe a resource, it may be possible to unambiguously identify that resource, in the sense of conveying what resource it is, as distinct from all other possible resources.
For example, if I provide descriptive information telling you that the URI http://t-d-b.org?http://dbooth.org/2005/dbooth/ identifies all-and-only the actual, living person with email address dbooth@hp.com as of 1-Jan-2005, that is sufficient to unambiguously identify me, distinct from all other possible resources."
"The ability to uniquely identify a resource -- in the sense of conveying the distinction between this resource and all other resources -- is important because it enables others to publish additional descriptive information about the resource, beyond what the URI owner provides. The Semantic Web is all about the network effect created by the use of URIs as universal identifiers. When a URI's resource is uniquely identified, it enables "anyone to say anything" about that resource[4].
"If a URI's resource is not uniquely identified -- if others must rely solely on authoritative descriptive information about that resource -- then those who wish to make statements about it run the risk that they may have guessed wrong about what resource the URI owner was intending to identify. This hampers others' ability to make statements about that resource, thus diminishing the value of that URI. This is analogous to connecting, to the telephone network, a telephone that nobody wants to call: it consumes resources without contributing anything to the network effect."
Via, URIs and the Myth of Resource Identity.
Related to, Why Different Things are the Same and Architecture of the World Wide Web, Volume One.
Subscribe to:
Posts (Atom)