📄 owlresource.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 com.hp.hpl.jena.rdf.model.Resource;
/**
* The base interface for all the objects that are OWL resources. This interface actually corresponds to
* a RDF resource because it encapsulates OWL classes, properties and individuals. It defines some basic
* functions to access the underlying RDF model.
*
* @author Evren Sirin
*
*/
public interface OWLResource {
/**
* Check if this resource represents an anonymous node
*
* @return
*/
public boolean isAnon();
/**
* Return the URI for this resource. If this resource is anonymous then null value will be returned
*
* @return
*/
public URI getURI();
/**
* Get the rdfs:label for this resource. This function will look for labels with different language
* codes according to the settings defined in {@link org.mindswap.owl.OWLConfig#DEFAULT_LANGS OWLConfig}
*
* @return
*/
public String getLabel();
/**
* Get the rdfs:label with the specified language code. If the label for the given language does not
* exist return null even a label is found for another language. Use {@link org.mindswap.owl.OWLResource#getLabel()
* getLabel()} to be more flexible.
*
* @param lang
* @return
*/
public String getLabel(String lang);
/**
* Set the value of rdfs:label for this resource. Empty language identifier will be used.
*
* @param label
*/
public void setLabel(String label);
/**
* Return true if a value for the given property exists.
*
* @param propURI
* @return
*/
public boolean hasProperty(URI propURI);
/**
* Get the value for the given object property. If the resource has more than one value for this property
* a random one will be returned
*
* @param propURI
* @return
*/
public OWLResource getProperty(URI propURI);
/**
* Get the value for the given datatype property URI. If the resource has more than one value for this property
* with different language identifiers than the returned value will be determined according to the
* settings defined in {@link org.mindswap.owl.OWLConfig#DEFAULT_LANGS OWLConfig}
*
* @param propURI
* @return
*/
public String getDataProperty(URI propURI);
/**
* Get the value for the given property URI with the specified language identifier. If the value
* for the given language does not exist return null even if a value is found for another language.
* Use {@link org.mindswap.owl.OWLResource#getProperty(URI) getProperty(URI)} to be more flexible.
*
* @param propURI
* @param lang
* @return
*/
public String getDataProperty(URI propURI, String lang);
/**
* Set the value for the given property
*
* @param propURI
* @param value
*/
public void setDataProperty(URI propURI, String value);
/**
* Set the value for the given data property with the specified language identifier
*
* @param propURI
* @param value
* @param lang
*/
public void setDataProperty(URI propURI, String value, String lang);
/**
* Wrap this resource in another view. This is a similar functionality as provided in Jena but uses
* one global table in {@link org.mindswap.owl.OWLConfig#WRAPPERS OWLConfig} to define mappings.
*
* @param Class
* @return
*/
public OWLResource wrap(Class view);
/**
* Get the resource object from the underlying Jena model (Subject to change)
*
* @return
*/
public Resource getJenaResource();
/**
* equals
*
* @param o
* @return
*/
public boolean equals(Object o);
/**
* debugString
*
* @return
*/
public String debugString();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -