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 -~----------~----~----~----~------~----~------~--~---
