Joseph;  The SELECT statement returns a result set and therefore makes
no changes to the data (just a a SQL SELECT statement only retrieves
data).  To "modify" a value you would need to construct a value
(INSERT to assert the additional triple) then remove the old one
(DELETE).  SPARQLMotion would be a good idea if this is something you
do often.

For creating an instance of a class, you need to add the triple that
corresponds to the type statement you want.  Here is an example based
on what you have given thus far.

CONSTRUCT {?newURI rdf:type :Person .}
WHERE {
         ?survey a :Survey .
         ?survey :ID ?id .
         LET (?newURI := smf:buildURI(":cls_{?id}")) .
}

Note that if you run this in the SPARQL tab, you will then have to
assert the triples in the result set to make them part of your model
(CONSTRUCT only returns triples, it does not assert them).  The
SPARQLMotion module ApplyConstruct will do both, i.e. apply the query
to get the triples, and then assert the triples to the model.

-- Scott

On Jan 22, 12:43 pm, Joseph Shea <[email protected]> wrote:
> Hello and thank you for the reply. That sort of helped...I'm able to
> get the correct results from that query that I posted earlier, but the
> problem is that I don't know how to actually change the string field
> to a date field. Honestly, I'm not too familiar with TopBraid and
> SPARQL, but I figure that this would be a good way to learn.
>
> As for the "Converting a string to a class", my explanation was rather
> poor. I'll try to use an example. Say I have a collection of surveys
> that are instances of class "Survey". These surveys have names or ID
> numbers on them (some unique identifier) and I want to use the surveys
> to populate the class "Person". Hopefully that makes sense.
>
> Thank you for any and all help.
>
> On 1/22/09, Holger Knublauch <[email protected]> wrote:
>
>
>
> > Hi Joseph,
>
> > BTW SPARQL has a built-in feature to convert between XSD datatypes, e.g.
>
> >    LET (?string := "2008-01-02") .
> >    LET (?date := xsd:date(?string))
>
> > binds ?date with "2008-01-02"^^xsd:date.
>
> > I don't know what you mean with converting a date to a class, but you
> > can convert a URI string to a class using the function smf:resource(?
> > uri). You could then use smf:buildURI() to construct a valid URI from
> > a date.
>
> > I hope that helps, if not please clarify.
>
> > Holger
>
> > On Jan 22, 2009, at 6:45 AM, Joseph Shea wrote:
>
> >> Hello all. I'm relatively new to TopBraid. I'm trying to convert
> >> strings into classes, or even dates for that matter....I'm not really
> >> sure how to do that, but I tried converting a string into a date, and
> >> the following SPARQL query seemed to have done the job, though it was
> >> never changed. Any advice on this, or how to convert strings into
> >> classes? (Websites and tutorials would also be appreciated)
>
> >> SELECT  *
> >>        WHERE {
> >>                ?person :HasBirthdate ?Birthdate .
> >>                LET (?newBirthdate := smf:cast(?Birthdate, xsd:date)) .
> >>        }
>
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to