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


Java Reasoner.setParameter方法代码示例

本文整理汇总了Java中com.hp.hpl.jena.reasoner.Reasoner.setParameter方法的典型用法代码示例。如果您正苦于以下问题:Java Reasoner.setParameter方法的具体用法?Java Reasoner.setParameter怎么用?Java Reasoner.setParameter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.hp.hpl.jena.reasoner.Reasoner的用法示例。


在下文中一共展示了Reasoner.setParameter方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: main

import com.hp.hpl.jena.reasoner.Reasoner; //导入方法依赖的package包/类
public static void main( String[] args )
{
	// load some data that uses RDFS
	Model data = FileManager.get().loadModel("file:data/input/turtle/ex5-data.ttl");

	
	Reasoner reasoner = ReasonerRegistry.getRDFSReasoner();
	reasoner.setParameter(ReasonerVocabulary.PROPsetRDFSLevel, 
               ReasonerVocabulary.RDFS_DEFAULT);
	InfModel infmodel = ModelFactory.createInfModel(reasoner, data );
	
	/* Do a SPARQL Query over the data in the model */
	String queryString = "SELECT ?x  ?z WHERE { ?x <http://www.example.org/example#worksFor> ?z }" ;

	/* Now create and execute the query using a Query object */
	Query query = QueryFactory.create(queryString) ;
	QueryExecution qexec = QueryExecutionFactory.create(query, infmodel) ;

	QueryExecUtils.executeQuery(qexec);
	
	System.out.println( "\n----------\ndone" );
	
}
 
开发者ID:fogbeam,项目名称:JenaTutorial,代码行数:24,代码来源:SparqlQueryWithPropertySubclass.java

示例2: main

import com.hp.hpl.jena.reasoner.Reasoner; //导入方法依赖的package包/类
public static void main( String[] args )
{
	// load some data that uses RDFS
	Model data = FileManager.get().loadModel("file:data/input/turtle/ex13-data.ttl");
	
	Reasoner reasoner = ReasonerRegistry.getRDFSReasoner();
	reasoner.setParameter(ReasonerVocabulary.PROPsetRDFSLevel, 
               ReasonerVocabulary.RDFS_DEFAULT);
	InfModel infmodel = ModelFactory.createInfModel(reasoner, data );
	
	/* Do a SPARQL Query over the data in the model */
	String queryString = "SELECT ?x ?z WHERE { ?x <http://www.w3.org/2000/01/rdf-schema#label> ?z }";

	/* Now create and execute the query using a Query object */
	Query query = QueryFactory.create(queryString) ;
	QueryExecution qexec = QueryExecutionFactory.create(query, infmodel) ;

	QueryExecUtils.executeQuery(qexec);
		
	
	System.out.println( "done" );		
	
}
 
开发者ID:fogbeam,项目名称:JenaTutorial,代码行数:24,代码来源:RDFSLabels.java

示例3: main

import com.hp.hpl.jena.reasoner.Reasoner; //导入方法依赖的package包/类
public static void main( String[] args )
{
	// load some data that uses RDFS
	Model data = FileManager.get().loadModel("file:data/input/turtle/ex12-data.ttl");
	
	Reasoner reasoner = ReasonerRegistry.getRDFSReasoner();
	reasoner.setParameter(ReasonerVocabulary.PROPsetRDFSLevel, 
               ReasonerVocabulary.RDFS_DEFAULT);
	InfModel infmodel = ModelFactory.createInfModel(reasoner, data );
	
	/* Do a SPARQL Query over the data in the model */
	String 	queryString = "SELECT ?x WHERE { ?x <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.example.org/example#Analyst> }";

	/* Now create and execute the query using a Query object */
	Query query = QueryFactory.create(queryString) ;
	QueryExecution qexec = QueryExecutionFactory.create(query, infmodel) ;

	QueryExecUtils.executeQuery(qexec);
	
	System.out.println( "\n---------------\n" );		
	
}
 
开发者ID:fogbeam,项目名称:JenaTutorial,代码行数:23,代码来源:TermReconciliation_Subclass.java

示例4: main

import com.hp.hpl.jena.reasoner.Reasoner; //导入方法依赖的package包/类
public static void main( String[] args )
{
	// load some data that uses RDFS
	Model data = FileManager.get().loadModel("file:data/input/turtle/ex12-data2.ttl");
	
	Reasoner reasoner = ReasonerRegistry.getRDFSReasoner();
	reasoner.setParameter(ReasonerVocabulary.PROPsetRDFSLevel, 
               ReasonerVocabulary.RDFS_DEFAULT);
	InfModel infmodel = ModelFactory.createInfModel(reasoner, data );
	
	/* Do a SPARQL Query over the data in the model */
	String queryString = "SELECT ?x WHERE { ?x <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.example.org/example#Investigator> }";

	/* Now create and execute the query using a Query object */
	Query query = QueryFactory.create(queryString) ;
	QueryExecution qexec = QueryExecutionFactory.create(query, infmodel) ;

	QueryExecUtils.executeQuery(qexec);
	
	
	System.out.println( "\n---------------\n" );		
	
}
 
开发者ID:fogbeam,项目名称:JenaTutorial,代码行数:24,代码来源:TermReconcilation_UnionPattern.java

示例5: main

import com.hp.hpl.jena.reasoner.Reasoner; //导入方法依赖的package包/类
public static void main( String[] args )
{
	// load some data that uses RDFS
	Model data = FileManager.get().loadModel("file:data/input/turtle/ex17-data2.ttl");
	
	
	Reasoner reasoner = ReasonerRegistry.getRDFSReasoner();
	reasoner.setParameter(ReasonerVocabulary.PROPsetRDFSLevel, 
               ReasonerVocabulary.RDFS_DEFAULT);
	InfModel infmodel = ModelFactory.createInfModel(reasoner, data );
	
	/* Do a SPARQL Query over the data in the model */
	String queryString = "SELECT ?x ?z WHERE { ?x <http://cal.example.com/cal#nextDeparture> ?z }";

	/* Now create and execute the query using a Query object */
	Query query = QueryFactory.create(queryString) ;
	QueryExecution qexec = QueryExecutionFactory.create(query, infmodel) ;
			
	QueryExecUtils.executeQuery(qexec);		
	
	System.out.println( "done" );		
	
}
 
开发者ID:fogbeam,项目名称:JenaTutorial,代码行数:24,代码来源:RDFS_CommonProperty.java

示例6: checkInferrayCorrectnessRDFSAndDumpToFiles

import com.hp.hpl.jena.reasoner.Reasoner; //导入方法依赖的package包/类
/**
 * Check the correctness for RDFS FULL, i.e. follow the RDFS specification
 * exactly, even inferring syntactic sugar.
 * <p>
 * Ontology must be in NT format
 * 
 * @param ontologyLocation
 *            where the ontology is on disk
 */
public static void checkInferrayCorrectnessRDFSAndDumpToFiles(
		final String ontologyLocation) {
	// Compute the model processed by Inferray
	final DefaultConfiguration config = new DefaultConfiguration();
	config.setRulesProfile(SupportedProfile.RDFS);
	final Inferray infere = new Inferray(config);
	infere.parse(ontologyLocation);
	infere.process();
	final Model actualModel = ExportUtils.exportToJenaModel(infere);
	// Compute the Jena Model
	final Model intemerdiateModel = ModelFactory.createDefaultModel();
	try {
		final InputStream is = new BufferedInputStream(new FileInputStream(
				ontologyLocation));
		intemerdiateModel.read(is, null, "N-TRIPLE");//
	} catch (final FileNotFoundException e) {
		LOGGER.error("Error reading file", e);
		return;
	}
	final Reasoner reasoner = ReasonerRegistry.getRDFSReasoner();
	reasoner.setParameter(ReasonerVocabulary.PROPsetRDFSLevel,
			ReasonerVocabulary.RDFS_FULL);
	final InfModel expectedModel = ModelFactory.createInfModel(reasoner,
			intemerdiateModel);
	// Compute correctness checking
	final CorrectnessResult result = CorrectnessChecker
			.checkForCorrectness(expectedModel, actualModel);
	result.dumpMissingToFile(new File("missing.nt"));
	result.dumpOverheadToFile(new File("overhead.nt"));
}
 
开发者ID:jsubercaze,项目名称:inferray,代码行数:40,代码来源:InferrayCorrectness.java

示例7: main

import com.hp.hpl.jena.reasoner.Reasoner; //导入方法依赖的package包/类
public static void main( String[] args )
{

	// load some data that uses RDFS
	Model data = FileManager.get().loadModel("file:data/input/turtle/ex2-data.ttl");
	
	
	Reasoner reasoner = ReasonerRegistry.getRDFSReasoner();
	reasoner.setParameter(ReasonerVocabulary.PROPsetRDFSLevel, 
               ReasonerVocabulary.RDFS_DEFAULT);
	
	InfModel infmodel = ModelFactory.createInfModel(reasoner, data );
	
	/* Do a SPARQL Query over the data in the model */
	String queryString = "SELECT ?x WHERE { ?x  <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.example.com/shop#Shirts>}" ;

	/* Now create and execute the query using a Query object */
	Query query = QueryFactory.create(queryString) ;
	QueryExecution qexec = QueryExecutionFactory.create(query, infmodel);

	try
	{
	    ResultSet results = qexec.execSelect() ;
	    while( results.hasNext() )
	    {
	    	QuerySolution soln = results.nextSolution();
	    	System.out.println( "soln: " + soln.toString());
	    }
	}
	finally
	{
		qexec.close();
	}
	
	System.out.println( "done" );
	
}
 
开发者ID:fogbeam,项目名称:JenaTutorial,代码行数:38,代码来源:BasicSparqlQuery.java

示例8: main

import com.hp.hpl.jena.reasoner.Reasoner; //导入方法依赖的package包/类
public static void main( String[] args )
{

	// load some data that uses RDFS
	Model data = FileManager.get().loadModel("file:data/input/turtle/ex2-data.ttl");
	
	
	Reasoner reasoner = ReasonerRegistry.getRDFSReasoner();
	reasoner.setParameter(ReasonerVocabulary.PROPsetRDFSLevel, 
               ReasonerVocabulary.RDFS_DEFAULT);
	
	InfModel infmodel = ModelFactory.createInfModel(reasoner, data );
	
	/* Do a SPARQL Query over the data in the model */
	String queryString = "SELECT ?x WHERE { ?x  <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.example.com/shop#Shirts>}" ;

	/* Now create and execute the query using a Query object */
	Query query = QueryFactory.create(queryString) ;
	QueryExecution qexec = QueryExecutionFactory.create(query, infmodel) ;

	QueryExecUtils.executeQuery(qexec);
	
	System.out.println( "done" );
	
}
 
开发者ID:fogbeam,项目名称:JenaTutorial,代码行数:26,代码来源:BasicSparqlQueryWithQueryExecUtils.java

示例9: main

import com.hp.hpl.jena.reasoner.Reasoner; //导入方法依赖的package包/类
public static void main( String[] args )
{
	// load some data that uses RDFS
	Model data = FileManager.get().loadModel("file:data/input/turtle/ex5-data.ttl");

	
	Reasoner reasoner = ReasonerRegistry.getRDFSReasoner();
	reasoner.setParameter(ReasonerVocabulary.PROPsetRDFSLevel, 
               ReasonerVocabulary.RDFS_DEFAULT);
	InfModel infmodel = ModelFactory.createInfModel(reasoner, data );
	
	/* Do a SPARQL Query over the data in the model */
	String queryString = "SELECT ?x ?y ?z WHERE { ?x ?y ?z }" ;

	/* Now create and execute the query using a Query object */
	Query query = QueryFactory.create(queryString) ;
	QueryExecution qexec = QueryExecutionFactory.create(query, infmodel) ;

	
	QueryExecUtils.executeQuery(qexec);
	
	
	System.out.println( "\n----------\ndone" );
	
}
 
开发者ID:fogbeam,项目名称:JenaTutorial,代码行数:26,代码来源:SparqlQueryForAllTriples.java

示例10: main

import com.hp.hpl.jena.reasoner.Reasoner; //导入方法依赖的package包/类
public static void main(String[] args) 
{
	Dataset dataset = DatasetFactory.createMem();
	
	Reasoner reasoner = ReasonerRegistry.getRDFSReasoner();
	reasoner.setParameter(ReasonerVocabulary.PROPsetRDFSLevel, 
               ReasonerVocabulary.RDFS_DEFAULT);
	
	InfModel infmodel = ModelFactory.createInfModel(reasoner, dataset.getDefaultModel() );
	
	/* Do a SPARQL Query over the data in the model */
	String queryString = 
		"SELECT * WHERE { SERVICE <http://dbpedia.org/sparql> {  <http://dbpedia.org/resource/George_Harrison> ?p ?o . } } LIMIT 10";

	/* Now create and execute the query using a Query object */
	Query query = QueryFactory.create(queryString) ;
	QueryExecution qexec = QueryExecutionFactory.create(query, infmodel) ;		
	
	QueryExecUtils.executeQuery(qexec);
	
	
	System.out.println( "done" );

}
 
开发者ID:fogbeam,项目名称:JenaTutorial,代码行数:25,代码来源:FederatedSparqlQuery.java

示例11: main

import com.hp.hpl.jena.reasoner.Reasoner; //导入方法依赖的package包/类
public static void main( String[] args )
{
	// load some data that uses RDFS
	Model data = FileManager.get().loadModel("file:data/input/turtle/ex9-data.ttl");

	
	Reasoner reasoner = ReasonerRegistry.getRDFSReasoner();
	reasoner.setParameter(ReasonerVocabulary.PROPsetRDFSLevel, 
               ReasonerVocabulary.RDFS_DEFAULT);
	InfModel infmodel = ModelFactory.createInfModel(reasoner, data );
	
	
	
	String queryString = "SELECT ?y WHERE { <http://www.example.org/example#DannyLemon> ?y <http://www.example.org/example#Room101> }";

	/* Now create and execute the query using a Query object */
	Query query = QueryFactory.create(queryString) ;
	QueryExecution qexec = QueryExecutionFactory.create(query, infmodel) ;

	QueryExecUtils.executeQuery(qexec);	
	
	System.out.println( "\n---------------\n" );		
	
}
 
开发者ID:fogbeam,项目名称:JenaTutorial,代码行数:25,代码来源:SubProperty_Multiple.java

示例12: main

import com.hp.hpl.jena.reasoner.Reasoner; //导入方法依赖的package包/类
public static void main( String[] args )
{
	// load some data that uses RDFS
	Model data = FileManager.get().loadModel("file:data/input/turtle/ex11-data.ttl");
	
	
	Reasoner reasoner = ReasonerRegistry.getRDFSReasoner();
	reasoner.setParameter(ReasonerVocabulary.PROPsetRDFSLevel, 
               ReasonerVocabulary.RDFS_DEFAULT);
	InfModel infmodel = ModelFactory.createInfModel(reasoner, data );
			
	
	String queryString = "SELECT ?x ?z WHERE { ?x <http://www.example.org/example#hasPossession> ?z }";

	/* Now create and execute the query using a Query object */
	Query query = QueryFactory.create(queryString) ;
	QueryExecution qexec = QueryExecutionFactory.create(query, infmodel) ;

	QueryExecUtils.executeQuery(qexec);
	
	System.out.println( "\n---------------\n" );		
	
}
 
开发者ID:fogbeam,项目名称:JenaTutorial,代码行数:24,代码来源:AnotherSubpropertyExample.java

示例13: main

import com.hp.hpl.jena.reasoner.Reasoner; //导入方法依赖的package包/类
public static void main( String[] args )
{
	// load some data that uses RDFS
	Model data = FileManager.get().loadModel("file:data/input/turtle/ex8-data.ttl");
	
	Reasoner reasoner = ReasonerRegistry.getRDFSReasoner();
	reasoner.setParameter(ReasonerVocabulary.PROPsetRDFSLevel, 
               ReasonerVocabulary.RDFS_DEFAULT);
	InfModel infmodel = ModelFactory.createInfModel(reasoner, data );

	
	String queryString = "SELECT ?z WHERE { <http://www.example.org/example#Kildaire> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?z  }" ;

	/* Now create and execute the query using a Query object */
	Query query = QueryFactory.create(queryString) ;
	QueryExecution qexec = QueryExecutionFactory.create(query, infmodel) ;

	QueryExecUtils.executeQuery(qexec);		
	
	
	System.out.println( "\n---------------\n" );		
	
	
	
	
}
 
开发者ID:fogbeam,项目名称:JenaTutorial,代码行数:27,代码来源:ShowInferredTypes_Subclass_Multiple.java

示例14: main

import com.hp.hpl.jena.reasoner.Reasoner; //导入方法依赖的package包/类
public static void main( String[] args )
{
	// load some data that uses RDFS
	Model data = FileManager.get().loadModel("file:data/input/turtle/ex10-data.ttl");
	
	Reasoner reasoner = ReasonerRegistry.getRDFSReasoner();
	reasoner.setParameter(ReasonerVocabulary.PROPsetRDFSLevel, 
               ReasonerVocabulary.RDFS_DEFAULT);
	InfModel infmodel = ModelFactory.createInfModel(reasoner, data );
	
	/* Do a SPARQL Query over the data in the model */
	String 	queryString = "SELECT ?x WHERE { ?x <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.example.org/example#AllStarCandidate> }";



	/* Now create and execute the query using a Query object */
	Query query = QueryFactory.create(queryString) ;
	QueryExecution qexec = QueryExecutionFactory.create(query, infmodel) ;


	QueryExecUtils.executeQuery(qexec);
	
	System.out.println( "done" );
	
}
 
开发者ID:fogbeam,项目名称:JenaTutorial,代码行数:26,代码来源:AnotherSubclassExample.java

示例15: main

import com.hp.hpl.jena.reasoner.Reasoner; //导入方法依赖的package包/类
public static void main( String[] args )
{
	// load some data that uses RDFS
	Model data = FileManager.get().loadModel("file:data/input/turtle/ex17-data.ttl");
	
	
	Reasoner reasoner = ReasonerRegistry.getRDFSReasoner();
	reasoner.setParameter(ReasonerVocabulary.PROPsetRDFSLevel, 
               ReasonerVocabulary.RDFS_DEFAULT);
	InfModel infmodel = ModelFactory.createInfModel(reasoner, data );
	
	/* Do a SPARQL Query over the data in the model */
	String queryString = "SELECT ?y ?z WHERE { <http://www.example.org/example#Johanne> ?y ?z }";

	/* Now create and execute the query using a Query object */
	Query query = QueryFactory.create(queryString) ;
	QueryExecution qexec = QueryExecutionFactory.create(query, infmodel) ;

	QueryExecUtils.executeQuery(qexec);
			
	
	System.out.println( "\n---------------\n" );		
	
}
 
开发者ID:fogbeam,项目名称:JenaTutorial,代码行数:25,代码来源:RDFS_WeirdInference.java


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