⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 owlreader.java

📁 开发owl的API,提供了W3C规定标准接口,是目前比较少的API.
💻 JAVA
字号:
// The MIT License
//
// Copyright (c) 2004 Evren Sirin
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.

/*
 * Created on Dec 27, 2003
 *
 */
package org.mindswap.owl;

import java.net.URI;
import java.util.List;
import java.util.Map;

import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.RDFErrorHandler;

/**
 * OWLReader provides various functions to read an OWL ontology from a given URI. 
 * 
 * @author Evren Sirin
 *
 */
public interface OWLReader {	
	
	/**
	 * Reads the imports closure of the ontology from the given URI in to a Jena model. This
	 * function is equivalent to read(uri, true).  
	 * 
	 * @param uri URI of the ontology
	 * @return Jena model
	 * @throws Exception thrown when the ontology cannot be read 
	 */
	public Model read(URI uri) throws Exception;
	
	/**
	 * Reads the the ontology from the given URI in to a Jena model.   
	 * 
	 * @param uri URI of the ontology
	 * @param withImports if true load the imports closure of the ontology. otherwise only
	 * the given onotlogy is loaded, imported ones are discarded
	 * @return Jena model
	 * @throws Exception
	 */
	public Model read(URI uri, boolean withImports) throws Exception;
	
	/**
	 * Reads the ontology and the ontologies imported by that one into separate Jena models. If each
	 * ontology needs to be examined separately (for example to keep track of which statement is coming 
	 * from which file) this function can be used.
	 * 
	 * @param uri URI of the ontology
	 * @return
	 * @throws Exception
	 */
	public Model[] readSeparate(URI uri) throws Exception;
	
	/**
	 * Returns the URI for a given Jena model. If the given model was read by another reader than
	 * the function will return null.
	 * 
	 * @param model
	 * @return
	 */
	public URI getModelURI(Model model);
	
	/**
	 * Return the URI of all the ontologies imported by the ontology given by the URI.
	 * 
	 * @param uri
	 * @return
	 */
	public List getImports(URI uri);
		
	/**
	 * Return a map of namespaces that are used in the given ontology
	 * 
	 * @param uri
	 * @return
	 */
	public Map getNameSpaces(URI uri);
	
	public RDFErrorHandler setErrorHandler(RDFErrorHandler errHandler); 
}

⌨️ 快捷键说明

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