/** * Get the single static precomputed rule closure. */ protected synchronized InfGraph getPreload() { if (cachePreload && preload == null) { preload = (new FBRuleInfGraph(this, rules, null)); preload.prepare(); } return preload; }
/** * Get the single static precomputed rule closure. */ protected synchronized InfGraph getPreload() { if (cachePreload && preload == null) { preload = (new FBRuleInfGraph(this, rules, null)); preload.prepare(); } return preload; }
/** * Get the single static precomputed rule closure. */ @Override public synchronized InfGraph getPreload() { // Method synchronized - synchronize with other FBRulereasoer sync methods // synchronized block - sync on static synchronized (OWLFBRuleReasoner.class) { if (staticPreload == null) { boolean prior = JenaParameters.enableFilteringOfHiddenInfNodes; try { JenaParameters.enableFilteringOfHiddenInfNodes = true; staticPreload = new FBRuleInfGraph(this, rules, null); staticPreload.prepare(); } finally { JenaParameters.enableFilteringOfHiddenInfNodes = prior; } } return staticPreload; } }
/** * Get the single static precomputed rule closure. */ @Override public synchronized InfGraph getPreload() { // Method synchronized - synchronize with other FBRulereasoer sync methods // synchronized block - sync on static synchronized (OWLFBRuleReasoner.class) { if (staticPreload == null) { boolean prior = JenaParameters.enableFilteringOfHiddenInfNodes; try { JenaParameters.enableFilteringOfHiddenInfNodes = true; staticPreload = new FBRuleInfGraph(this, rules, null); staticPreload.prepare(); } finally { JenaParameters.enableFilteringOfHiddenInfNodes = prior; } } return staticPreload; } }
/** * Get the single static precomputed rule closure. */ @Override protected synchronized InfGraph getPreload() { // We only support this in HYBRID mode if (cachePreload && preload == null && mode == HYBRID) { preload = new FBRuleInfGraph( this, rules, null, Factory.createDefaultGraph() ); if (enableTGCCaching) ((FBRuleInfGraph)preload).setUseTGCCache(); preload.prepare(); } return preload; }
/** * Get the single static precomputed rule closure. */ @Override protected synchronized InfGraph getPreload() { // We only support this in HYBRID mode if (cachePreload && preload == null && mode == HYBRID) { preload = new FBRuleInfGraph( this, rules, null, Factory.createDefaultGraph() ); if (enableTGCCaching) ((FBRuleInfGraph)preload).setUseTGCCache(); preload.prepare(); } return preload; }
/** * Attach the reasoner to a set of RDF data to process. * The reasoner may already have been bound to specific rules or ontology * axioms (encoded in RDF) through earlier bindRuleset calls. * * @param data the RDF data to be processed, some reasoners may restrict * the range of RDF which is legal here (e.g. syntactic restrictions in OWL). * @return an inference graph through which the data+reasoner can be queried. * @throws ReasonerException if the data is ill-formed according to the * constraints imposed by this reasoner. */ @Override public InfGraph bind( Graph data ) throws ReasonerException { Graph schemaArg = schemaGraph == null ? getPreload() : (FBRuleInfGraph) schemaGraph; FBRuleInfGraph graph = new FBRuleInfGraph( this, rules, schemaArg ); graph.setDerivationLogging( recordDerivations ); graph.setTraceOn( traceOn ); graph.rebind( data ); return graph; }
/** * Attach the reasoner to a set of RDF data to process. * The reasoner may already have been bound to specific rules or ontology * axioms (encoded in RDF) through earlier bindRuleset calls. * * @param data the RDF data to be processed, some reasoners may restrict * the range of RDF which is legal here (e.g. syntactic restrictions in OWL). * @return an inference graph through which the data+reasoner can be queried. * @throws ReasonerException if the data is ill-formed according to the * constraints imposed by this reasoner. */ @Override public InfGraph bind( Graph data ) throws ReasonerException { Graph schemaArg = schemaGraph == null ? getPreload() : (FBRuleInfGraph) schemaGraph; FBRuleInfGraph graph = new FBRuleInfGraph( this, rules, schemaArg ); graph.setDerivationLogging( recordDerivations ); graph.setTraceOn( traceOn ); graph.rebind( data ); return graph; }
/** * Precompute the implications of a schema graph. The statements in the graph * will be combined with the data when the final InfGraph is created. */ @Override public Reasoner bindSchema(Graph tbox) throws ReasonerException { if (schemaGraph != null) { throw new ReasonerException("Can only bind one schema at a time to an OWLRuleReasoner"); } FBRuleInfGraph graph = new FBRuleInfGraph(this, rules, getPreload(), tbox); graph.prepare(); FBRuleReasoner fbr = new FBRuleReasoner(rules, graph, factory); fbr.setDerivationLogging(recordDerivations); fbr.setTraceOn(traceOn); return fbr; }
/** * Precompute the implications of a schema graph. The statements in the graph * will be combined with the data when the final InfGraph is created. */ @Override public Reasoner bindSchema(Graph tbox) throws ReasonerException { if (schemaGraph != null) { throw new ReasonerException("Can only bind one schema at a time to an OWLRuleReasoner"); } FBRuleInfGraph graph = new FBRuleInfGraph(this, rules, getPreload(), tbox); graph.prepare(); FBRuleReasoner fbr = new FBRuleReasoner(rules, graph, factory); fbr.setDerivationLogging(recordDerivations); fbr.setTraceOn(traceOn); return fbr; }
/** * Precompute the implications of a schema graph. The statements in the graph * will be combined with the data when the final InfGraph is created. */ @Override public Reasoner bindSchema(Graph tbox) throws ReasonerException { checkArgGraph(tbox); if (schemaGraph != null) { throw new ReasonerException("Can only bind one schema at a time to an OWLRuleReasoner"); } FBRuleInfGraph graph = new FBRuleInfGraph(this, rules, getPreload(), tbox); graph.addPreprocessingHook(new OWLRuleTranslationHook()); graph.prepare(); return new OWLFBRuleReasoner(this, graph); }
/** * Precompute the implications of a schema graph. The statements in the graph * will be combined with the data when the final InfGraph is created. */ @Override public Reasoner bindSchema(Graph tbox) throws ReasonerException { checkArgGraph(tbox); if (schemaGraph != null) { throw new ReasonerException("Can only bind one schema at a time to an OWLRuleReasoner"); } FBRuleInfGraph graph = new FBRuleInfGraph(this, rules, getPreload(), tbox); graph.addPreprocessingHook(new OWLRuleTranslationHook()); graph.prepare(); return new OWLFBRuleReasoner(this, graph); }
/** * Attach the reasoner to a set of RDF data to process. * The reasoner may already have been bound to specific rules or ontology * axioms (encoded in RDF) through earlier bindRuleset calls. * * @param data the RDF data to be processed, some reasoners may restrict * the range of RDF which is legal here (e.g. syntactic restrictions in OWL). * @return an inference graph through which the data+reasoner can be queried. * @throws ReasonerException if the data is ill-formed according to the * constraints imposed by this reasoner. */ @Override public InfGraph bind(Graph data) throws ReasonerException { checkArgGraph(data); FBRuleInfGraph graph = null; InfGraph schemaArg = schemaGraph == null ? getPreload() : (FBRuleInfGraph)schemaGraph; List<Rule> baseRules = ((FBRuleInfGraph)schemaArg).getRules(); graph = new FBRuleInfGraph(this, baseRules, schemaArg); graph.addPreprocessingHook(new OWLRuleTranslationHook()); graph.setDerivationLogging(recordDerivations); graph.setTraceOn(traceOn); graph.rebind(data); graph.setDatatypeRangeValidation(true); return graph; }
/** * Attach the reasoner to a set of RDF data to process. * The reasoner may already have been bound to specific rules or ontology * axioms (encoded in RDF) through earlier bindRuleset calls. * * @param data the RDF data to be processed, some reasoners may restrict * the range of RDF which is legal here (e.g. syntactic restrictions in OWL). * @return an inference graph through which the data+reasoner can be queried. * @throws ReasonerException if the data is ill-formed according to the * constraints imposed by this reasoner. */ @Override public InfGraph bind(Graph data) throws ReasonerException { checkArgGraph(data); FBRuleInfGraph graph = null; InfGraph schemaArg = schemaGraph == null ? getPreload() : (FBRuleInfGraph)schemaGraph; List<Rule> baseRules = ((FBRuleInfGraph)schemaArg).getRules(); graph = new FBRuleInfGraph(this, baseRules, schemaArg); graph.addPreprocessingHook(new OWLRuleTranslationHook()); graph.setDerivationLogging(recordDerivations); graph.setTraceOn(traceOn); graph.rebind(data); graph.setDatatypeRangeValidation(true); return graph; }
/** * Precompute the implications of a schema graph. The statements in the graph * will be combined with the data when the final InfGraph is created. */ @Override public Reasoner bindSchema(Graph tbox) throws ReasonerException { if (schemaGraph != null) { throw new ReasonerException("Can only bind one schema at a time to an RDFSRuleReasoner"); } FBRuleInfGraph graph = new FBRuleInfGraph(this, rules, getPreload(), tbox); if (enableTGCCaching) (graph).setUseTGCCache(); graph.prepare(); RDFSRuleReasoner grr = new RDFSRuleReasoner(graph, factory); grr.setDerivationLogging(recordDerivations); grr.setTraceOn(traceOn); grr.setTransitiveClosureCaching(enableTGCCaching); grr.setFunctorFiltering(filterFunctors); if (preprocessorHooks != null) { for (RulePreprocessHook rulePreprocessHook : preprocessorHooks) { grr.addPreprocessingHook(rulePreprocessHook); } } return grr; }
/** * Precompute the implications of a schema graph. The statements in the graph * will be combined with the data when the final InfGraph is created. */ @Override public Reasoner bindSchema(Graph tbox) throws ReasonerException { if (schemaGraph != null) { throw new ReasonerException("Can only bind one schema at a time to an RDFSRuleReasoner"); } FBRuleInfGraph graph = new FBRuleInfGraph(this, rules, getPreload(), tbox); if (enableTGCCaching) (graph).setUseTGCCache(); graph.prepare(); RDFSRuleReasoner grr = new RDFSRuleReasoner(graph, factory); grr.setDerivationLogging(recordDerivations); grr.setTraceOn(traceOn); grr.setTransitiveClosureCaching(enableTGCCaching); grr.setFunctorFiltering(filterFunctors); if (preprocessorHooks != null) { for (RulePreprocessHook rulePreprocessHook : preprocessorHooks) { grr.addPreprocessingHook(rulePreprocessHook); } } return grr; }
} else { List<Rule> ruleSet = rules; graph = new FBRuleInfGraph(this, ruleSet, getPreload(), tbox); if (enableTGCCaching) ((FBRuleInfGraph)graph).setUseTGCCache(); ((FBRuleInfGraph)graph).prepare();
} else { List<Rule> ruleSet = rules; graph = new FBRuleInfGraph(this, ruleSet, getPreload(), tbox); if (enableTGCCaching) ((FBRuleInfGraph)graph).setUseTGCCache(); ((FBRuleInfGraph)graph).prepare();
} else { List<Rule> ruleSet = ((FBRuleInfGraph)schemaArg).getRules(); FBRuleInfGraph fbgraph = new FBRuleInfGraph(this, ruleSet, schemaArg); graph = fbgraph; if (enableTGCCaching) fbgraph.setUseTGCCache();
} else { List<Rule> ruleSet = ((FBRuleInfGraph)schemaArg).getRules(); FBRuleInfGraph fbgraph = new FBRuleInfGraph(this, ruleSet, schemaArg); graph = fbgraph; if (enableTGCCaching) fbgraph.setUseTGCCache();