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

Reply via email to