1 10 package com.hp.hpl.jena.reasoner.rulesys; 11 12 13 import com.hp.hpl.jena.reasoner.*; 14 import com.hp.hpl.jena.reasoner.rulesys.Util; 15 import com.hp.hpl.jena.reasoner.transitiveReasoner.TransitiveReasoner; 16 import com.hp.hpl.jena.rdf.model.*; 17 import com.hp.hpl.jena.vocabulary.*; 18 19 35 public class OWLMicroReasonerFactory implements ReasonerFactory { 36 37 38 private static ReasonerFactory theInstance = new OWLMicroReasonerFactory(); 39 40 41 public static final String URI = "http://jena.hpl.hp.com/2003/OWLMicroFBRuleReasoner"; 42 43 44 protected Model capabilities; 45 46 49 public static ReasonerFactory theInstance() { 50 return theInstance; 51 } 52 53 58 public Reasoner create(Resource configuration) { 59 OWLMicroReasoner reasoner = new OWLMicroReasoner(this); 60 if (configuration != null) { 61 Boolean doLog = Util.checkBinaryPredicate(ReasonerVocabulary.PROPderivationLogging, configuration); 62 if (doLog != null) { 63 reasoner.setDerivationLogging(doLog.booleanValue()); 64 } 65 Boolean doTrace = Util.checkBinaryPredicate(ReasonerVocabulary.PROPtraceOn, configuration); 66 if (doTrace != null) { 67 reasoner.setTraceOn(doTrace.booleanValue()); 68 } 69 } 70 return reasoner; 71 } 72 73 78 public Model getCapabilities() { 79 if (capabilities == null) { 80 capabilities = ModelFactory.createDefaultModel(); 81 Resource base = capabilities.createResource(getURI()); 82 base.addProperty(ReasonerVocabulary.nameP, "OWL Mini Reasoner") 83 .addProperty(ReasonerVocabulary.descriptionP, "Experimental mini OWL reasoner.\n" 84 + "Can separate tbox and abox data if desired to reuse tbox caching or mix them.") 85 .addProperty(ReasonerVocabulary.supportsP, RDFS.subClassOf) 86 .addProperty(ReasonerVocabulary.supportsP, RDFS.subPropertyOf) 87 .addProperty(ReasonerVocabulary.supportsP, RDFS.member) 88 .addProperty(ReasonerVocabulary.supportsP, RDFS.range) 89 .addProperty(ReasonerVocabulary.supportsP, RDFS.domain) 90 .addProperty(ReasonerVocabulary.supportsP, TransitiveReasoner.directSubClassOf) 91 .addProperty(ReasonerVocabulary.supportsP, TransitiveReasoner.directSubPropertyOf) 92 .addProperty(ReasonerVocabulary.supportsP, OWL.ObjectProperty ) 94 .addProperty(ReasonerVocabulary.supportsP, OWL.DatatypeProperty) 95 .addProperty(ReasonerVocabulary.supportsP, OWL.FunctionalProperty ) 96 .addProperty(ReasonerVocabulary.supportsP, OWL.SymmetricProperty ) 97 .addProperty(ReasonerVocabulary.supportsP, OWL.TransitiveProperty ) 98 .addProperty(ReasonerVocabulary.supportsP, OWL.InverseFunctionalProperty ) 99 100 .addProperty(ReasonerVocabulary.supportsP, OWL.hasValue ) 101 .addProperty(ReasonerVocabulary.supportsP, OWL.intersectionOf ) 102 .addProperty(ReasonerVocabulary.supportsP, OWL.unionOf ) 104 .addProperty(ReasonerVocabulary.versionP, "0.1"); 105 } 106 return capabilities; 107 } 108 109 112 public String getURI() { 113 return URI; 114 } 115 116 } 117 118 | Popular Tags |