RE: pfps-06 hold off?

I think in .NET one can finetune the lexical value check

using System.Globalization;

one can use

NumberStyles.AllowLeadingWhite
NumberStyles.AllowTrailingWhite
NumberStyles.AllowLeadingSign
NumberStyles.AllowTrailingSign
NumberStyles.AllowParentheses
NumberStyles.AllowDecimalPoint
NumberStyles.AllowThousands
NumberStyles.AllowExponent
NumberStyles.AllowCurrencySymbol
NumberStyles.AllowHexSpecifier


For xsd:integer we actually seem to have

   if (dt == XSDinteger) return Decimal.Parse(s1,
NumberStyles.AllowLeadingSign|NumberStyles.AllowDecimalPoint|NumberStyles.AllowLeadingWhite|NumberStyles.AllowTrailingWhite,
 NumberFormatInfo.InvariantInfo).CompareTo(Decimal.Parse(s2,
NumberStyles.AllowLeadingSign|NumberStyles.AllowDecimalPoint|NumberStyles.AllowLeadingWhite|NumberStyles.AllowTrailingWhite,
 NumberFormatInfo.InvariantInfo));

but that should be corrected to

   if (dt == XSDinteger) return Decimal.Parse(s1,
NumberStyles.AllowLeadingSign|NumberStyles.AllowLeadingWhite|NumberStyles.AllowTrailingWhite,
 NumberFormatInfo.InvariantInfo).CompareTo(Decimal.Parse(s2,
NumberStyles.AllowLeadingSign|NumberStyles.AllowLeadingWhite|NumberStyles.AllowTrailingWhite,
 NumberFormatInfo.InvariantInfo));

or maybe even

   if (dt == XSDinteger) return Decimal.Parse(s1,
NumberStyles.AllowLeadingSign,
NumberFormatInfo.InvariantInfo).CompareTo(Decimal.Parse(s2,
NumberStyles.AllowLeadingSign, NumberFormatInfo.InvariantInfo));

depending on what we want.

I don't know yet for Java Xerces.


--
Jos De Roo, AGFA http://www.agfa.com/w3c/jdroo/


                                                                                                                                        
                      <Patrick.Stickler@                                                                                                
                      nokia.com>                To:       Jos De_Roo/AMDUS/MOR/Agfa-NV/BE/BAYER@AGFA                                    
                      Sent by:                  cc:       <bwm@hplb.hpl.hp.com>, <phayes@ihmc.us>, <w3c-rdfcore-wg@w3.org>,             
                      w3c-rdfcore-wg-req         <Patrick.Stickler@nokia.com>                                                           
                      uest@w3.org               Subject:  RE: pfps-06 hold off?                                                         
                                                                                                                                        
                                                                                                                                        
                      2003-08-28 11:42                                                                                                  
                      AM                                                                                                                
                                                                                                                                        
                                                                                                                                        






Fair enough, though I think it would be a valid argument that your
implementation is erroneous for making entailments that are clearly
in conflict with the XML Schema specs (even if it's useful and possible
to perform coercions to get those entailments) as "10.0" is most
definitely not a valid lexical form for xsd:integer.

It's not a very large step from there to accepting "10abc"^^xsd:integer
if you have a scanner that is happy to scan up to but not beyond
relevant characters... e.g.

   sscanf ("10abc", "%i", &myInteger);

You're coercion based entailments seem to overhang a pretty steep
and slippery slope as far as design rational goes...

IMO, if an application "supports" XML Schema datatypes, it will
do so responsibly, complaining about invalid lexical forms (even
if it can do something useful with them) since RDF is after all
meant to provide a foundation for precise and reliable reasoning.

No?

Patrick


> -----Original Message-----
> From: ext Jos De_Roo [mailto:jos.deroo@agfa.com]
> Sent: 27 August, 2003 17:55
> To: Stickler Patrick (NMP/Tampere)
> Cc: bwm@hplb.hpl.hp.com; Stickler Patrick (NMP/Tampere);
> phayes@ihmc.us;
> w3c-rdfcore-wg@w3.org
> Subject: RE: pfps-06 hold off?
>
>
>
> Well, it's a bit complicated...
> In our implementation
>
>   :Jenny :age "33"^^xsd:integer.
>
> does rdf:, xsd:integer entail
>
>   :Jenny :age "33.0"^^_:D.
>
> but for instance
>
>   :Jenny :age "33"^^xsd:long.
>
> does rdf:, xsd:integer entail
>
>   :Jenny :age "33.0"^^_:D.
>
> using Xerces but not using .NET
> where we can use an appropriate
> [[
> if (dt == XSDlong)
>   return XmlConvert.ToInt64(s1).CompareTo(XmlConvert.ToInt64(s2));
> ]]
> whereas for Xerces we have to rely on
> [[
> if (dt == XSDlong) {
>   TypeValidator dv = new DecimalDV();
>   return dv.compare(dv.getActualValue(s1, null), dv.getActualValue(s2,
> null));
> }
> ]]
> because we couldn't find a better TypeValidator
> (but that was months ago)
>
>
>
> --
> Jos De Roo, AGFA http://www.agfa.com/w3c/jdroo/
>
>
>
>
>
>                       <Patrick.Stickler@
>
>
>                       nokia.com>                To:       Jos
> De_Roo/AMDUS/MOR/Agfa-NV/BE/BAYER@AGFA
>
>                       Sent by:                  cc:
> <bwm@hplb.hpl.hp.com>, <phayes@ihmc.us>,
> <w3c-rdfcore-wg@w3.org>,
>                       w3c-rdfcore-wg-req
> <Patrick.Stickler@nokia.com>
>
>                       uest@w3.org               Subject:  RE:
> pfps-06 hold off?
>
>
>
>
>
>
>
>                       2003-08-27 03:00
>
>
>                       PM
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> > -----Original Message-----
> > From: ext Jos De_Roo [mailto:jos.deroo@agfa.com]
> > Sent: 27 August, 2003 15:44
> > To: Stickler Patrick (NMP/Tampere)
> > Cc: bwm@hplb.hpl.hp.com; Stickler Patrick (NMP/Tampere);
> > phayes@ihmc.us;
> > w3c-rdfcore-wg@w3.org
> > Subject: RE: pfps-06 hold off?
> >
> >
> >
> > For example in the testcase
> >
> > does
> >
> > :Jenny :age "33"^^xsd:integer.
> >
> > rdf:, xsd:integer entail
> >
> > :Jenny :age " 33 "^^?D.
> >
> > (but I should have better written
> > :Jenny :age " 33 "^^_:D.
> > here in RDFCore)
> >
> > and our answer is
> > :Jenny :age " 33 "^^xsd:integer.
>
>
> The answer is 'no' because " 33 " is not a member of the
> lexical space of xsd:integer and thus is not equivalent
> to the lexical form "33".
>
> The fact that you get 'yes' is because you are not actually
> testing the validity of the lexical form, but applying
> a coercion function that is not equivalent to the L2V
> mapping, as provided by a tool intended to operate
> in a looser environment, allowing spurious whitespace,
> rather than deal with actual lexical forms of XML Schema
> simple types.
>
> Again, what do you get if the test is the following:
>
>   Does
>
>   :Jenny :age "33"^^xsd:integer.
>
>   rdf:, xsd:integer entail
>
>   :Jenny :age "33.0"^^?D.
>
> ???
>
> Patrick
>
>
>
>
>
>
>

Received on Thursday, 28 August 2003 09:55:23 UTC