public JenaOWLReasoningService() { super(ReasonerRegistry.getOWLReasoner()); }
public JenaRDFSReasoningService() { super(ReasonerRegistry.getRDFSReasoner()); }
/** * Return the single global instance of the registry */ public static ReasonerRegistry theRegistry() { if (theRegistry == null) { theRegistry = new ReasonerRegistry(); } return theRegistry; }
/** Answer a ReasonerFactory which delivers reasoners with the given URL <code>reasonerURL</code>. If there is no such reasoner, throw an <code>UnknownreasonerException</code>. */ public static ReasonerFactory getReasonerFactoryByURL( Resource root, Resource reasonerURL ) { String url = reasonerURL.getURI(); ReasonerFactory factory = ReasonerRegistry.theRegistry().getFactory( url ); if (factory == null) throw new UnknownReasonerException( root, reasonerURL ); return factory; } }
/** * Return a property Node which represents the direct version of a * transitively closed property. See <code>makeDirect(String)</code>; * this method makes a new Node with the direct respelling of * <code>node</code>s URI. */ public static Node makeDirect(Node node) { return NodeFactory.createURI( makeDirect( node.getURI() ) ); }
public JenaOWLMiniReasoningService() { super(ReasonerRegistry.getOWLMiniReasoner()); }
/** * Constructor is hidden - go via theRegistry */ private ReasonerRegistry() { allDescriptions = ModelFactory.createDefaultModel(); // Preload the known Jena reasoners register(TransitiveReasonerFactory.theInstance()); register(RDFSRuleReasonerFactory.theInstance()); register(OWLFBRuleReasonerFactory.theInstance()); register(GenericRuleReasonerFactory.theInstance()); register(OWLMicroReasonerFactory.theInstance()); register(OWLMiniReasonerFactory.theInstance()); }
/** * Create and return a new instance of the reasoner identified by * the given uri. * @param uri the uri of the reasoner to be created, expressed as a simple string * @param configuration an optional set of configuration information encoded in RDF this * parameter can be null if no configuration information is required. * @return a reaoner instance * @throws ReasonerException if there is not such reasoner or if there is * some problem during instantiation */ public Reasoner create(String uri, Resource configuration) throws ReasonerException { ReasonerFactory factory = getFactory(uri); if (factory != null) { return factory.create(configuration); } else { throw new ReasonerException("Attempted to instantiate an unknown reasoner: " + uri); } }
Reasoner reasoner = ReasonerRegistry.getRDFSSimpleReasoner().bindSchema(schema); InfModel inf = ModelFactory.createInfModel(reasoner, config);
public static OWLKnowledgeBase newKB() { if (!OWLSConfigurations.instance().usePellet()) { BSDFLogger.getLogger().info("Creates a KB using OWLMicroReasoner"); OWLKnowledgeBase kb = OWLFactory.createKB(); kb.setReasoner(ReasonerRegistry.getOWLMicroReasoner()); return kb; } else { BSDFLogger.getLogger().info("Creates a KB using Pellet"); return ObjectOWLSTranslator.jenaModelToOWLKnowledgeBase(ModelFactory.createOntologyModel(PelletReasonerFactory.THE_SPEC)); } }
/** compact call to ReasonerRegistry.makeDirect */ private static final Property makeDirect( Property type ) { return ResourceFactory.createProperty( ReasonerRegistry.makeDirect( type.asNode().getURI() ) ); }
public JenaOWLMiniReasoningService() { super(ReasonerRegistry.getOWLMiniReasoner()); }
public JenaRDFSReasoningService() { super(ReasonerRegistry.getRDFSReasoner()); }
public JenaOWLReasoningService() { super(ReasonerRegistry.getOWLReasoner()); }
sc = getModel().getProperty( ReasonerRegistry.makeDirect( sc.asNode() ).getURI() );
/** * Return a Model through which all the RDFS entailments * derivable from the given model are accessible. Some work is done * when the inferenced model is created but each query will also trigger some * additional inference work. * * @param model the Model containing both instance data and schema assertions to be inferenced over */ public static InfModel createRDFSModel(Model model) { Reasoner reasoner = ReasonerRegistry.getRDFSReasoner(); InfGraph graph = reasoner.bind( model.getGraph() ); return new InfModelImpl( graph ); }
void applyReasoning(Reasoning r) { switch(r) { case rdfs: this.jenaModel = ModelFactory.createRDFSModel(this.jenaModel); break; case owl: this.jenaModel = ModelFactory.createInfModel(ReasonerRegistry.getOWLReasoner(), this.jenaModel); break; default: break; } }
/** * Return a Model through which all the RDFS entailments * derivable from the given data and schema models are accessible. * There is no strict requirement to separate schema and instance data between the two * arguments. * * @param model a Model containing instance data assertions * @param schema a Model containing RDFS schema data */ public static InfModel createRDFSModel( Model schema, Model model ) { Reasoner reasoner = ReasonerRegistry.getRDFSReasoner(); InfGraph graph = reasoner.bindSchema(schema.getGraph()).bind(model.getGraph()); return new InfModelImpl( graph ); }
System.out.println("Trying to load " + schemaowl.toString()); Model schema1 = FileManager.get().loadModel(schemaowl.toString()); Reasoner reasoner = ReasonerRegistry.getOWLReasoner(); Reasoner reasonerAll = ReasonerRegistry.getOWLReasoner();
private Model getInfModel(String ttlPath, String ontoPath){ com.hp.hpl.jena.rdf.model.Model jenaModel = RDFDataMgr.loadModel(ttlPath); com.hp.hpl.jena.rdf.model.Model ontoModel = RDFDataMgr.loadModel(ontoPath); com.hp.hpl.jena.rdf.model.Model unionModel = ModelFactory.createUnion(jenaModel,ontoModel); Reasoner reasoner = ReasonerRegistry.getRDFSReasoner(); InfModel infModel = ModelFactory.createInfModel(reasoner, unionModel); Model model2go = new org.ontoware.rdf2go.impl.jena.ModelImplJena(infModel); model2go.open(); return model2go; }