Hi Sergio, We have written the attached program to try and test the issue you report: import com.hp.hpl.jena.query.*; import com.hp.hpl.jena.rdf.model.RDFNode; import com.hp.hpl.jena.graph.Triple; import com.hp.hpl.jena.graph.Node; import com.hp.hpl.jena.graph.Graph; import com.hp.hpl.jena.rdf.model.*; import java.util.Iterator; import java.io.*; import virtuoso.jena.driver.*; public class V_TEST_UNI { /** * Executes a SPARQL query against a virtuoso url and prints results. */ public static void main(String[] args) { String conn_str = "jdbc:virtuoso://hostname:portno"; try { VirtGraph set = new VirtGraph ("virt:UNI", conn_str, "dba", "dba"); set.clear(); Model md = VirtModel.createDatabaseModel("virt:UNI", conn_str, "dba", "dba"); md.read(new FileInputStream("t_uni8.rdf"), "http://www.example.org/"); System.out.println("==Inserted=="); Model md1 = VirtModel.createDatabaseModel("virt:UNI", conn_str, "dba", "dba"); md1.write(new FileOutputStream("my_out.rdf"), "RDF/XML-ABBREV"); System.out.println("==Save copy=="); } catch (Exception e) { System.out.println("Exception=="+e); } } } The attached file (t-uni8.rdf) contains some sample Spanish and French words, which we have been able to read in and retrieve the correct data multiple times: SQL> sparql select * from <virt:UNI> where {?s ?p ?o}; s p o VARCHAR VARCHAR VARCHAR _______________________________________________________________________________ http://www.example.org/#Resource http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://www.w3.org/2000/01/rdf-schema#Class http://www.example.org/#Literal http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://www.w3.org/2000/01/rdf-schema#Class http://www.example.org/#Organisation http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://www.w3.org/2000/01/rdf-schema#Class 9 Rows. -- 8 msec. SQL> Or checking the created "my_out.rdf" file the program reads the data store to. Can you try this yourself ... Best Regards Hugh Williams Professional Services OpenLink Software Support: http://support.openlinksw.com |
t_uni8.rdf
Description: Binary data
On 4 Sep 2009, at 09:09, Sergio Fernández wrote:
|