Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLRuntimeException


    /** @return current ontology */
    @Nonnull
    public OWLOntology getCurrentOntology() {
        OWLOntology ontology = walker.getOntology();
        if (ontology == null) {
            throw new OWLRuntimeException(
                    "No current ontology; is the walker being used outside of an ontology visit?");
        }
        return ontology;
    }
View Full Code Here


                SWRLIArgument iObject = translateSWRLAtomIObject(firstObject,
                        ARGUMENT_1.getIRI());
                IRI classIRI = consumer.getResourceObject(firstObject,
                        CLASS_PREDICATE.getIRI(), true);
                if (classIRI == null) {
                    throw new OWLRuntimeException(
                            "Don't know how to translate SWRL Atom: class IRI is null "
                                    + firstObject);
                }
                OWLClassExpression desc = accessor
                        .translateClassExpression(classIRI);
                return dataFactory.getSWRLClassAtom(desc, iObject);
            } else if (consumer.isSWRLDataRangeAtom(firstObject)) {
                // DR(?x) or DR(val)
                SWRLDArgument dObject = translateSWRLAtomDObject(firstObject,
                        ARGUMENT_1.getIRI());
                IRI dataRangeIRI = consumer.getResourceObject(firstObject,
                        DATA_RANGE.getIRI(), true);
                if (dataRangeIRI == null) {
                    throw new OWLRuntimeException(
                            "Don't know how to translate SWRL Atom: data range IRI is null "
                                    + firstObject);
                }
                OWLDataRange dataRange = consumer
                        .translateDataRange(dataRangeIRI);
                return dataFactory.getSWRLDataRangeAtom(dataRange, dObject);
            } else if (consumer.isSWRLDataValuedPropertyAtom(firstObject)) {
                SWRLIArgument arg1 = translateSWRLAtomIObject(firstObject,
                        ARGUMENT_1.getIRI());
                SWRLDArgument arg2 = translateSWRLAtomDObject(firstObject,
                        ARGUMENT_2.getIRI());
                IRI dataPropertyIRI = consumer.getResourceObject(firstObject,
                        PROPERTY_PREDICATE.getIRI(), true);
                if (dataPropertyIRI == null) {
                    throw new OWLRuntimeException(
                            "Don't know how to translate SWRL Atom: data property IRI is null "
                                    + firstObject);
                }
                OWLDataPropertyExpression prop = consumer
                        .translateDataPropertyExpression(dataPropertyIRI);
                return dataFactory.getSWRLDataPropertyAtom(prop, arg1, arg2);
            } else if (consumer.isSWRLIndividualPropertyAtom(firstObject)) {
                SWRLIArgument arg1 = translateSWRLAtomIObject(firstObject,
                        ARGUMENT_1.getIRI());
                SWRLIArgument arg2 = translateSWRLAtomIObject(firstObject,
                        ARGUMENT_2.getIRI());
                IRI objectPropertyIRI = consumer.getResourceObject(firstObject,
                        PROPERTY_PREDICATE.getIRI(), true);
                if (objectPropertyIRI == null) {
                    throw new OWLRuntimeException(
                            "Don't know how to translate SWRL Atom: object property IRI is null "
                                    + firstObject);
                }
                OWLObjectPropertyExpression prop = consumer
                        .translateObjectPropertyExpression(objectPropertyIRI);
                return dataFactory.getSWRLObjectPropertyAtom(prop, arg1, arg2);
            } else if (consumer.isSWRLSameAsAtom(firstObject)) {
                SWRLIArgument arg1 = translateSWRLAtomIObject(firstObject,
                        ARGUMENT_1.getIRI());
                SWRLIArgument arg2 = translateSWRLAtomIObject(firstObject,
                        ARGUMENT_2.getIRI());
                return dataFactory.getSWRLSameIndividualAtom(arg1, arg2);
            } else if (consumer.isSWRLDifferentFromAtom(firstObject)) {
                SWRLIArgument arg1 = translateSWRLAtomIObject(firstObject,
                        ARGUMENT_1.getIRI());
                SWRLIArgument arg2 = translateSWRLAtomIObject(firstObject,
                        ARGUMENT_2.getIRI());
                return dataFactory.getSWRLDifferentIndividualsAtom(arg1, arg2);
            }
            throw new OWLRuntimeException(
                    "Don't know how to translate SWRL Atom: " + firstObject);
        }
View Full Code Here

                    "Don't know how to translate SWRL Atom: " + firstObject);
        }

        @Override
        public SWRLAtom translate(OWLLiteral firstObject) {
            throw new OWLRuntimeException("Unexpected literal in atom list: "
                    + firstObject);
        }
View Full Code Here

                } else {
                    return dataFactory.getSWRLIndividualArgument(consumer
                            .getOWLIndividual(argIRI));
                }
            } else {
                throw new OWLRuntimeException(
                        "Cannot translate SWRL Atom I-Object for "
                                + argPredicateIRI + " Triple not found.");
            }
        }
View Full Code Here

                while (existingDocumentIRIs.contains(documentIRI)) {
                    documentIRI = IRI.generateDocumentIRI();
                }
            }
            if (documentIRIsByID.values().contains(documentIRI)) {
                throw new OWLRuntimeException(
                        new OWLOntologyDocumentAlreadyExistsException(
                                documentIRI));
            }
        }
        return result;
View Full Code Here

        return new OWLObjectComplementOfImpl(this);
    }

    @Override
    public OWLClass asOWLClass() {
        throw new OWLRuntimeException(
                "Not an OWLClass.  This method should only be called if the isAnonymous method returns false!");
    }
View Full Code Here

    @Override
    public OWLOntology loadOWLOntology(OWLOntologyManager manager,
            OWLOntologyDocumentSource documentSource,
            OWLOntologyCreationHandler handler,
            OWLOntologyLoaderConfiguration configuration) {
        throw new OWLRuntimeException(new UnsupportedOperationException(
                "Cannot load OWL ontologies in an empty factory."));
    }
View Full Code Here

        IRI versionIRI = IRI("http://www.semanticweb.org/owlapi/ontology/version");
        OWLOntologyID ontologyID = new OWLOntologyID(of(ontIRI), of(versionIRI));
        try {
            return m.createOntology(ontologyID);
        } catch (OWLOntologyCreationException e) {
            throw new OWLRuntimeException(e);
        }
    }
View Full Code Here

    void endElement() {}

    @Nonnull
    @Override
    OWLClassExpression getOWLObject() {
        throw new OWLRuntimeException(
                "getOWLObject should not be called on OWLUnionOfElementHandler");
    }
View Full Code Here

    KRSS2Parser(java.io.InputStream stream, String encoding) {
        try {
            jj_input_stream = new JavaCharStream(stream, encoding, 1, 1);
        } catch (java.io.UnsupportedEncodingException e) {
            throw new OWLRuntimeException(e);
        }
        token_source = new KRSS2ParserTokenManager(jj_input_stream);
        token = new Token();
        jj_ntk = -1;
        jj_gen = 0;
View Full Code Here

TOP

Related Classes of org.semanticweb.owlapi.model.OWLRuntimeException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.