On 22/05/13 05:08, Meraj A. Khan wrote:
Unfortunately it does not provide me the stack trace , I suspect it's
the block of code that I mentioned below.

What's "it" that does not provide stacktrace? Exceptions provide a stacktrace.

>>         Resource s1 = model.createResource(s.getURI());
>>         Property p1 = model.createProperty(p.getURI());

The message comes from Node.getURI() - one of s or p isn't a URI.

        Andy


--------------------------------------------------
From: "Bahador(reza)? OFOGHI" <[email protected]>
Sent: Tuesday, May 21, 2013 11:41 PM
To: <[email protected]>
Subject: Re: Apache Jena Unsupported Operation Exception

on which line do you exactly get the error? have you traced your code?

BO



________________________________
From: Meraj A. Khan <[email protected]>
To: [email protected]
Sent: Wednesday, 22 May 2013 1:11 PM
Subject: Apache Jena Unsupported Operation Exception


Hello there I get the following exception when I run the code below. I
use the maven dependency for Jena apache-jena-libs:2.10.1 : pom

WARNING: Exception java.lang.UnsupportedOperationException INFO:
ERROR: nodecfcd208495d565ef66e7dff9f98764da is not a URI node:

The following code causes this error.

        Statement statement  =  null;
        com.hp.hpl.jena.graph.Node s = Utils.convertToJena(nodes[0]);
        com.hp.hpl.jena.graph.Node p = Utils.convertToJena(nodes[1]);
        com.hp.hpl.jena.graph.Node o = Utils.convertToJena(nodes[2]);

        Resource s1 = model.createResource(s.getURI());
        Property p1 = model.createProperty(p.getURI());

        if(o.isURI()) {

            Resource o1 = model.createResource(o.getURI());
            statement = ResourceFactory.createStatement(s1,p1,o1);
        }

        else if(o.isLiteral()) {

            Literal l1 = model.createLiteral(o.getLiteralLexicalForm());
            statement = ResourceFactory.createStatement(s1,p1,l1);
        }

        else if(o.isBlank()) {

           Resource o1 = model.createResource(o.getBlankNodeId());
           statement = ResourceFactory.createStatement(s1,p1,o1);

        }

        model.add(statement);
Any help would be appreciated.

Thanks.


Reply via email to