URI foafPerson = model.createURI("http://xmlns.com/foaf/0.1/Person");
URI foafTitle = model.createURI("http://xmlns.com/foaf/0.1/title");
URI foafKnows = model.createURI("http://xmlns.com/foaf/0.1/knows");
URI foafHomepage = model.createURI("http://xmlns.com/foaf/0.1/homepage");
// use a blank node for the person
BlankNode werner = model.createBlankNode();
/*
* now we can add statements to the model (for easier reading we
* replaced the blank nodes cryptical letters with a human readable
* version - you will see something different when exectuing this
* example
*/
// _:blankNodeWerner
// <http://xmlns.com/foaf/0.1/homepage>
// <http://www.blue-agents.com> .
model.addStatement(werner, foafHomepage, model.createURI("http://www.blue-agents.com"));
// _:blankNodeWerner
// <http://xmlns.com/foaf/0.1/title>
// "Mr" .
model.addStatement(werner, foafTitle, "Mr");
// _:blankNodeWerner
// <http://xmlns.com/foaf/0.1/name>
// "Werner Thiemann" .
model.addStatement(werner, foafName, "Werner Thiemann");
// _:blankNodeWerner
// <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
// <http://xmlns.com/foaf/0.1/Person> .
model.addStatement(werner, RDF.type, foafPerson);
BlankNode max = model.createBlankNode();
// _:blankNodeMax
// <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
// <http://xmlns.com/foaf/0.1/Person> .
model.addStatement(max, RDF.type, foafPerson);
// _:blankNodeMax