當前位置: 首頁>>代碼示例>>Java>>正文


Java ReasonerException類代碼示例

本文整理匯總了Java中com.hp.hpl.jena.reasoner.ReasonerException的典型用法代碼示例。如果您正苦於以下問題:Java ReasonerException類的具體用法?Java ReasonerException怎麽用?Java ReasonerException使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ReasonerException類屬於com.hp.hpl.jena.reasoner包,在下文中一共展示了ReasonerException類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: bindSchema

import com.hp.hpl.jena.reasoner.ReasonerException; //導入依賴的package包/類
@Override
public Reasoner bindSchema(final Graph tbox) throws ReasonerException {
	if (LOGGER.isTraceEnabled()) {
		LOGGER.trace("Binding schema graph");
	}
	return new InferrayReasoner(tbox, capabilities);

}
 
開發者ID:jsubercaze,項目名稱:inferray,代碼行數:9,代碼來源:InferrayReasoner.java

示例2: bind

import com.hp.hpl.jena.reasoner.ReasonerException; //導入依賴的package包/類
@Override
public InferrayInfGraph bind(final Graph data) throws ReasonerException {
	if (LOGGER.isTraceEnabled()) {
		LOGGER.trace("Binding graph with profile " + profile);
	}
	return new InferrayInfGraph(data, this, profile);
}
 
開發者ID:jsubercaze,項目名稱:inferray,代碼行數:8,代碼來源:InferrayReasoner.java

示例3: allMonotonic

import com.hp.hpl.jena.reasoner.ReasonerException; //導入依賴的package包/類
private boolean allMonotonic(ClauseEntry[] elts) {
    for (int i = 0; i < elts.length; i++) {
        ClauseEntry elt = elts[i];
        if (elt instanceof Functor) {
            Builtin b = ((Functor)elt).getImplementor();
            if (b != null) {
                if (! b.isMonotonic() ) return false;
            } else {
                throw new ReasonerException("Undefined Functor " + ((Functor)elt).getName() +" in " + toShortString());
            }
        }
    }
    return true;
}
 
開發者ID:jacekkopecky,項目名稱:parkjam,代碼行數:15,代碼來源:Rule.java

示例4: execute

import com.hp.hpl.jena.reasoner.ReasonerException; //導入依賴的package包/類
/**
 * Execute a single rule firing. 
 */
public static void execute(RETERuleContext context, boolean isAdd) {
    Rule rule = context.getRule();
    BindingEnvironment env = context.getEnv();
    ForwardRuleInfGraphI infGraph = (ForwardRuleInfGraphI)context.getGraph();
    if (infGraph.shouldTrace()) {
        logger.info("Fired rule: " + rule.toShortString());
    }
    RETEEngine engine = context.getEngine();
    engine.incRuleCount();
    List<Triple> matchList = null;
    if (infGraph.shouldLogDerivations() && isAdd) {
        // Create derivation record
        matchList = new ArrayList<Triple>(rule.bodyLength());
        for (int i = 0; i < rule.bodyLength(); i++) {
            Object clause = rule.getBodyElement(i);
            if (clause instanceof TriplePattern) {
                matchList.add(env.instantiate((TriplePattern)clause));
            } 
        }
    }
    for (int i = 0; i < rule.headLength(); i++) {
        Object hClause = rule.getHeadElement(i);
        if (hClause instanceof TriplePattern) {
            Triple t = env.instantiate((TriplePattern) hClause);
            // Used to filter out triples with literal subjects
            // but this is not necessary
            // if (!t.getSubject().isLiteral()) {
                // Only add the result if it is legal at the RDF level.
                // E.g. RDFS rules can create assertions about literals
                // that we can't record in RDF
                if (isAdd) {
                    if ( ! context.contains(t) ) {
                        engine.addTriple(t, true);
                        if (infGraph.shouldLogDerivations()) {
                            infGraph.logDerivation(t, new RuleDerivation(rule, t, matchList, infGraph));
                        }
                    }
                } else {
                    if ( context.contains(t)) {
                        // Remove the generated triple
                        engine.deleteTriple(t, true);
                    }
                }
          // }
        } else if (hClause instanceof Functor && isAdd) {
            Functor f = (Functor)hClause;
            Builtin imp = f.getImplementor();
            if (imp != null) {
                imp.headAction(f.getBoundArgs(env), f.getArgLength(), context);
            } else {
                throw new ReasonerException("Invoking undefined Functor " + f.getName() +" in " + rule.toShortString());
            }
        } else if (hClause instanceof Rule) {
            Rule r = (Rule)hClause;
            if (r.isBackward()) {
                if (isAdd) {
                    infGraph.addBRule(r.instantiate(env));
                } else {
                    infGraph.deleteBRule(r.instantiate(env));
                }
            } else {
                throw new ReasonerException("Found non-backward subrule : " + r); 
            }
        }
    }        
}
 
開發者ID:jacekkopecky,項目名稱:parkjam,代碼行數:70,代碼來源:RETEConflictSet.java


注:本文中的com.hp.hpl.jena.reasoner.ReasonerException類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。