Re: working on "A Model of Authority in the Web" (str:search and str:scrape)

Dan Connolly wrote:
[...]
> On Fri, 2009-12-18 at 16:10 +0100, jos.deroo@agfa.com wrote:
> [...]
>> I also had to add the string search builtin in Eye and I see that it 
>> is called "scrape" in http://www.w3.org/2000/10/swap/doc/CwmBuiltins 
>
> search and scrape aren't quite the same; scrape's range is a string,
> while search's range is a list of strings.
>
> I neglected to document search when I coded it up.

Thanks Dan and it is clear now.
I implemented both in 
http://eulersharp.sourceforge.net/2006/02swap/euler.yap
version_info('$Id: euler.yap 3220 2009-12-18 18:10:00Z josd $').
plus added them in 
http://eulersharp.sourceforge.net/2003/03swap/euler-builtins.n3

Both cwm and eye now agree that

@prefix str: <http://www.w3.org/2000/10/swap/string#>.
("http://example.org/1995/manifesto" "http://([^/]+)/") str:scrape 
"example.org".
("http://example.org/1995/manifesto" "http://([^/]+)/([^/]+)") str:scrape 
"example.org".
("http://example.org/1995/manifesto" "http://([^/]+)/") str:search 
("example.org").
("http://example.org/1995/manifesto" "http://([^/]+)/([^/]+)") str:search 
("example.org" "1995").
("http://example.org/1995/manifesto" "http://([^/]+)/([^/]+)/([^/]+)") 
str:search ("example.org" "1995" "manifesto").
("http://example.org/1995/manifesto/a/b/c/d/e/f/g/h/i" "http://(
[^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)") 
str:search ("example.org" "1995" "manifesto" "a" "b" "c" "d" "e" "f" "g").


Kind regards,

Jos De Roo | Agfa HealthCare
Senior Researcher | HE/Advanced Clinical Applications Research
T  +32 3444 7618
 http://www.agfa.com/w3c/jdroo/

Quadrat NV, Kortrijksesteenweg 157, 9830 Sint-Martens-Latem, Belgium
http://www.agfa.com/healthcare

Received on Friday, 18 December 2009 18:42:22 UTC