<?xml version="1.0" encoding="UTF-8"?>
<!-- ====================================================================== 
     OSLC Vocabulary V2    
     Generates Wiki HTML pages from RDFS documents.
                   
     Arthur Ryman <ryman@ca.ibm.com>                                                                
     ====================================================================== -->
<project name="OSLC Vocabulary V2" default="html">
	<description>
            Generates Wiki HTML pages from RDFS documents. 
		
		To use this pages, create a Wiki page, attach the
		generated HTML to it, and put an INCLUDE command in the body of the Wiki page. For example, to
		include ems.html, use the following command: %%INCLUDE:perfmon.html%%
    </description>

	<!-- Step 1. Generate non-abbreviated RDF/XML from RDF/XML or Turtle source file -->

	<!-- the RDFS source document in this example is perfmon-v2.rdf -->
	<target name="xml" description="Generates non-abbreviated RDF/XML from RDF/XML source.">
		<rdf2xml model="perfmon-v2" />
	</target>

	<!-- Step 2. Transform the non-abbreviated RDF/XML to HTML -->

	<target name="html" depends="xml" description="Generates Wiki HTML pages from RDFS documents.">
		<xslt style="Vocabulary-v2.xsl" in="perfmon-v2.xml" out="perfmon-v2.html" force="yes">
		</xslt>
	</target>

	<!-- jena.lib.dir is the directory that stores all the Jena jar files. -->
	<property name="jena.lib.dir" location="C:\Jena-2.6.4\lib" />

	<!-- jena.classpath is the CLASSPATH for Jena commands. -->
	<path id="jena.classpath">
		<fileset dir="${jena.lib.dir}">
			<include name="*.jar" />
		</fileset>
	</path>

	<!-- = = = = = = = = = = = = = = = = =
          macrodef: rdf2xml - convert RDF/XML to non-abbreviated RDF/XML
         = = = = = = = = = = = = = = = = = -->
	<macrodef name="rdf2xml">
		<attribute name="model" />
		<sequential>
			<java classpathref="jena.classpath" classname="jena.rdfcopy" fork="true" maxmemory="1024m" output="@{model}.xml">
				<arg value="@{model}.rdf" />
				<arg value="RDF/XML" />
				<arg value="RDF/XML" />
			</java>
		</sequential>
	</macrodef>

	<!-- = = = = = = = = = = = = = = = = =
          macrodef: ttl2xml - convert Turtle to non-abbreviated RDF/XML
         = = = = = = = = = = = = = = = = = -->
	<macrodef name="ttl2xml">
		<attribute name="model" />
		<sequential>
			<java classpathref="jena.classpath" classname="jena.rdfcopy" fork="true" maxmemory="1024m" output="@{model}.xml">
				<arg value="@{model}.ttl" />
				<arg value="TURTLE" />
				<arg value="RDF/XML" />
			</java>
		</sequential>
	</macrodef>

</project>
