Hi,

When you are done with the file, you should close your manager.

I believe should do the trick:

        public void endRDF() throws RDFHandlerException {
                manager.close();
        }

// NOTE: I don't know the specifics of RDFHandler, but it sounds like endRDF() 
is the method called when the file handler is complete. ?

This way, the last triples inserted, but not committed, are committed.

Perhaps that is your problem? ... you are missing the tail end of your RDF file.

However, if you are simply calling a SPARQL query within the same thread then 
the uncommitted triples should be visible to your code.

What are your thoughts on the matter?,
Marko.

http://markorodriguez.com

On Aug 31, 2011, at 7:45 AM, shri wrote:

> Hello Marko,
> 
> here is my TripleHandler class:
> 
> 
> public class TripleHandler implements RDFHandler {
>       private SailConnection sc;
>       private CommitManager manager;
>       
>       public TripleHandler(SailConnection sc, CommitManager manager) { 
>               this.sc = sc;
>               this.manager = manager;
>       }
> 
>       public void handleComment(String arg0) throws RDFHandlerException {
>       }
> 
>       public void handleNamespace(String arg0, String arg1)
>                       throws RDFHandlerException {
>       }
> 
>       public void handleStatement(Statement arg0) {
> 
>               try {
>                       // avoid self-cycles
>                       if
> (arg0.getSubject().stringValue().equals(arg0.getObject().stringValue()))
>                               return;
>                       
>                       sc.addStatement(arg0.getSubject(), arg0.getPredicate(),
> arg0.getObject());
>                       manager.incrCounter();
>                       if (manager.atCommit())
>                               System.out.print(".");
>               } catch (SailException e) {
>                       e.printStackTrace();
>               } catch (Exception e) {
>                       e.printStackTrace();
>                       System.out.println("Subject: " + 
> arg0.getSubject().toString() +
>                                       " Predicate: " + 
> arg0.getPredicate().toString() +
>                                       " Object: " + 
> arg0.getObject().toString());
>               }
>       }
> 
>       public void startRDF() throws RDFHandlerException {
>       }
>       
>       public void endRDF() throws RDFHandlerException {
>       }
> }
> 
> 
> Cheers,
> Shri
> 
> --
> View this message in context: 
> http://neo4j-community-discussions.438527.n3.nabble.com/problem-in-SPARQL-querying-tp3298204p3298387.html
> Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
> _______________________________________________
> Neo4j mailing list
> [email protected]
> https://lists.neo4j.org/mailman/listinfo/user

_______________________________________________
Neo4j mailing list
[email protected]
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to