1 10 package com.hp.hpl.jena.reasoner.rulesys.impl.oldCode; 11 12 13 import com.hp.hpl.jena.reasoner.*; 14 import com.hp.hpl.jena.reasoner.rulesys.Util; 15 import com.hp.hpl.jena.rdf.model.*; 16 import com.hp.hpl.jena.vocabulary.*; 17 18 39 public class OWLRuleReasonerFactory implements ReasonerFactory { 40 41 42 private static ReasonerFactory theInstance = new OWLRuleReasonerFactory(); 43 44 45 public static final String URI = "http://jena.hpl.hp.com/2003/OWLRuleReasoner"; 46 47 48 protected Model capabilities; 49 50 53 public static ReasonerFactory theInstance() { 54 return theInstance; 55 } 56 57 63 public Reasoner create(Resource configuration) { 64 OWLRuleReasoner reasoner = new OWLRuleReasoner(); 65 if (configuration != null) { 66 Boolean doLog = Util.checkBinaryPredicate(ReasonerVocabulary.PROPderivationLogging, configuration); 67 if (doLog != null) { 68 reasoner.setDerivationLogging(doLog.booleanValue()); 69 } 70 Boolean doTrace = Util.checkBinaryPredicate(ReasonerVocabulary.PROPtraceOn, configuration); 71 if (doTrace != null) { 72 reasoner.setTraceOn(doTrace.booleanValue()); 73 } 74 } 75 return reasoner; 76 } 77 78 83 public Model getCapabilities() { 84 if (capabilities == null) { 85 capabilities = ModelFactory.createDefaultModel(); 86 Resource base = capabilities.createResource(getURI()); 87 base.addProperty(ReasonerVocabulary.nameP, "OWL Rule Reasoner") 88 .addProperty(ReasonerVocabulary.descriptionP, "Experimental OWL reasoner.\n" 89 + "Pure forward chaining so all entailments are immediate calculated\n" 90 + "Can separate tbox and abox data if desired to reuse tbox caching or mix them.") 91 .addProperty(ReasonerVocabulary.supportsP, RDFS.subClassOf) 92 .addProperty(ReasonerVocabulary.supportsP, RDFS.subPropertyOf) 93 .addProperty(ReasonerVocabulary.supportsP, RDFS.member) 94 .addProperty(ReasonerVocabulary.supportsP, RDFS.range) 95 .addProperty(ReasonerVocabulary.supportsP, RDFS.domain) 96 .addProperty(ReasonerVocabulary.supportsP, ReasonerVocabulary.individualAsThingP ) 98 .addProperty(ReasonerVocabulary.versionP, "0.1"); 99 } 100 return capabilities; 101 } 102 103 106 public String getURI() { 107 return URI; 108 } 109 110 } 111 112 141 142 | Popular Tags |