Hello, Carol; The way to look at the "Generate SPARQL from Current
Graph" feature in Composer is as a query-by-example tool.  Build an
example graph and each node will be turned into a variable.

I your case, add a member of C in the graph and choose has_A as the
property.  Let's say you choose c1.  Expand has_A and you will get {c1
has_A a1 ; has_A a2}.  Remove one of these so there is just one
triple.  Then choose c1 again and the has_B, expanding to {c1 has_B
b1} (note this triple was repeated in the example given).

At that point you should have a graph with two triples {c1 has_A a1 .
c1 has_B b1}.  Click on the "Generate SPARQL..." star and the query
will appear in the SPARQL view.

There is an alternative in Ensemble that works differently, and could
also be useful.  In that case. assuming you have TBC-ME running, go to
http://localhost:8083/tbl, open your model in the Default Application
and go to the Graph Editor and Query tab.  Choose Add Node and click
in the workspace.  Use autocomplete to choose a c1, c2, or c3.  Click
on the node and panels will appear to the left and right to show
"incoming" and "outgoing" properties.  You can build your graph this
way, and has the advantage that you can choose one or many properties
to build on.  Then when the graph is right, choose each node you want
to turn into a variable and choose the "Generalize" button on the
bottom.  When finished, choose Submit Query on the top.  The results
will appear in the Results Grid and the query will appear in the
SPARQL Editor.

It's difficult to describe visual tools verbally, so if you get hung
up anywhere, let us know.

-- Scott

On Apr 12, 8:53 pm, Carol <[email protected]> wrote:
>     If I have an class C with say instances c1, c2 and c3
>
>     I have two more classes A, and B with instances a1, a2 and b1, b2
> and b3 respectively.
>
>     I have two object properties linking the C class (domain) with A
> (Range) and B (Range):  has_A, has_B.
>
>     The following triples are set in my graph:
>
>     c1 has_A a1
>
>     c1 has_A a2
>
>     c1 has_B b1
>
>     c1 has_B b1
>
>     c2 has_A a1
>
>     c2 has_B b1
>
>     c3 has_B b1
>
>     c3 has_B b3
>
>     I can create a SPARQL query that will list all members of class C
> who have links with both a1 and b1 using has_A and has_B respectively,
> which results in identifying c1 and c2.
>
>     The question is how can I use the Graph Editor in TBC to give me
> the same answers ?

-- 
You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include TopBraid Composer,
TopBraid Live, TopBraid Ensemble, SPARQLMotion 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