Java 类org.semanticweb.owlapi.model.OWLRuntimeException 实例源码

项目:semantika    文件:StreamDocumentSource.java   
/**
 * 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);
   }
}
项目:owlapi-gwt    文件:DefaultPrefixManager.java   
@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);
    }
}
项目:owlapi-gwt    文件:OWLLiteralImpl.java   
/**
 * @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);
}
项目:rf2-to-owl    文件:OWLFunctionalSyntaxRefsetRenderer.java   
@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);
    }
}
项目:elk-reasoner    文件:ElkConverter.java   
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);
}
项目:elk-reasoner    文件:OWLAPIFunctionalSyntaxParser.java   
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);
    }
}
项目:owlapi-gwt    文件:OWLDatatypeImpl.java   
@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);
    }
}
项目:elk-reasoner    文件:ElkConverter.java   
public OWLRuntimeException convert(ElkRuntimeException e) {
    return new ReasonerInternalException(e);
}
项目:owlapi-gwt    文件:OWLLiteralImplPlain.java   
@Override
public boolean parseBoolean() {
    throw new OWLRuntimeException(getClass().getName() + " does not have a boolean value");
}
项目:owlapi-gwt    文件:OWLLiteralImplPlain.java   
@Override
public double parseDouble() {
    throw new OWLRuntimeException(getClass().getName() + " does not have a double value");
}
项目:owlapi-gwt    文件:OWLLiteralImplPlain.java   
@Override
public float parseFloat() {
    throw new OWLRuntimeException(getClass().getName() + " does not have a float value");
}
项目:owlapi-gwt    文件:OWLLiteralImplString.java   
@Override
public boolean parseBoolean() {
    throw new OWLRuntimeException(getClass().getName() + " does not have a boolean value");
}
项目:owlapi-gwt    文件:OWLLiteralImplString.java   
@Override
public double parseDouble() {
    throw new OWLRuntimeException(getClass().getName() + " does not have a double value");
}
项目:owlapi-gwt    文件:OWLLiteralImplString.java   
@Override
public float parseFloat() {
    throw new OWLRuntimeException(getClass().getName() + " does not have a float value");
}
项目:owlapi-gwt    文件:OWLDataPropertyImpl.java   
@Override
public OWLClass asOWLClass() {
    throw new OWLRuntimeException("Not an OWLClass!");
}
项目:owlapi-gwt    文件:OWLDataPropertyImpl.java   
@Override
public OWLDatatype asOWLDatatype() {
    throw new OWLRuntimeException("Not an OWLDatatype!");
}
项目:owlapi-gwt    文件:OWLDataPropertyImpl.java   
@Override
public OWLNamedIndividual asOWLNamedIndividual() {
    throw new OWLRuntimeException("Not an OWLIndividual!");
}
项目:owlapi-gwt    文件:OWLDataPropertyImpl.java   
@Override
public OWLObjectProperty asOWLObjectProperty() {
    throw new OWLRuntimeException("Not an OWLObjectProperty!");
}
项目:owlapi-gwt    文件:OWLDataPropertyImpl.java   
@Override
public OWLAnnotationProperty asOWLAnnotationProperty() {
    throw new OWLRuntimeException("Not an annotation property");
}
项目:owlapi-gwt    文件:OWLAnonymousClassExpressionImpl.java   
@Override
public OWLClass asOWLClass() {
    throw new OWLRuntimeException(
            "Not an OWLClass.  This method should only be called if the isAnonymous method returns false!");
}
项目:owlapi-gwt    文件:OWLObjectInverseOfImpl.java   
@Override
public OWLObjectProperty asOWLObjectProperty() {
    throw new OWLRuntimeException(
            "Property is not a named property.  Check using the isAnonymous method before calling this method!");
}
项目:owlapi-gwt    文件:OWLDatatypeImpl.java   
@Override
public OWLClass asOWLClass() {
    throw new OWLRuntimeException("Not an OWLClass!");
}
项目:owlapi-gwt    文件:OWLDatatypeImpl.java   
@Override
public OWLDataProperty asOWLDataProperty() {
    throw new OWLRuntimeException("Not a data property!");
}
项目:owlapi-gwt    文件:OWLDatatypeImpl.java   
@Override
public OWLNamedIndividual asOWLNamedIndividual() {
    throw new OWLRuntimeException("Not an individual!");
}
项目:owlapi-gwt    文件:OWLDatatypeImpl.java   
@Override
public OWLObjectProperty asOWLObjectProperty() {
    throw new OWLRuntimeException("Not an object property");
}
项目:owlapi-gwt    文件:OWLDatatypeImpl.java   
@Override
public OWLAnnotationProperty asOWLAnnotationProperty() {
    throw new OWLRuntimeException("Not an annotation property");
}
项目:owlapi-gwt    文件:OWLDataComplementOfImpl.java   
@Nonnull
@Override
public OWLDatatype asOWLDatatype() {
    throw new OWLRuntimeException("Not a data type!");
}
项目:owlapi-gwt    文件:OWLClassImpl.java   
@Override
public OWLDataProperty asOWLDataProperty() {
    throw new OWLRuntimeException("Not a data property!");
}
项目:owlapi-gwt    文件:OWLClassImpl.java   
@Override
public OWLDatatype asOWLDatatype() {
    throw new OWLRuntimeException("Not a data type!");
}
项目:owlapi-gwt    文件:OWLClassImpl.java   
@Override
public OWLNamedIndividual asOWLNamedIndividual() {
    throw new OWLRuntimeException("Not an individual!");
}
项目:owlapi-gwt    文件:OWLClassImpl.java   
@Override
public OWLObjectProperty asOWLObjectProperty() {
    throw new OWLRuntimeException("Not an object property");
}
项目:owlapi-gwt    文件:OWLClassImpl.java   
@Override
public OWLAnnotationProperty asOWLAnnotationProperty() {
    throw new OWLRuntimeException("Not an annotation property");
}
项目:java-skos-api    文件:SKOSTypedLiteralImpl.java   
public SKOSUntypedLiteral getAsSKOSUntypedLiteral() {
    throw new OWLRuntimeException("Not a SKOS Untyped Constant");
}
项目:java-skos-api    文件:SKOSConceptImpl.java   
public SKOSConceptScheme asSKOSConceptScheme() {
    throw new OWLRuntimeException("Not a SKOS Concept Scheme");
}
项目:java-skos-api    文件:SKOSConceptImpl.java   
public SKOSLabelRelationImpl asSKOSLabelRelation() {
    throw new OWLRuntimeException("Not a SKOS Label Relation");
}
项目:java-skos-api    文件:SKOSConceptImpl.java   
public SKOSResource asSKOSResource() {
    throw new OWLRuntimeException("Not a SKOS Resource");
}
项目:java-skos-api    文件:SKOSDataTypeImpl.java   
public SKOSConceptScheme asSKOSConceptScheme() {
    throw new OWLRuntimeException("Not a SKOS Concept Scheme");
}
项目:java-skos-api    文件:SKOSDataTypeImpl.java   
public SKOSLabelRelation asSKOSLabelRelation() {
    throw new OWLRuntimeException("Not a SKOS Label Relation");
}
项目:java-skos-api    文件:SKOSDataTypeImpl.java   
public SKOSResource asSKOSResource() {
    throw new OWLRuntimeException("Not a SKOS Resource");
}
项目:java-skos-api    文件:SKOSUntypedLiteralImpl.java   
public SKOSTypedLiteral getAsSKOSTypedLiteral() {
    throw new OWLRuntimeException("This is not a SKOS Typed Constant");
}