Hi Alexandre,

Can you please confirm if their are any created Virtuoso RDFViews in the database, as the query looks fine, but we note the following in the error output:

        ( ?o = <  ^{custom-verbatim-1}^_INVERSE (__id2in (^{tree}^))> )

Which looks like some form of RDFView mapping ?

What happens if the same is executed against the Virtuoso SPARQL endpoint or isql interface ?

Please enable extra debugging on the server using the trace_on/off functions as detailed at:

        http://docs.openlinksw.com/virtuoso/fn_trace_on.html#(NULL)

and provide the trace information for an instance when the query is failing via JDBC, SPARQL endpoint or isql, which ever fails.

If you are using RDFViews is "custom-verbatim-1" a column or table in you database schema and if so can you provide the schema definition for it please ?

Best Regards
Hugh Williams
Professional Services
OpenLink Software
Web: http://www.openlinksw.com
Support: http://support.openlinksw.com
Forums: http://boards.openlinksw.com/support



On 7 Jul 2009, at 09:13, Alexandre Bertails wrote:

Hi,

actually we have the same issue on 5.0.11.

5.0.9 is ok.

Alexandre.


2009/7/6 Alexandre Bertails <[email protected]>:
Hi all,

we managed to try this snapshot :
ftp://download.openlinksw.com/support/vos/virtuoso- opensource-20090701.tar.gz

We have some issues with the REGEX function in SPARQL context. Here is
a example:

-----------------------------------

import java.sql.DriverManager;

import virtuoso.jena.driver.VirtGraph;
import virtuoso.jena.driver.VirtuosoQueryExecutionFactory;

import com.hp.hpl.jena.query.QueryExecution;
import com.hp.hpl.jena.query.ResultSet;

public class Main2 {

   public static void main(String[] args) throws Exception {
       testVirtGraph("foobar", "oo");
       testVirtGraph("foobar", "ooo");
       testVirtGraph("foobar", ".oo");
       testJDBC("foobar", "oo");
       testJDBC("foobar", "ooo");
       testJDBC("foobar", ".oo");
   }

   public static void testVirtGraph(String value, String regex) {
       try {
           String query = String.format("SELECT DISTINCT * WHERE { ?s
 ?p  ?o FILTER regex('%s', '%s') }", value, regex);
           System.out.println(query);
           VirtGraph graph = new VirtGraph(
                   "jdbc:virtuoso://localhost:1111", "dba", "dba");
           QueryExecution qe =
VirtuosoQueryExecutionFactory.create(query, graph);
           ResultSet rs = qe.execSelect();
           System.out.println("testVirtGraph: " + rs.next());
       } catch (Exception e) {
           e.printStackTrace(System.out);
       }
       System.out.flush();
   }

   public static void testJDBC(String value, String regex) {
       String query = String.format("select DB.DBA.RDF_REGEX('%s',
'%s')", value, regex);
       System.out.println(query);
       try {
           java.sql.Connection conn = DriverManager.getConnection(
                   "jdbc:virtuoso://localhost:1111", "dba", "dba");
           java.sql.ResultSet result =
conn.createStatement().executeQuery(query);
           result.next();
           System.out.println("testJDBC: " + result.getString(1));
       } catch (Exception e) {
           e.printStackTrace(System.out);
       }
       System.out.flush();
   }

}

-----------------------------------

Here is what is printed:

-----------------------------------

SELECT DISTINCT * WHERE { ?s  ?p  ?o FILTER regex('foobar', 'oo') }
testVirtGraph: ( ?p =
<http://www.openlinksw.com/schemas/virtrdf#qmfShortOfLongTmpl> ) ( ?s
= <http://www.openlinksw.com/virtrdf-data-formats#sql-varchar-uri-fn>
) ( ?o = <  ^{custom-verbatim-1}^_INVERSE (__id2in (^{tree}^))> ) ->
[Root]
SELECT DISTINCT * WHERE { ?s  ?p  ?o FILTER regex('foobar', 'ooo') }
java.util.NoSuchElementException: class
com.hp.hpl.jena.sparql.engine.ResultSetStream.next
at com.hp.hpl.jena.sparql.engine.ResultSetStream.nextSolution (ResultSetStream.java:88) at com.hp.hpl.jena.sparql.engine.ResultSetStream.next (ResultSetStream.java:98)
       at fr.bnf.spar.init.Main2.testVirtGraph(Main2.java:30)
       at fr.bnf.spar.init.Main2.main(Main2.java:15)
SELECT DISTINCT * WHERE { ?s  ?p  ?o FILTER regex('foobar', '.oo') }
java.util.NoSuchElementException: class
com.hp.hpl.jena.sparql.engine.ResultSetStream.next
at com.hp.hpl.jena.sparql.engine.ResultSetStream.nextSolution (ResultSetStream.java:88) at com.hp.hpl.jena.sparql.engine.ResultSetStream.next (ResultSetStream.java:98)
       at fr.bnf.spar.init.Main2.testVirtGraph(Main2.java:30)
       at fr.bnf.spar.init.Main2.main(Main2.java:16)
select DB.DBA.RDF_REGEX('foobar', 'oo')
testJDBC: 1
select DB.DBA.RDF_REGEX('foobar', 'ooo')
testJDBC: 0
select DB.DBA.RDF_REGEX('foobar', '.oo')
testJDBC: 1

-----------------------------------

Regards,

Alexandre.


---------------------------------------------------------------------- --------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/blackberry
_______________________________________________
Virtuoso-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/virtuoso-devel

Reply via email to