On Fri, Dec 7, 2012 at 5:31 PM, Hugh Williams <[email protected]>wrote:
> Hi Vishesh,
>
>
Hey Hugh
> There are a number of ways to perform SPARUL insert/update/delete
> operations with Virtuoso in the tips and tricks guide, at:
>
>
> http://virtuoso.openlinksw.com/dataspace/dav/wiki/Main/VirtTipsAndTricksGuide#RDF%20data%20management
>
> The key being to perform such operations with log_mode(3) to set
> transaction logging mode to autocommit, particularly when performing a
> large number of such operations which would otherwise consume large amounts
> of memory affecting the performance of the system significantly ...
>
Thanks for the link, however the proposed method of moving triples from one
graph to another assumes that the user wants to move all the triples from
one graph to another. In my case I just need to move a particular subset of
triples from one graph to another.
Also, it seems to be an overkill to remove triples from the database and
re-insert them when I just need to be changing their graph parameter. Do
you think I could use the tip give over here [1] with an additional where
clause to specify the triples?
Something like this -
UPDATE DB.DBA.RDF_QUAD TABLE OPTION (index RDF_QUAD_GS)
SET g = iri_to_id ('newGraph')
WHERE s = iri_to_id ('subject', 0) and p = iri_to_id('predicate') and
o = iri_to_id('object');
[1]
http://virtuoso.openlinksw.com/dataspace/dav/wiki/Main/VirtTipsAndTricksGuideRenameGraph
>
> Best Regards
> Hugh Williams
> Professional Services
> OpenLink Software, Inc. // http://www.openlinksw.com/
> 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 7 Dec 2012, at 10:23, Vishesh Handa wrote:
>
> Hey everyone
>
> In our install, we have a case where we need to move triples from one
> graph to another. This is a fairly regular operation, and we would like it
> to be as fast as possible.
>
> The current approach that we are using is -
>
> SQL> sparql delete from <graph> { triples } where { triples }
> SQL> sparql insert into <newGraph> { triples }
>
> Since all the triples are quite often not in the same graph. We land up
> executing the delete statement a number of times.
>
> Is there any better way of doing this?
>
> I experimented with directly updating the SQL tables. Though I do not
> think we should be doing this as the virtuoso documentation [1] explicitly
> asks clients not to do so. Apparently the internal caches are not updated.
>
> Otherwise we could do something like this -
> for each triple -
> SQL> update DB.DBA.RDF_QUAD set G = iri_to_id('newGraph', 0) where S =
> iri_to_id( 'subject', 0 ) and P = iri_to_id('predicate', 0) and O =
> iri_to_id('object', 0);
>
> This might result in fewer commands than our current approach.
>
> [1] http://docs.openlinksw.com/virtuoso/rdfdatarepresentation.html
>
> --
> Vishesh Handa
>
>
> ------------------------------------------------------------------------------
> LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
> Remotely access PCs and mobile devices and provide instant support
> Improve your efficiency, and focus on delivering more value-add services
> Discover what IT Professionals Know. Rescue delivers
>
> http://p.sf.net/sfu/logmein_12329d2d_______________________________________________
> Virtuoso-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/virtuoso-users
>
>
>
--
Vishesh Handa
------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Virtuoso-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/virtuoso-users