Using a variable declared outside the Query string inside a SPARQL Query- Using JSP and Java Servlet

前端 未结 2 1206
天命终不由人
天命终不由人 2021-01-23 20:11

I have 2 jsp pages. In the index page I am selecting a dropdown value and passing the selected value as a url parameter to the SearchResults page.

http://localh         


        
相关标签:
2条回答
  • 2021-01-23 20:45

    I assume jobCategory is a Literal/Label? Simple ask directly for the label.

    String queryString =
    "Select ?a ?b"+
    " Where { <uri> <uri>\""  + jobCategory +"\"}";
    

    I case it is a URI the query would look like.

    String queryString =
    "Select ?a ?b"+
    " Where { <uri> <uri> <" + jobCategory+ ">}";
    
    0 讨论(0)
  • 2021-01-23 20:50

    I have a solution for this issue. I used regex to obtain the result

    "filter(regex(?a, \"" + jobCategory + "\"))"
    
    0 讨论(0)
提交回复
热议问题