Hi Cristian,

Virtuoso does not have a native boolean type as many databases don't becuase it 
is not a native SQL type. So we cast booleans to integers inside the engine 
because there's no
built-in SQL datatype for booleans. If the SQL standard is ever extended with 
native boolean as a basic datatype then we immediately will reflect that in RDF 
/ Relational storage and in SPARQL / SQL .

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

On 25 Nov 2009, at 15:26, Cristian Vasquez wrote:

> Hello,
> 
> I'm having a problem when I try to recover inserted triples which had
> xsd:boolean datatypes,  after insertion, they seem to be turned into
> xsd:integer
> 
> Example:
> 
> SQL> TTLP ('
>       @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
>       @prefix nameme: <http://foo.com/> .
>       <http://foo.com/entity/1> nameme:hasFalse "false"^^xsd:boolean .
>       <http://foo.com/entity/1> nameme:hasTrue "true"^^xsd:boolean .
>       ', '', 'http://foo.com/entity/1' );
> 
> SQL> sparql define output:format "RDF/XML" construct { ?s ?p ?o} where
> {graph <http://foo.com/entity/1> { ?s ?p ?o }};
> 
> And I get:
> 
> <?xml version="1.0" encoding="utf-8" ?>
> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
> xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#";>
>       <rdf:Description rdf:about="http://foo.com/entity/1";>
>               <n0pred:hasTrue xmlns:n0pred="http://foo.com/";
> rdf:datatype="http://www.w3.org/2001/XMLSchema#integer";>1</n0pred:hasTrue>
>       </rdf:Description>
>       <rdf:Description rdf:about="http://foo.com/entity/1";>
>               <n0pred:hasFalse xmlns:n0pred="http://foo.com/";
> rdf:datatype="http://www.w3.org/2001/XMLSchema#integer";>0</n0pred:hasFalse>
>       </rdf:Description>
> </rdf:RDF>
> 
> Something similar happens when I store a value with datatype
> xsd:decimal, where I get an xsd:double. And That is not what I want
> since decimal and double are not the same.
> 
> Is there a direct way to keep the declared datatype?
> 
> Thank you.
> 
> Cristian
> 
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
> trial. Simplify your report design, integration and deployment - and focus on 
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Virtuoso-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/virtuoso-users


Reply via email to