Hi Ivan,

If we take into consideration the SPARQL 1.0 spec. I would expected *no
untyped *
because the datatype IRI of typedLit; returns *xsd:string *if the parameter
is a *simple literal *(our case)

----------
> 11.4.7 datatype
>  IRI   datatype (typed literal typedLit)
>  IRI   datatype (simple literal simpleLit)
>
> Returns the datatype IRI of typedLit; returns *xsd:string *if the
> parameter is a *simple literal.*
> ----------
>

I would expect something like, if I tried to insert a value with explicit
datatype, this should be the* right one*, otherwise should raise an error.

- example:
  "1"^^xsd:integer -> OK
  "1"^^xsd:int -> ERROR

And if I tried to insert a value (no explicit) this should get the
"default" values.
- example
   1 -> saved as xsd:double
   "1" -> saved as xsd:string

Best Regards,

Percy

2012/2/28 Ivan Mikhailov <[email protected]>

> Hello Percy,
>
> It's not a bug, it's an implementation feature. Virtuoso does not
> distinguish equal values of different numeric types when check triples
> for uniqueness and when object variable from one SPARQL triple pattern
> appears in other triple pattern. It's a roll of dice, what of two equal
> values is stored, 2 (i.e. "2"^^xsd:integer) or "2"^^xsd:int . The only
> useful support for different numeric types is range checks for them, so
> "1000000"^xsd:byte will not be stored as a number, instead it will be
> stored as a weird strict-typed "1000000"^xsd:byte not equal to any valid
> numeric value.
>
> The thing is done this way because it would be really inconvenient to
> use RDF Views, i.e., mappings of relational data to RDF. There is only
> one SQL integer for more than a handful of XSD integers, fixed- and
> floating-point arithmetic does not match exactly as well.
>
> Non-numeric types are kept accurately, so xsd:string and xsd:String will
> always differ from each other and from untyped. Languages are kept
> accurately as well.
>
> Best Regards,
>
> Ivan Mikhailov
> OpenLink Software
> http://virtuoso.openlinksw.com
>
> On Thu, 2012-02-23 at 18:49 -0200, Percy Enrique Rivera Salas wrote:
> > All,
> >
> > I successfully inserted the data below, with explicit datatypes
> > through the Sparql Endpoint (WebBrowser), I also tried using the iSQL
> > and Conductor Importer
> >
> >         insert data into <teste_datatype>
> >         {
> >         <subject> <predicate> "string",
> >                               "string"^^xsd:string,
> >                               "string"^^xsd:String,
> >                               "1"^^xsd:int,
> >                               "1"^^xsd:integer,
> >                                2,
> >                               "2"^^xsd:int.
> >         }
> >
> > But, after the following query execution
> >
> >         select  *
> >         from <teste_datatype>
> >         where {?s ?p ?o}
> >
> > I got these triples
> >
> >            s
> >            p
> >            o
> > subject
> > predicate
> > "1"^^<http://www.w3.org/2001/XMLSchema#int>
> > subject
> > predicate
> > 2
> > subject
> > predicate
> > "string"^^<http://www.w3.org/2001/XMLSchema#string>
> > subject
> > predicate
> > "string"^^<http://www.w3.org/2001/XMLSchema#String>
> > subject
> > predicate
> > string
> >
> > I would expected something like
> >
> >            s
> >            p
> >            o
> > subject
> > predicate
> > 1
> > subject
> > predicate
> > 2
> > subject
> > predicate
> > string
> >
> > Is this a bug? or am I doing something wrong?
> >
> > Best Regards,
> >
> > Percy
>
>
>

Reply via email to