1 7 package jena.examples.rdf ; 8 9 import com.hp.hpl.jena.rdf.model.*; 10 import com.hp.hpl.jena.vocabulary.*; 11 12 17 public class Tutorial04 extends Object { 18 19 static String tutorialURI = "http://hostname/rdf/tutorial/"; 21 static String briansName = "Brian McBride"; 22 static String briansEmail1 = "brian_mcbride@hp.com"; 23 static String briansEmail2 = "brian_mcbride@hpl.hp.com"; 24 static String title = "An Introduction to RDF and the Jena API"; 25 static String date = "23/01/2001"; 26 27 public static void main (String args[]) { 28 29 String personURI = "http://somewhere/JohnSmith"; 31 String givenName = "John"; 32 String familyName = "Smith"; 33 String fullName = givenName + " " + familyName; 34 Model model = ModelFactory.createDefaultModel(); 36 37 Resource johnSmith 40 = model.createResource(personURI) 41 .addProperty(VCARD.FN, fullName) 42 .addProperty(VCARD.N, 43 model.createResource() 44 .addProperty(VCARD.Given, givenName) 45 .addProperty(VCARD.Family, familyName)); 46 47 model.write(System.out); 49 } 50 } 51 52 78 | Popular Tags |