Thanks,
Do I understand correct that in case the syntax of the XML is 
<cp: class.attribute >650.000000</cp: class.attribute> …

There is no way to get other than string even if the datatypes information is 
available in a RDF scheme
I was thinking that RDF schema can be somehow considered at the read activity 
or as a second step



-----Original Message-----
From: Martynas Jusevičius <[email protected]> 
Sent: Tuesday, November 26, 2019 10:21 PM
To: jena-users-ml <[email protected]>
Subject: Re: XML Model read and datatypes

    @cp:class.attribute "650.000000";

is also a string.

In Turtle, typed literals need a datatype:

@cp:class.attribute "650.000000"^^xsd:float;

The spec: https://www.w3.org/TR/turtle/#abbrev

In RDF/XML, that would be

<cp: class.attribute
rdf:datatype="http://www.w3.org/2001/XMLSchema#float";>650.000000</cp:
class.attribute>

On Tue, Nov 26, 2019 at 9:55 PM Dr. Chavdar Ivanov <[email protected]> wrote:
>
> Dear all,
>
> When I read an xml I see that all values are read as strings. It 
> doesn’t matter if they are stings, integers, float, etc
>
> I read a XML file using this
> RDFDataMgr.read(model, new FileInputStream(file), "http://myNs1#";, 
> Lang.RDFXML);
>
> And in the xml I have
> …
> <cp: class.attribute >650.000000</cp: class.attribute> …
>
> In the model when I browse I see
> … @cp:class.attribute "650.000000";…
>
>
> Is there a way to read the xml and parse the values in their proper form, 
> e.g. float, string, …?
>
> Regards
> Chavdar

Reply via email to