本文整理汇总了Java中org.dllearner.reasoning.SPARQLReasoner类的典型用法代码示例。如果您正苦于以下问题:Java SPARQLReasoner类的具体用法?Java SPARQLReasoner怎么用?Java SPARQLReasoner使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SPARQLReasoner类属于org.dllearner.reasoning包,在下文中一共展示了SPARQLReasoner类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: TripleConverterPortuguese
import org.dllearner.reasoning.SPARQLReasoner; //导入依赖的package包/类
public TripleConverterPortuguese(QueryExecutionFactory qef, PropertyVerbalizerPortuguese propertyVerbalizer,
IRIConverter uriConverter, String cacheDirectory, Dictionary wordnetDirectory, Lexicon lexicon) {
if (uriConverter == null) {
uriConverter = new DefaultIRIConverterPortuguese(qef, cacheDirectory);
}
this.uriConverter = uriConverter;
if (propertyVerbalizer == null) {
propertyVerbalizer = new PropertyVerbalizerPortuguese(uriConverter, wordnetDirectory);
}
pp = propertyVerbalizer;
if (lexicon == null) {
lexicon = new XMLLexicon();
}
nlgFactory = new NLGFactory(lexicon);
realiser = new Realiser();
literalConverter = new LiteralConverterPortuguese(uriConverter);
literalConverter.setEncapsulateStringLiterals(encapsulateStringLiterals);
reasoner = new SPARQLReasoner(qef);
genderDetector = new DictionaryBasedGenderDetector();
}
示例2: TripleConverter
import org.dllearner.reasoning.SPARQLReasoner; //导入依赖的package包/类
public TripleConverter(QueryExecutionFactory qef, PropertyVerbalizer propertyVerbalizer, IRIConverter uriConverter,
String cacheDirectory, Dictionary wordnetDirectory, Lexicon lexicon) {
if (uriConverter == null) {
uriConverter = new DefaultIRIConverter(qef, cacheDirectory);
}
this.uriConverter = uriConverter;
if (propertyVerbalizer == null) {
propertyVerbalizer = new PropertyVerbalizer(uriConverter, wordnetDirectory);
}
pp = propertyVerbalizer;
if (lexicon == null) {
lexicon = Lexicon.getDefaultLexicon();
}
nlgFactory = new NLGFactory(lexicon);
realiser = new Realiser(lexicon);
literalConverter = new LiteralConverter(uriConverter);
literalConverter.setEncapsulateStringLiterals(encapsulateStringLiterals);
reasoner = new SPARQLReasoner(qef);
genderDetector = new DictionaryBasedGenderDetector();
}
示例3: getClassesInstances
import org.dllearner.reasoning.SPARQLReasoner; //导入依赖的package包/类
/**
* get for each class n instances and compute the CBD for each instance
* @param maxNrOfClasses
* @param maxNrOfInstancesPerClass
* @param model
* @param reasoner
* @param cbdGen
* @param classes
* @author sherif
*/
private static void getClassesInstances(int maxNrOfClasses,
int maxNrOfInstancesPerClass, Model model, SPARQLReasoner reasoner,
ConciseBoundedDescriptionGenerator cbdGen, Set<OWLClass> classes) {
int i = 0;
for (OWLClass cls : classes) {
logger.debug("\t...processing class " + cls + "...");
SortedSet<OWLIndividual> individuals = reasoner.getIndividuals(cls, maxNrOfInstancesPerClass*2);
Model classSample = ModelFactory.createDefaultModel();
int cnt = 0;
Model cbd;
for (OWLIndividual individual : individuals) {
try {
cbd = cbdGen.getConciseBoundedDescription(individual.toStringID(), maxCBDDepth);
classSample.add(cbd);
if(cnt++ == maxNrOfInstancesPerClass){
break;
}
} catch (Exception e) {
e.printStackTrace();
}
}
model.add(classSample);
if(!classSample.isEmpty()){
i++;
} else {
logger.debug("Skipping empty class " + cls);
}
if(i == maxNrOfClasses){
break;
}
}
}
示例4: LocalKnowledgeBase
import org.dllearner.reasoning.SPARQLReasoner; //导入依赖的package包/类
public LocalKnowledgeBase(Model model, String namespace) throws ComponentInitException {
this.model = model;
this.namespace = namespace;
LocalModelBasedSparqlEndpointKS localModelBasedSparqlEndpointKS = new LocalModelBasedSparqlEndpointKS(model);
localModelBasedSparqlEndpointKS.init();
reasoner = new SPARQLReasoner(localModelBasedSparqlEndpointKS);
reasoner.init();
}
示例5: RemoteKnowledgeBase
import org.dllearner.reasoning.SPARQLReasoner; //导入依赖的package包/类
public RemoteKnowledgeBase(SparqlEndpoint endpoint, ExtractionDBCache cache, String namespace) throws ComponentInitException {
this.endpoint = endpoint;
this.cache = cache;
this.namespace = namespace;
SparqlEndpointKS ks = new SparqlEndpointKS(endpoint);
ks.init();
reasoner = new SPARQLReasoner(ks);
reasoner.init();
}
示例6: TestDLLearnerConfig
import org.dllearner.reasoning.SPARQLReasoner; //导入依赖的package包/类
/**
* @param source
* @param target
*@author sherif
*/
public TestDLLearnerConfig(KnowledgeBase source, KnowledgeBase target, Set<OWLClass> sourceClasses) throws ComponentInitException {
super(source, target, sourceClasses);
SparqlEndpointKS sparqlEndpointKS = new SparqlEndpointKS(endpoint, cacheDirectory);
sparqlEndpointKS.init();
reasoner = new SPARQLReasoner(sparqlEndpointKS);
reasoner.init();
}
示例7: SPARQLFunctionalityDetector
import org.dllearner.reasoning.SPARQLReasoner; //导入依赖的package包/类
public SPARQLFunctionalityDetector(QueryExecutionFactory qef) {
sparqlReasoner = new SPARQLReasoner(qef);
}
示例8: getReasoner
import org.dllearner.reasoning.SPARQLReasoner; //导入依赖的package包/类
@Override
public SPARQLReasoner getReasoner() {
return reasoner;
}
示例9: getReasoner
import org.dllearner.reasoning.SPARQLReasoner; //导入依赖的package包/类
SPARQLReasoner getReasoner();