I didn't say that there was a problem with ex002.ttl, only that it was
extremely simple. The book is an introduction to the SPARQL query language,
not to semantic web data modeling, for which Dean Allemang and Jim Hendler
already wrote the excellent "Semantic Web for the Working Ontologist." The
expanded edition of "Learning SPARQL" will include a section on querying
for inferenced triples, especially those entailed by RDFS properties such
as rdfs:type, rdfs:domain, and rdfs:range.

The main example in my book's section on converting data with CONSTRUCT
queries, which begins on page 114, is about how to convert the book's
sample address book data from the demo vocabulary it uses to FOAF. When you
get to that page, try this in TBC:

1. open the book's ex012.ttl data file and drag foaf.ttl from the Common
folder of the TopBraid project into the Imports view. This defines the
vocabulary that the result of the conversion will use.

2. Paste the ex194.rq query into the SPARQL view, remove the two blank
lines, and  add the triple

   ?s a foaf:Person .

inside the curly braces after the CONSTRUCT keyword

3. Run the query, select all the resulting triples on the right, and pick
"Assert selected constructed triples" from that view's menu.

In the classes view, under owl:Thing/foaf:Agent, you will see that
foaf:Person now has 3 instances that you can see in the Instances view.

It's very common, when relating data from different sources that use
different vocabularies, to use CONSTRUCT queries to align the data like
this.

Bob

On Sat, Jan 28, 2012 at 4:16 AM, Bruce Whealton <[email protected]>wrote:

> Bob, I was confused.  You said the SPARQL worked if you edited it.
> However, you had said there was a problem with the
> ex002.ttl.  I'm almost embrassed to be asking something so simple but
> getting a good feel for working with any type of data
> is important to me.  Indeed, that is one of the features of TBC and in
> the book you point out that Sparql can be used to query various
> types of data, spreadsheets, relational DB.  So, I would first need to
> define a vocabulary that would describe the address book
> and/or relate it to existing vocabularies, like for this FOAF might be
> fine.
> Thanks,
> Bruce
>
> On Jan 25, 10:05 pm, Bob DuCharme <[email protected]> wrote:
> > Bruce,
> >
> > As the book's second example, ex002.ttl is extremely simple. Three
> > resources have two or three properties each, and rdf:type is not declared
> > for any of them, which is why they don't show up under owl:Thing in TBC.
> > The resources aren't declared to be of any type, and they have to be
> > declared to be of type owl:Thing or some subclass of that to show up on
> > that tree.
> >
> > If you open ex002.ttl in TBC and then paste the ex003.rq query into the
> > SPARQL view, the query does run as described in the book, except that you
> > have to remove the blank lines from the query first because the TBC
> SPARQL
> > view's syntax checker doesn't like blank lines. I just ran it with no
> > problem.
> >
> > For arq issues, it would be better to ask on the jena mailing list (
> http://jena.sourceforge.net/support.html) or email me offline instead of
> > putting the questions on the TopBraid mailing list.
> >
> > Bob
> >
> > On Wed, Jan 25, 2012 at 8:57 PM, Bruce Whealton <[email protected]
> >wrote:
> >
> >
> >
> >
> >
> >
> >
> > > I am wondering why I cannot run the files from the book by Bob
> > > DuCharme inside of TBC.  I created a project called LearningSparql.  I
> > > then dragged the exercise files from where I had unzipped them and and
> > > dropped them inside TBC inside the LearningSparql folder.
> >
> > > What step could I be missing?  I then open up ex002.ttl inside TBC and
> > > I don't see anything.  I mean starting with owl:Thing there is nothing
> > > in there.  Needless to say the first query does not work.
> > > I can do this from the command line.  Although, it doesn't seem to
> > > accept my path.
> > > I have to type in c:\arq\bat\arq
> > > to get arq to run.  I have tried to put into the path c:\arq\bat and
> > > also c:\arq
> > > I know this is a bit off topic, though.  I do have the ARQROOT set to
> > > c:\arq
> >
> > > Anyway, I was curious as to why I cannot open ex002.ttl inside TBC.
> > > The contents of the file are:
> >
> > > # filename: ex002.ttl
> >
> > > @prefix ab: <http://learningsparql.com/ns/addressbook#> .
> >
> > > ab:richard ab:homeTel "(229) 276-5135" .
> > > ab:richard ab:email   "[email protected]" .
> >
> > > ab:cindy ab:homeTel "(245) 646-5488" .
> > > ab:cindy ab:email   "[email protected]" .
> >
> > > ab:craig ab:homeTel "(194) 966-1505" .
> > > ab:craig ab:email   "[email protected]" .
> > > ab:craig ab:email   "[email protected]" .
> >
> > > Thanks,
> > > Bruce
> >
> > > --
> > > 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
>
> --
> 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 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 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