/** * <p>Answer the reasoner that will be used to infer additional entailed * triples in the ontology model.</p> * @return The reasoner for this specification */ public Reasoner getReasoner() { if (m_reasoner == null && m_rFactory != null) { // we need to create the reasoner // create a new one on each call since reasoners aren't guaranteed to be reusable return m_rFactory.create( null ); } return m_reasoner; }
/** * Determine whether the given property is recognized and treated specially * by this reasoner. This is a convenience packaging of a special case of getCapabilities. * @param property the property which we want to ask the reasoner about, given as a Node since * this is part of the SPI rather than API * @return true if the given property is handled specially by the reasoner. */ @Override public boolean supportsProperty(Property property) { if (factory == null) return false; Model caps = factory.getCapabilities(); Resource root = caps.getResource(factory.getURI()); return caps.contains(root, ReasonerVocabulary.supportsP, property); }
public void testRuleReasonerWrapper() { MockFactory mock = new MockFactory(); ReasonerFactory wrapped = wrap( mock ); assertEquals( MockFactory.capabilities, wrapped.getCapabilities() ); assertEquals( MockFactory.uri, wrapped.getURI() ); assertEquals( MockFactory.reasoner, wrapped.create( null ) ); assertEquals( Arrays.asList( new Object[] {"capabilities", "uri", "create"} ), mock.done ); }
.addProperty(ReasonerVocabulary.PROPderivationLogging, "true"); Reasoner reasoner = reasonerF.create(configuration); long t1 = System.currentTimeMillis(); InfGraph graph = reasoner.bind(premises.getGraph()); Assert.assertTrue("Test: " + test + "\n" + reasonerF.getURI() + "\n" + description, correct);
/** Answer the URI of the underlying ReasonerFactory. */ @Override public String getURI() { return factory.getURI(); } }
/** Answer the capabilities of the underlying ReasonerFactory. */ @Override public Model getCapabilities() { return factory.getCapabilities(); }
public void testRuleReasonerWrapper() { MockFactory mock = new MockFactory(); ReasonerFactory wrapped = wrap( mock ); assertEquals( MockFactory.capabilities, wrapped.getCapabilities() ); assertEquals( MockFactory.uri, wrapped.getURI() ); assertEquals( MockFactory.reasoner, wrapped.create( null ) ); assertEquals( Arrays.asList( new Object[] {"capabilities", "uri", "create"} ), mock.done ); }
.addProperty(ReasonerVocabulary.PROPderivationLogging, "true"); Reasoner reasoner = reasonerF.create(configuration); long t1 = System.currentTimeMillis(); InfGraph graph = reasoner.bind(premises.getGraph()); Assert.assertTrue("Test: " + test + "\n" + reasonerF.getURI() + "\n" + description, correct);
/** Answer the URI of the underlying ReasonerFactory. */ @Override public String getURI() { return factory.getURI(); } }
/** Answer the capabilities of the underlying ReasonerFactory. */ @Override public Model getCapabilities() { return factory.getCapabilities(); }
/** * <p>Answer the reasoner that will be used to infer additional entailed * triples in the ontology model.</p> * @return The reasoner for this specification */ public Reasoner getReasoner() { if (m_reasoner == null && m_rFactory != null) { // we need to create the reasoner // create a new one on each call since reasoners aren't guaranteed to be reusable return m_rFactory.create( null ); } return m_reasoner; }
/** * Determine whether the given property is recognized and treated specially * by this reasoner. This is a convenience packaging of a special case of getCapabilities. * @param property the property which we want to ask the reasoner about, given as a Node since * this is part of the SPI rather than API * @return true if the given property is handled specially by the reasoner. */ @Override public boolean supportsProperty(Property property) { if (factory == null) return false; Model caps = factory.getCapabilities(); Resource root = caps.getResource(factory.getURI()); return caps.contains(root, ReasonerVocabulary.supportsP, property); }
@Override public String getURI() { return rf.getURI(); } };
@Override public Model getCapabilities() { return r.getCapabilities(); }
/** * Prebuilt mini configuration for the default OWL reasoner. This omits bNode * introduction rules which has significant performance gain in some cases and * avoids breaking the find contract. */ public static Reasoner getOWLMiniReasoner() { if (theOWLMiniReasoner == null) theOWLMiniReasoner = OWLMiniReasonerFactory.theInstance().create(null); return theOWLMiniReasoner; }
/** * Register a Reasoner. * @param factory an factory that can be used to create instances of the reasoner */ public void register(ReasonerFactory factory) { reasonerFactories.put(factory.getURI(), factory); Model description = factory.getCapabilities(); if (description != null) { allDescriptions.add(description); } allDescriptions.createResource(factory.getURI()) .addProperty(RDF.type, ReasonerVocabulary.ReasonerClass); }
@Override public String getURI() { return r.getURI(); } };
@Override public Model getCapabilities() { return r.getCapabilities(); }
/** * Return a prebuilt standard configuration for the default RDFS reasoner */ public static Reasoner getRDFSReasoner() { if (theRDFSReasoner == null) theRDFSReasoner = RDFSRuleReasonerFactory.theInstance().create(null); return theRDFSReasoner; }
/** * Determine whether the given property is recognized and treated specially * by this reasoner. This is a convenience packaging of a special case of getCapabilities. * @param property the property which we want to ask the reasoner about, given as a Node since * this is part of the SPI rather than API * @return true if the given property is handled specially by the reasoner. */ @Override public boolean supportsProperty(Property property) { if (factory == null) return false; Model caps = factory.getCapabilities(); Resource root = caps.getResource(factory.getURI()); return caps.contains(root, ReasonerVocabulary.supportsP, property); }