Hello,

i am trying to use Virtuoso as RDF store for a C# application with .Net 4, but i have some issues with the ADO.NET library. I have no troubles creating triples with SPARQL using SPASQL, but the retrieval is problematic. In the result set, all typed literals are strings without type information. I get the IRI as SqlExtendedString and the literals with language information as SqlRdfBox, so no problem there. Now i am wondering what i'm doing wrong.
This is how i access the data:

DataTable results = new DataTable();
results.Columns.Add("s", typeof(System.Object));
results.Columns.Add("p",typeof(System.Object));
results.Columns.Add("o", typeof(System.Object));
VirtuosoCommand cmd = Connection.CreateCommand();
cmd.CommandText = "SPARQL select * where {?s ?p ?o.}"; //just an example here
VirtuosoDataAdapter adapter = new VirtuosoDataAdapter(cmd);
adapter.Fill(results);

I also tried to use the RDF/XML output, although not optimal performance-wise, it kind of worked. One thing i noticed though, was that ASK statments produce malformed XML.
As example, this statment
SPARQL define output:format "RDF/XML" ask where {?s ?p ?o.};
produced
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"; xmlns:rs="http://www.w3.org/2005/sparql-results#"; xmlns:xsd="http://www.w3.org/2001/XMLSchema#"; >
<rs:results rdf:nodeID="rset">
<rs:boolean rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean";>1</rs:boolean>
</results>
</rdf:RDF>
The prefix of the closing result tag is missing. You can try it in the Interactive SQL form of the conductor.

My system specs:
OS: Windows 7 64-bit
Virtuoso:  Open-Source-Edition Version 06.01.3127 - Build Jul 9 2010  32-bit
virtado3.dll: Version 6.2.3128.1

It would be great if somebody could help me to resolve my issues.

Cheers,
Moritz

Reply via email to