A safer way would be to use ParameterizedSparqlString:
https://jena.apache.org/documentation/javadoc/arq/org/apache/jena/query/ParameterizedSparqlString.html

On Tue, Nov 1, 2016 at 5:13 PM, lookman sanni <[email protected]> wrote:
> Hi Tina,
>
> You can have your query stored in a composed java string (e.g. String query
> = "Select blablabla where { ?emp rdf:type " + someJavaVariable + "}"
>
> Hope that helps
> Le 1 nov. 2016 17:02, "tina sani" <[email protected]> a écrit :
>
>> Hello.
>>
>> How can I use a Java variable in the SPARQL query.
>> ?emp rdf:type ?SomeVariable
>>
>> I want rdf:type of Managers and Technicals while these two values(Managers
>> and Technicals) are in my Java variable: employee.
>>
>> So I need something like:
>>
>> ?emp rdf:type "employee"
>>
>> Regards
>>

Reply via email to