FLEX TBL- Add triples into localgraph

14 views
Skip to first unread message

Andrea Todaro (Euriware)

unread,
Mar 22, 2012, 1:14:58 PM3/22/12
to topbrai...@googlegroups.com
 Hi to all,
I would like to add some triple into a localgraph, I wrote the following code:
graph = gf.createLocalGraph();
            changeAddorUpdate = new Change();
            var nodes:Node = gf.createURINode("http://subject");
            var nodep:Node = gf.createURINode("http://predicate");
            var nodeo:Node = gf.createURINode("http://object");
            var triple:TripleMatch = gf.createTripleMatch(nodes,nodep,nodeo);
            changeAddorUpdate.add(triple);


Could u help me to understand what is wrong?
I got this error:
An unexpected error has occured.

If you believe this is due to a bug in TopBraid Composer, then please consider to report the problem to compose...@topquadrant.com and ideally include an export of the Error Log View (Window > Show View > Error Log).

On: 22 mars 2012 18:59:44

Reason:
java.lang.NullPointerException

    at java.util.concurrent.ConcurrentHashMap.get(Unknown Source)

    at org.topbraidlive.server.session.TBLSessionManager.isNewDeath(TBLSessionManager.java:227)

    at org.topbraidlive.server.servlet.AbstractRequestDelegate$1.sendError(AbstractRequestDelegate.java:103)

    at org.topbraidlive.server.servlet.TBEActionErrorHandler.handle(TBEActionErrorHandler.java:45)

    at org.topbraidlive.server.servlet.TBLActionErrorHandler.handleException(TBLActionErrorHandler.java:42)

    at org.topbraidlive.server.servlet.TBLThreadPoolServletDriver.performWork(TBLThreadPoolServletDriver.java:342)

    at org.topbraidlive.server.servlet.TBLThreadPoolServletDriver.doGet(TBLThreadPoolServletDriver.java:178)

    at org.topbraidlive.server.servlet.TBLParentServlet.doStuff(TBLParentServlet.java:389)

    at org.topbraidlive.server.servlet.TBLParentServlet.doXMLMultiRequest(TBLParentServlet.java:159)

    at org.topbraidlive.server.servlet.TBLParentServlet.considerContentType(TBLParentServlet.java:86)

    at org.topbraidlive.server.servlet.TBLParentServlet.doPost(TBLParentServlet.java:365)

    at org.topbraidlive.server.servlet.TBLServlet.doPost(TBLServlet.java:30)

    at org.topbraidlive.server.servlet.TBLServletController.doPost(TBLServletController.java:91)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)

    at org.topbraid.eclipsex.servlet.TBHttpServlet.service(TBHttpServlet.java:57)

    at org.eclipse.equinox.http.registry.internal.ServletManager$ServletWrapper.service(ServletManager.java:180)

    at org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61)

    at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:126)

    at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:60)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)

    at org.eclipse.equinox.http.jetty.internal.HttpServerManager$InternalHttpServiceServlet.service(HttpServerManager.java:318)

    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)

    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)

    at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)

    at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)

    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)

    at org.mortbay.jetty.Server.handle(Server.java:326)

    at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)

    at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:939)

    at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)

    at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)

    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)

    at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)

    at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)


Thank you for your help in this matter.

Andrea.




Andrea Todaro (Euriware)

unread,
Mar 23, 2012, 5:15:41 AM3/23/12
to topbrai...@googlegroups.com
As back way I created an empty graph in TBC, I retrieve it in Flex code by using the function GraphFactory.singleton().openRemoteGraph(http://emptygraph_url), so now I  have a new graph that is a local cached copy of a graph on the server and I can add my triples.


On Thursday, March 22, 2012 6:14:58 PM UTC+1, Andrea Todaro (Euriware) wrote:
 Hi to all,
I would like to add some triple into a localgraph, I wrote the following code:
graph = gf.createLocalGraph();
            changeAddorUpdate = new Change();
            var nodes:Node = gf.createURINode("http://​subject");
            var nodep:Node = gf.createURINode("http://​predicate");
            var nodeo:Node = gf.createURINode("http://​object");
            var triple:TripleMatch = gf.createTripleMatch(nodes,​nodep,nodeo);
            changeAddorUpdate.add(triple);


Could u help me to understand what is wrong?
I got this error:
An unexpected error has occured.

If you believe this is due to a bug in TopBraid Composer, then please consider to report the problem to composersupport@topquadrant.​com and ideally include an export of the Error Log View (Window > Show View > Error Log).

Willie Milnor

unread,
Mar 23, 2012, 3:13:25 PM3/23/12
to topbrai...@googlegroups.com
Hi Andrea,

From the code that you have shown, I don't see how you could get an error on the server-side (the Java error) as you that code doesn't make a request to the server.  But it sounds like you've changed the code to open a remove graph (http://emptygraph_url).  Could you please send the code snippet now with that change, as well as with the call you make against the server (I assume you are calling Graph.modifyGraph())?

--
You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include Enterprise Vocabulary Network (EVN), TopBraid Composer,
TopBraid Live, TopBraid Ensemble, SPARQLMotion and SPIN.
To post to this group, send email to
topbrai...@googlegroups.com
To unsubscribe from this group, send email to
topbraid-user...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/topbraid-users?hl=en



--
Willie Milnor
Sr. Semantic Solutions Developer
 
TopQuadrant, Inc.
330 John Carlyle Street
Suite 180
Alexandria, VA 22314
 


Reply all
Reply to author
Forward
0 new messages