本文整理汇总了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);
}
示例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);
}
示例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;
}
示例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);
}
}
}
}