You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by kumar rohit <ku...@gmail.com> on 2015/08/15 16:16:09 UTC
What is the error in code
Hello, what is the problem with this code.. I can not understand even the
error message by eclipse.
______________________________________________
import java.io.InputStream;
import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.util.FileManager;
public class istmain
{
public static void main(String[] args) {
Model model=ModelFactory.createDefaultModel();
InputStream in=FileManager.get().open("Module.owl");
model.read(in,null,"RDF/XML");
model.write(System.out);
}
_____________________________________________________
Re: What is the error in code
Posted by Andy Seaborne <an...@apache.org>.
On 16/08/15 10:56, kumar rohit wrote:
> No line before this.. This is what all eclipse display the error.
"at ..." is a line from a stacktrace but it's not the start of it There
is more - if Eclipse is not showing it, change the console settings.
My guess is that is says the trace below. Please try the suggestions
already made.
Andy
Exception in thread "main" java.lang.NullPointerException
at java.io.FilterInputStream.read(FilterInputStream.java:83)
at
org.apache.xerces.impl.XMLEntityManager$RewindableInputStream.readAndBuffer(Unknown
Source)
at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown
Source)
at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.startDocumentEntity(Unknown
Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl.setInputSource(Unknown
Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at
com.hp.hpl.jena.rdfxml.xmlinput.impl.RDFXMLParser.parse(RDFXMLParser.java:151)
at com.hp.hpl.jena.rdfxml.xmlinput.ARP.load(ARP.java:119)
at org.apache.jena.riot.lang.LangRDFXML.parse(LangRDFXML.java:143)
at
org.apache.jena.riot.RDFParserRegistry$ReaderRIOTLang.read(RDFParserRegistry.java:185)
at org.apache.jena.riot.RDFDataMgr.process(RDFDataMgr.java:906)
at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:257)
at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:243)
at org.apache.jena.riot.adapters.RDFReaderRIOT.read(RDFReaderRIOT.java:70)
at com.hp.hpl.jena.rdf.model.impl.ModelCom.read(ModelCom.java:277)
at reports.MainReport.main(MainReport.java:38)
>
> On Sun, Aug 16, 2015 at 9:00 AM, Claude Warren <cl...@xenei.com> wrote:
>
>> Kumar,
>>
>> what is the line before:
>>
>> "at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:243)
>> org.apache.jena.riot.adapters.RDFReaderRIOT.read(RDFReaderRIOT.java:70)
>> com.hp.hpl.jena.rdf.model.impl.ModelCom.read(ModelCom.java:277)
>> at tutorial.istmain.main(istmain.java:23)"
>>
>> in your error stack?
>>
>> Claude
>>
>> On Sat, Aug 15, 2015 at 9:08 PM, kumar rohit <ku...@gmail.com>
>> wrote:
>>
>>> I think "Maybe Module.owl is OWL syntax, not RDF", this is right..
>> Protege
>>> deals with Owl and not rdf. right?
>>>
>>> On Sat, Aug 15, 2015 at 6:04 PM, kumar rohit <ku...@gmail.com>
>>> wrote:
>>>
>>>> Module,owl is a protege file placed in my desktop folder.
>>>>
>>>> On Sat, Aug 15, 2015 at 6:00 PM, Andy Seaborne <an...@apache.org>
>> wrote:
>>>>
>>>>> On 15/08/15 17:38, kumar rohit wrote:
>>>>>
>>>>>> 2.13 is jena version.. I have not placed the Inputstream code in
>>>>>> try/catch
>>>>>> block, is it the problem?
>>>>>>
>>>>>
>>>>> No idea. There isn't enough information; all this email thread says
>> so
>>>>> far is "there's an exception".
>>>>>
>>>>> Maybe "in" is null (=> not found)
>>>>>
>>>>> Maybe Module.owl has a syntax error in the RDF/XML
>>>>> Maybe Module.owl is OWL syntax, not RDF.
>>>>>
>>>>> If Module.owl is a file and not a Java resource, then
>>>>>
>>>>> RDFDataMgr.read(model, "Module.owl", Lang.RDFXML) ;
>>>>>
>>>>> is simpler and more direct
>>>>>
>>>>> Andy
>>>>>
>>>>>
>>>>>
>>>>>> On Sat, Aug 15, 2015 at 5:12 PM, Andy Seaborne <an...@apache.org>
>>> wrote:
>>>>>>
>>>>>> That looks like part of stacktace but missing the exception itself.
>>> What
>>>>>>> is
>>>>>>> it?
>>>>>>>
>>>>>>> And which version of Jena are you running?
>>>>>>>
>>>>>>> On 16:26, Sat, 15 Aug 2015 kumar rohit <ku...@gmail.com>
>> wrote:
>>>>>>>
>>>>>>> The closing braces are fine. Its only missed in my email. Actually
>> it
>>>>>>>>
>>>>>>> gives
>>>>>>>
>>>>>>>> me the following error in eclipse.
>>>>>>>>
>>>>>>>> "at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:243)
>>>>>>>>
>>> org.apache.jena.riot.adapters.RDFReaderRIOT.read(RDFReaderRIOT.java:70)
>>>>>>>> com.hp.hpl.jena.rdf.model.impl.ModelCom.read(ModelCom.java:277)
>>>>>>>> at tutorial.istmain.main(istmain.java:23)"
>>>>>>>>
>>>>>>>> On Sat, Aug 15, 2015 at 4:09 PM, Andy Seaborne <an...@apache.org>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>> On 15/08/15 15:16, kumar rohit wrote:
>>>>>>>>>
>>>>>>>>> Hello, what is the problem with this code.. I can not understand
>>> even
>>>>>>>>>>
>>>>>>>>> the
>>>>>>>>
>>>>>>>>> error message by eclipse.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>> What is the error you are seeing?
>>>>>>>>>
>>>>>>>>> (it's missing a closing "}" for start; if this is jena3, then the
>>>>>>>>>
>>>>>>>> imports
>>>>>>>
>>>>>>>> are wrong - but Eclipse will sort that out with shift-cntr-O)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> ______________________________________________
>>>>>>>>>> import java.io.InputStream;
>>>>>>>>>>
>>>>>>>>>> import com.hp.hpl.jena.rdf.model.Model;
>>>>>>>>>> import com.hp.hpl.jena.rdf.model.ModelFactory;
>>>>>>>>>> import com.hp.hpl.jena.util.FileManager;
>>>>>>>>>>
>>>>>>>>>> public class istmain
>>>>>>>>>> {
>>>>>>>>>>
>>>>>>>>>> public static void main(String[] args) {
>>>>>>>>>>
>>>>>>>>>> Model model=ModelFactory.createDefaultModel();
>>>>>>>>>>
>>>>>>>>>> InputStream in=FileManager.get().open("Module.owl");
>>>>>>>>>> model.read(in,null,"RDF/XML");
>>>>>>>>>> model.write(System.out);
>>>>>>>>>> }
>>>>>>>>>>
>>>>>>>>>> _____________________________________________________
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>
>>
>>
>> --
>> I like: Like Like - The likeliest place on the web
>> <http://like-like.xenei.com>
>> LinkedIn: http://www.linkedin.com/in/claudewarren
>>
>
Re: What is the error in code
Posted by kumar rohit <ku...@gmail.com>.
No line before this.. This is what all eclipse display the error.
On Sun, Aug 16, 2015 at 9:00 AM, Claude Warren <cl...@xenei.com> wrote:
> Kumar,
>
> what is the line before:
>
> "at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:243)
> org.apache.jena.riot.adapters.RDFReaderRIOT.read(RDFReaderRIOT.java:70)
> com.hp.hpl.jena.rdf.model.impl.ModelCom.read(ModelCom.java:277)
> at tutorial.istmain.main(istmain.java:23)"
>
> in your error stack?
>
> Claude
>
> On Sat, Aug 15, 2015 at 9:08 PM, kumar rohit <ku...@gmail.com>
> wrote:
>
> > I think "Maybe Module.owl is OWL syntax, not RDF", this is right..
> Protege
> > deals with Owl and not rdf. right?
> >
> > On Sat, Aug 15, 2015 at 6:04 PM, kumar rohit <ku...@gmail.com>
> > wrote:
> >
> > > Module,owl is a protege file placed in my desktop folder.
> > >
> > > On Sat, Aug 15, 2015 at 6:00 PM, Andy Seaborne <an...@apache.org>
> wrote:
> > >
> > >> On 15/08/15 17:38, kumar rohit wrote:
> > >>
> > >>> 2.13 is jena version.. I have not placed the Inputstream code in
> > >>> try/catch
> > >>> block, is it the problem?
> > >>>
> > >>
> > >> No idea. There isn't enough information; all this email thread says
> so
> > >> far is "there's an exception".
> > >>
> > >> Maybe "in" is null (=> not found)
> > >>
> > >> Maybe Module.owl has a syntax error in the RDF/XML
> > >> Maybe Module.owl is OWL syntax, not RDF.
> > >>
> > >> If Module.owl is a file and not a Java resource, then
> > >>
> > >> RDFDataMgr.read(model, "Module.owl", Lang.RDFXML) ;
> > >>
> > >> is simpler and more direct
> > >>
> > >> Andy
> > >>
> > >>
> > >>
> > >>> On Sat, Aug 15, 2015 at 5:12 PM, Andy Seaborne <an...@apache.org>
> > wrote:
> > >>>
> > >>> That looks like part of stacktace but missing the exception itself.
> > What
> > >>>> is
> > >>>> it?
> > >>>>
> > >>>> And which version of Jena are you running?
> > >>>>
> > >>>> On 16:26, Sat, 15 Aug 2015 kumar rohit <ku...@gmail.com>
> wrote:
> > >>>>
> > >>>> The closing braces are fine. Its only missed in my email. Actually
> it
> > >>>>>
> > >>>> gives
> > >>>>
> > >>>>> me the following error in eclipse.
> > >>>>>
> > >>>>> "at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:243)
> > >>>>>
> > org.apache.jena.riot.adapters.RDFReaderRIOT.read(RDFReaderRIOT.java:70)
> > >>>>> com.hp.hpl.jena.rdf.model.impl.ModelCom.read(ModelCom.java:277)
> > >>>>> at tutorial.istmain.main(istmain.java:23)"
> > >>>>>
> > >>>>> On Sat, Aug 15, 2015 at 4:09 PM, Andy Seaborne <an...@apache.org>
> > >>>>> wrote:
> > >>>>>
> > >>>>> On 15/08/15 15:16, kumar rohit wrote:
> > >>>>>>
> > >>>>>> Hello, what is the problem with this code.. I can not understand
> > even
> > >>>>>>>
> > >>>>>> the
> > >>>>>
> > >>>>>> error message by eclipse.
> > >>>>>>>
> > >>>>>>>
> > >>>>>> What is the error you are seeing?
> > >>>>>>
> > >>>>>> (it's missing a closing "}" for start; if this is jena3, then the
> > >>>>>>
> > >>>>> imports
> > >>>>
> > >>>>> are wrong - but Eclipse will sort that out with shift-cntr-O)
> > >>>>>>
> > >>>>>>
> > >>>>>>
> > >>>>>> ______________________________________________
> > >>>>>>> import java.io.InputStream;
> > >>>>>>>
> > >>>>>>> import com.hp.hpl.jena.rdf.model.Model;
> > >>>>>>> import com.hp.hpl.jena.rdf.model.ModelFactory;
> > >>>>>>> import com.hp.hpl.jena.util.FileManager;
> > >>>>>>>
> > >>>>>>> public class istmain
> > >>>>>>> {
> > >>>>>>>
> > >>>>>>> public static void main(String[] args) {
> > >>>>>>>
> > >>>>>>> Model model=ModelFactory.createDefaultModel();
> > >>>>>>>
> > >>>>>>> InputStream in=FileManager.get().open("Module.owl");
> > >>>>>>> model.read(in,null,"RDF/XML");
> > >>>>>>> model.write(System.out);
> > >>>>>>> }
> > >>>>>>>
> > >>>>>>> _____________________________________________________
> > >>>>>>>
> > >>>>>>>
> > >>>>>>>
> > >>>>>>
> > >>>>>
> > >>>>
> > >>>
> > >>
> > >
> >
>
>
>
> --
> I like: Like Like - The likeliest place on the web
> <http://like-like.xenei.com>
> LinkedIn: http://www.linkedin.com/in/claudewarren
>
Re: What is the error in code
Posted by Claude Warren <cl...@xenei.com>.
Kumar,
what is the line before:
"at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:243)
org.apache.jena.riot.adapters.RDFReaderRIOT.read(RDFReaderRIOT.java:70)
com.hp.hpl.jena.rdf.model.impl.ModelCom.read(ModelCom.java:277)
at tutorial.istmain.main(istmain.java:23)"
in your error stack?
Claude
On Sat, Aug 15, 2015 at 9:08 PM, kumar rohit <ku...@gmail.com> wrote:
> I think "Maybe Module.owl is OWL syntax, not RDF", this is right.. Protege
> deals with Owl and not rdf. right?
>
> On Sat, Aug 15, 2015 at 6:04 PM, kumar rohit <ku...@gmail.com>
> wrote:
>
> > Module,owl is a protege file placed in my desktop folder.
> >
> > On Sat, Aug 15, 2015 at 6:00 PM, Andy Seaborne <an...@apache.org> wrote:
> >
> >> On 15/08/15 17:38, kumar rohit wrote:
> >>
> >>> 2.13 is jena version.. I have not placed the Inputstream code in
> >>> try/catch
> >>> block, is it the problem?
> >>>
> >>
> >> No idea. There isn't enough information; all this email thread says so
> >> far is "there's an exception".
> >>
> >> Maybe "in" is null (=> not found)
> >>
> >> Maybe Module.owl has a syntax error in the RDF/XML
> >> Maybe Module.owl is OWL syntax, not RDF.
> >>
> >> If Module.owl is a file and not a Java resource, then
> >>
> >> RDFDataMgr.read(model, "Module.owl", Lang.RDFXML) ;
> >>
> >> is simpler and more direct
> >>
> >> Andy
> >>
> >>
> >>
> >>> On Sat, Aug 15, 2015 at 5:12 PM, Andy Seaborne <an...@apache.org>
> wrote:
> >>>
> >>> That looks like part of stacktace but missing the exception itself.
> What
> >>>> is
> >>>> it?
> >>>>
> >>>> And which version of Jena are you running?
> >>>>
> >>>> On 16:26, Sat, 15 Aug 2015 kumar rohit <ku...@gmail.com> wrote:
> >>>>
> >>>> The closing braces are fine. Its only missed in my email. Actually it
> >>>>>
> >>>> gives
> >>>>
> >>>>> me the following error in eclipse.
> >>>>>
> >>>>> "at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:243)
> >>>>>
> org.apache.jena.riot.adapters.RDFReaderRIOT.read(RDFReaderRIOT.java:70)
> >>>>> com.hp.hpl.jena.rdf.model.impl.ModelCom.read(ModelCom.java:277)
> >>>>> at tutorial.istmain.main(istmain.java:23)"
> >>>>>
> >>>>> On Sat, Aug 15, 2015 at 4:09 PM, Andy Seaborne <an...@apache.org>
> >>>>> wrote:
> >>>>>
> >>>>> On 15/08/15 15:16, kumar rohit wrote:
> >>>>>>
> >>>>>> Hello, what is the problem with this code.. I can not understand
> even
> >>>>>>>
> >>>>>> the
> >>>>>
> >>>>>> error message by eclipse.
> >>>>>>>
> >>>>>>>
> >>>>>> What is the error you are seeing?
> >>>>>>
> >>>>>> (it's missing a closing "}" for start; if this is jena3, then the
> >>>>>>
> >>>>> imports
> >>>>
> >>>>> are wrong - but Eclipse will sort that out with shift-cntr-O)
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> ______________________________________________
> >>>>>>> import java.io.InputStream;
> >>>>>>>
> >>>>>>> import com.hp.hpl.jena.rdf.model.Model;
> >>>>>>> import com.hp.hpl.jena.rdf.model.ModelFactory;
> >>>>>>> import com.hp.hpl.jena.util.FileManager;
> >>>>>>>
> >>>>>>> public class istmain
> >>>>>>> {
> >>>>>>>
> >>>>>>> public static void main(String[] args) {
> >>>>>>>
> >>>>>>> Model model=ModelFactory.createDefaultModel();
> >>>>>>>
> >>>>>>> InputStream in=FileManager.get().open("Module.owl");
> >>>>>>> model.read(in,null,"RDF/XML");
> >>>>>>> model.write(System.out);
> >>>>>>> }
> >>>>>>>
> >>>>>>> _____________________________________________________
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>
> >>>>>
> >>>>
> >>>
> >>
> >
>
--
I like: Like Like - The likeliest place on the web
<http://like-like.xenei.com>
LinkedIn: http://www.linkedin.com/in/claudewarren
Re: What is the error in code
Posted by kumar rohit <ku...@gmail.com>.
I think "Maybe Module.owl is OWL syntax, not RDF", this is right.. Protege
deals with Owl and not rdf. right?
On Sat, Aug 15, 2015 at 6:04 PM, kumar rohit <ku...@gmail.com> wrote:
> Module,owl is a protege file placed in my desktop folder.
>
> On Sat, Aug 15, 2015 at 6:00 PM, Andy Seaborne <an...@apache.org> wrote:
>
>> On 15/08/15 17:38, kumar rohit wrote:
>>
>>> 2.13 is jena version.. I have not placed the Inputstream code in
>>> try/catch
>>> block, is it the problem?
>>>
>>
>> No idea. There isn't enough information; all this email thread says so
>> far is "there's an exception".
>>
>> Maybe "in" is null (=> not found)
>>
>> Maybe Module.owl has a syntax error in the RDF/XML
>> Maybe Module.owl is OWL syntax, not RDF.
>>
>> If Module.owl is a file and not a Java resource, then
>>
>> RDFDataMgr.read(model, "Module.owl", Lang.RDFXML) ;
>>
>> is simpler and more direct
>>
>> Andy
>>
>>
>>
>>> On Sat, Aug 15, 2015 at 5:12 PM, Andy Seaborne <an...@apache.org> wrote:
>>>
>>> That looks like part of stacktace but missing the exception itself. What
>>>> is
>>>> it?
>>>>
>>>> And which version of Jena are you running?
>>>>
>>>> On 16:26, Sat, 15 Aug 2015 kumar rohit <ku...@gmail.com> wrote:
>>>>
>>>> The closing braces are fine. Its only missed in my email. Actually it
>>>>>
>>>> gives
>>>>
>>>>> me the following error in eclipse.
>>>>>
>>>>> "at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:243)
>>>>> org.apache.jena.riot.adapters.RDFReaderRIOT.read(RDFReaderRIOT.java:70)
>>>>> com.hp.hpl.jena.rdf.model.impl.ModelCom.read(ModelCom.java:277)
>>>>> at tutorial.istmain.main(istmain.java:23)"
>>>>>
>>>>> On Sat, Aug 15, 2015 at 4:09 PM, Andy Seaborne <an...@apache.org>
>>>>> wrote:
>>>>>
>>>>> On 15/08/15 15:16, kumar rohit wrote:
>>>>>>
>>>>>> Hello, what is the problem with this code.. I can not understand even
>>>>>>>
>>>>>> the
>>>>>
>>>>>> error message by eclipse.
>>>>>>>
>>>>>>>
>>>>>> What is the error you are seeing?
>>>>>>
>>>>>> (it's missing a closing "}" for start; if this is jena3, then the
>>>>>>
>>>>> imports
>>>>
>>>>> are wrong - but Eclipse will sort that out with shift-cntr-O)
>>>>>>
>>>>>>
>>>>>>
>>>>>> ______________________________________________
>>>>>>> import java.io.InputStream;
>>>>>>>
>>>>>>> import com.hp.hpl.jena.rdf.model.Model;
>>>>>>> import com.hp.hpl.jena.rdf.model.ModelFactory;
>>>>>>> import com.hp.hpl.jena.util.FileManager;
>>>>>>>
>>>>>>> public class istmain
>>>>>>> {
>>>>>>>
>>>>>>> public static void main(String[] args) {
>>>>>>>
>>>>>>> Model model=ModelFactory.createDefaultModel();
>>>>>>>
>>>>>>> InputStream in=FileManager.get().open("Module.owl");
>>>>>>> model.read(in,null,"RDF/XML");
>>>>>>> model.write(System.out);
>>>>>>> }
>>>>>>>
>>>>>>> _____________________________________________________
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>
>
Re: What is the error in code
Posted by Andy Seaborne <an...@apache.org>.
Hmm ... a reply within 4 minutes.
Which of the suggestions I've made so far have you tried? What happens?
Two of them look quite likely to show you the problem.
Andy
On 15/08/15 18:04, kumar rohit wrote:
> Module,owl is a protege file placed in my desktop folder.
>
> On Sat, Aug 15, 2015 at 6:00 PM, Andy Seaborne <an...@apache.org> wrote:
>
>> On 15/08/15 17:38, kumar rohit wrote:
>>
>>> 2.13 is jena version.. I have not placed the Inputstream code in try/catch
>>> block, is it the problem?
>>>
>>
>> No idea. There isn't enough information; all this email thread says so
>> far is "there's an exception".
>>
>> Maybe "in" is null (=> not found)
>>
>> Maybe Module.owl has a syntax error in the RDF/XML
>> Maybe Module.owl is OWL syntax, not RDF.
>>
>> If Module.owl is a file and not a Java resource, then
>>
>> RDFDataMgr.read(model, "Module.owl", Lang.RDFXML) ;
>>
>> is simpler and more direct
>>
>> Andy
>>
>>
>>
>>> On Sat, Aug 15, 2015 at 5:12 PM, Andy Seaborne <an...@apache.org> wrote:
>>>
>>> That looks like part of stacktace but missing the exception itself. What
>>>> is
>>>> it?
>>>>
>>>> And which version of Jena are you running?
>>>>
>>>> On 16:26, Sat, 15 Aug 2015 kumar rohit <ku...@gmail.com> wrote:
>>>>
>>>> The closing braces are fine. Its only missed in my email. Actually it
>>>>>
>>>> gives
>>>>
>>>>> me the following error in eclipse.
>>>>>
>>>>> "at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:243)
>>>>> org.apache.jena.riot.adapters.RDFReaderRIOT.read(RDFReaderRIOT.java:70)
>>>>> com.hp.hpl.jena.rdf.model.impl.ModelCom.read(ModelCom.java:277)
>>>>> at tutorial.istmain.main(istmain.java:23)"
>>>>>
>>>>> On Sat, Aug 15, 2015 at 4:09 PM, Andy Seaborne <an...@apache.org> wrote:
>>>>>
>>>>> On 15/08/15 15:16, kumar rohit wrote:
>>>>>>
>>>>>> Hello, what is the problem with this code.. I can not understand even
>>>>>>>
>>>>>> the
>>>>>
>>>>>> error message by eclipse.
>>>>>>>
>>>>>>>
>>>>>> What is the error you are seeing?
>>>>>>
>>>>>> (it's missing a closing "}" for start; if this is jena3, then the
>>>>>>
>>>>> imports
>>>>
>>>>> are wrong - but Eclipse will sort that out with shift-cntr-O)
>>>>>>
>>>>>>
>>>>>>
>>>>>> ______________________________________________
>>>>>>> import java.io.InputStream;
>>>>>>>
>>>>>>> import com.hp.hpl.jena.rdf.model.Model;
>>>>>>> import com.hp.hpl.jena.rdf.model.ModelFactory;
>>>>>>> import com.hp.hpl.jena.util.FileManager;
>>>>>>>
>>>>>>> public class istmain
>>>>>>> {
>>>>>>>
>>>>>>> public static void main(String[] args) {
>>>>>>>
>>>>>>> Model model=ModelFactory.createDefaultModel();
>>>>>>>
>>>>>>> InputStream in=FileManager.get().open("Module.owl");
>>>>>>> model.read(in,null,"RDF/XML");
>>>>>>> model.write(System.out);
>>>>>>> }
>>>>>>>
>>>>>>> _____________________________________________________
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>
>
Re: What is the error in code
Posted by kumar rohit <ku...@gmail.com>.
Module,owl is a protege file placed in my desktop folder.
On Sat, Aug 15, 2015 at 6:00 PM, Andy Seaborne <an...@apache.org> wrote:
> On 15/08/15 17:38, kumar rohit wrote:
>
>> 2.13 is jena version.. I have not placed the Inputstream code in try/catch
>> block, is it the problem?
>>
>
> No idea. There isn't enough information; all this email thread says so
> far is "there's an exception".
>
> Maybe "in" is null (=> not found)
>
> Maybe Module.owl has a syntax error in the RDF/XML
> Maybe Module.owl is OWL syntax, not RDF.
>
> If Module.owl is a file and not a Java resource, then
>
> RDFDataMgr.read(model, "Module.owl", Lang.RDFXML) ;
>
> is simpler and more direct
>
> Andy
>
>
>
>> On Sat, Aug 15, 2015 at 5:12 PM, Andy Seaborne <an...@apache.org> wrote:
>>
>> That looks like part of stacktace but missing the exception itself. What
>>> is
>>> it?
>>>
>>> And which version of Jena are you running?
>>>
>>> On 16:26, Sat, 15 Aug 2015 kumar rohit <ku...@gmail.com> wrote:
>>>
>>> The closing braces are fine. Its only missed in my email. Actually it
>>>>
>>> gives
>>>
>>>> me the following error in eclipse.
>>>>
>>>> "at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:243)
>>>> org.apache.jena.riot.adapters.RDFReaderRIOT.read(RDFReaderRIOT.java:70)
>>>> com.hp.hpl.jena.rdf.model.impl.ModelCom.read(ModelCom.java:277)
>>>> at tutorial.istmain.main(istmain.java:23)"
>>>>
>>>> On Sat, Aug 15, 2015 at 4:09 PM, Andy Seaborne <an...@apache.org> wrote:
>>>>
>>>> On 15/08/15 15:16, kumar rohit wrote:
>>>>>
>>>>> Hello, what is the problem with this code.. I can not understand even
>>>>>>
>>>>> the
>>>>
>>>>> error message by eclipse.
>>>>>>
>>>>>>
>>>>> What is the error you are seeing?
>>>>>
>>>>> (it's missing a closing "}" for start; if this is jena3, then the
>>>>>
>>>> imports
>>>
>>>> are wrong - but Eclipse will sort that out with shift-cntr-O)
>>>>>
>>>>>
>>>>>
>>>>> ______________________________________________
>>>>>> import java.io.InputStream;
>>>>>>
>>>>>> import com.hp.hpl.jena.rdf.model.Model;
>>>>>> import com.hp.hpl.jena.rdf.model.ModelFactory;
>>>>>> import com.hp.hpl.jena.util.FileManager;
>>>>>>
>>>>>> public class istmain
>>>>>> {
>>>>>>
>>>>>> public static void main(String[] args) {
>>>>>>
>>>>>> Model model=ModelFactory.createDefaultModel();
>>>>>>
>>>>>> InputStream in=FileManager.get().open("Module.owl");
>>>>>> model.read(in,null,"RDF/XML");
>>>>>> model.write(System.out);
>>>>>> }
>>>>>>
>>>>>> _____________________________________________________
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>
>
Re: What is the error in code
Posted by Andy Seaborne <an...@apache.org>.
On 15/08/15 17:38, kumar rohit wrote:
> 2.13 is jena version.. I have not placed the Inputstream code in try/catch
> block, is it the problem?
No idea. There isn't enough information; all this email thread says so
far is "there's an exception".
Maybe "in" is null (=> not found)
Maybe Module.owl has a syntax error in the RDF/XML
Maybe Module.owl is OWL syntax, not RDF.
If Module.owl is a file and not a Java resource, then
RDFDataMgr.read(model, "Module.owl", Lang.RDFXML) ;
is simpler and more direct
Andy
>
> On Sat, Aug 15, 2015 at 5:12 PM, Andy Seaborne <an...@apache.org> wrote:
>
>> That looks like part of stacktace but missing the exception itself. What is
>> it?
>>
>> And which version of Jena are you running?
>>
>> On 16:26, Sat, 15 Aug 2015 kumar rohit <ku...@gmail.com> wrote:
>>
>>> The closing braces are fine. Its only missed in my email. Actually it
>> gives
>>> me the following error in eclipse.
>>>
>>> "at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:243)
>>> org.apache.jena.riot.adapters.RDFReaderRIOT.read(RDFReaderRIOT.java:70)
>>> com.hp.hpl.jena.rdf.model.impl.ModelCom.read(ModelCom.java:277)
>>> at tutorial.istmain.main(istmain.java:23)"
>>>
>>> On Sat, Aug 15, 2015 at 4:09 PM, Andy Seaborne <an...@apache.org> wrote:
>>>
>>>> On 15/08/15 15:16, kumar rohit wrote:
>>>>
>>>>> Hello, what is the problem with this code.. I can not understand even
>>> the
>>>>> error message by eclipse.
>>>>>
>>>>
>>>> What is the error you are seeing?
>>>>
>>>> (it's missing a closing "}" for start; if this is jena3, then the
>> imports
>>>> are wrong - but Eclipse will sort that out with shift-cntr-O)
>>>>
>>>>
>>>>
>>>>> ______________________________________________
>>>>> import java.io.InputStream;
>>>>>
>>>>> import com.hp.hpl.jena.rdf.model.Model;
>>>>> import com.hp.hpl.jena.rdf.model.ModelFactory;
>>>>> import com.hp.hpl.jena.util.FileManager;
>>>>>
>>>>> public class istmain
>>>>> {
>>>>>
>>>>> public static void main(String[] args) {
>>>>>
>>>>> Model model=ModelFactory.createDefaultModel();
>>>>>
>>>>> InputStream in=FileManager.get().open("Module.owl");
>>>>> model.read(in,null,"RDF/XML");
>>>>> model.write(System.out);
>>>>> }
>>>>>
>>>>> _____________________________________________________
>>>>>
>>>>>
>>>>
>>>
>>
>
Re: What is the error in code
Posted by kumar rohit <ku...@gmail.com>.
2.13 is jena version.. I have not placed the Inputstream code in try/catch
block, is it the problem?
On Sat, Aug 15, 2015 at 5:12 PM, Andy Seaborne <an...@apache.org> wrote:
> That looks like part of stacktace but missing the exception itself. What is
> it?
>
> And which version of Jena are you running?
>
> On 16:26, Sat, 15 Aug 2015 kumar rohit <ku...@gmail.com> wrote:
>
> > The closing braces are fine. Its only missed in my email. Actually it
> gives
> > me the following error in eclipse.
> >
> > "at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:243)
> > org.apache.jena.riot.adapters.RDFReaderRIOT.read(RDFReaderRIOT.java:70)
> > com.hp.hpl.jena.rdf.model.impl.ModelCom.read(ModelCom.java:277)
> > at tutorial.istmain.main(istmain.java:23)"
> >
> > On Sat, Aug 15, 2015 at 4:09 PM, Andy Seaborne <an...@apache.org> wrote:
> >
> > > On 15/08/15 15:16, kumar rohit wrote:
> > >
> > >> Hello, what is the problem with this code.. I can not understand even
> > the
> > >> error message by eclipse.
> > >>
> > >
> > > What is the error you are seeing?
> > >
> > > (it's missing a closing "}" for start; if this is jena3, then the
> imports
> > > are wrong - but Eclipse will sort that out with shift-cntr-O)
> > >
> > >
> > >
> > >> ______________________________________________
> > >> import java.io.InputStream;
> > >>
> > >> import com.hp.hpl.jena.rdf.model.Model;
> > >> import com.hp.hpl.jena.rdf.model.ModelFactory;
> > >> import com.hp.hpl.jena.util.FileManager;
> > >>
> > >> public class istmain
> > >> {
> > >>
> > >> public static void main(String[] args) {
> > >>
> > >> Model model=ModelFactory.createDefaultModel();
> > >>
> > >> InputStream in=FileManager.get().open("Module.owl");
> > >> model.read(in,null,"RDF/XML");
> > >> model.write(System.out);
> > >> }
> > >>
> > >> _____________________________________________________
> > >>
> > >>
> > >
> >
>
Re: What is the error in code
Posted by Andy Seaborne <an...@apache.org>.
That looks like part of stacktace but missing the exception itself. What is
it?
And which version of Jena are you running?
On 16:26, Sat, 15 Aug 2015 kumar rohit <ku...@gmail.com> wrote:
> The closing braces are fine. Its only missed in my email. Actually it gives
> me the following error in eclipse.
>
> "at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:243)
> org.apache.jena.riot.adapters.RDFReaderRIOT.read(RDFReaderRIOT.java:70)
> com.hp.hpl.jena.rdf.model.impl.ModelCom.read(ModelCom.java:277)
> at tutorial.istmain.main(istmain.java:23)"
>
> On Sat, Aug 15, 2015 at 4:09 PM, Andy Seaborne <an...@apache.org> wrote:
>
> > On 15/08/15 15:16, kumar rohit wrote:
> >
> >> Hello, what is the problem with this code.. I can not understand even
> the
> >> error message by eclipse.
> >>
> >
> > What is the error you are seeing?
> >
> > (it's missing a closing "}" for start; if this is jena3, then the imports
> > are wrong - but Eclipse will sort that out with shift-cntr-O)
> >
> >
> >
> >> ______________________________________________
> >> import java.io.InputStream;
> >>
> >> import com.hp.hpl.jena.rdf.model.Model;
> >> import com.hp.hpl.jena.rdf.model.ModelFactory;
> >> import com.hp.hpl.jena.util.FileManager;
> >>
> >> public class istmain
> >> {
> >>
> >> public static void main(String[] args) {
> >>
> >> Model model=ModelFactory.createDefaultModel();
> >>
> >> InputStream in=FileManager.get().open("Module.owl");
> >> model.read(in,null,"RDF/XML");
> >> model.write(System.out);
> >> }
> >>
> >> _____________________________________________________
> >>
> >>
> >
>
Re: What is the error in code
Posted by kumar rohit <ku...@gmail.com>.
The closing braces are fine. Its only missed in my email. Actually it gives
me the following error in eclipse.
"at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:243)
org.apache.jena.riot.adapters.RDFReaderRIOT.read(RDFReaderRIOT.java:70)
com.hp.hpl.jena.rdf.model.impl.ModelCom.read(ModelCom.java:277)
at tutorial.istmain.main(istmain.java:23)"
On Sat, Aug 15, 2015 at 4:09 PM, Andy Seaborne <an...@apache.org> wrote:
> On 15/08/15 15:16, kumar rohit wrote:
>
>> Hello, what is the problem with this code.. I can not understand even the
>> error message by eclipse.
>>
>
> What is the error you are seeing?
>
> (it's missing a closing "}" for start; if this is jena3, then the imports
> are wrong - but Eclipse will sort that out with shift-cntr-O)
>
>
>
>> ______________________________________________
>> import java.io.InputStream;
>>
>> import com.hp.hpl.jena.rdf.model.Model;
>> import com.hp.hpl.jena.rdf.model.ModelFactory;
>> import com.hp.hpl.jena.util.FileManager;
>>
>> public class istmain
>> {
>>
>> public static void main(String[] args) {
>>
>> Model model=ModelFactory.createDefaultModel();
>>
>> InputStream in=FileManager.get().open("Module.owl");
>> model.read(in,null,"RDF/XML");
>> model.write(System.out);
>> }
>>
>> _____________________________________________________
>>
>>
>
Re: What is the error in code
Posted by Andy Seaborne <an...@apache.org>.
On 15/08/15 15:16, kumar rohit wrote:
> Hello, what is the problem with this code.. I can not understand even the
> error message by eclipse.
What is the error you are seeing?
(it's missing a closing "}" for start; if this is jena3, then the
imports are wrong - but Eclipse will sort that out with shift-cntr-O)
>
> ______________________________________________
> import java.io.InputStream;
>
> import com.hp.hpl.jena.rdf.model.Model;
> import com.hp.hpl.jena.rdf.model.ModelFactory;
> import com.hp.hpl.jena.util.FileManager;
>
> public class istmain
> {
>
> public static void main(String[] args) {
>
> Model model=ModelFactory.createDefaultModel();
>
> InputStream in=FileManager.get().open("Module.owl");
> model.read(in,null,"RDF/XML");
> model.write(System.out);
> }
>
> _____________________________________________________
>