From af288936a2ee49bace0f1070ef9c6e81e9ea6fce Mon Sep 17 00:00:00 2001 From: Lucca Hirschi Date: Fri, 29 Jun 2012 10:27:58 +0200 Subject: [PATCH] Queries and script for testing. --- run_tests | 3 +++ tests/queries/Treebank.xml.queries | 9 +++++++++ tests/queries/chrom5.xml.queries | 9 +++++++++ tests/queries/medline.xml.queries | 7 +++++++ tests/queries/medline_full.xml.queries | 10 +++++++++ tests/queries/xmark_01.04.xml.queries | 26 ++++++++++++++++++++++++ tests/queries/xmark_10.xml.queries | 27 +++++++++++++++++++++++++ tests/queries/xmark_all.xml.queries | 28 ++++++++++++++++++++++++++ 8 files changed, 119 insertions(+) create mode 100755 run_tests create mode 100644 tests/queries/Treebank.xml.queries create mode 100644 tests/queries/chrom5.xml.queries create mode 100644 tests/queries/medline.xml.queries create mode 100644 tests/queries/medline_full.xml.queries create mode 100644 tests/queries/xmark_01.04.xml.queries create mode 100644 tests/queries/xmark_10.xml.queries create mode 100644 tests/queries/xmark_all.xml.queries diff --git a/run_tests b/run_tests new file mode 100755 index 0000000..867fbe2 --- /dev/null +++ b/run_tests @@ -0,0 +1,3 @@ +./test.native ./tests/docs/tiny.xml '/child::site/child::regions' +./test.native ./tests/docs/tiny.xml -f ./tests/queries/Treebank.xml.queries +./test.native ./tests/docs/tiny.xml '/descendant::listitem[not(descendant::keyword/child::emph)]/descendant::parlist' diff --git a/tests/queries/Treebank.xml.queries b/tests/queries/Treebank.xml.queries new file mode 100644 index 0000000..114552e --- /dev/null +++ b/tests/queries/Treebank.xml.queries @@ -0,0 +1,9 @@ +/descendant::NP +#%/descendant::*/child::NP +#T03%/descendant::NP/descendant::VBZ +T02%/descendant::S[descendant::VP and descendant::NP]/child::VP/child::PP[child::IN]/child::NP/child::VBN +T03%/descendant::NP[descendant::JJ or descendant::CC] +T04%/descendant::CC[ not(descendant::JJ) ] +#%/descendant::S/child::VP/child::PP[child::NP/child::VBN]/child::IN +T05%/descendant::NN[descendant::VBZ or descendant::IN]/child::*[descendant::NN or descendant::_QUOTE_] +#T06%/descendant::EMPTY[descendant::VP and descendant::S]/descendant::PP[descendant::S and descendant::VGN] \ No newline at end of file diff --git a/tests/queries/chrom5.xml.queries b/tests/queries/chrom5.xml.queries new file mode 100644 index 0000000..705d741 --- /dev/null +++ b/tests/queries/chrom5.xml.queries @@ -0,0 +1,9 @@ +/descendant::promoter[contains(., "PSSM 5000 8 1 0 19 20 18 1 20 7 1 0 1 0 1 18 0 2 17 0 0 0 1 0 0 3 1 20 0 0 0 1 0 8")] +/descendant::promoter[contains(., "PSSM 100000 12 6 19 19 20 5 0 1 20 19 20 1 1 4 0 0 0 3 10 1 0 1 0 13 13 10 1 0 0 11 0 18 0 0 0 6 1 0 0 1 0 1 10 0 0 0 0 0 5") ] +/descendant::promoter[contains(., "PSSM 300000 14 0 1 12 6 0 0 0 1 2 6 6 1 3 0 0 0 0 7 13 3 2 0 0 4 5 10 6 3 2 12 1 0 0 0 0 0 11 3 1 1 0 3 11 0 0 0 0 10 11 12 0 0 1 1 4 7") ] +/descendant::exon[ descendant::sequence[ contains(., "PSSM 5000 8 1 0 19 20 18 1 20 7 1 0 1 0 1 18 0 2 17 0 0 0 1 0 0 3 1 20 0 0 0 1 0 8")] ] +/descendant::exon[ descendant::sequence[ contains( ., "PSSM 100000 12 6 19 19 20 5 0 1 20 19 20 1 1 4 0 0 0 3 10 1 0 1 0 13 13 10 1 0 0 11 0 18 0 0 0 6 1 0 0 1 0 1 10 0 0 0 0 0 5") ] ] +/descendant::exon[ descendant::sequence[ contains(., "PSSM 300000 14 0 1 12 6 0 0 0 1 2 6 6 1 3 0 0 0 0 7 13 3 2 0 0 4 5 10 6 3 2 12 1 0 0 0 0 0 11 3 1 1 0 3 11 0 0 0 0 10 11 12 0 0 1 1 4 7") ] ] +/descendant::*[contains(., "PSSM 5000 8 1 0 19 20 18 1 20 7 1 0 1 0 1 18 0 2 17 0 0 0 1 0 0 3 1 20 0 0 0 1 0 8")] +/descendant::*[contains(., "PSSM 100000 12 6 19 19 20 5 0 1 20 19 20 1 1 4 0 0 0 3 10 1 0 1 0 13 13 10 1 0 0 11 0 18 0 0 0 6 1 0 0 1 0 1 10 0 0 0 0 0 5") ] +/descendant::*[contains(., "PSSM 300000 14 0 1 12 6 0 0 0 1 2 6 6 1 3 0 0 0 0 7 13 3 2 0 0 4 5 10 6 3 2 12 1 0 0 0 0 0 11 3 1 1 0 3 11 0 0 0 0 10 11 12 0 0 1 1 4 7") ] diff --git a/tests/queries/medline.xml.queries b/tests/queries/medline.xml.queries new file mode 100644 index 0000000..738f266 --- /dev/null +++ b/tests/queries/medline.xml.queries @@ -0,0 +1,7 @@ +/descendant::Article[ descendant::AbstractText[ contains ( . , "plus") or contains ( . , "for") ] ]%/descendant::Article/descendant::AbstractText[ . ftcontains "plus" ftor "for" ] +/descendant::Article[ descendant::AbstractText[ contains ( . , "plus") and not(contains ( . , "for")) ] ]%/descendant::Article/descendant::AbstractText[ . ftcontains "plus" ftand ftnot "for" ] +/descendant::MedlineCitation/child::Article/child::AuthorList/child::Author[ child::LastName[starts-with( ., "Bar")]]%/descendant::MedlineCitation/child::Article/child::AuthorList/child::Author[ child::LastName ftcontains "Bar" at start ] +/descendant::*[ descendant::LastName[ contains( ., "Nguyen") ] ]%/descendant::*[ descendant::LastName ftcontains "Nguyen" entire content ] +/descendant::*/descendant::*[ contains( ., "epididymis") ]%/descendant::*/descendant::*[ . ftcontains "epididymis" ] +/descendant::*[ descendant::PublicationType[ ends-with( ., "Article") ]]%/descendant::*[ descendant::PublicationType ftcontains "Article" at end ] +/descendant::MedlineCitation[ descendant::Country[ contains( ., "AUSTRALIA") ] ]%/descendant::MedlineCitation[ descendant::Country ftcontains "AUSTRALIA" ] diff --git a/tests/queries/medline_full.xml.queries b/tests/queries/medline_full.xml.queries new file mode 100644 index 0000000..012d255 --- /dev/null +++ b/tests/queries/medline_full.xml.queries @@ -0,0 +1,10 @@ +/descendant::Article[ descendant::AbstractText[ contains ( . , "blood sample") ] ]%/descendant::Article/descendant::AbstractText[ . ftcontains "blood sample" all words ordered ] +W2%/descendant::Article[ descendant::AbstractText[ contains ( . , "is such that") ] ]%/descendant::Article/descendant::AbstractText[ . ftcontains "is such that" all words ordered ] +W3%/descendant::Article[ descendant::AbstractText[ contains( . , "various types of") and contains( . , "immune cells") ] ]%/descendant::Article[descendant::AbstractText[ . ftcontains "various types of" all words ordered ftand "immune cells" all words ordered ]] +W4%/descendant::Article[ descendant::AbstractText[ contains( . , "of the bone marrow") ] ]%/descendant::Article[descendant::AbstractText[ . ftcontains "of the bone marrow" all words ordered ]] +W5%/descendant::Article[ descendant::AbstractText[ contains( . , "cell") and not(contains( ., "blood")) ] ]%/descendant::Article[descendant::AbstractText[ . ftcontains "cell" ftand ftnot "blood" ]] +#W5%/descendant::MedlineCitation/child::Article/child::AuthorList/child::Author[ child::LastName[starts-with( ., "Bar")]]%/descendant::MedlineCitation/child::Article/child::AuthorList/child::Author[ child::LastName ftcontains "Bar" at start ] +#W6%/descendant::*[ descendant::LastName[ contains( ., "Nguyen") ] ]%/descendant::*[ descendant::LastName ftcontains "Nguyen" entire content ] +#W7%/descendant::*/descendant::*[ contains( ., "epididymis") ]%/descendant::*/descendant::*[ . ftcontains "epididymis" ] +#W8%/descendant::*[ descendant::PublicationType[ ends-with( ., "Article") ]]%/descendant::*[ descendant::PublicationType ftcontains "Article" at end ] +#W9%/descendant::MedlineCitation[ descendant::Country[ contains( ., "AUSTRALIA") ] ]%/descendant::MedlineCitation[ descendant::Country ftcontains "AUSTRALIA" ] diff --git a/tests/queries/xmark_01.04.xml.queries b/tests/queries/xmark_01.04.xml.queries new file mode 100644 index 0000000..7755f47 --- /dev/null +++ b/tests/queries/xmark_01.04.xml.queries @@ -0,0 +1,26 @@ +/child::site/child::closed_auctions/child::closed_auction/child::annotation/child::description/child::text/child::keyword +X04%/descendant::listitem/descendant::keyword +#%/descendant::closed_auction/descendant::keyword +#%/site/closed_auctions/closed_auction/descendant::keyword +X05%/child::site/child::closed_auctions/child::closed_auction[child::annotation/child::description/child::text/child::keyword]/child::date +X06%/child::site/child::closed_auctions/child::closed_auction[descendant::keyword]/child::date +X07%/child::site/child::people/child::person[child::profile/child::gender and child::profile/child::age]/child::name +X08%/child::site/child::people/child::person[child::phone or child::homepage]/child::name +X09%/child::site/child::people/child::person[child::address and (child::phone or child::homepage) and (child::creditcard or child::profile)]/child::name +X10%/descendant::listitem[not(descendant::keyword/child::emph)]/descendant::parlist +X11%/descendant::listitem[ (descendant::keyword or descendant::emph) and (descendant::emph or descendant::bold)]/child::parlist +X12%/descendant::people[ descendant::person[not(child::address)] and descendant::person[not(child::watches)]]/child::person[child::watches] +#%/site/regions/europe/item/mailbox/mail/text/keyword +#%/site/closed_auctions/closed_auction/annotation/description/parlist/listitem +#%/site/closed_auctions/closed_auction/annotation/description/parlist/listitem/parlist/listitem/*/descendant::keyword +#%/site/regions/*/item/descendant::keyword +#%/site/regions/*/person[ address and (phone or homepage) ] +#%/descendant::listitem[ descendant::keyword and descendant::emph]/descendant::parlist +#%/site/regions/*/item[ mailbox/mail/date ]/mailbox/mail +X13%/child::*[ descendant::* ] +X14%/descendant::* +X15%/descendant::*/descendant::* +X16%/descendant::*/descendant::*/descendant::* +X17%/descendant::*/descendant::*/descendant::*/descendant::* +#%/descendant::*/descendant::*/descendant::*/descendant::*/descendant::*/descendant::* +#%/descendant::*/descendant::* diff --git a/tests/queries/xmark_10.xml.queries b/tests/queries/xmark_10.xml.queries new file mode 100644 index 0000000..5e28255 --- /dev/null +++ b/tests/queries/xmark_10.xml.queries @@ -0,0 +1,27 @@ +/child::site/child::regions/child::*/child::item +X03%/child::site/child::closed_auctions/child::closed_auction/child::annotation/child::description/child::text/child::keyword +X04%/descendant::listitem/descendant::keyword +#%/descendant::closed_auction/descendant::keyword +#%/site/closed_auctions/closed_auction/descendant::keyword +X05%/child::site/child::closed_auctions/child::closed_auction[child::annotation/child::description/child::text/child::keyword]/child::date +X06%/child::site/child::closed_auctions/child::closed_auction[descendant::keyword]/child::date +X07%/child::site/child::people/child::person[child::profile/child::gender and child::profile/child::age]/child::name +X08%/child::site/child::people/child::person[child::phone or child::homepage]/child::name +X09%/child::site/child::people/child::person[child::address and (child::phone or child::homepage) and (child::creditcard or child::profile)]/child::name +X10%/descendant::listitem[not(descendant::keyword/child::emph)]/descendant::parlist +X11%/descendant::listitem[ (descendant::keyword or descendant::emph) and (descendant::emph or descendant::bold)]/child::parlist +X12%/descendant::people[ descendant::person[not(child::address)] and descendant::person[not(child::watches)]]/child::person[child::watches] +#%/site/regions/europe/item/mailbox/mail/text/keyword +#%/site/closed_auctions/closed_auction/annotation/description/parlist/listitem +#%/site/closed_auctions/closed_auction/annotation/description/parlist/listitem/parlist/listitem/*/descendant::keyword +#%/site/regions/*/item/descendant::keyword +#%/site/regions/*/person[ address and (phone or homepage) ] +#%/descendant::listitem[ descendant::keyword and descendant::emph]/descendant::parlist +#%/site/regions/*/item[ mailbox/mail/date ]/mailbox/mail +X13%/child::*[ descendant::* ] +X14%/descendant::* +X15%/descendant::*/descendant::* +X16%/descendant::*/descendant::*/descendant::* +X17%/descendant::*/descendant::*/descendant::*/descendant::* +#%/descendant::*/descendant::*/descendant::*/descendant::*/descendant::*/descendant::* +#%/descendant::*/descendant::* diff --git a/tests/queries/xmark_all.xml.queries b/tests/queries/xmark_all.xml.queries new file mode 100644 index 0000000..5331567 --- /dev/null +++ b/tests/queries/xmark_all.xml.queries @@ -0,0 +1,28 @@ +/child::site/child::closed_auctions +X02%/child::site/child::regions/child::*/child::item +X03%/child::site/child::closed_auctions/child::closed_auction/child::annotation/child::description/child::text/child::keyword +X04%/descendant::listitem/descendant::keyword +#%/descendant::closed_auction/descendant::keyword +#%/site/closed_auctions/closed_auction/descendant::keyword +X05%/child::site/child::closed_auctions/child::closed_auction[child::annotation/child::description/child::text/child::keyword]/child::date +X06%/child::site/child::closed_auctions/child::closed_auction[descendant::keyword]/child::date +X07%/child::site/child::people/child::person[child::profile/child::gender and child::profile/child::age]/child::name +X08%/child::site/child::people/child::person[child::phone or child::homepage]/child::name +X09%/child::site/child::people/child::person[child::address and (child::phone or child::homepage) and (child::creditcard or child::profile)]/child::name +X10%/descendant::listitem[not(descendant::keyword/child::emph)]/descendant::parlist +X11%/descendant::listitem[ (descendant::keyword or descendant::emph) and (descendant::emph or descendant::bold)]/child::parlist +X12%/descendant::people[ descendant::person[not(child::address)] and descendant::person[not(child::watches)]]/child::person[child::watches] +#%/site/regions/europe/item/mailbox/mail/text/keyword +#%/site/closed_auctions/closed_auction/annotation/description/parlist/listitem +#%/site/closed_auctions/closed_auction/annotation/description/parlist/listitem/parlist/listitem/*/descendant::keyword +#%/site/regions/*/item/descendant::keyword +#%/site/regions/*/person[ address and (phone or homepage) ] +#%/descendant::listitem[ descendant::keyword and descendant::emph]/descendant::parlist +#%/site/regions/*/item[ mailbox/mail/date ]/mailbox/mail +X13%/child::*[ descendant::* ] +X14%/descendant::* +X15%/descendant::*/descendant::* +X16%/descendant::*/descendant::*/descendant::* +X17%/descendant::*/descendant::*/descendant::*/descendant::* +#%/descendant::*/descendant::*/descendant::*/descendant::*/descendant::*/descendant::* +#%/descendant::*/descendant::* -- 2.17.1