Hi Ivan, I've hit a small problem with CONSTRUCT - when I use construct (instead of select), they query seems to take forever, I waited about 10 mins and then gave up.
This query returns 10 rows and returns instantly: sparql define input:storage <http://terapath.net/adb/quad_storage/default> Select * where { ?s ?p ?o } limit 10 This query takes some amount of time, > 10 mins, I haven't waited long enough to see it complete... The computer's CPU stays at 100% usage while I waited.. After 10 mins I restarted the service. sparql define input:storage <http://terapath.net/adb/quad_storage/default> construct { ?s ?p ?o } where { ?s ?p ?o } limit 10 There is quite a lot of data in the sql server database behind this quad storage (1.8gb), is there some reason construct would take so much longer? Perhaps the 'limit 10' gets ignored? - Alex > -----Original Message----- > From: Alex Black > Sent: Monday, April 30, 2007 9:00 AM > To: 'imikhailov' > Cc: virtuoso-users-boun...@lists.sourceforge.net > Subject: RE: [Virtuoso-users] Export RDF to a file > > Thanks very much Ivan, that helps a lot! > > > -----Original Message----- > > From: imikhailov [mailto:imikhai...@openlinksw.com] > > Sent: Saturday, April 28, 2007 3:19 PM > > To: Alex Black > > Cc: virtuoso-users-boun...@lists.sourceforge.net > > Subject: RE: [Virtuoso-users] Export RDF to a file > > > > Hello Alex, > > > > The output stream may be created by string_output() 'constructor' > > function. > > The returned value is an object that can grow basically > infinitely (it > > supports even flushing to disk when it become really huge). It is a > > valid input for variety of functions including http(), http_value() > > etc; > > DB.DBA.RDF_TRIPLES_TO_TTL() serialize data using http_* family of > > functions so the serialisation can be sent to HTTP client (if the > > second parameter is > > NULL) or written to file (by string_to_file()) or converted to a > > string by string_output_string(). > > > > A simple use case: > > > > create procedure DB.DBA.CONSTRUCT_AND_SAVE_TO_TTL_FILE (in > > construct_query varchar, in dflt_graph varchar, in filename > varchar) { > > declare ses, res, triples any; > > res := DB.DBA.SPARQL_EVAL_TO_ARRAY (construct_query, > dflt_graph, 1); > > triples := dict_list_keys (res[0][0], 1); > > ses := string_output (); > > DB.DBA.RDF_TRIPLES_TO_TTL (triples, ses); > > string_to_file (filename, ses, -2); > > } > > ; > > > > DB.DBA.CONSTRUCT_AND_SAVE_TO_TTL_FILE ( > > 'construct { ?s ?p ?o } where { ?s ?p ?o }', > > DB.DBA.JSO_SYS_GRAPH(), > > 'system_metadata.ttl' ); > > > > > > Best Regards, > > IvAn Mikhailov. > > > > -----Original Message----- > > From: virtuoso-users-boun...@lists.sourceforge.net > > [mailto:virtuoso-users-boun...@lists.sourceforge.net] On Behalf Of > > Alex Black > > Sent: Saturday, April 28, 2007 3:32 AM > > To: virtuoso-users@lists.sourceforge.net > > Subject: [Virtuoso-users] Export RDF to a file > > > > Can anyone point me in the right direction to export RDF to a file > > (say TTL, or RDF/XML)? > > > > It looks to me like DB.DBA.RDF_TRIPLES_TO_TTL() would work, but I > > can't figure out what to pass in to the second parameter > (the output > > stream)? > > > >