Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 5 of 5

Thread: jena code

  1. #1
    Junior Member
    Join Date
    Jun 2011
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default jena code

    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
    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");
     
        }
     
    }


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,162
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: jena code

    This thread has been cross posted here:

    http://www.java-forums.org/advanced-java/45807-load-rdf-file.html#post218270

    Although cross posting is allowed, for everyone's benefit, please read:

    Java Programming Forums Cross Posting Rules

    The Problems With Cross Posting


  3. #3
    Junior Member
    Join Date
    Jun 2011
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: jena code

    but i havn't got any response on either of the forums

  4. #4
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 294 Times in 227 Posts
    Blog Entries
    4

    Default Re: jena code

    Quote Originally Posted by priyam_maheshwari View Post
    but i havn't got any response on either of the forums
    Norm is making people aware of your other thread. It's important you let people know about your cross posts.

    Please read - http://www.javaprogrammingforums.com...s-posting.html

    As for your question, are you sure it is connecting to the database correctly?
    Please use [highlight=Java] code [/highlight] tags when posting your code.
    Forum Tip: Add to peoples reputation by clicking the button on their useful posts.

  5. #5
    Junior Member
    Join Date
    Jun 2011
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: jena code

    hi,

    Yes i am able to connect to the database, but unable to load data through code.

Tags for this Thread