• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java OWLRuntimeException类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.semanticweb.owlapi.model.OWLRuntimeException的典型用法代码示例。如果您正苦于以下问题:Java OWLRuntimeException类的具体用法?Java OWLRuntimeException怎么用?Java OWLRuntimeException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



OWLRuntimeException类属于org.semanticweb.owlapi.model包,在下文中一共展示了OWLRuntimeException类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: readIntoBuffer

import org.semanticweb.owlapi.model.OWLRuntimeException; //导入依赖的package包/类
/**
 * Reads all the bytes from the specified stream into a temporary buffer,
 * which is necessary because we may need to access the input stream more
 * than once. In other words, this method caches the input stream.
 * 
 * @param stream
 *           The stream to be cached
 */
private void readIntoBuffer(InputStream reader)
{
   try {
      ByteArrayOutputStream bos = new ByteArrayOutputStream();
      final int length = 100000;
      byte[] tempBuffer = new byte[length];
      int read = 0;
      do {
         read = reader.read(tempBuffer, 0, length);
         if (read > 0) {
            bos.write(tempBuffer, 0, read);
         }
      }
      while (read > 0);
      mBuffer = bos.toByteArray();
   }
   catch (IOException e) {
      throw new OWLRuntimeException(e);
   }
}
 
开发者ID:obidea,项目名称:semantika,代码行数:29,代码来源:StreamDocumentSource.java


示例2: getIRI

import org.semanticweb.owlapi.model.OWLRuntimeException; //导入依赖的package包/类
@Override
public IRI getIRI(String prefixIRI) {
    if (prefixIRI.startsWith("<")) {
        return IRI.create(prefixIRI.substring(1, prefixIRI.length() - 1));
    }
    int sep = prefixIRI.indexOf(':');
    if (sep == -1) {
        if (getDefaultPrefix() != null) {
            return IRI.create(getDefaultPrefix() + prefixIRI);
        } else {
            return IRI.create(prefixIRI);
        }
    } else {
        String prefixName = prefixIRI.substring(0, sep + 1);
        if (!containsPrefixMapping(prefixName)) {
            throw new OWLRuntimeException("Prefix not registered for prefix name: " + prefixName);
        }
        String prefix = getPrefix(prefixName);
        String localName = prefixIRI.substring(sep + 1);
        return IRI.create(prefix, localName);
    }
}
 
开发者ID:matthewhorridge,项目名称:owlapi-gwt,代码行数:23,代码来源:DefaultPrefixManager.java


示例3: OWLLiteralImpl

import org.semanticweb.owlapi.model.OWLRuntimeException; //导入依赖的package包/类
/**
 * @param literal the lexical form
 * @param lang the language; can be null or an empty string, in which case datatype can be any
 *        datatype but not null
 * @param datatype the datatype; if lang is null or the empty string, it can be null or it MUST
 *        be RDFPlainLiteral
 */
public OWLLiteralImpl(@Nonnull String literal, @Nullable String lang,
    @Nullable OWLDatatype datatype) {
    this.literal = new LiteralWrapper(checkNotNull(literal, "literal cannot be null"));
    if (lang == null || lang.isEmpty()) {
        language = "";
        if (datatype == null) {
            this.datatype = RDF_PLAIN_LITERAL;
        } else {
            this.datatype = datatype;
        }
    } else {
        if (datatype != null && !datatype.isRDFPlainLiteral()) {
            // ERROR: attempting to build a literal with a language tag and
            // type different from plain literal
            throw new OWLRuntimeException("Error: cannot build a literal with type: "
                + datatype.getIRI() + " and language: " + lang);
        }
        language = lang;
        this.datatype = RDF_PLAIN_LITERAL;
    }
    hashcode = getHashCode(literal);
}
 
开发者ID:matthewhorridge,项目名称:owlapi-gwt,代码行数:30,代码来源:OWLLiteralImpl.java


示例4: render

