[ https://issues.apache.org/jira/browse/JENA-331?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andy Seaborne resolved JENA-331. -------------------------------- Resolution: Won't Do No response. > XSDDatatype does not properly handle URIs > ----------------------------------------- > > Key: JENA-331 > URL: https://issues.apache.org/jira/browse/JENA-331 > Project: Apache Jena > Issue Type: Improvement > Components: Jena > Affects Versions: Jena 2.7.3 > Reporter: Claude Warren > Priority: Minor > Attachments: JENA-331.patch > > > Using the TypeMapper to convert a URI to a literal and back again fails as a > String is returned not a URI. > Test code: > import com.hp.hpl.jena.datatypes.RDFDatatype; > import com.hp.hpl.jena.datatypes.TypeMapper; > import com.hp.hpl.jena.rdf.model.Literal; > import com.hp.hpl.jena.rdf.model.ResourceFactory; > import java.net.URI; > import org.junit.Assert; > import org.junit.Test; > public class XSDDatatypeTest > { > @Test > public void testURIConversion() throws Exception > { > TypeMapper typeMapper = TypeMapper.getInstance(); > RDFDatatype dt = typeMapper.getTypeByClass( java.net.URI.class ); > URI uri = new URI("http://example.com" ); > String lexicalForm = dt.unparse( uri ); > Literal l = ResourceFactory.createTypedLiteral( lexicalForm, dt ); > > Object o = dt.parse( l.getLexicalForm() ); > Assert.assertEquals( uri, o ); > } > } -- This message was sent by Atlassian Jira (v8.20.1#820001)