Hi guys,
I'm not sure Peter, Ben and Steve are still in this mail group or not. Anyway, can anybody help me solve this problem? Thanks a lot.
My code is attached as well. What I want is outputing my vocabulary "Manifest" instead of "rdf:Description".
Map<String, String> ns = new HashMap<String, String>();
ns.put("", "
http://www.test.com/2007/08/test-vocabulary#");
ns.put("rdfs", "
http://www.w3.org/2000/01/rdf-schema#");
ns.put("rdf", "
http://www.w3.org/1999/02/22-rdf-syntax-ns#");
Model model = ModelFactory.createDefaultModel();
model.setNsPrefixes(ns);
Resource r = model.createResource("
http://www.test.com/2007/08/test_config#MyNodeID").addProperty(model.createProperty("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"), "
http://www.test.com/2007/08/test-vocabulary#Manifest");
Property p = model.createProperty("
http://www.test.com/2007/08/test-vocabulary#created_by
");
Statement s = model.createStatement(r, p, "Chaohong");
model.add(s);
RDFWriter w = model.getWriter("RDF/XML-ABBREV");
w.setProperty("showXMLDeclaration", "true");
w.setProperty("tab", "2");
w.setProperty("xmlbase", "
http://www.test.com/2007/08/test_config#");
w.write(model,
System.out, "
http://www.test.com/2007/08/test-vocabulary#");
Chaohong