import org.semanticweb.owlapi.model.OWLRuntimeException; //导入依赖的package包/类
@Override
public void render(OWLOntology ontology, PrintWriter writer) throws OWLRendererException {
    try {
        OWLFuncionalSyntaxRefsetObjectRenderer ren = new OWLFuncionalSyntaxRefsetObjectRenderer(ontology,
                writer);
        ontology.accept(ren);
        writer.flush();
    } catch (OWLRuntimeException e) {
        throw new OWLRendererIOException(e);
    }
}
 
开发者ID:termMed,项目名称:rf2-to-owl,代码行数:12,代码来源:OWLFunctionalSyntaxRefsetRenderer.java


示例5: convert

import org.semanticweb.owlapi.model.OWLRuntimeException; //导入依赖的package包/类
public OWLRuntimeException convert(ElkException e) {
	if (e instanceof ElkFreshEntitiesException)
		return convert((ElkFreshEntitiesException) e);
	else if (e instanceof ElkInconsistentOntologyException)
		return convert((ElkInconsistentOntologyException) e);
	else if (e instanceof ElkInterruptedException)
		return convert((ElkInterruptedException) e);
	else
		return new OWLRuntimeException(e);
}
 
开发者ID:liveontologies,项目名称:elk-reasoner,代码行数:11,代码来源:ElkConverter.java


示例6: loadViaOWLAPI

import org.semanticweb.owlapi.model.OWLRuntimeException; //导入依赖的package包/类
private OWLOntology loadViaOWLAPI() throws Owl2ParseException {
	try {
		return TestOWLManager.createOWLOntologyManager()
				.loadOntologyFromOntologyDocument(mOntoSource);

	} catch (OWLOntologyCreationException e) {
		throw new Owl2ParseException(e);
	} catch (OWLRuntimeException re) {
		throw new Owl2ParseException(re);
	}
}
 
开发者ID:liveontologies,项目名称:elk-reasoner,代码行数:12,代码来源:OWLAPIFunctionalSyntaxParser.java


示例7: getBuiltInDatatype

import org.semanticweb.owlapi.model.OWLRuntimeException; //导入依赖的package包/类
@Override
public OWL2Datatype getBuiltInDatatype() {
    if (!builtin) {
        throw new OWLRuntimeException(
                iri
                        + " is not a built in datatype.  The getBuiltInDatatype() method should only be called on built in datatypes.");
    } else {
        return OWL2Datatype.getDatatype(iri);
    }
}
 
开发者ID:matthewhorridge,项目名称:owlapi-gwt,代码行数:11,代码来源:OWLDatatypeImpl.java


示例8: parseBoolean

import org.semanticweb.owlapi.model.OWLRuntimeException; //导入依赖的package包/类
@Override
public boolean parseBoolean() {
    throw new OWLRuntimeException(getClass().getName() + " does not have a boolean value");
}
 
开发者ID:matthewhorridge,项目名称:owlapi-gwt,代码行数:5,代码来源:OWLLiteralImplPlain.java


示例9: parseDouble

import org.semanticweb.owlapi.model.OWLRuntimeException; //导入依赖的package包/类
@Override
public double parseDouble() {
    throw new OWLRuntimeException(getClass().getName() + " does not have a double value");
}
 
开发者ID:matthewhorridge,项目名称:owlapi-gwt,代码行数:5,代码来源:OWLLiteralImplPlain.java


示例10: parseFloat

import org.semanticweb.owlapi.model.OWLRuntimeException; //导入依赖的package包/类
@Override
public float parseFloat() {
    throw new OWLRuntimeException(getClass().getName() + " does not have a float value");
}
 
开发者ID:matthewhorridge,项目名称:owlapi-gwt,代码行数:5,代码来源:OWLLiteralImplPlain.java


示例11: asOWLClass

import org.semanticweb.owlapi.model.OWLRuntimeException; //导入依赖的package包/类
@Override
public OWLClass asOWLClass() {
    throw new OWLRuntimeException("Not an OWLClass!");
}
 
开发者ID:matthewhorridge,项目名称:owlapi-gwt,代码行数:5,代码来源:OWLDataPropertyImpl.java


