Hello Rob,

currently i do not use any API. I first wanted to be able to get the RDF data with basic SPARQL queries. While trying to figure out what i was doing wrong, i also used your API. The results where pretty much the same. All typed literals were returned as strings.

You are right about the boolean datatype in Virtuoso. I just tried to store a xsd:boolean, which resulted in a xsd:integer using the RDF/XML representation.

Cheers,
Moritz

Am 26.01.2011 13:03, schrieb Rob Vesse:
Hi Moritz

What API are you using to manipulate the RDF within your application or have you rolled your own?

My API dotNetRDF (http://www.dotnetrdf.org) has Virtuoso integration built in and might be helpful to you as it handles all the data type retrieval appropriately. I've had isolated reports that on some machines things don't come back correctly and I know that it was an issue with older 6.x releases of Virtuoso (though should be fine in the version you're using).

One think to note about datatypes is that in my experience Virtuoso doesn't return all datatypes correctly even when you do a SPASQL select like you've done and do all the type handling. If my memory serves me this particularly applies to xsd:boolean typed literals which come back as a 1/0 rather than a true/false though if you do a CONSTRUCT over the same data the type does come back correctly.

Regards,

Rob Vesse

------------------------------------------------------------------------
*From*: "Moritz Eberl" <[email protected]>
*Sent*: 26 January 2011 11:51
*To*: [email protected]
*Subject*: [Virtuoso-users] Missing datatypes using ADO.NET

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

xmlns:rs="http://www.w3.org/2005/sparql-results#";
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"; >


rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean";>1


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

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Virtuoso-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


Reply via email to