HolgerKnublauch opened a new issue, #3362:
URL: https://github.com/apache/jena/issues/3362
### Version
5.5
### What happened?
This crashes:
```
import org.apache.jena.rdf.model.Model;
import org.apache.jena.rdf.model.ModelFactory;
import org.apache.jena.rdf.model.Statement;
import org.apache.jena.rdf.model.StatementTerm;
import org.apache.jena.vocabulary.RDF;
import org.junit.jupiter.api.Test;
public class StatementTermTest {
@Test
public void testAsResource() {
Model model = ModelFactory.createDefaultModel();
Statement s = model.createStatement(RDF.type, RDF.type,
RDF.Property);
StatementTerm term = model.createStatementTerm(s);
if(term.isResource()) {
term.asResource(); // Throws
ResourceRequiredException
}
}
}
```
term.isResource() should return false because StatementTerm is not a subtype
of Resource. The error is in EnhNode.isResource() which includes TripleTerms.
### Relevant output and stacktrace
```shell
```
### Are you interested in making a pull request?
None
--
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]