Just a small correction. In my example query, I meant SELECT ?x
WHERE {:birthYear rdfs:domain ?x}-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Irene Polikoff Sent: Friday, October 02, 2009 1:53 PM To: [email protected] Subject: [tbc-users] Re: Creating SPARQL Queries Using Graph Panel I don't think this is a limitation of the ontology design, but rather the design philosophy behind the query by example feature. It expects you to create a sample graph. Given this, starting with some instance (does not have to be this particular one) and browsing through to identify what properties you are interested in makes sense. Since SPARQL can be used to create queries about classes (such as SELECT ?x WHERE ?x rdfs:domain :birthYear - give me a class in the domain of the property birthYear), starting with a class is treated by the tool the same as starting with any other resource. That is, you will see properties appropriate for a given resource type. Thus, if you start with an instance of a person, you will see properties appropriate for people. If you start with a class Person, you will see properties appropriate for the instance of owl:Class (such as domain, range, subClassOf, etc.) User's interest in let's say a person born in a certain year, often develops because they are browsing the data and discover a pattern they want to understand better. These use cases happen when users do not necessarily have a preconceived query in mind but, rather, are getting their clues from the data. Then building a query using the data as the starting point feels quite natural. On the other hand, if you know from the beginning that you are looking for a person that was born in 1965, having to find such person before creating a query will seem like a hard way to start. In this case, it is best to approach it slightly differently. You are interested in people born in 1965. Query by example provides you with a template of how to query for people born in a certain year. Don't worry if a person you start with has a different year of birth, just pick any person, get the possible properties as the result of this, generate a query and replace the value(s) with the one(s) you are interested in. -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of bradleys Sent: Friday, October 02, 2009 11:14 AM To: TopBraid Composer Users Subject: [tbc-users] Re: Creating SPARQL Queries Using Graph Panel Irene, The issue is the sequence of target selection. I clicked on Class Female, then selcted Gender, then had to find my year and ran the query. This is a really convoluted way fo finding which females were born in 1965. Starting with selecting the year from one of the known instances is not intuitive. Perhaps it is a limitation within the design of the ontology example. On Oct 2, 11:44 am, "Irene Polikoff" <[email protected]> wrote: > When I follow the HELP file example: > > 1. Select AlinaMojica > 2. Switch to a Graph view > 3. Click to set the year of birth property for Alina (If properties are > not shown in the box, toggle on the property icon - it is 2 icons before the > generate SPARQL icon) > 4. Expand to get the gender link > 5. Click to set female > > I get exactly this query > > SELECT ?person > WHERE { > ?person :gender :female . > ?person :birthYear 1965 . > > } > > I am not sure if there are some steps you may be doing differently to get > another query or if it is a version issue. > > Irene > > > > -----Original Message----- > From: [email protected] > > [mailto:[email protected]] On Behalf Of bradleys > Sent: Friday, October 02, 2009 10:13 AM > To: TopBraid Composer Users > Subject: [tbc-users] Re: Creating SPARQL Queries Using Graph Panel > > Scott, > > I didn't get a reply to the Grpah probelm I am having. Below is what > happened when I reproduced the Help file example. Obviously there are > too many "persons" listed, so my quesiton is why? > > On Sep 23, 9:17 am, bradleys <[email protected]> wrote: > > Scott, > > Yes, that is what I am trying to do but the SPARQL query never finshes > > executing. > > > On Sep 22, 4:43 pm, Scott Henninger <[email protected]> > > wrote:> OK, so forget about inferencing. SPARQL queries are independent > of > > > inferencing, and is not necessary for this example > > > > If you reproduce exactly the exact graph shown in the Help file, > > > including the :gender link between :AlinaMojica and :female, I get > > > the query: > > > SELECT ?person1 ?person3 ?person33 ?person31 ?person35 ?person4 ? > > person32 ?person15 ?person29 ?person26 ?person14 ?person24 ?person30 ? > > person5 ?person16 ?person25 ?person11 ?person19 ?person28 ?person13 ? > > person2 ?matriarch ?person ?person17 ?person8 ?person12 ?person9 ? > > person34 ?person18 ?person10 ?person22 ?person7 ?person23 ?person21 ? > > person27 ?person6 ?person20 > > WHERE { > > ?person1 :gender :female . > > ?person3 :gender :female . > > ?person33 :gender :female . > > ?person31 :gender :female . > > ?person35 :gender :female . > > ?person4 :gender :female . > > ?person32 :gender :female . > > ?person15 :gender :female . > > ?person29 :gender :female . > > ?person26 :gender :female . > > ?person14 :gender :female . > > ?person24 :gender :female . > > ?person30 :gender :female . > > ?person5 :gender :female . > > ?person16 :gender :female . > > ?person25 :gender :female . > > ?person11 :gender :female . > > ?person19 :gender :female . > > ?person28 :gender :female . > > ?person13 :gender :female . > > ?person2 :gender :female . > > ?matriarch :gender :female . > > ?person :gender :female . > > ?person17 :gender :female . > > ?person8 :gender :female . > > ?person12 :gender :female . > > ?person9 :gender :female . > > ?person34 :gender :female . > > ?person18 :gender :female . > > ?person10 :gender :female . > > ?person22 :gender :female . > > ?person7 :gender :female . > > ?person23 :gender :female . > > ?person21 :gender :female . > > ?person27 :gender :female . > > ?person6 :gender :female . > > ?person20 :gender :female . > > ?person4 :birthYear 1965 .}Your thoughts on what is going on? I only > had a checkbox on Female > > > and brith year 1965 for Jeannie Ripp > > > > SELECT ?person > > > WHERE { > > > ?person kennedys:gender kennedys:female . > > > ?person kennedys:birthYear 1965 . > > > > } > > > > Running this gets all matches with the properties :birthYear = 1965 > > > and :gender = female. (Clicking twice on "Generate SPARQL Query from > > > current Graph" - the orange star **in the Graph View** - will generate > > > and execute the query.) > > > > -- Scott > > > > On Sep 22, 1:59 pm, bradleys <[email protected]> wrote: > > > > > OK TB is version 3.1.1. > > > > I am creating a SPARQL Queries by Example from you TopBraid Composer > > > > > How To? files. I am in the Graph Panel and as per the Kennedy example, > > > > I select the instance of female and check it, the click on the left > > > > side arro to get "has gender" to appear with a list of all the > > > > femails. I go to Alina Mojica and check 1965. Then I click twice the > > > > SPARQL button on the Graphs tool bar. When this didn't work. I added > > > > TopSpin to my File Settings Inferences Configuration as an expereiment > > > > thinking that perhaps my Inferencing hasd to be inline with my SPARQL > > > > query. No lunk running a query. I tried for the mailes, an no luck. > > > > Went back to the females and configured TOPSPIN inferecnign for > > > > Workspace settings. No luck with my query. > > > > > I just removed TopSpin from my Inferences configuration for File and > > > > Workspaces and re-ran the SAPRQL query on the Graph panel toolbar. No > > > > luck after 5 minutes. > > > > > I can go to a Centra netmeeting session here if you have time to > > troubleshoot:http://142.166.163.54/main/User/GuestAttend.jhtml?s_guid=000000 > 9b777a... > > > > > On Sep 22, 3:37 pm, Scott Henninger <[email protected]> > > > > wrote: > > > > > > Bradley; There seem to be a number of things going on here. First > is > > > > > that the version you gave is the Eclipse version. To find the > > > > > Composer version, go to Help > Software Update > Installed Software. > > > > > > I'm not sure what example you refer to. By "SPARQL graphical > query", > > > > > I assume you mean a SPARQL query on a graph structure? There is > also > > > > > a way to create queries from the Graph view, so this can cause > > > > > confusion. > > > > > > SPARQL queries can be executed independent of whether inference is > > > > > turned on or off. > > > > > > If you turn the inference mode on in the SPARQL View, inferences > will > > > > > be executed first and the SPARQL query is applied to the union of > the > > > > > asserted and inferred graphs (i.e. original data + inferences). > > > > > Therefore, the SPARQL query will not be able to execute until > > > > > inferences have completed. I suspect this is what you are > > > > > experiencing. > > > > > > Perhaps some details on the example you are trying will help explain > > > > > this more. > > > > > > -- Scott > > > > > > On Sep 22, 1:12 pm, bradleys <[email protected]> > wrote: > > > > > > > In preparation of testing my OWL ontology, I ahve been using the > Graph > > > > > > feature in TB Maestro and using the Kennedy example OWL to try to > > > > > > generate a SPARQL graphical query. I tried to reporduce the > example > > > > > > (female, 1965 and male 1965) but had no luck. The query engine > runs > > > > > > for 30 minutes but gives no instance results ie Alina Mojica and > > > > > > Jeannie Ripp. > > > > > > I am running Meastro with the 3.4.2 M20090211-1700 update. My File > > > > > > Inferences has SWIFTOWLIM (owl-max) and TopSPIN (SPARQL Rules). I > > > > > > discovered my Workspace did not have TopSPIN (SPARQL Rules), so I > > > > > > configured that na dran inferences before doing the SPARQL Query. > > > > > > Still no luck getting any results. > > > > > > > Am I missing anything obvious?- Hide quoted text - > > > > > > - Show quoted text -- Hide quoted text - > > > > - Show quoted text -- Hide quoted text - > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TopBraid Composer Users" group. 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-composer-users?hl=en -~----------~----~----~----~------~----~------~--~---
