W3C home > Mailing lists > Public > www-rdf-interest@w3.org > August 2003

RFC for regex object builtin (was Re: Question about CWM)

From: James Michael DuPont <mdupont777@yahoo.com>
Date: Thu, 28 Aug 2003 06:26:02 -0700 (PDT)
Message-ID: <20030828132602.96357.qmail@web41509.mail.yahoo.com>
To: (wrong string) Žl-Massieux" <dom@w3.org>
Cc: www-rdf-interest@w3.org


--- Dominique HazaŽl-Massieux <dom@w3.org> wrote:
> Le mar 26/08/2003 ŗ 11:20, James Michael DuPont a ťcrit :
> > 1. how is it possible to do sedlike "s/_/-/g" type
> > replacements on
> > strings? I am using the string:scrape any way to just scrap and
> concat
> > each part that matches a pattern?
> 
> I don't know...

What do you all think about making the followin builtins for CWM :


# myregex is a search and replace thingie
:myregex a regex:search-replace.

# look for foo
:myrefex regex:search-for      "foo*".
:myrefex regex:search-for      "baz".

# repleace with bar
:myrefex regex:replace  "bar".

# store the result in :result
:myrefex regex:result          :result.

# prepare input 
:var foo:name :input.

# apply to the varible :input
:myregex regex:apply :input.

#store the first result to :result-var
:result regex:match-1 :result-val;
:result regex:match-2 :result-val2;

how does that sound ? 

> 
> > 2. How can i convert an string to an uri? 
> > i would like to take "<http://goo.foo.com/bar/baz#>" and convert it
> to
> > the  uri <http://goo.foo.com/bar/baz#>. Any ideas?
> 
> AFAIK, log:uri does that (but without the < >), e.g.
> :toto log:uri "http://example.org/foobar#"

How about a new built in for that ?
   log:uri-absolute
that  will emit "<http://example.org/foobar#>"

   log:uri-prefixed
that  will emit "foo:"
if foo: is 
@prefix foo: <http://example.org/foobar#>

Any comments?

mike


=====
James Michael DuPont
http://introspector.sourceforge.net/

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
Received on Thursday, 28 August 2003 09:26:07 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:52:01 GMT