Hi Martynas,

On 21/05/16 17:30, Martynas Jusevičius wrote:
Hey,

If I have URI such as xsd:long for example, how do I get an instance
of XSDDatatype.XSDlong from it?

If this is just for the XSD types known to Jena then use:

    TypeMapper.getInstance().getTypeByName( uri )

[byName may not be the most intuitive description for lookup by URI :)]

I was looking for a factory method like XSDDatatype.createDatatype()
or a public constructor XSDDatatype(), but couldn't find either.

The constructors for XSDDatatype are public, at least in the code version I'm looking at. However, there are various sub-types of XSDDatatype and using the TypeMapper avoids having to worry about which of those sub-types to instantiate.

Dave

Reply via email to