This repository has been archived by the owner on Apr 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement qvar highlighting by creating $q var
Just like $x references hit, XQG now generates a $q variable which is a map of qvar names to their xml:id attributes. * Created additional unit test to test nested qvars and multiple qvar constraints and mappings * Refactor generateQvarConstraints() to use iterators to improve readability
- Loading branch information
Showing
7 changed files
with
122 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/test/resources/com/formulasearchengine/mathmlquerygenerator/mws/qqx2xy.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0"?> | ||
<mws:query xmlns:mws="http://search.mathweb.org/ns" xmlns:m="http://www.w3.org/1998/Math/MathML" limitmin="0" | ||
answsize="30"> | ||
<mws:expr> | ||
<m:apply xml:id="p1.1.m1.1.5.cmml" xref="p1.1.m1.1.5"> | ||
<m:plus xml:id="p1.3.7.1.4.cmml" xref="p1.765.21.1"/> | ||
<m:apply xml:id="p5.1.3.1.cmml" xref="p4.2.6.21"> | ||
<m:plus xml:id="p1.1.m1.1.3.cmml" xref="p1.1.m1.1.3"/> | ||
<m:apply xml:id="p1.1.m1.1.5.1.cmml" xref="p1.1.m1.1.5.1"> | ||
<m:csymbol cd="ambiguous" xml:id="p1.1.m1.1.5.1.1.cmml">superscript</m:csymbol> | ||
<mws:qvar>x</mws:qvar> | ||
<m:apply xml:id="p1.1.m1.1.5.1.2.cmml" xref="p1.2.4.2.cmml"> | ||
<m:times xml:id="p1.1.m1.1.6.1.3.cmml" xref="p2.31.41.cmml"/> | ||
<mws:qvar>y</mws:qvar> | ||
<mws:qvar>y</mws:qvar> | ||
</m:apply> | ||
</m:apply> | ||
<mws:qvar>x</mws:qvar> | ||
</m:apply> | ||
<mws:qvar>x</mws:qvar> | ||
</m:apply> | ||
</mws:expr> | ||
</mws:query> |
15 changes: 15 additions & 0 deletions
15
src/test/resources/com/formulasearchengine/mathmlquerygenerator/mws/qqx2xy.xq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
declare default element namespace "http://www.w3.org/1998/Math/MathML"; | ||
for $m in db2-fn:xmlcolumn("math.math_mathml") return | ||
for $x in $m//*:apply | ||
[*[1]/name() = 'plus' and *[2]/name() = 'apply' and *[2][*[1]/name() = 'plus' and *[2]/name() = 'apply' and *[2][*[1]/name() = 'csymbol' and *[1][./text() = 'superscript'] and *[3]/name() = 'apply' and *[3][*[1]/name() = 'times']]]] | ||
where | ||
fn:count($x/*[2]/*[2]/*[1]/*) = 0 | ||
and fn:count($x/*[2]/*[2]/*[3]/*) = 3 | ||
and fn:count($x/*[2]/*[2]/*) = 3 | ||
and fn:count($x/*[2]/*) = 3 | ||
and fn:count($x/*) = 3 | ||
and $x/*[2]/*[2]/*[2] = $x/*[2]/*[3] and $x/*[2]/*[2]/*[2] = $x/*[3] | ||
and $x/*[2]/*[2]/*[3]/*[2] = $x/*[2]/*[2]/*[3]/*[3] | ||
let $q := map {"x" : (data($x/*[2]/*[2]/*[2]/@xml:id),data($x/*[2]/*[3]/@xml-id),data($x/*[3]/@xml-id)),"y" : (data($x/*[2]/*[2]/*[3]/*[2]/@xml:id),data($x/*[2]/*[2]/*[3]/*[3]/@xml-id))} | ||
return | ||
data($m/*[1]/@alttext) |