Examples of SWRLIArgument


Examples of org.semanticweb.owlapi.model.SWRLIArgument

        String predicate = consumeToken();
        if (!isDataPropertyName(predicate)) {
            throw new ExceptionBuilder().withData().build();
        }
        consumeToken(OPEN.keyword());
        SWRLIArgument obj1 = parseIObject();
        consumeToken(COMMA.keyword());
        SWRLDArgument obj2 = parseDObject();
        consumeToken(CLOSE.keyword());
        return dataFactory.getSWRLDataPropertyAtom(
                getOWLDataProperty(predicate), obj1, obj2);
View Full Code Here

Examples of org.semanticweb.owlapi.model.SWRLIArgument

        if (!isObjectPropertyName(predicate)) {
            throw new ExceptionBuilder().withObject().build();
        }
        assert predicate != null;
        consumeToken(OPEN.keyword());
        SWRLIArgument obj1 = parseIObject();
        consumeToken(COMMA.keyword());
        SWRLIArgument obj2 = parseIObject();
        consumeToken(CLOSE.keyword());
        return dataFactory.getSWRLObjectPropertyAtom(
                getOWLObjectProperty(predicate), obj1, obj2);
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.SWRLIArgument

    }

    private SWRLAtom parseClassAtom() {
        OWLClassExpression predicate = parseUnion();
        consumeToken(OPEN.keyword());
        SWRLIArgument obj = parseIObject();
        consumeToken(CLOSE.keyword());
        return dataFactory.getSWRLClassAtom(predicate, obj);
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.SWRLIArgument

    }

    private SWRLDifferentIndividualsAtom parseDifferentFromAtom() {
        consumeToken(ManchesterOWLSyntax.DIFFERENT_FROM.toString());
        consumeToken(OPEN.keyword());
        SWRLIArgument obj1 = parseIObject();
        consumeToken(COMMA.keyword());
        SWRLIArgument obj2 = parseIObject();
        consumeToken(CLOSE.keyword());
        return dataFactory.getSWRLDifferentIndividualsAtom(obj1, obj2);
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.SWRLIArgument

    }

    private SWRLSameIndividualAtom parseSameAsAtom() {
        consumeToken(ManchesterOWLSyntax.SAME_AS.toString());
        consumeToken(OPEN.keyword());
        SWRLIArgument obj1 = parseIObject();
        consumeToken(COMMA.keyword());
        SWRLIArgument obj2 = parseIObject();
        consumeToken(CLOSE.keyword());
        return dataFactory.getSWRLSameIndividualAtom(obj1, obj2);
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.SWRLIArgument

                List<SWRLDArgument> args = listTranslator
                        .translateList(mainIRI);
                return dataFactory.getSWRLBuiltInAtom(builtInIRI, args);
            } else if (consumer.isSWRLClassAtom(firstObject)) {
                // C(?x) or C(ind)
                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

Examples of org.semanticweb.owlapi.model.SWRLIArgument

        throw new Error("Missing return statement in function");
    }

    final public SWRLClassAtom ClassAtom() throws ParseException {
        OWLClassExpression ce;
        SWRLIArgument arg0;
        jj_consume_token(CLASSATOM);
        jj_consume_token(OPENPAR);
        ce = ClassExpression();
        arg0 = IArg();
        jj_consume_token(CLOSEPAR);
View Full Code Here

Examples of org.semanticweb.owlapi.model.SWRLIArgument

    }

    final public SWRLObjectPropertyAtom ObjectPropertyAtom()
            throws ParseException {
        OWLObjectPropertyExpression prop;
        SWRLIArgument arg0;
        SWRLIArgument arg1;
        jj_consume_token(OBJECTPROPERTYATOM);
        jj_consume_token(OPENPAR);
        prop = ObjectPropertyExpression();
        arg0 = IArg();
        arg1 = IArg();
View Full Code Here

Examples of org.semanticweb.owlapi.model.SWRLIArgument

        throw new Error("Missing return statement in function");
    }

    final public SWRLDataPropertyAtom DataPropertyAtom() throws ParseException {
        OWLDataProperty prop;
        SWRLIArgument arg0;
        SWRLDArgument arg1;
        jj_consume_token(DATAPROPERTYATOM);
        jj_consume_token(OPENPAR);
        prop = DataPropertyIRI();
        arg0 = IArg();
View Full Code Here

Examples of org.semanticweb.owlapi.model.SWRLIArgument

        throw new Error("Missing return statement in function");
    }

    final public SWRLSameIndividualAtom SameIndividualAtom()
            throws ParseException {
        SWRLIArgument arg0;
        SWRLIArgument arg1;
        jj_consume_token(SAMEINDIVIDUALATOM);
        jj_consume_token(OPENPAR);
        arg0 = IArg();
        arg1 = IArg();
        jj_consume_token(CLOSEPAR);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.