Click here to Skip to main content
15,887,854 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to search text in rdf by sparql query using index, the code is not showing error but returning no result, is should show the matched text.pls help
Java
....................................................................
//indexing
// -- Read and index all literal strings.
IndexBuilderString larqBuilder = new IndexBuilderString() ;

// -- Index statements as they are added to the model.
model3.register(larqBuilder) ;

FileManager.get().readModel(model3, MY_LOG_FILE1) ;

// -- Finish indexing
larqBuilder.closeWriter() ;
model3.unregister(larqBuilder) ;

// -- Create the access index  
IndexLARQ index = larqBuilder.getIndex() ;
	
// index registration
		
// -- Make globally available
LARQ.setDefaultIndex(index) ;
			
String queryString =" PREFIX db:  select  ?object  { ?object db:textMatch  '"+SearchObject+"'}" ;
Query query = QueryFactory.create(queryString) ;
QueryExecution qExec = QueryExecutionFactory.create(query, model3) ;
ResultSetFormatter.out(System.out, qExec.execSelect(), query) ;
Posted
Updated 26-Jun-13 19:07pm
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900