I have an ANT task which uses an RDF file - cpldm.ttl and run a query on it which is present in the file- ASK-ldm.rq. It is done using JAVA ant tasks. The code is given below-
<java classname="arq.sparql" fork="true" outputproperty="javaresult" errorproperty="javaerror1">
<arg value="--data=${tools.dir}/build-config/SPARQL/cpldm.ttl"/>
<arg value="--query=${tools.dir}/build-config/SPARQL/ASK-ldm.rq"/>
<jvmarg value="-Xmx1024M"/>
<classpath>
<path>
<fileset dir="${jena.dir}/lib">
<include name="*.jar"/>
</fileset>
</path>
</classpath>
</java>
Now I want extend this by using a set of SPARQL query files (.rq) / fileset. Like 'ASK1-ldm.rq', ASK2-ldm.rq etc and for each of them I want to capture the 'outputproperty' after the query is run on the same RDF file 'cpldm.ttl'
I hope I had been able to explain the challenge proeprly, if not feel free to ask.
After using Simon's suggestion the final code is-
<target name="validation">
<foreach target="javatask" param="queryFile">
<fileset dir="${tools.dir}/build-config/SPARQL/Queries">
<include name="*.rq"/>
</fileset>
</foreach>
</target>
<target name="javatask">
<java classname="arq.sparql" fork="true" outputproperty="javaresult" errorproperty="javaerror1">
<arg value="--data=${tools.dir}/build-config/SPARQL/cpldm.ttl"/>
<arg value="--query=${queryFile}"/>
<jvmarg value="-Xmx1024M"/>
<classpath>
<path>
<fileset dir="${jena.dir}/lib">
<include name="*.jar"/>
</fileset>
</path>
</classpath>
</java>
<fail message="Error at: ${javaerror1}">
<condition>
<not>
<equals arg1="${javaerror1}" arg2=""/>
</not>
</condition>
</fail>
<echo message="Result for {queryFile} is: ${javaresult}"/>
</target>
In the out put I am first getting this message-
[foreach] The nested fileset element is deprectated, use a nested path instead
Then in the out put it is showing-
javatask:
[echo] Result for {queryFile} is: Ask => Yes
First, what does that error message mean, and I want to see the name of the 'queryFile' in the put put so that I know which file gave what result.
Any more help?