syntheticPatients/Makefile
author Eric Prud'hommeaux <eric@w3.org>
Thu, 16 Dec 2010 11:08:50 -0800
changeset 35 c46e908fef9b
parent 30 d5cb0312ef53
child 36 1e3b9b02d90e
permissions -rw-r--r--
~ test: += Q8S
~ silence make test except for errors
# $Id$

# XSLT ?= xsltprocDocStyle.sh
XSLT ?= saxonb-xslt -ext:on
SPARQL ?= SPARQL

all : \
 AD_PCHR_1-indivo.xml AD_PCHR_1-tmo.trig \
 AD_PCHR_2-indivo.xml AD_PCHR_2-tmo.trig \
 AD_PCHR_3-indivo.xml AD_PCHR_3-tmo.trig \
 AD_PCHR_4-indivo.xml AD_PCHR_4-tmo.trig \
 AD_PCHR_5-indivo.xml AD_PCHR_5-tmo.trig \
 AD_PCHR_6-indivo.xml AD_PCHR_6-tmo.trig \
 AD_PCHR_7-indivo.xml AD_PCHR_7-tmo.trig

old : \
 AD_PCHR_1.html AD_PCHR_1.rdf \
 AD_PCHR_2.html AD_PCHR_2.rdf \
 AD_PCHR_3.html AD_PCHR_3.rdf \
 AD_PCHR_4.html AD_PCHR_4.rdf \
 AD_PCHR_5.html AD_PCHR_5.rdf \
 AD_PCHR_6.html AD_PCHR_6.rdf \
 AD_PCHR_7.html AD_PCHR_7.rdf

%.rdf : %.xml Pat2rdf.xsl
	$(XSLT) $^ > $@

%-indivo.xml : %.xml Pat2Indivo2.xsl
	$(XSLT) $^ > $@

%-tmo.trig : %-indivo.xml Indivo2Trig.xsl
	$(XSLT) $^ > $@

%.html: %.rdf Patrdf2html.xsl
	$(XSLT) $^ > $@

xerces2val.class: xerces2val.java
	javac $^

validate: AD_PCHR_1-indivo.xml indivo-schemas/envelope.xsd 
	# java xerces2val document.xsd $<
	xmllint --noout --schema indivo-schemas/envelope.xsd $<

INPUTLIST  :=  AD_PCHR_1 AD_PCHR_2 AD_PCHR_3 AD_PCHR_4 AD_PCHR_5 AD_PCHR_6 AD_PCHR_7
MBOXES := $(subst AD_PCHR_, mbox_, $(INPUTLIST))
Q1S := $(subst AD_PCHR_, q1_, $(INPUTLIST))
Q4S := $(subst AD_PCHR_, q4_, $(INPUTLIST))
Q6S := $(subst AD_PCHR_, q6_, $(INPUTLIST))
Q8S := $(subst AD_PCHR_, q8_, $(INPUTLIST))
#$(error TMOLIST: $(TMOLIST))

mbox_%: AD_PCHR_%-tmo.trig tests/email_%.srt
	@$(SPARQL) -qd $(word 1, $^) -e 'PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT ?mbox { ?s foaf:mbox ?mbox }' --compare $(word 2, $^) || echo $<\(0\): error !mbox

q1_%: AD_PCHR_%-tmo.trig tests/q1.rq tests/q1_%.srt
	@$(SPARQL) -qg pchr $(word 1, $^) $(word 2, $^) --compare $(word 3, $^) || echo $<:0: error: data\\n$(word 2, $^):0: note: query\\n$(word 3, $^):0: note: expected results

q4_%: AD_PCHR_%-tmo.trig tests/q4.rq tests/q4_%.srt
	@$(SPARQL) -qg pchr $(word 1, $^) $(word 2, $^) --compare $(word 3, $^) || echo $<:0: error: data\\n$(word 2, $^):0: note: query\\n$(word 3, $^):0: note: expected results

q6_%: AD_PCHR_%-tmo.trig tests/q6.rq tests/q6_%.srt
	@$(SPARQL) -qd $(word 1, $^) $(word 2, $^) --compare $(word 3, $^) || echo $<:0: error: data\\n$(word 2, $^):0: note: query\\n$(word 3, $^):0: note: expected results

q8_%: AD_PCHR_%-tmo.trig tests/q8.rq tests/q8_%.srt
	@$(SPARQL) -qg pchr $(word 1, $^) $(word 2, $^) --compare $(word 3, $^) || echo $<:0: error: data\\n$(word 2, $^):0: note: query\\n$(word 3, $^):0: note: expected results

test: all $(MBOXES) $(Q1S) $(Q4S) $(Q6S) $(Q8S)

clean:
	rm -f *-indivo.xml *-tmo.trig