Jena in Processing
in
Share your Work
•
9 months ago
By copying the Jena-libs into the "code" directory i was able to run the code from
Ian Dickinson in Processing.
The Processing code is :
The Processing code is :
- import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.rdf.model.Property;
import com.hp.hpl.jena.rdf.model.Resource;
import com.hp.hpl.jena.datatypes.xsd.XSDDatatype;
Model m = ModelFactory.createDefaultModel();
String NS = "http://example.com/test/";
void setup()
{
size(200,200);
noLoop();
}
void draw()
{
Resource r = m.createResource(NS + "r");
Property p = m.createProperty(NS + "p");
r.addProperty(p, "hello world", XSDDatatype.XSDstring);
m.write(System.out, "Turtle");
}