indiceslibrary.java

来自「Semantic Web Ontology Editor」· Java 代码 · 共 66 行

JAVA
66
字号
/* * Created on Feb 14, 2005 * */package org.mindswap.swoop.utils.owlapi;import java.util.HashMap;import java.util.Iterator;import java.util.Set;import org.mindswap.swoop.SwoopModel;import org.semanticweb.owl.model.OWLOntology;/** * @author Aditya  * * Build a library of ontology_indices for cross-referencing information.  * Used in econn refactoring and search *  */public class IndicesLibrary {	SwoopModel swoopModel;	private HashMap indexedLibrary;			public IndicesLibrary(SwoopModel swoopModel) {		this.swoopModel = swoopModel;		indexedLibrary = new HashMap();	}				/**	 * Compute indices for a single OWL ontology and add the indexed 	 * information to a local library (HashMap)	 * @param ontology	 */	public void computeIndices(OWLOntology ontology) {		OntologyIndices index = new OntologyIndices(swoopModel.getDefaultReasoner());		index.buildIndex(ontology, swoopModel.getShowImports(), false);		indexedLibrary.put(ontology, index);	}		/** 	 * Compute indices for a set of ontologies. Iteratively call computeIndices(..)	 * for each ontology in the set	 * @param ontologies	 */	public void computeIndices(Set ontologies) {		for (Iterator iter = ontologies.iterator(); iter.hasNext();) {			OWLOntology ont = (OWLOntology) iter.next();			this.computeIndices(ont);		}	}		/**	 * Get the ontology index information for a single ontology 	 * @param ontology	 * @return	 */	public OntologyIndices getIndices(OWLOntology ontology) {		return (OntologyIndices) indexedLibrary.get(ontology);	}}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?