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 Tutorial02 extends Object { 18 19 public static void main (String args[]) { 20 String personURI = "http://somewhere/JohnSmith"; 22 String givenName = "John"; 23 String familyName = "Smith"; 24 String fullName = givenName + " " + familyName; 25 26 Model model = ModelFactory.createDefaultModel(); 28 29 Resource johnSmith = model.createResource(personURI) 32 .addProperty(VCARD.FN, fullName) 33 .addProperty(VCARD.N, 34 model.createResource() 35 .addProperty(VCARD.Given, givenName) 36 .addProperty(VCARD.Family, familyName)); 37 38 } 39 } 40 41 67 | Popular Tags |