Som Sarkar
Som Sarkar

Reputation: 289

Passing data file as generic file

I have ANT build file having these two tasks-

<target name="ldm-validation">
<property name="graphFile"      value="${tools.dir}/build-config/SPARQL/*.ttl"/>
 <record name="${tools.dir}/build-config/SPARQL/BuildLog.txt" action="start"/>
  <foreach target="jena-sparql-validation" param="queryFile">
   <path>
    <fileset dir="${tools.dir}/build-config/SPARQL/Queries">
      <include name="*.rq"/>
    </fileset>
   </path>
  </foreach>
 <record name="${tools.dir}/build-config/SPARQL/BuildLog.txt" action="stop"/>

</target>

<target name="jena-sparql-validation">
   <java classname="arq.sparql" fork="true" outputproperty="javaresult" errorproperty="javaerror1">
       <arg value="--data=${graphFile}"/>
       <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} in ${queryFile}">
       <condition>
        <not>
         <equals arg1="${javaerror1}" arg2=""/>
        </not>
      </condition>
   </fail>
<echo message="Result for ${queryFile} is: ${javaresult}"/>
</target>

But when I am running this it is always failing saying that -

C:\CI-POC\tools\build-config\validate.all.xml:41: Error at: Failed to load data

It is unable to get the Data file using the Property name 'graphFile'. I am not sure what is going wrong. Can any one help.

Upvotes: 1

Views: 79

Answers (1)

Mark O&#39;Connor
Mark O&#39;Connor

Reputation: 77961

Try calling the build as follows:

ant ldm-validation jena-sparql-validation

so that the values of the properties graphFile and queryFile are set.

Another option is to create a dependency between the two targets.

<target name="jena-sparql-validation" depends="ldm-validation">

Upvotes: 1

Related Questions