Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.SWRLDArgument


            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


        }
        List<SWRLDArgument> args = new ArrayList<>();
        if (v != null && v.getMaxArity() >= 0) {
            // We know the arity!
            for (int i = 0; i < v.getMaxArity(); i++) {
                SWRLDArgument obj = parseDObject();
                args.add(obj);
                // parse at least the minumum arity
                if (i < v.getMinArity() - 1) {
                    consumeToken(COMMA.keyword());
                } else if (i < v.getMaxArity() - 1) {
                    if (peekToken().equals(COMMA.keyword())) {
                        consumeToken();
                    } else {
                        break;
                    }
                }
            }
        } else {
            // Unknown arity so just parse as many arguments as we can
            String sep = COMMA.keyword();
            while (COMMA.matches(sep)) {
                SWRLDArgument arg = parseDObject();
                args.add(arg);
                sep = peekToken();
                if (COMMA.matches(sep)) {
                    consumeToken();
                }
View Full Code Here

                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(
View Full Code Here

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

    final public SWRLDataRangeAtom DataRangeAtom() throws ParseException {
        OWLDataRange rng;
        SWRLDArgument arg0;
        jj_consume_token(DATARANGEATOM);
        jj_consume_token(OPENPAR);
        rng = DataRange();
        arg0 = DArg();
        jj_consume_token(CLOSEPAR);
View Full Code Here

    }

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

    final public SWRLBuiltInAtom BuiltInAtom() throws ParseException {
        IRI iri;
        List<SWRLDArgument> args;
        ;
        SWRLDArgument arg;
        jj_consume_token(BUILTINATOM);
        jj_consume_token(OPENPAR);
        args = new ArrayList<SWRLDArgument>();
        iri = IRI();
        arg = DArg();
View Full Code Here

        OWLDataFactory factory = OWLManager.getOWLDataFactory();

        SWRLAtom swrlAtom1 = (SWRLAtom) adapter.adaptTo(argument1, SWRLRule.class);
        SWRLAtom swrlAtom2 = (SWRLAtom) adapter.adaptTo(argument2, SWRLRule.class);

        SWRLDArgument swrldArgument1;
        SWRLDArgument swrldArgument2;

        List<SWRLAtom> listOfArguments = new ArrayList<SWRLAtom>();

        if (swrlAtom1 instanceof HigherOrderSWRLAtom) {
            swrldArgument1 = ((HigherOrderSWRLAtom) swrlAtom1).getBindableArgument();
View Full Code Here

        OWLDataFactory factory = OWLManager.getOWLDataFactory();

        SWRLAtom swrlAtom1 = (SWRLAtom) adapter.adaptTo(argument1, SWRLRule.class);
        SWRLAtom swrlAtom2 = (SWRLAtom) adapter.adaptTo(argument2, SWRLRule.class);

        SWRLDArgument swrldArgument1;
        SWRLDArgument swrldArgument2;

        List<SWRLAtom> listOfArguments = new ArrayList<SWRLAtom>();

        if (swrlAtom1 instanceof HigherOrderSWRLAtom) {
            swrldArgument1 = ((HigherOrderSWRLAtom) swrlAtom1).getBindableArgument();
View Full Code Here

        OWLDataFactory factory = OWLManager.getOWLDataFactory();

        SWRLAtom swrlAtom1 = (SWRLAtom) adapter.adaptTo(argument1, SWRLRule.class);
        SWRLAtom swrlAtom2 = (SWRLAtom) adapter.adaptTo(argument2, SWRLRule.class);

        SWRLDArgument swrldArgument1 = factory.getSWRLVariable(IRI.create(Symbols.variablesPrefix
                                                                          + mul_result));
        SWRLDArgument swrldArgument2;
        SWRLDArgument swrldArgument3;

        List<SWRLAtom> listOfArguments = new ArrayList<SWRLAtom>();

        if (swrlAtom1 instanceof HigherOrderSWRLAtom) {
            swrldArgument2 = ((HigherOrderSWRLAtom) swrlAtom1).getBindableArgument();
View Full Code Here

        SWRLAtom stringFunctionAtom = (SWRLAtom) adapter.adaptTo(stringFunction, SWRLRule.class);
        SWRLAtom startAtom = (SWRLAtom) adapter.adaptTo(start, SWRLRule.class);
        SWRLAtom lengthAtom = (SWRLAtom) adapter.adaptTo(length, SWRLRule.class);

        SWRLDArgument retArgument = factory.getSWRLVariable(IRI.create(Symbols.variablesPrefix
                                                                       + substring_result));
        ;
        SWRLDArgument stringArgument;
        SWRLDArgument startArgument;
        SWRLDArgument lengthArgument;

        List<SWRLAtom> listOfArguments = new ArrayList<SWRLAtom>();

        if (stringFunctionAtom instanceof HigherOrderSWRLAtom) {
            stringArgument = ((HigherOrderSWRLAtom) stringFunctionAtom).getBindableArgument();
View Full Code Here

TOP

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

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.