I have no idea how I can make use of jena in my web search form (written in php (wamp)).
For example this code will display all the titles in my rdf data, but how can I run the process.php of my search-form to run the input text against it? The only thing I know so far is that I need to modify my jena code.java and link my php file to the jena code.class but that's not sufficient to write my code. I greatly appreciate if someone can guide me with any opinion, example, code... or whatever you think I'm missing. Thank you.
FileManager.get().addLocatorClassLoader(search.class.getClassLoader());
Model model = FileManager.get().loadModel("newSample.rdf");
String queryString =
"PREFIX rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#" +
"PREFIX dc: http://purl.org/dc/elements/1.1/" +
"SELECT ?title " +
"WHERE { " +
"?x dc:title ?title ." +
"}";
Query query = QueryFactory.create(queryString);
QueryExecution qexec = QueryExecutionFactory.create(query, model);
try {
ResultSet results = qexec.execSelect();
while ( results.hasNext() ) {
QuerySolution soln = results.nextSolution();
Literal title = soln.getLiteral("title");
System.out.println(title);
} }
asked
23 Aug '12, 01:09
sshhiny
97●5
accept rate:
0%
Have you solve you problem? I have the same problem.I created a jena code.java which qeury from endpoint fuseki and i want to make it web application.