1 10 package com.hp.hpl.jena.reasoner.rulesys; 11 12 import com.hp.hpl.jena.reasoner.*; 13 import com.hp.hpl.jena.reasoner.rulesys.Util; 14 import com.hp.hpl.jena.reasoner.transitiveReasoner.TransitiveReasoner; 15 import com.hp.hpl.jena.rdf.model.*; 16 import com.hp.hpl.jena.vocabulary.*; 17 18 30 public class OWLMiniReasonerFactory implements ReasonerFactory { 31 32 33 private static ReasonerFactory theInstance = new OWLMiniReasonerFactory(); 34 35 36 public static final String URI = "http://jena.hpl.hp.com/2003/OWLMiniFBRuleReasoner"; 37 38 39 protected Model capabilities; 40 41 44 public static ReasonerFactory theInstance() { 45 return theInstance; 46 } 47 48 53 public Reasoner create(Resource configuration) { 54 OWLMiniReasoner reasoner = new OWLMiniReasoner(this); 55 if (configuration != null) { 56 Boolean doLog = Util.checkBinaryPredicate(ReasonerVocabulary.PROPderivationLogging, configuration); 57 if (doLog != null) { 58 reasoner.setDerivationLogging(doLog.booleanValue()); 59 } 60 Boolean doTrace = Util.checkBinaryPredicate(ReasonerVocabulary.PROPtraceOn, configuration); 61 if (doTrace != null) { 62 reasoner.setTraceOn(doTrace.booleanValue()); 63 } 64 } 65 return reasoner; 66 } 67 68 73 public Model getCapabilities() { 74 if (capabilities == null) { 75 capabilities = ModelFactory.createDefaultModel(); 76 Resource base = capabilities.createResource(getURI()); 77 base.addProperty(ReasonerVocabulary.nameP, "OWL Mini Reasoner") 78 .addProperty(ReasonerVocabulary.descriptionP, "Experimental mini OWL reasoner.\n" 79 + "Can separate tbox and abox data if desired to reuse tbox caching or mix them.") 80 .addProperty(ReasonerVocabulary.supportsP, RDFS.subClassOf) 81 .addProperty(ReasonerVocabulary.supportsP, RDFS.subPropertyOf) 82 .addProperty(ReasonerVocabulary.supportsP, RDFS.member) 83 .addProperty(ReasonerVocabulary.supportsP, RDFS.range) 84 .addProperty(ReasonerVocabulary.supportsP, RDFS.domain) 85 .addProperty(ReasonerVocabulary.supportsP, TransitiveReasoner.directSubClassOf) 86 .addProperty(ReasonerVocabulary.supportsP, TransitiveReasoner.directSubPropertyOf) 87 .addProperty(ReasonerVocabulary.supportsP, ReasonerVocabulary.individualAsThingP ) 89 .addProperty(ReasonerVocabulary.supportsP, OWL.ObjectProperty ) 90 .addProperty(ReasonerVocabulary.supportsP, OWL.DatatypeProperty) 91 .addProperty(ReasonerVocabulary.supportsP, OWL.FunctionalProperty ) 92 .addProperty(ReasonerVocabulary.supportsP, OWL.SymmetricProperty ) 93 .addProperty(ReasonerVocabulary.supportsP, OWL.TransitiveProperty ) 94 .addProperty(ReasonerVocabulary.supportsP, OWL.InverseFunctionalProperty ) 95 96 .addProperty(ReasonerVocabulary.supportsP, OWL.hasValue ) 97 .addProperty(ReasonerVocabulary.supportsP, OWL.intersectionOf ) 98 .addProperty(ReasonerVocabulary.supportsP, OWL.unionOf ) .addProperty(ReasonerVocabulary.supportsP, OWL.maxCardinality ) .addProperty(ReasonerVocabulary.supportsP, OWL.cardinality ) .addProperty(ReasonerVocabulary.supportsP, OWL.allValuesFrom ) .addProperty(ReasonerVocabulary.supportsP, OWL.sameAs ) 103 .addProperty(ReasonerVocabulary.supportsP, OWL.differentFrom ) 104 .addProperty(ReasonerVocabulary.supportsP, OWL.disjointWith ) 105 106 .addProperty(ReasonerVocabulary.versionP, "0.1"); 107 } 108 return capabilities; 109 } 110 111 114 public String getURI() { 115 return URI; 116 } 117 118 } 119 120 121 | Popular Tags |