Hi Ibrahim,

This should be possible if SPARQL query is executed by Jena ARQ parser and not 
executed directly via Virtuoso SPARQL sparser. Although note that  execution 
via ARQ will be slower, because all the data for the queries are processed on 
client side. The Virtuoso Jena Provider VirtuosoSPARQLExample12.java sample 
program shows how this can be done:

        
https://github.com/openlink/virtuoso-opensource/blob/develop/7/binsrc/jena3/virtuoso_driver/VirtuosoSPARQLExample12.java
 
<https://github.com/openlink/virtuoso-opensource/blob/develop/7/binsrc/jena3/virtuoso_driver/VirtuosoSPARQLExample12.java>

ie as in the following part:


      // Query string.
       String queryString = prolog + "SELECT ?title WHERE {?x dc:title ?title}" 
; 
       System.out.println("Execute query=\n"+queryString) ;
       System.out.println() ;

   Query query = QueryFactory.create(queryString) ;

System.out.println("\n==CASE 1 ==Parse ARQ  Execute ARQ  GraphStore Virtuoso");
//NOTE: query is parsed & executed by ARQ, so it works slow
// and you can't use Virtuoso SPARQL features
       QueryExecution qexec = QueryExecutionFactory.create(query, m) ;
       // Or QueryExecutionFactory.create(queryString, model) ;
       System.out.println("Titles: ") ;
       try {
           ResultSet rs = qexec.execSelect() ;
           for ( ; rs.hasNext() ; ) {
               QuerySolution rb = rs.nextSolution() ;
               RDFNode x = rb.get("title") ;
               if ( x.isLiteral() ) {
                   Literal titleStr = (Literal)x  ;
                   System.out.println("    "+titleStr) ;
               } else
                   System.out.println("Strange - not a literal: "+x) ;
           }
       } finally {
           qexec.close() ;
       }

Best Regards
Hugh Williams
Professional Services
OpenLink Software, Inc.      //              http://www.openlinksw.com/
Weblog   -- http://www.openlinksw.com/blogs/
LinkedIn -- http://www.linkedin.com/company/openlink-software/
Twitter  -- http://twitter.com/OpenLink
Google+  -- http://plus.google.com/100570109519069333827/
Facebook -- http://www.facebook.com/OpenLinkSoftware
Universal Data Access, Integration, and Management Technology Providers



> On 4 Dec 2017, at 09:11, Ibrahim DELLAL <notificati...@github.com> wrote:
> 
> Hi,
> I would like to submit you a question about querying QUADS.
> In my project, I work on Uncertain RDF Data, and I use the name of graph to 
> represent the certainty of each triple.
> 
> Example :
> <0.9/1>
> 
> My query takes an additional condition to get the desired result’s trust as 
> following:
> SELECT * WHERE {?w President Of USA.} Trust > 0.8
> 
> With Jena TDB, I used the quad’s filter function 
> <https://jena.apache.org/documentation/tdb/quadfilter.html> to represent the 
> condition of result’s trust.
> 
> So my question: Is there a same solution of Jena’s Quad Filter in Virtuoso?
> 
> Thanks in advance for your help.
> With my best regards,
> 
> Ibrahim
> 
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub 
> <https://github.com/openlink/virtuoso-opensource/issues/699>, or mute the 
> thread 
> <https://github.com/notifications/unsubscribe-auth/AEpH8XxNXRpLdmspWunMD1QrKp1cW6c_ks5s87cwgaJpZM4Q0U8P>.
> 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users

Reply via email to