import java.io.IOException; import org.apache.xmlrpc.WebServer; import com.hp.hpl.jena.query.Query; import com.hp.hpl.jena.query.QueryExecution; import com.hp.hpl.jena.query.QueryExecutionFactory; import com.hp.hpl.jena.query.QueryFactory; import com.hp.hpl.jena.query.QuerySolution; import com.hp.hpl.jena.query.ResultSet; import com.hp.hpl.jena.query.ResultSetFormatter; import com.hp.hpl.jena.rdf.model.InfModel; import com.hp.hpl.jena.rdf.model.Model; import com.hp.hpl.jena.rdf.model.ModelFactory; import com.hp.hpl.jena.rdf.model.RDFNode; import com.hp.hpl.jena.util.ModelLoader; import com.hp.hpl.jena.vocabulary.ReasonerVocabulary; import com.hp.hpl.jena.rdf.model.InfModel; import com.hp.hpl.jena.reasoner.Reasoner; public class PruebaQuery { static InfModel infmodel; public static void main(String[] args){ if(args.length < 1){ System.out.println("Usage: java AreaServer [port]"); System.exit(-1); } System.out.println("Cargando ontologĂ­as."); Model schema = ModelLoader.loadModel ("file:/home/siaf/siaf_aplicaciones/cvs_repository/durito/production_vers/ontologies/system"); Model schema1 = ModelLoader.loadModel("file:/home/siaf/siaf_aplicaciones/cvs_repository/durito/production_vers/ontologies/self"); schema.add(schema1); Model schema2 = ModelLoader.loadModel("file:/home/siaf/siaf_aplicaciones/cvs_repository/durito/production_vers/ontologies/worldview"); schema.add(schema2); Model schema3 = ModelLoader.loadModel("file:/home/siaf/siaf_aplicaciones/cvs_repository/durito/production_vers/ontologies/instituto-mora"); schema.add(schema3); Model data = ModelLoader.loadModel("file:/home/siaf/siaf_aplicaciones/cvs_repository/durito/production_vers/ontologies/repository"); infmodel = ModelFactory.createRDFSModel(schema, data); Reasoner reason = infmodel.getReasoner(); reason.setParameter(ReasonerVocabulary.PROPsetRDFSLevel, ReasonerVocabulary.RDFS_FULL); try { startServer(args); } catch(IOException e){ System.out.println("Could not start server: " + e.getMessage()); } } public static void startServer(String[] args) throws IOException { //Start the server using built-in version System.out.println("Attempting to start XML-RPC Server..."); WebServer server = new WebServer(Integer.parseInt(args[0])); System.out.println("Started succesfully."); //Register our handler class area server.addHandler("ws", new PruebaHandler()); System.out.println("Now Accepting requests (Halt program to stop.)"); server.start(); } }