Re: Exception in the code

2016-07-15 Thread Andy Seaborne
Collaborate with other people doing the project or related projects. It is clear there are several of you. On 15/07/16 10:09, kumar rohit wrote: Yes you are right sir, it is a project based assignment but stuck in the first portion/part of creating individuals based on user entered string. I i

Re: Exception in the code

2016-07-15 Thread kumar rohit
Yes you are right sir, it is a project based assignment but stuck in the first portion/part of creating individuals based on user entered string. I initialized the OntModel in the button handler as: jButton1ActionPerformed(java.awt.event.ActionEvent evt) { OntModel model=ModelFactory.createOntolo

Re: Exception in the code

2016-07-14 Thread Lorenz B.
OntModel is the in-memory knowledge base.That's where you create the individual. By the way, some of your class mates asked similar things on Stackoverflow, so it looks like you're doing some assignments. I also don't see the problem. A user enters a String and you use this to create the individual

Re: Exception in the code

2016-07-14 Thread kumar rohit
I am sorry but I thought if Ontclass can be passed as null, so shall be OntModel. My sole purpose is to pass the string entered by user to the read() which can be used create individuals. On Thu, Jul 14, 2016 at 5:03 AM, Lorenz B. < buehm...@informatik.uni-leipzig.de> wrote: > In which the seco

Re: Exception in the code

2016-07-14 Thread Lorenz B.
In which the second argument is the class and not the model as in your code. It looks like you did mostly copy and paste without understanding the code. In your case the model is ALWAYS null, do you understand that? > I have read it here: > http://tutorial-academy.com/category/java/ > > He used nu

Re: Exception in the code

2016-07-14 Thread kumar rohit
I have read it here: http://tutorial-academy.com/category/java/ He used null argument in the main() method: public static void main(String[] args) { // create OntModel OntModel model = ModelFactory.createOntologyModel(); // read camera ontology readOntology( "./ontology/camera.owl", model ); // s

Re: Exception in the code

2016-07-14 Thread Lorenz B.
I don't get it. Where did you saw this in the Jena tutorial? And do you understand that when you call in your main() read(str, null); that the second argument is always null, thus, the code will never go into the if-clause? > The read() method is given below: I used null reference after reading

Re: Exception in the code

2016-07-14 Thread kumar rohit
The read() method is given below: I used null reference after reading this tutorial of Jena which used it in main(). *Since I have to create individual of name entered in text field and then button clicked, either I need OntClass in button handler or the string of text field in the read() method.*

Re: Exception in the code

2016-07-14 Thread Lorenz B.
Andy already told you correctly that you call read(str, null) thus the second argument is null. Moreover, you did not show the read() method but only readOntology(), thus, nobody knows what's going inside the read() method. But obviously, some object is null and you call a method on that. I sugge

Re: Exception in the code

2016-07-14 Thread kumar rohit
*As I also mentioned in the code: model.write(), it writes the rdf to console and load the GUI also.* *But when I enter text and press button ,it gives exception error:* Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at javaapplication4.NewJFrame.read(NewJFrame.java:53) at j

Re: Exception in the code

2016-07-13 Thread kumar rohit
The error message no changed to : I dont think its UI problem ERROR [main] (RDFDefaultErrorHandler.java:44) - Premature end of file. Exception in thread "main" com.hp.hpl.jena.shared.JenaException: org.xml.sax.SAXParseException; Premature end of file. at com.hp.hpl.jena.rdf.model.impl.RDFDefaultE

Re: Exception in the code

2016-07-13 Thread Andy Seaborne
This looks rather similar to ; http://stackoverflow.com/questions/38351713/creating-individual-in-jena I suggest local collaboration. On 13/07/16 16:37, kumar rohit wrote: Hi I have the following code in which I want to create an instance/individual of the class Student. The student name is en

Re: Fwd: Exception in the code

2016-07-13 Thread Andy Seaborne
On 13/07/16 16:58, kumar rohit wrote: Hi I have the following code in which I want to create an instance/individual of the class Student. The student name is entered in a text box (in a button even handler). But it gives exception. _ public class NewJFram

Fwd: Exception in the code

2016-07-13 Thread kumar rohit
Hi I have the following code in which I want to create an instance/individual of the class Student. The student name is entered in a text box (in a button even handler). But it gives exception. _ public class NewJFrame extends javax.swing.JFrame { publ

Exception in the code

2016-07-13 Thread kumar rohit
Hi I have the following code in which I want to create an instance/individual of the class Student. The student name is entered in a text box (in a button even handler). But it gives exception. _ public class NewJFrame extends javax.swing.JFrame { publ