@@ -0,0 +1,2334 @@
+package ontologyapi;%0A%0Aimport java.io.InputStream;%0A%0Aimport com.hp.hpl.jena.ontology.Individual;%0Aimport com.hp.hpl.jena.ontology.OntClass;%0Aimport com.hp.hpl.jena.ontology.OntModel;%0Aimport com.hp.hpl.jena.ontology.OntModelSpec;%0Aimport com.hp.hpl.jena.rdf.model.ModelFactory;%0Aimport com.hp.hpl.jena.rdf.model.Property;%0Aimport com.hp.hpl.jena.util.FileManager;%0Aimport com.hp.hpl.jena.vocabulary.VCARD;%0A%0A%0Apublic class cesoriano_Task06%0A%7B%0A%09public static String ns = %22http://somewhere#%22;%0A%09public static String foafNS = %22http://xmlns.com/foaf/0.1#%22;%0A%09public static String foafEmailURI = foafNS+%22email%22;%0A%09public static String foafKnowsURI = foafNS+%22knows%22;%0A%09public static String stringTypeURI = %22http://www.w3.org/2001/XMLSchema#string%22;%0A%09%0A%09public static void main(String args%5B%5D)%0A%09%7B%0A%09%09String filename = %22example5.rdf%22;%0A%09%09%0A%09%09// Create an empty model%0A%09%09OntModel model = ModelFactory.createOntologyModel(OntModelSpec.RDFS_MEM);%0A%09%09%0A%09%09// Use the FileManager to find the input file%0A%09%09InputStream in = FileManager.get().open(filename);%0A%09%0A%09%09if (in == null)%0A%09%09%09throw new IllegalArgumentException(%22File: %22+filename+%22 not found%22);%0A%09%0A%09%09// Read the RDF/XML file%0A%09%09model.read(in, null);%0A%09%09%0A%09%09// Create a new class named %22Researcher%22%0A%09%09OntClass researcher = model.createClass(ns+%22Researcher%22);%0A%09%09%0A%09%09// ** TASK 6.1: Create a new class named %22University%22 **%0A%09%09OntClass university = model.createClass(ns+%22University%22);%0A%09%09%0A%09%09// ** TASK 6.2: Add %22Researcher%22 as a subclass of %22Person%22 **%0A%09%09model.getOntClass(ns+%22Person%22).addSubClass(model.createClass(ns+%22Researcher%22));%0A%09%09%0A%09%09// ** TASK 6.3: Create a new property named %22worksIn%22 **%0A%09%09Property worksIn = model.createProperty(ns+%22worksIn%22);%0A%09%09%0A%09%09// ** TASK 6.4: Create a new individual of Researcher named %22Jane Smith%22 **%0A%09%09Individual janeSmith = researcher.createIndividual(ns+%22JaneSmith%22);%0A%09%09%0A%09%09// ** TASK 6.5: Add to the individual JaneSmith the fullName, given and family names **%0A%09%09janeSmith.addProperty(VCARD.FN, %22JaneSmith%22);%0A%09%09janeSmith.addProperty(VCARD.Given, %22Jane%22);%0A%09%09janeSmith.addProperty(VCARD.Family, %22Smith%22);%0A%09%09%0A%09%09// ** TASK 6.6: Add UPM as the university where John Smith works **%0A        Individual upm = university.createIndividual(ns + %22UPM%22);%0A        Individual john = model.getIndividual(ns + %22JohnSmith%22);%0A%0A        john.addProperty(worksIn, upm);%0A%09%09%0A%09%09model.write(System.out, %22TURTLE%22);%0A%09%7D%0A%7D%0A

Create cesoriano_Task06.java