In Soprano I actually simulate them using a custom-typed string. It
works nicely except of course that you cannot use it in queries.
...well, to be honest I never tried something like:
FILTER(xsd:boolean(?x) something)
where ?x binds to the custom types string which contains "true" or "1"
or "false" or "0".
Cheers,
Sebastian
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
>
>