示例12: asOWLDatatype

import org.semanticweb.owlapi.model.OWLRuntimeException; //导入依赖的package包/类
@Override
public OWLDatatype asOWLDatatype() {
    throw new OWLRuntimeException("Not an OWLDatatype!");
}
 
开发者ID:matthewhorridge,项目名称:owlapi-gwt,代码行数:5,代码来源:OWLDataPropertyImpl.java


示例13: asOWLNamedIndividual

import org.semanticweb.owlapi.model.OWLRuntimeException; //导入依赖的package包/类
@Override
public OWLNamedIndividual asOWLNamedIndividual() {
    throw new OWLRuntimeException("Not an OWLIndividual!");
}
 
开发者ID:matthewhorridge,项目名称:owlapi-gwt,代码行数:5,代码来源:OWLDataPropertyImpl.java


示例14: asOWLObjectProperty

import org.semanticweb.owlapi.model.OWLRuntimeException; //导入依赖的package包/类
@Override
public OWLObjectProperty asOWLObjectProperty() {
    throw new OWLRuntimeException("Not an OWLObjectProperty!");
}
 
开发者ID:matthewhorridge,项目名称:owlapi-gwt,代码行数:5,代码来源:OWLDataPropertyImpl.java


示例15: asOWLAnnotationProperty

import org.semanticweb.owlapi.model.OWLRuntimeException; //导入依赖的package包/类
@Override
public OWLAnnotationProperty asOWLAnnotationProperty() {
    throw new OWLRuntimeException("Not an annotation property");
}
 
开发者ID:matthewhorridge,项目名称:owlapi-gwt,代码行数:5,代码来源:OWLDataPropertyImpl.java


示例16: asOWLClass

import org.semanticweb.owlapi.model.OWLRuntimeException; //导入依赖的package包/类
@Override
public OWLClass asOWLClass() {
    throw new OWLRuntimeException(
            "Not an OWLClass.  This method should only be called if the isAnonymous method returns false!");
}
 
开发者ID:matthewhorridge,项目名称:owlapi-gwt,代码行数:6,代码来源:OWLAnonymousClassExpressionImpl.java


示例17: asOWLObjectProperty

import org.semanticweb.owlapi.model.OWLRuntimeException; //导入依赖的package包/类
@Override
public OWLObjectProperty asOWLObjectProperty() {
    throw new OWLRuntimeException(
            "Property is not a named property.  Check using the isAnonymous method before calling this method!");
}
 
开发者ID:matthewhorridge,项目名称:owlapi-gwt,代码行数:6,代码来源:OWLObjectInverseOfImpl.java


示例18: asOWLDataProperty

import org.semanticweb.owlapi.model.OWLRuntimeException; //导入依赖的package包/类
@Override
public OWLDataProperty asOWLDataProperty() {
    throw new OWLRuntimeException("Not a data property!");
}
 
开发者ID:matthewhorridge,项目名称:owlapi-gwt,代码行数:5,代码来源:OWLDatatypeImpl.java


示例19: asOWLNamedIndividual

import org.semanticweb.owlapi.model.OWLRuntimeException; //导入依赖的package包/类
@Override
public OWLNamedIndividual asOWLNamedIndividual() {
    throw new OWLRuntimeException("Not an individual!");
}
 
开发者ID:matthewhorridge,项目名称:owlapi-gwt,代码行数:5,代码来源:OWLDatatypeImpl.java


示例20: asOWLObjectProperty

import org.semanticweb.owlapi.model.OWLRuntimeException; //导入依赖的package包/类
@Override
public OWLObjectProperty asOWLObjectProperty() {
    throw new OWLRuntimeException("Not an object property");
}
 
开发者ID:matthewhorridge,项目名称:owlapi-gwt,代码行数:5,代码来源:OWLDatatypeImpl.java



注:本文中的org.semanticweb.owlapi.model.OWLRuntimeException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java CollectionView类代码示例发布时间:2022-05-22
下一篇:
Java Animatable2类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap