当前位置: 首页>>代码示例>>Java>>正文


Java SPARQLReasoner类代码示例

本文整理汇总了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();
}
 
开发者ID:dice-group,项目名称:RDF2PT,代码行数:27,代码来源:TripleConverterPortuguese.java

示例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();
}
 
开发者ID:dice-group,项目名称:BENGAL,代码行数:27,代码来源:TripleConverter.java

示例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;
		}
	}
}
 
开发者ID:dice-group,项目名称:LASSIE,代码行数:44,代码来源:KnowledgebaseSampleGenerator.java

示例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();
}
 
开发者ID:dice-group,项目名称:LASSIE,代码行数:10,代码来源:LocalKnowledgeBase.java

示例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();
}
 
开发者ID:dice-group,项目名称:LASSIE,代码行数:11,代码来源:RemoteKnowledgeBase.java

示例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();
}
 
开发者ID:dice-group,项目名称:LASSIE,代码行数:13,代码来源:TestDLLearnerConfig.java

示例7: SPARQLFunctionalityDetector

import org.dllearner.reasoning.SPARQLReasoner; //导入依赖的package包/类
public SPARQLFunctionalityDetector(QueryExecutionFactory qef) {
	sparqlReasoner = new SPARQLReasoner(qef);
}
 
开发者ID:dice-group,项目名称:RDF2PT,代码行数:4,代码来源:SPARQLFunctionalityDetector.java

示例8: getReasoner

import org.dllearner.reasoning.SPARQLReasoner; //导入依赖的package包/类
@Override
public SPARQLReasoner getReasoner() {
	return reasoner;
}
 
开发者ID:dice-group,项目名称:LASSIE,代码行数:5,代码来源:AbstractKnowledgeBase.java

示例9: getReasoner

import org.dllearner.reasoning.SPARQLReasoner; //导入依赖的package包/类
SPARQLReasoner getReasoner(); 
开发者ID:dice-group,项目名称:LASSIE,代码行数:2,代码来源:KnowledgeBase.java


注:本文中的org.dllearner.reasoning.SPARQLReasoner类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。