Hello Percy, I'd write either
MODIFY <http://test.com/> delete {?s ?p ?o} insert {?s_new ?p ?o} where { { SELECT iri(bif:replace( str(?s),"http://test.com/link","http://test.com/extra/link" ) ) AS ?s_new ?s ?p ?o WHERE {?s ?p ?o filter (regex (str(?s), "http://test.com/link")) } } } or MODIFY <http://test.com/> delete {?s ?p ?o} insert {`iri(?s_new)` ?p ?o} where { { SELECT bif:replace( str(?s),"http://test.com/link","http://test.com/extra/link" ) AS ?s_new ?s ?p ?o WHERE {?s ?p ?o filter (regex (str(?s), "http://test.com/link")) } } } or even MODIFY <http://test.com/> delete {?s ?p ?o} insert { `iri(bif:replace( str(?s),"http://test.com/link","http://test.com/extra/link" ))` ?p ?o } where { {?s ?p ?o filter (regex (str(?s), "http://test.com/link")) } } } but in any case I'd convert string to IRI somewhere before trying to construct a subject node. Best Regards, Ivan Mikhailov OpenLink Software http://virtuoso.openlinksw.com On Thu, 2012-01-12 at 10:55 -0200, Percy Enrique Rivera Salas wrote: > Hi Hugh, > > I provided a wrong example =( > the right one is the following > Virtuoso 22023 Error SR007: Function sprintf needs a string or UNAME or NULL > as argument 2, not an arg of type INTEGER (189) > MODIFY <http://test.com/> > delete > {?s ?p ?o} > insert > {?s_new ?p ?o} > where > { > { > SELECT > > bif:replace(str(?s),"http://test.com/link","http://test.com/extra/link") AS > ?s_new ?s ?p ?o > WHERE > {?s ?p ?o > filter (regex (str(?s), "http://test.com/link")) > } > } > } > > Best Regards, > > Percy > > 2012/1/11 Hugh Williams <[email protected]> > Hi Percy, > > > In what way does it now work as the query itself runs on my > machine but doesn’t modify anything as I don’t have such data, > so are you getting and error or unexpected results are > occurring ? Please provide some output of what you are seeing > as not working ? > > Best Regards > Hugh Williams > Professional Services > OpenLink Software, Inc. // > http://www.openlinksw.com/ > 10 Burlington Mall Road, Suite 265, Burlington MA 01803 > Weblog -- http://www.openlinksw.com/blogs/ > LinkedIn -- http://www.linkedin.com/company/openlink-software/ > Twitter -- http://twitter.com/OpenLink > Google+ -- http://plus.google.com/100570109519069333827/ > Facebook -- http://www.facebook.com/OpenLinkSoftware > Universal Data Access, Integration, and Management Technology > Providers > > On 11 Jan 2012, at 19:03, Percy Enrique Rivera Salas wrote: > > > > Dear All, > > > > The following MODIFY Statement doesn't work properly, I > > think is because > > the variable ?url and ?new_url is an IRI (not a Literal) > > > > MODIFY <http://test.com/> > > delete > > {?s ?p ?url} > > insert > > {?s ?p ?new_url} > > where > > { > > { > > SELECT > > ?s ?p > > > bif:replace(str(?url),"http://test.com/link","http://test.com/extra/link") AS > ?new_url ?url > > WHERE > > {?s ?p ?url > > filter (regex (str(?url), "http://test.com/link")) > > } > > } > > } > > > > Any idea to workaround? > > > > Best Regards, > > > > Percy > > > > > ------------------------------------------------------------------------------ > > Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't > > need a complex > > infrastructure or vast IT resources to deliver seamless, > > secure access to > > virtual desktops. With this all-in-one solution, easily > > deploy virtual > > desktops for less than the cost of PCs and save 60% on VDI > > infrastructure > > costs. Try it free! > > > http://p.sf.net/sfu/Citrix-VDIinabox_______________________________________________ > > Virtuoso-users mailing list > > [email protected] > > https://lists.sourceforge.net/lists/listinfo/virtuoso-users > > > > ------------------------------------------------------------------------------ > RSA(R) Conference 2012 > Mar 27 - Feb 2 > Save $400 by Jan. 27 > Register now! > http://p.sf.net/sfu/rsa-sfdev2dev2 > _______________________________________________ Virtuoso-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/virtuoso-users
