001 /** 002 * OntoBride library 003 * Departamento de Ingeniería del Software e Inteligencia Artificial 004 * Universidad Complutense de Madrid 005 * 006 * Licensed under the terms of the GNU Library or Lesser General Public License (LGPL) 007 * 008 * @author Juan A. Recio García 009 * 010 * This software is a subproject of the jCOLIBRI framework 011 * http://sourceforge.net/projects/jcolibri-cbr/ 012 * http://gaia.fdi.ucm.es/projects/jcolibri/ 013 * 014 * File: Test2gui.java 015 * 26/02/2007 016 */ 017 package es.ucm.fdi.gaia.ontobridge.test; 018 019 import java.util.ArrayList; 020 021 import es.ucm.fdi.gaia.ontobridge.OntoBridge; 022 import es.ucm.fdi.gaia.ontobridge.OntologyDocument; 023 import es.ucm.fdi.gaia.ontobridge.test.gui.PnlConceptsTree; 024 025 /** 026 * File used for testing the library using the GAIA restaurants ontology. 027 * Shows a graphical representation of the ontology (Classes only) 028 * http://gaia.fdi.ucm.es/ontologies/ 029 * 030 * @author Juan A. Recio Garcia 031 */ 032 public class Test2gui { 033 034 public static void main(String args[]) 035 { 036 OntoBridge ob = new OntoBridge(); 037 ob.initWithPelletReasoner(); 038 039 OntologyDocument mainOnto = new OntologyDocument("http://gaia.fdi.ucm.es/ontologies/restaurant.owl","file:test/restaurant.owl"); 040 041 ArrayList<OntologyDocument> subOntologies = new ArrayList<OntologyDocument>(); 042 subOntologies.add(new OntologyDocument("http://gaia.fdi.ucm.es/ontologies/calendar.owl","file:test/calendar.owl")); 043 subOntologies.add(new OntologyDocument("http://gaia.fdi.ucm.es/ontologies/price.owl","file:test/price.owl")); 044 subOntologies.add(new OntologyDocument("http://gaia.fdi.ucm.es/ontologies/address.owl","file:test/address.owl")); 045 subOntologies.add(new OntologyDocument("http://gaia.fdi.ucm.es/ontologies/contact-details.owl","file:test/contact-details.owl")); 046 047 ob.loadOntology(mainOnto, subOntologies, false); 048 049 javax.swing.JFrame window = new javax.swing.JFrame(mainOnto.getURL()); 050 PnlConceptsTree tree = new PnlConceptsTree(ob); 051 window.getContentPane().add(tree); 052 window.pack(); 053 window.setSize(300, 600); 054 window.setVisible(true); 055 056 } 057 }