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.

        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's gravatar image

accept rate: 0%

edited 23 Aug '12, 03:38

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.

(19 Feb '13, 07:33) Hlias Tsoukalas Hlias%20Tsoukalas's gravatar image

Two possibilities:

1/ Use a SPARQL PHP library (e.g. ARC2 - there are others)

2/ Put the data in a data server (e.g. Fuseki) and connect from your PHP code in one system to the backend "database server". There are many PHP libraries that can make SPARQL calls (i.e. they are SPARQL clients)

permanent link

answered 23 Aug '12, 08:13

AndyS's gravatar image

AndyS ♦
accept rate: 32%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 23 Aug '12, 01:09

question was seen: 1,604 times

last updated: 19 Feb '13, 12:10