Virtuoso RDF file load

Matters relating to Virtuoso and OpenLink Data Spaces AMI's hosted on Amazon EC2

Virtuoso RDF file load

Postby priyam_maheshwari on Mon Jun 27, 2011 2:50 pm

Hi

I have written this following code to load a local RDF file to my local Virtuoso instance with the help of Jena. But even for the smallest of RDF file it times out. Can anybody please point out what could be the possible cause

Code: Select all
import com.hp.hpl.jena.query.*; import com.hp.hpl.jena.rdf.model.Model; import com.hp.hpl.jena.rdf.model.ModelFactory; import com.hp.hpl.jena.rdf.model.RDFNode; import com.hp.hpl.jena.update.UpdateException; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.InputStream; import virtuoso.jena.driver.VirtDataSource; import virtuoso.jena.driver.VirtGraph; import virtuoso.jena.driver.VirtuosoUpdateFactory; import virtuoso.jena.driver.VirtuosoUpdateRequest;

/**
*
* @author Priyam
*/
public class Main {
    public static void main(String[] args) throws FileNotFoundException {
VirtGraph set = new VirtGraph ("jdbc:virtuoso://localhost:1111", "dba", "dba");
   InputStream in = new FileInputStream("C://Users//Dell//Documents//NetBeansProjects//CoKo//build//web//files//test11.rdf");
  VirtuosoUpdateRequest vur = VirtuosoUpdateFactory.read(in,set);
                vur.exec();
System.out.println("done");

    }

}
priyam_maheshwari
 
Posts: 28
Joined: Mon Mar 14, 2011 10:13 pm

Re: Virtuoso RDF file load

Postby hwilliams on Mon Jun 27, 2011 8:57 pm

Hi

Please enable the trace_on() function so we can trace what activity is occurring on the server when this time out occurs as detailed at:

http://docs.openlinksw.com/virtuoso/fn_trace_on.html

The trace output will be added to the the virtuoso.log file

Best Regards
Hugh Williams
OpenLink Software
hwilliams
 
Posts: 909
Joined: Thu Mar 06, 2008 4:30 am

Re: Virtuoso RDF file load

Postby priyam_maheshwari on Tue Jun 28, 2011 3:25 pm

Hi

Please find attached the log file..with trace_on()

Priyam
Attachments
virtuoso.log
(176.78 KiB) Downloaded 216 times
priyam_maheshwari
 
Posts: 28
Joined: Mon Mar 14, 2011 10:13 pm

Re: Virtuoso RDF file load

Postby hwilliams on Tue Jun 28, 2011 6:26 pm

Hi

When I check your log file there is no additional "trace_on" information, as all I see is:

Code: Select all
10:58:44 HTTP/WebDAV server online at 8890
10:58:44 Server online at 1111 (pid 6384)
12:17:17 Checkpoint started
12:18:10 Checkpoint finished, log reused


Whereas I would expect to see the following entries indicating tracing has been enabled for a given session:

Code: Select all
21:08:51 HTTP/WebDAV server online at 8890
21:08:51 Server online at 1111 (pid 46146)
21:10:15 LTRS_1 dba 127.0.0.1 1111:1 Commit transact 0x10738120 0
21:10:15 LTRS_2 dba 127.0.0.1 1111:1 Restart transact 0x10738120
21:10:57 LTRS_1 <DBA> 127.0.0.1 Internal Commit transact 0x125a53c0 0
21:10:57 LTRS_2 <DBA> 127.0.0.1 Internal Restart transact 0x125a53c0


So did you run the "trace_on()" command after starting Virtuoso and then attempt the data load ?

Best Regards
Hugh Williams
OpenLink Software
hwilliams
 
Posts: 909
Joined: Thu Mar 06, 2008 4:30 am

Re: Virtuoso RDF file load

Postby priyam_maheshwari on Wed Jun 29, 2011 11:02 am

I deleted the previous log file..and again started the server and ran trace_on() and the code.
Please find attached the new log file

Priyam
Attachments
virtuoso.log
(8.34 KiB) Downloaded 218 times
priyam_maheshwari
 
Posts: 28
Joined: Mon Mar 14, 2011 10:13 pm

Re: Virtuoso RDF file load

Postby hwilliams on Tue Jul 19, 2011 10:05 am

Hi

It is not advisable to use VirtuosoUpdateFactory for adding RDF data to the Quad Store, as VirtuosoUpdateFactory was designed specifically for executing SPARUL queries ONLY. For loading RDF files via Jena something like the following is recommended:

Code: Select all
------------------------------------------------------------
import com.hp.hpl.jena.query.*;
import com.hp.hpl.jena.rdf.model.RDFNode;
import com.hp.hpl.jena.graph.Triple;
import com.hp.hpl.jena.graph.Node;
import com.hp.hpl.jena.graph.Graph;
import com.hp.hpl.jena.rdf.model.*;
import java.util.Iterator;
import java.io.*;

import virtuoso.jena.driver.*;

public class V_TEST {

public static void main(String[] args) {

   String conn_str = "jdbc:virtuoso://pcc:1112";

   try {
     Model md = VirtModel.openDatabaseModel("virt:test1", conn_str, "dba", "dba");
         md.read(new FileInputStream("t_uni8.rdf"), "http://www.example.org/");
     System.out.println("==Inserted==");

   } catch (Exception e) {
     System.out.println("Exception=="+e);
   }

}
}


Best Regards
Hugh Williams
OpenLink Software
hwilliams
 
Posts: 909
Joined: Thu Mar 06, 2008 4:30 am


Return to Virtuoso and OpenLink Data Spaces AMI on Amazon EC2

Who is online

Users browsing this forum: No registered users and 1 guest

cron