Create iri nodes in Java - Values.iri

I'm having a problem - probably a misunderstanding, possibly a bug - using Values.statement and .iri to insert data into stardog. I created a short example to try to figure out what I was doing wrong. I think it also illustrates my problem nicely:

				final Statement aStatement = Values.statement(
						,(Resource) Values.iri(URIs.BraveDataModelBase));
				aConn.add().statement( aStatement);
				final Statement idStatement = Values.statement(
						,(Resource) Values.iri(URIs.BraveDataModelBase));

This produces the following RDF (exported from stardog):

<> <rdf:type> <> ;
  <rdf:id> "uniqueID" .

As you might assume I was hoping for rdf:type and rdf:id NOT having "<" and ">" as if they are uri's.
How should I be creating the triples?

You can get the rdf:type IRI directly from the com.stardog.stark.vocabs.RDF class. Otherwise, the prefix declaration isn't recognized in the string passed to Values.iri() so you must expand it and pass the full IRI.

Many thanks, how might I go about adding some prefixes (such as rdf)?

Prefixes are not recognized in these calls. You can do:

Values.iri("", "type");


Values.iri(com.stardog.stark.vocabs.RDF.NAMESPACE, "type");

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.