Commit 38e6e034 authored by Sylvain Schmitz's avatar Sylvain Schmitz

multiple fixes

parent 023ce25d
......@@ -48,7 +48,7 @@ This buildfile is used to retrieve and parse XPath expressions from various sour
in="@{name}-full.xml"
out="@{name}.xml">
<classpath>
<pathelement path="${lib.dir}/saxon9he.jar"/>
<pathelement path="../lib/saxon9he.jar"/>
</classpath>
</xslt>
</sequential>
......@@ -184,12 +184,12 @@ This buildfile is used to retrieve and parse XPath expressions from various sour
<!-- download saxon if needed -->
<target name="saxon">
<local name="offline"/>
<available file="${lib.dir}/saxon9he.jar" property="offline"/>
<mkdir unless:set="offline" dir="${lib.dir}"/>
<available file="../lib/saxon9he.jar" property="offline"/>
<mkdir unless:set="offline" dir="../lib"/>
<get unless:set="offline"
src="https://downloads.sourceforge.net/project/saxon/Saxon-HE/9.7/SaxonHE9-7-0-14J.zip?r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fsaxon%2Ffiles%2FSaxon-HE%2F9.7%2F&amp;ts=1485885576&amp;use_mirror=vorboss"
dest="${lib.dir}" usetimestamp="true"/>
<unzip unless:set="offline" src="${lib.dir}/SaxonHE9-7-0-14J.zip" dest="${lib.dir}"
dest="../lib" usetimestamp="true"/>
<unzip unless:set="offline" src="../lib/SaxonHE9-7-0-14J.zip" dest="../lib"
overwrite="no"/>
</target>
</project>
......@@ -20,5 +20,7 @@ namespace xqx = "http://www.w3.org/2005/XQueryX"
include "xpath-emso2-join.rnc"
include "misc/id.rnc"
include "expr/varref.rnc"
path |= id.rootedpath
primary |= varref
\ No newline at end of file
......@@ -18,7 +18,7 @@
default namespace = "http://www.w3.org/2005/XQueryX"
namespace xqx = "http://www.w3.org/2005/XQueryX"
include "xpath-emso2-orig.rnc"
include "xpath-emso2-var.rnc"
include "misc/id.rnc"
path |= id.rootedpath
# EMSO2 fragment with variables
#
# Copyright (C) 2016 Sylvain Schmitz (ENS Cachan)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
default namespace = "http://www.w3.org/2005/XQueryX"
namespace xqx = "http://www.w3.org/2005/XQueryX"
include "xpath-emso2-orig.rnc"
include "expr/varref.rnc"
primary |= varref
......@@ -112,9 +112,9 @@ public abstract class XPathEntry {
query.appendChild(text);
xpath.appendChild(query);
}
xpath.appendChild(ast);
if (astSize < MAX_AST_SIZE) {
xpath.appendChild(ast);
Element schemas = doc.createElementNS
(XMLConstants.NULL_NS_URI, "schemas");
// validate
......
#!/bin/bash
echo "<constantJoin>"
sum=0
for FILE in ../../benchmark/*xml
for FILE in ../../benchmark/*-full.xml
do
filename=$(basename "$FILE")
value=$(xmlstarlet sel -t -c "count(/benchmark/xpath[ast/descendant::*[(local-name()='eqOp' or local-name()='equalOp' or local-name()='neOp' or local-name()='notEqualOp') and */*[local-name()='intergerConstantExpr' or local-name()='decimalConstantExpr' or local-name()='doubleConstantExpr' or local-name()='stringConstantExpr']]])" $FILE)
......
#!/bin/bash
echo '<?xml version="1.0"?>'
echo "<extensions>"
echo ""
......
#!/bin/bash
echo "<freevar>"
sum=0
for FILE in ../../benchmark/*xml
for FILE in ../../benchmark/*-full.xml
do
filename=$(basename "$FILE")
value=$(xmlstarlet sel -t -c "count(/benchmark/xpath[ast/descendant::*[local-name()='varRef' and not(name = ancestor::*[local-name()='flworExpr']/*/*/*/*[local-name()='varName'])]])" $FILE)
......
#!/bin/bash
echo "<id>"
sum=0
for FILE in ../../benchmark/*xml
for FILE in ../../benchmark/*-full.xml
do
filename=$(basename "$FILE")
value=$(xmlstarlet sel -t -c "count(/benchmark/xpath[ast/descendant::*[local-name()='functionName' and .='id']])" $FILE)
......
echo "<arbitraryJoin>"
#!/bin/bash
echo "<fullJoin>"
sum=0
for FILE in ../../benchmark/*xml
for FILE in ../../benchmark/*-full.xml
do
filename=$(basename "$FILE")
value=$(xmlstarlet sel -t -c "count(/benchmark/xpath[ast/descendant::*[local-name()='eqOp' or local-name()='equalOp' or local-name()='neOp' or local-name()='notEqualOp']])" $FILE)
value=$(xmlstarlet sel -t -c "count(/benchmark/xpath[ast/descendant::*[(local-name()='eqOp' or local-name()='equalOp' or local-name()='neOp' or local-name()='notEqualOp') and child::*[local-name()='firstOperand']/child::*[local-name()='pathExpr'] and child::*[local-name()='secondOperand']/child::*[local-name()='pathExpr']]])" $FILE)
sum=$(($sum+$value))
echo " <source @name='$filename'>$value</source>"
done
echo " <total>$sum</total>"
echo "</arbitraryJoin>"
echo "</fullJoin>"
#!/bin/bash
echo "<last>"
sum=0
for FILE in ../../benchmark/*xml
for FILE in ../../benchmark/*-full.xml
do
filename=$(basename "$FILE")
value=$(xmlstarlet sel -t -c "count(/benchmark/xpath[ast/descendant::*[local-name()='functionName' and .='last']])" $FILE)
......
#!/bin/bash
echo "<positiveJoin>"
sum=0
for FILE in ../../benchmark/*xml
for FILE in ../../benchmark/*-full.xml
do
filename=$(basename "$FILE")
value=$(xmlstarlet sel -t -c "count(/benchmark/xpath[ast/descendant::*[(local-name()='eqOp' or local-name()='equalOp' or local-name()='neOp' or local-name()='notEqualOp') and not(ancestor::*[local-name()='functionCallExpr']/*[local-name()='functionName' and . = 'not'])]])" $FILE)
......
#!/bin/bash
echo "<root>"
sum=0
for FILE in ../../benchmark/*xml
for FILE in ../../benchmark/*-full.xml
do
filename=$(basename "$FILE")
value=$(xmlstarlet sel -t -c "count(/benchmark/xpath[ast/descendant::*[local-name()='functionName' and .='root']])" $FILE)
value=$(xmlstarlet sel -t -c "count(/benchmark/xpath[ast/descendant::*[local-name()='functionName' and .='root']] | /benchmark/xpath[ast/descendant::*[local-name()='rootExpr']])" $FILE)
sum=$(($sum+$value))
echo " <source @name='$filename'>$value</source>"
done
......
#!/bin/bash
echo "<var>"
sum=0
for FILE in ../../benchmark/*xml
for FILE in ../../benchmark/*-full.xml
do
filename=$(basename "$FILE")
value=$(xmlstarlet sel -t -c "count(/benchmark/xpath[ast/descendant::*[local-name()='varRef']])" $FILE)
......
#!/bin/bash
# path to benchmark files
path=$1
full=$2
xmlarray=(docbook htmlbook existdb histei marklogic xqjson)
names=(DocBook HTMLBook eXist-db HisTEI MarkLogic XQJSON)
echo "\\toprule"
echo "Source & \\textsf{Core~1.0} & \\textsf{Core~2.0} & \\textsf{Downward} & \\textsf{Vertical} & \\textsf{Forward} & \\textsf{EMSO\$^\\textsf 2\$} & \\textsf{NonMixing}\\\\"
echo "\\midrule"
for ((i = 0; i < ${#xmlarray[@]}; ++i))
do
printf "${names[$i]} "
echo "`./numbers.sh $path/${xmlarray[$i]}$2.xml 'xpath-1.0-core-full.rnc.*yes' 'xpath-2.0-core-join.rnc.*yes' 'xpath-1.0-downward-last.rnc.*yes' 'xpath-1.0-vertical-full.rnc.*yes' 'xpath-1.0-forward-last.rnc.*yes' 'xpath-emso2-full.rnc.*yes' 'xpath-patterns-orig.rnc.*yes'`\\\\"
done
echo "\\bottomrule"
#!/bin/bash
# path to benchmark files
path=$1
full=$2
xmlarray=(docbook htmlbook existdb histei marklogic xqjson)
names=(DocBook HTMLBook eXist-db HisTEI MarkLogic XQJSON)
echo "\\toprule"
echo "Source & \\textsf{Core~1.0} & \\textsf{Core~2.0} & \\textsf{Downward} & \\textsf{Vertical} & \\textsf{Forward} & \\textsf{EMSO\$^\\textsf 2\$} & \\textsf{NonMixing}\\\\"
echo "\\midrule"
for ((i = 0; i < ${#xmlarray[@]}; ++i))
do
printf "${names[$i]} "
echo "`./numbers.sh $path/${xmlarray[$i]}$2.xml 'xpath-1.0-core-join.rnc.*yes' 'xpath-2.0-core-join.rnc.*yes' 'xpath-1.0-downward-orig.rnc.*yes' 'xpath-1.0-vertical-orig.rnc.*yes' 'xpath-1.0-forward-orig.rnc.*yes' 'xpath-emso2-join.rnc.*yes' 'xpath-patterns-orig.rnc.*yes'`\\\\"
done
echo "\\bottomrule"
#!/bin/bash
# path to benchmark files
path=$1
full=$2
xmlarray=(docbook htmlbook existdb histei marklogic xqjson)
names=(DocBook HTMLBook eXist-db HisTEI MarkLogic XQJSON)
echo "\\toprule"
echo "Source & \\textsf{Core~1.0} & \\textsf{Core~2.0} & \\textsf{Downward} & \\textsf{Vertical} & \\textsf{Forward} & \\textsf{EMSO\$^\\textsf 2\$} & \\textsf{NonMixing}\\\\"
echo "\\midrule"
for ((i = 0; i < ${#xmlarray[@]}; ++i))
do
printf "${names[$i]} "
echo "`./numbers.sh $path/${xmlarray[$i]}$2.xml 'xpath-1.0-core-last.rnc.*yes' 'xpath-2.0-core-orig.rnc.*yes' 'xpath-1.0-downward-orig.rnc.*yes' 'xpath-1.0-vertical-last.rnc.*yes' 'xpath-1.0-forward-last.rnc.*yes' 'xpath-emso2-var.rnc.*yes' 'xpath-patterns-orig.rnc.*yes'`\\\\"
done
echo "\\bottomrule"
#!/bin/bash
# path to benchmark files
path=$1
full=$2
xmlarray=(docbook htmlbook existdb histei marklogic xqjson)
names=(DocBook HTMLBook eXist-db HisTEI MarkLogic XQJSON)
echo "\\toprule"
echo "Source & \\textsf{Core~1.0} & \\textsf{Core~2.0} & \\textsf{Downward} & \\textsf{Vertical} & \\textsf{Forward} & \\textsf{EMSO\$^\\textsf 2\$} & \\textsf{NonMixing}\\\\"
echo "\\midrule"
for ((i = 0; i < ${#xmlarray[@]}; ++i))
do
printf "${names[$i]} "
echo "`./numbers.sh $path/${xmlarray[$i]}$2.xml 'xpath-1.0-core-orig.rnc.*yes' 'xpath-2.0-core-orig.rnc.*yes' 'xpath-1.0-downward-orig.rnc.*yes' 'xpath-1.0-vertical-orig.rnc.*yes' 'xpath-1.0-forward-orig.rnc.*yes' 'xpath-emso2-orig.rnc.*yes' 'xpath-patterns-orig.rnc.*yes'`\\\\"
done
echo "\\bottomrule"
#!/bin/bash
# path to benchmark files
path=$1
full=$2
xmlarray=(docbook htmlbook existdb histei marklogic xqjson)
names=(DocBook HTMLBook eXist-db HisTEI MarkLogic XQJSON)
echo "\\toprule"
echo "Source & \\textsf{Core~1.0} & \\textsf{Core~2.0} & \\textsf{Downward} & \\textsf{Vertical} & \\textsf{Forward} & \\textsf{EMSO\$^\\textsf 2\$} & \\textsf{NonMixing}\\\\"
echo "\\midrule"
for ((i = 0; i < ${#xmlarray[@]}; ++i))
do
printf "${names[$i]} "
echo "`./numbers.sh $path/${xmlarray[$i]}$2.xml 'xpath-1.0-core-var.rnc.*yes' 'xpath-2.0-core-orig.rnc.*yes' 'xpath-1.0-downward-orig.rnc.*yes' 'xpath-1.0-vertical-var.rnc.*yes' 'xpath-1.0-forward-orig.rnc.*yes' 'xpath-emso2-var.rnc.*yes' 'xpath-patterns-orig.rnc.*yes'`\\\\"
done
echo "\\bottomrule"
......@@ -2,14 +2,18 @@
# path to benchmark files
path=$1
full=$2
xmlarray=(docbook htmlbook existdb histei marklogic xqjson)
names=(DocBook HTMLBook eXist-db HisTEI MarkLogic XQJSON)
echo "\\toprule"
echo "Source & queries & XPath~1.0 & XPath~2.0 & XPath~3.0\\\\"
echo "\\midrule"
echo "DocBook `./numbers.sh $path/docbook.xml '<schemas>' 'xpath-1.0.rnc.*yes' 'xpath-2.0.rnc.*yes' 'xpath-3.0.rnc.*yes'`\\\\"
echo "HTMLBook `./numbers.sh $path/htmlbook.xml '<schemas>' 'xpath-1.0.rnc.*yes' 'xpath-2.0.rnc.*yes' 'xpath-3.0.rnc.*yes'`\\\\"
echo "\\midrule"
echo "eXist-db `./numbers.sh $path/existdb.xml '<schemas>' 'xpath-1.0.rnc.*yes' 'xpath-2.0.rnc.*yes' 'xpath-3.0.rnc.*yes'`\\\\"
echo "HisTEI `./numbers.sh $path/histei.xml '<schemas>' 'xpath-1.0.rnc.*yes' 'xpath-2.0.rnc.*yes' 'xpath-3.0.rnc.*yes'`\\\\"
echo "MarkLogic `./numbers.sh $path/marklogic.xml '<schemas>' 'xpath-1.0.rnc.*yes' 'xpath-2.0.rnc.*yes' 'xpath-3.0.rnc.*yes'`\\\\"
echo "XQJSON `./numbers.sh $path/xqjson.xml '<schemas>' 'xpath-1.0.rnc.*yes' 'xpath-2.0.rnc.*yes' 'xpath-3.0.rnc.*yes'`\\\\"
for ((i = 0; i < ${#xmlarray[@]}; ++i))
do
printf "${names[$i]} "
echo "`./numbers.sh $path/${xmlarray[$i]}$2.xml '<schemas>' 'xpath-1.0.rnc.*yes' 'xpath-2.0.rnc.*yes' 'xpath-3.0.rnc.*yes'`\\\\"
done
echo "\\bottomrule"
......@@ -4,7 +4,7 @@ MAX=`grep 'MAX_AST_SIZE =' ../../src/main/java/fr/lsv/xpparser/XPathEntry.java|
for ((i = 1; i < $MAX; ++i))
do
C=`grep "ast size=\"$i\"" ../../benchmark/*.xml | wc -l`
C=`grep "ast size=\"$i\"" ../../benchmark/*-full.xml | wc -l`
echo "$i $C"
done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment