Package org.semanticweb.owl.util

Examples of org.semanticweb.owl.util.SWRLVariableExtractor



    public Set<SWRLAtomVariable> getVariables() {
        if(variables == null) {
            Set<SWRLAtomVariable> vars = new HashSet<SWRLAtomVariable>();
            SWRLVariableExtractor extractor = new SWRLVariableExtractor();
            accept(extractor);
            vars.addAll(extractor.getIVariables());
            vars.addAll(extractor.getDVariables());
            variables = new HashSet<SWRLAtomVariable>(vars);
        }
        return variables;
    }
View Full Code Here



    public Set<SWRLAtomDVariable> getDVariables() {
        if(dVariables == null) {
            Set<SWRLAtomDVariable> vars = new HashSet<SWRLAtomDVariable>();
            SWRLVariableExtractor extractor = new SWRLVariableExtractor();
            accept(extractor);
            vars.addAll(extractor.getDVariables());
            dVariables = new HashSet<SWRLAtomDVariable>(vars);
        }
        return dVariables;
    }
View Full Code Here


    public Set<SWRLAtomIVariable> getIVariables() {
         if(iVariables == null) {
            Set<SWRLAtomIVariable> vars = new HashSet<SWRLAtomIVariable>();
            SWRLVariableExtractor extractor = new SWRLVariableExtractor();
            accept(extractor);
            vars.addAll(extractor.getIVariables());
            iVariables = new HashSet<SWRLAtomIVariable>(vars);
        }
        return iVariables;
    }
View Full Code Here

        Set<SWRLRule> ruleAxioms = ontology.getRules();
        createGraph(ruleAxioms);
        if (!ruleAxioms.isEmpty()) {
            writeBanner("Rules");
            SWRLVariableExtractor variableExtractor = new SWRLVariableExtractor();
            for (SWRLRule rule : ruleAxioms) {
                beginObject();
                if (!rule.isAnonymous()) {
                    render(new RDFResourceNode(rule.getURI()));
                }
                rule.accept(variableExtractor);
                endObject();
            }
            for (SWRLAtomVariable var : variableExtractor.getIVariables()) {
                render(new RDFResourceNode(var.getURI()));
            }

            for (SWRLAtomVariable var : variableExtractor.getDVariables()) {
                render(new RDFResourceNode(var.getURI()));
            }
            renderAnonRoots();
        }
View Full Code Here

TOP

Related Classes of org.semanticweb.owl.util.SWRLVariableExtractor

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.