Hi Steve,

figuring out that all instances of Action are also instances of Event is typically called an inference. In semantic web technology, inferencing is supported by many languages including RDF Schema, where the rdfs:subClassOf property is defined in. However, SPARQL by default does not apply inferencing, and only delivers the information that is explicitly stated in the query graph.

So you can either run inferencing first (in TBC through the run inferences button) or - often the better choice - make your query independent of such assumptions and build the intelligence into the query. In your case the query could use the * operator that walks down into all suclasses of the Event class to find all instances:

SELECT ?event
WHERE {
    ?type rdfs:subClassOf* ex:Event .
    ?instance a ?type .
}

Note that rdfs:subClassOf* includes the Event class itself, while rdfs:subClassOf+ would not.

HTH
Holger


On 1/8/2013 16:26, tsaltd wrote:
One of the ontologies that I imported into TBC has a Class/Subclass relationship ... in this case it is:

Event

  * Action
  * Gain
  * Introduction
  * Loss
    (etc .. )

And when I do a Sparql Query to return all events that are of type Event ... the instances that are classified as Action, Loss, etc are not returned

( The SubcassOf ) attribute is on for each of the subtype "templates" and Action, Gain, Intro ... etc also appear in the tree as children of Event.

So I decided to add the rdfs:IsSubClasOf property to the form for each of the subtypes .... when I do that ... the instances for the subtype appear in the classes window (under Action, I believe ... ant they also display in the instances grid ... and the sparql query returns them the way I need them to be returned ( as instances of the parent Event )

I assume this is well understood behavior .... adding the rdfs:isSubclass seems to fix the problem ... but what's the story with the instances appearing in the Classes tree ...

And now I'm wondering if my sparql query should be ... ? rdfs:IsSubclassOf xyz:;Event instead of ? a Event ( nope .. that didn't work it returns the classes not the instances )

A newbie question ??   I am one ...

Steve

.
.
--
-- You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include Enterprise Vocabulary Network (EVN), TopBraid Composer, TopBraid Live,
TopBraid Ensemble, SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/topbraid-users?hl=en



--
-- You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include Enterprise Vocabulary 
Network (EVN), TopBraid Composer, TopBraid Live,
TopBraid Ensemble, SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/topbraid-users?hl=en


Reply via email to