BalduinLandolt opened a new issue, #2248:
URL: https://github.com/apache/jena/issues/2248
### Version
4.10.0
### What happened?
on `org.apache.jena.rdf.model.Literal`, the documentation states:
```java
/**
* If the literal is interpretable as a string return its value.
* For typed literals this will throw an error for non string
* literals and one needs to use getLexicalForm to return the
* string form of other datatypes.
*
* @return the literal string
*/
public String getString() ;
```
however, when I call `getString()` on a literal that is not a string (e.g.
`xsd:float`), I do not get an exception but instead it returns the lexical
value. This is obviously in contrast to the javadoc.
I think the code in question is in `package
org.apache.jena.rdf.model.impl.LiteralImpl`:
```java
@Override
public String getString() {
return asNode().getLiteralLexicalForm();
}
```
### Relevant output and stacktrace
_No response_
### Are you interested in making a pull request?
Maybe
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]