Examples of SWRLVariableExtractor


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

Examples of org.semanticweb.owl.util.SWRLVariableExtractor


    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

Examples of org.semanticweb.owl.util.SWRLVariableExtractor


    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

Examples of org.semanticweb.owl.util.SWRLVariableExtractor

        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

Examples of org.semanticweb.owlapi.util.SWRLVariableExtractor

            toReturn = variables.get();
        }
        if (toReturn != null) {
            return toReturn;
        }
        SWRLVariableExtractor extractor = new SWRLVariableExtractor();
        accept(extractor);
        toReturn = extractor.getVariables();
        variables = new WeakReference<>(toReturn);
        return toReturn;
    }
View Full Code Here

Examples of org.semanticweb.owlapi.util.SWRLVariableExtractor

    private void renderSWRLRules() throws IOException {
        Set<SWRLRule> ruleAxioms = ontology.getAxioms(AxiomType.SWRL_RULE);
        createGraph(ruleAxioms);
        if (!ruleAxioms.isEmpty()) {
            writeBanner(RULES_BANNER_TEXT);
            SWRLVariableExtractor variableExtractor = new SWRLVariableExtractor();
            for (SWRLRule rule : ruleAxioms) {
                rule.accept(variableExtractor);
            }
            for (SWRLVariable var : variableExtractor.getVariables()) {
                render(new RDFResourceIRI(var.getIRI()));
            }
            renderAnonRoots();
        }
    }
View Full Code Here

Examples of org.semanticweb.owlapi.util.SWRLVariableExtractor

        Set<SWRLRule> ruleAxioms = ontology.getAxioms(AxiomType.SWRL_RULE);
        createGraph(ruleAxioms);
        if (!ruleAxioms.isEmpty()) {
            writeBanner("Rules");
            SWRLVariableExtractor variableExtractor = new SWRLVariableExtractor();
            for (SWRLRule rule : ruleAxioms) {
                rule.accept(variableExtractor);
            }
            for (SWRLVariable var : variableExtractor.getVariables()) {
                render(new RDFResourceNode(var.getIRI()));
            }

            renderAnonRoots();
        }
View Full Code Here

Examples of org.semanticweb.owlapi.util.SWRLVariableExtractor


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

Examples of org.semanticweb.owlapi.util.SWRLVariableExtractor

        Set<SWRLRule> ruleAxioms = ontology.getAxioms(AxiomType.SWRL_RULE);
        createGraph(ruleAxioms);
        if (!ruleAxioms.isEmpty()) {
            writeBanner("Rules");
            SWRLVariableExtractor variableExtractor = new SWRLVariableExtractor();
            for (SWRLRule rule : ruleAxioms) {
                rule.accept(variableExtractor);
            }
            for (SWRLVariable var : variableExtractor.getVariables()) {
                render(new RDFResourceNode(var.getIRI()));
            }

            renderAnonRoots();
        }
View Full Code Here

Examples of org.semanticweb.owlapi.util.SWRLVariableExtractor


    public Set<SWRLVariable> getVariables() {
        if (variables == null) {
            Set<SWRLVariable> vars = new HashSet<SWRLVariable>();
            SWRLVariableExtractor extractor = new SWRLVariableExtractor();
            accept(extractor);
            vars.addAll(extractor.getVariables());
            variables = new HashSet<SWRLVariable>(vars);
        }
        return variables;
    }
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.