Click here to Skip to main content
15,884,298 members
Home / Discussions / Java
   

Java

 
AnswerRe: Duplicate entry 'VALUE' for key 'PRIMARY' Pin
Patrice T13-Aug-16 16:59
mvePatrice T13-Aug-16 16:59 
GeneralRe: Duplicate entry 'VALUE' for key 'PRIMARY' Pin
Django_Untaken14-Aug-16 3:28
Django_Untaken14-Aug-16 3:28 
GeneralRe: Duplicate entry 'VALUE' for key 'PRIMARY' Pin
Patrice T14-Aug-16 3:39
mvePatrice T14-Aug-16 3:39 
Question[SOLVED] java.lang.ClassNotFoundException: com.mysql.jdbc.Driver Pin
Django_Untaken4-Aug-16 8:35
Django_Untaken4-Aug-16 8:35 
AnswerRe: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver Pin
Richard MacCutchan4-Aug-16 20:38
mveRichard MacCutchan4-Aug-16 20:38 
QuestionMaven cmd line Tests failing,M aven Test Run Through Eclipse Pass Pin
DLamar123-Aug-16 8:29
DLamar123-Aug-16 8:29 
AnswerRe: Maven cmd line Tests failing,M aven Test Run Through Eclipse Pass Pin
jschell12-Aug-16 10:54
jschell12-Aug-16 10:54 
Questionread and traverse over the TTL file Pin
Eng.Roqaya22-Jul-16 8:12
Eng.Roqaya22-Jul-16 8:12 
I try to read TTL file and make traversing get subject, predict and object.

the program compile successfully but no output as a result of entering in an infinite call as I understood. any suggestion for help 

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package new_try;

//import static com.hp.hpl.jena.assembler.JA.Model;
//import com.hp.hpl.jena.graph.Triple;
//import com.hp.hpl.jena.rdf.model.Model;
///*import com.hp.hpl.jena.rdf.model.ModelFactory;*/import java.io.File;
import com.hp.hpl.jena.graph.Triple;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import org.apache.jena.riot.RDFDataMgr;
//import org.apache.jena.riot.RDFDataMgr;
import org.apache.jena.riot.lang.PipedRDFIterator;
import org.apache.jena.riot.lang.PipedRDFStream;
import org.apache.jena.riot.lang.PipedTriplesStream;

/**
 *
 * @author bonn
 */
public class New_try {

    /**
     * @param args the command line arguments
     * @throws java.io.FileNotFoundException
     */
  
    public static void main(String[] args) throws FileNotFoundException   {
        
  
        final String filename = "E:\\yagoTransitiveType.ttl";
        System.out.println(filename);
        
          System.out.println("Hello1");
          PipedRDFIterator<Triple> iter = new PipedRDFIterator<>();
          System.out.println("Hello2");
          final PipedRDFStream<Triple> inputStream = new PipedTriplesStream(iter);
          System.out.println("Hello3");
        // PipedRDFStream and PipedRDFIterator need to be on different threads
         ExecutorService executor = Executors.newSingleThreadExecutor();
          System.out.println("Hello4");
//         Create a runnable for our parser thread
        Runnable parser;
        parser = new Runnable() {
           
            @Override
            public void run() {
        System.out.println(filename);
//                 Call the parsing process.
                RDFDataMgr.parse(inputStream, filename);
                
                          System.out.println("Hello6");

            }
        };
//         Start the parser on another thread
        executor.submit(parser);
 
        
        while (iter.hasNext()) {
            Triple next = iter.next();
            System.out.println("Subject:  "+next.getSubject());
            System.out.println("Object:  "+next.getObject());
            System.out.println("Predicate:  "+next.getPredicate());
            System.out.println("\n");
        }
 

        
        
        
        
        
    }
    
}

AnswerRe: read and traverse over the TTL file Pin
Richard MacCutchan22-Jul-16 21:25
mveRichard MacCutchan22-Jul-16 21:25 
Question.jar to .exe Pin
prateek chauhan19-Jul-16 18:47
prateek chauhan19-Jul-16 18:47 
AnswerRe: .jar to .exe Pin
Richard MacCutchan19-Jul-16 21:48
mveRichard MacCutchan19-Jul-16 21:48 
AnswerRe: .jar to .exe Pin
Afzaal Ahmad Zeeshan22-Jul-16 8:33
professionalAfzaal Ahmad Zeeshan22-Jul-16 8:33 
AnswerRe: .jar to .exe Pin
Curry Francis25-Jul-16 1:50
Curry Francis25-Jul-16 1:50 
GeneralRe: .jar to .exe Pin
Richard MacCutchan25-Jul-16 3:16
mveRichard MacCutchan25-Jul-16 3:16 
GeneralRe: .jar to .exe Pin
Curry Francis27-Jul-16 4:01
Curry Francis27-Jul-16 4:01 
GeneralRe: .jar to .exe Pin
Richard MacCutchan27-Jul-16 4:51
mveRichard MacCutchan27-Jul-16 4:51 
GeneralRe: .jar to .exe Pin
jschell12-Aug-16 10:58
jschell12-Aug-16 10:58 
QuestionJava - Iterating through form controls to create Array of Selected Items from Multiple JLists Pin
Member 1141797813-Jul-16 20:31
Member 1141797813-Jul-16 20:31 
AnswerRe: Java - Iterating through form controls to create Array of Selected Items from Multiple JLists Pin
Richard MacCutchan13-Jul-16 21:48
mveRichard MacCutchan13-Jul-16 21:48 
GeneralRe: Java - Iterating through form controls to create Array of Selected Items from Multiple JLists Pin
Member 1141797813-Jul-16 23:14
Member 1141797813-Jul-16 23:14 
GeneralRe: Java - Iterating through form controls to create Array of Selected Items from Multiple JLists Pin
Richard MacCutchan13-Jul-16 23:15
mveRichard MacCutchan13-Jul-16 23:15 
QuestionThe main purposes of learning java Pin
Ratul Thakur24-Jun-16 4:04
Ratul Thakur24-Jun-16 4:04 
AnswerRe: The main purposes of learning java Pin
Richard MacCutchan24-Jun-16 4:27
mveRichard MacCutchan24-Jun-16 4:27 
GeneralRe: The main purposes of learning java Pin
Ratul Thakur24-Jun-16 5:04
Ratul Thakur24-Jun-16 5:04 
GeneralRe: The main purposes of learning java Pin
Richard MacCutchan24-Jun-16 5:09
mveRichard MacCutchan24-Jun-16 5:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.