1 7 package jena.examples.rdf ; 8 9 import com.hp.hpl.jena.rdf.model.*; 10 import com.hp.hpl.jena.vocabulary.*; 11 12 import java.io.PrintWriter ; 13 14 19 public class Tutorial11 extends Object { 20 21 public static void main (String args[]) { 22 Model model = ModelFactory.createDefaultModel(); 24 25 Resource r = model.createResource(); 27 28 r.addProperty(RDFS.label, model.createLiteral("chat", "en")) 30 .addProperty(RDFS.label, model.createLiteral("chat", "fr")) 31 .addProperty(RDFS.label, model.createLiteral("<em>chat</em>", true)); 32 33 model.write(new PrintWriter (System.out)); 35 System.out.println(); 36 37 model = ModelFactory.createDefaultModel(); 39 40 r = model.createResource(); 42 43 r.addProperty(RDFS.label, "11") 45 .addProperty(RDFS.label, 11); 46 47 model.write( System.out, "N-TRIPLE"); 49 } 50 } 51 52 78 | Popular Tags |