Package org.apache.stanbol.rules.base.api

Examples of org.apache.stanbol.rules.base.api.RuleAtomCallExeption


        if (classResourceAtom instanceof ArgumentSWRLAtom) {

            classPredicate = factory.getOWLClass(IRI.create(((ArgumentSWRLAtom) classResourceAtom).getId()));
        } else {
            throw new RuleAtomCallExeption(getClass());
        }

        if (argumentAtom instanceof ArgumentSWRLAtom) {
            argumentResource = (SWRLIArgument) ((ArgumentSWRLAtom) argumentAtom).getSwrlArgument();
        } else {
            throw new RuleAtomCallExeption(getClass());
        }

        return (T) factory.getSWRLClassAtom(classPredicate, argumentResource);

    }
View Full Code Here


        SWRLAtom swrlAtom = (SWRLAtom) adapter.adaptTo(uriResource, SWRLRule.class);

        if (swrlAtom instanceof ArgumentSWRLAtom) {
            return (T) swrlAtom;
        } else {
            throw new RuleAtomCallExeption(getClass());
        }

    }
View Full Code Here

        if (predicateAtom instanceof ArgumentSWRLAtom) {
            owlObjectProperty = factory.getOWLObjectProperty(IRI.create(((ArgumentSWRLAtom) predicateAtom)
                    .getId()));
        } else {
            throw new RuleAtomCallExeption(getClass());
        }

        if (subjectAtom instanceof ArgumentSWRLAtom) {
            swrliArgument1 = (SWRLIArgument) ((ArgumentSWRLAtom) subjectAtom).getSwrlArgument();
        } else {
            throw new RuleAtomCallExeption(getClass());
        }
        if (objectAtom instanceof ArgumentSWRLAtom) {
            swrliArgument2 = (SWRLIArgument) ((ArgumentSWRLAtom) objectAtom).getSwrlArgument();
        } else {
            throw new RuleAtomCallExeption(getClass());
        }

        return (T) factory.getSWRLObjectPropertyAtom(owlObjectProperty, swrliArgument1, swrliArgument2);

    }
View Full Code Here

        Node classNode;

        if (argumentClauseEntry instanceof NodeClauseEntry) {
            argumnetNode = ((NodeClauseEntry) argumentClauseEntry).getNode();
        } else {
            throw new RuleAtomCallExeption(getClass());
        }

        if (classClauseEntry instanceof NodeClauseEntry) {
            classNode = ((NodeClauseEntry) classClauseEntry).getNode();
        } else {
            throw new RuleAtomCallExeption(getClass());
        }

        return (T) new TriplePattern(argumnetNode, Node_RuleVariable.createURI(RDF.type.getURI()), classNode);

    }
View Full Code Here

        if (arg instanceof Variable) {
            argumentExpression = (Variable) arg;
        } else if (arg instanceof UriRef) {
            argumentExpression = new UriRefExpression((UriRef) arg);
        } else {
            throw new RuleAtomCallExeption(getClass());
        }

        List<Expression> expressions = new ArrayList<Expression>();
        expressions.add(argumentExpression);
View Full Code Here

        if (arg1 instanceof Variable) {
            subject = new UriRefOrVariable((Variable) arg1);
        } else if (arg1 instanceof UriRef) {
            subject = new UriRefOrVariable((UriRef) arg1);
        } else {
            throw new RuleAtomCallExeption(getClass());
        }

        if (dt instanceof Variable) {
            predicate = new UriRefOrVariable((Variable) dt);
        } else if (dt instanceof UriRef) {
            predicate = new UriRefOrVariable((UriRef) dt);
        } else {
            throw new RuleAtomCallExeption(getClass());
        }

        if (arg2 instanceof Variable) {
            object = new UriRefOrVariable((Variable) arg2);
        } else if (dt instanceof UriRef) {
            object = new UriRefOrVariable((UriRef) arg2);
        } else {
            throw new RuleAtomCallExeption(getClass());
        }

        return (T) new ClerezzaSparqlObject(new SimpleTriplePattern(subject, predicate, object));

    }
View Full Code Here

        if (arg1 instanceof Variable) {
            subject = new UriRefOrVariable((Variable) arg1);
        } else if (arg1 instanceof UriRef) {
            subject = new UriRefOrVariable((UriRef) arg1);
        } else {
            throw new RuleAtomCallExeption(getClass());
        }

        if (dt instanceof Variable) {
            predicate = new UriRefOrVariable((Variable) dt);
        } else if (dt instanceof UriRef) {
            predicate = new UriRefOrVariable((UriRef) dt);
        } else {
            throw new RuleAtomCallExeption(getClass());
        }

        if (arg2 instanceof Variable) {
            object = new ResourceOrVariable((Variable) arg2);
        } else if (arg2 instanceof LiteralExpression) {
            object = new ResourceOrVariable(((LiteralExpression) arg2).getLiteral());
        } else {
            throw new RuleAtomCallExeption(getClass());
        }

        return (T) new ClerezzaSparqlObject(new SimpleTriplePattern(subject, predicate, object));

    }
View Full Code Here

        if (predicateAtom instanceof ArgumentSWRLAtom) {
            owlDataProperty = factory.getOWLDataProperty(IRI.create(((ArgumentSWRLAtom) predicateAtom)
                    .getId()));
        } else {
            throw new RuleAtomCallExeption(getClass());
        }

        if (arg1Atom instanceof ArgumentSWRLAtom) {
            swrliArgument = (SWRLIArgument) ((ArgumentSWRLAtom) arg1Atom).getSwrlArgument();
        } else {
            throw new RuleAtomCallExeption(getClass());
        }
        if (arg2Atom instanceof ArgumentSWRLAtom) {
            swrldArgument = (SWRLDArgument) ((ArgumentSWRLAtom) arg2Atom).getSwrlArgument();
        } else {
            throw new RuleAtomCallExeption(getClass());
        }

        return (T) factory.getSWRLDataPropertyAtom(owlDataProperty, swrliArgument, swrldArgument);

    }
View Full Code Here

        if (arg instanceof Variable) {
            subject = new UriRefOrVariable((Variable) arg);
        } else if (arg instanceof UriRef) {
            subject = new UriRefOrVariable((UriRef) arg);
        } else {
            throw new RuleAtomCallExeption(getClass());
        }

        if (cl instanceof Variable) {
            object = new ResourceOrVariable((Variable) cl);
        } else if (cl instanceof UriRef) {
            object = new ResourceOrVariable((UriRef) cl);
        } else {
            throw new RuleAtomCallExeption(getClass());
        }

        return (T) new ClerezzaSparqlObject(new SimpleTriplePattern(subject, predicate, object));

    }
View Full Code Here

            List<ClauseEntry> clauseEntries = new ArrayList<ClauseEntry>();
            clauseEntries.add(functor);
            return (T) new HigherOrderClauseEntry(node, clauseEntries);

        } else {
            throw new RuleAtomCallExeption(getClass());
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.stanbol.rules.base.api.RuleAtomCallExeption

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.