Tuesday, April 24, 2007

TBC: Indirect Instances

Finally!

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.

Only problem was he couldn't recall how he enabled the feature and it wasn't an option in the Window > Preferences > TopBraid Composer list. I stumbled into it under the "Instances" window options. Its the last option with the label "Show indirect instances":

This feature definitely reduces my instance hunting time, modeling life just got easier.

Wednesday, April 11, 2007

SeRQL Query for all Resources w/o Some Relationship

After a few tries I managed to form a SeRQL query that would give me resources of a given type that did not have a given relationship:

select distinct
localName(A)
from
{A} rdf:type {foo:AClass}
where not exists (
select A
from
{A} foo:hasBar {B}
)
using namespace ...

Still, it seems this could be more simply expressed, what I was initially expecting was something more concise such as:


select distinct
localName(A)
from
{A} rdf:type {foo:AClass},
![{A} foo:hasBar {B}]
using namespace ...

Tuesday, April 03, 2007

The Case for Anti-Triples

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.

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.

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.

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.

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.

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?

TBC Tip: Form Clicks for Productivity

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.

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.

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.

Less mousing around, more modeling, good stuff!

SPARQLets!

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.

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 Bookmarklets (Bookmarks of Javascript Applets), thus SPARQlets!

For next week - SPARQLets that say "ni!"