I should have included the stack dump from Jena, which just triggered that chain that ended with Eclipse:
at org.apache.jena.graph.Node.getBlankNodeId(Node.java:86) at org.apache.jena.rdf.model.impl.ResourceImpl.getId(ResourceImpl.java:138) at com.adventiumlabs.aadltools.fhowlquery.plugin.handlers.MyHandler.execute(MyHandler.java:255) where MyHandler:255 is the createReifiedStatement call. Your code works just fine. Is there something odd about creating a Statement for a triple from a Model that was returned by a query of the OntModel that I'm adding the reified statement to? On 9/30/2017 11:52 AM, Dave Reynolds wrote: > On 30/09/17 16:31, Steve Vestal wrote: >> When I execute the following org.apache.jena.rdf.model.Model method >> >> ReifiedStatement myReifiedStatement = >> myOntology.createReifiedStatement(myNodeName, myStatement); >> >> where myStatement is an org.apache.jena.rdf.model.Statement in a Model >> returned by an org.apache.jena.query.Query#execConstruct query of >> myOntology, I get the exception >> >> org.eclipse.e4.core.di.InjectionException: >> java.lang.UnsupportedOperationException: >> http://www.test.com/test#myNodeName is not a blank node > > That exception is not from Jena but some other part of your > application or test suite. > >> The code >> >> ReifiedStatement myReifiedStatement = >> myOntology.createReifiedStatement(myStatement); >> >> seems to work OK. How do I create a ReifiedStatement in myOntology as >> an explicitly named resource? > > You pass the URI for the ReifiedStatement as the first argument to > createReifiedStatement just as you tried, works fine. E.g. try > > Model m = ModelFactory.createDefaultModel(); > Resource a = m.createResource(NS + "a"); > Statement s = m.createStatement(a, RDFS.label, "a"); > m.add(s); > ReifiedStatement r = m.createReifiedStatement(NS + "statement", s); > m.write(System.out, "Turtle"); > > to see that the created reified statement has the expected URI. > > Dave
