Gerrick, smf:regex uses the same regex used in SPARQL, the XQuery 1.0/
XPath 2.0 standard at
http://www.w3.org/TR/xpath-functions/#regex-syntax

One problem you are having is that characters such a '.' and '(' have
meaning in regex expressions.  To specify the character, you need a
double-escape.  Here's an example of what you are setting up in your
example:

Select  ?convertedColumnName
WHERE
{  LET (?colName := smf:lowerCamelCase("avg.FlowingTemp(F)")) .
   LET (?convertedColumnName := smf:regex(?colName, "([A-z]+)\\.([A-z]
+)\\(([A-z])\\)", "$1$2$3"))
}

-- Scott


On Apr 13, 10:05 pm, Gerrick Bivins <[email protected]> wrote:
> Hi Scott,
> Yes, this is occurring in one of my sparql motion scripts not in a specific
> module though. I was trying to build up a query to test it and the error was
> thrown.
> It looks like my regex syntax is incorrect:
>
> Select  ?convertedColumnName
> WHERE {
>     LET (?convertedColumnName := smf:lowerCamelCase("avg.FlowingTemp(F)")) .
>     LET (?convertedColumnName := smf:regex(?convertedColumnName, "#", "",
> ?convertedColumnName)) .
>     LET (?convertedColumnName := smf:regex(?convertedColumnName, " ", "",
> ?convertedColumnName)) .
> #LET (?convertedColumnName := smf:regex(?convertedColumnName, ")", "",
> ?convertedColumnName)) .
> #LET (?convertedColumnName := smf:regex(?convertedColumnName, "(", "",
> ?convertedColumnName)) .
> #LET (?convertedColumnName := smf:regex(?convertedColumnName, ".", "",
> ?convertedColumnName)) .
>
> }
>
> Uncommenting one of the first two lines throws the error. The last line
> returns no results.
>
> Gerrick
> On Tue, Apr 13, 2010 at 7:49 PM, Scott Henninger <[email protected]
>
> > wrote:
> > Gerrick; The code for converting column names is not available.  Are
> > you doing this via a script?  I.e. ConvertSpreadsheetToRDF?
>
> > Also, can you provide examples of smf:regex errors you are getting?
>
> > -- Scott
>
> > On Apr 13, 5:48 pm, gbiv <[email protected]> wrote:
> > > Just a quick question, is the algorithm that is used for converting
> > > spreadsheet column headers into property names available or do I need
> > > to roll my own?
> > > For instance, we're running across column names such as:
> > > Avg. Temp (F) and TBC converts it to avgTempF.
>
> > > Similar things happen with a heading like:
> > > Identification #  which TBC converts to identification.
>
> > > I've tried to use smf:regex but it throws an error on characters like
> > > "(",")" and "."   .
> > > Gerrick
>
> > --
> > 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]<topbraid-users%[email protected]>
> > For more options, visit this group at
> >http://groups.google.com/group/topbraid-users?hl=en
>
> > To unsubscribe, reply using "remove me" as the subject.

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