All Downloads are FREE. Search and download functionalities are using the official Maven repository.

es.ucm.fdi.gaia.ontobridge.test.Test9 Maven / Gradle / Ivy

/**
 * OntoBride library
 * Departamento de Ingenieria del Software e Inteligencia Artificial
 * Universidad Complutense de Madrid
 * 
 * Licensed under the terms of the GNU Library or Lesser General Public License (LGPL)
 *
 * @author Juan A. Recio Garcia
 * 
 * This software is a subproject of the jCOLIBRI framework
 * http://sourceforge.net/projects/jcolibri-cbr/
 * http://gaia.fdi.ucm.es/projects/jcolibri/
 * 
 * File: Test4.java
 * 26/02/2007
 */
package es.ucm.fdi.gaia.ontobridge.test;

import java.util.ArrayList;

import es.ucm.fdi.gaia.ontobridge.OntoBridge;
import es.ucm.fdi.gaia.ontobridge.OntologyDocument;

/**
 * File used for testing the library using the GAIA photos ontology.
* This test shows how to delete properties. * * @author Juan A. Recio Garcia */ public class Test9 { public static void main(String args[]) { OntoBridge ob = new OntoBridge(); ob.initWithPelletReasoner(); OntologyDocument mainOnto = new OntologyDocument("http://gaia.fdi.ucm.es/ontologies/fotos.owl","file:test/fotos.owl"); ArrayList subOntologies = new ArrayList(); ob.loadOntology(mainOnto, subOntologies, false); show("Foto_1",ob); ob.deleteProperties("Foto_1","urlfoto"); show("Foto_1",ob); ob.deleteOntProperty("Foto_1", "aparecePersona", "Paco"); show("Foto_1",ob); ob.createDataTypeProperty("Foto_1", "lugar", "Toledo"); show("Foto_1",ob); ob.deleteProperties("Foto_1","lugar"); show("Foto_1",ob); } private static void show(String instance, OntoBridge ob) { System.out.println(instance); ArrayList properties = new ArrayList(); ArrayList values = new ArrayList(); ob.listInstancePropertiesValues(instance, properties, values); for(int i=0; i "+ values.get(i)); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy