Commit 7fc4e137 authored by Sylvain Schmitz's avatar Sylvain Schmitz

added a draft schema for UCQs

parent 5d8c9fa1
# Unions of Conjunctive Queries fragment in Relax NG compact syntax.
#
# Based on: Wojciech Czerwinski, Claire David, Filip Murlak, and Pawel
# Parys, _Reasoning About Integrity Constraints for Tree-Structured
# Data_, in the Proceedings of the 19th International Conference on
# Database Theory (ICDT 2016), volume 48 of LIPIcs, article 20, LZI,
# 2016. doi:10.4230/LIPIcs.ICDT.2016.20.
#
# Copyright (C) 2017 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-1.0-core.rnc" {
# restrict to positive Boolean combinations
fun = element functionCallExpr {
element functionName {
attribute xqx:prefix { string "fn" }?,
attribute xqx:URI { string "http://www.w3.org/2005/xpath-functions" }?,
( string "true"
| string "false"
| string "boolean" )
},
element arguments { expr* }?
}
# root.fun uses negation
fun |= cst.fun | fun.child
# last.path uses negation
last.path = notAllowed
}
# positive equality checks
op |= element ( eqOp | equalOp ) {
element firstOperand { expr },
element secondOperand { expr }
}
# existential quantifiers
include "expr/quant.rnc" {
quant.expr = element quantifiedExpr {
element quantifier { string "some" },
element quantifiedExprInClause {
element typedVariableBinding {
element varName { external "misc/eqname.rnc" }
},
element sourceExpr { expr }
}+,
element predicateExpr { expr }
}
}
# UCQs can do path intersections
op |= element ( intersectOp # path intersection
| isOp | nodeBeforeOp | nodeAfterOp # node comparisons
) {
element firstOperand { expr },
element secondOperand { expr }
}
......@@ -4,7 +4,7 @@
<xsl:output method="text"/>
<xsl:param name="fragments"
select="('xpath-1.0-core.rnc', 'xpath-1.0-downward.rnc', 'xpath-1.0-forward.rnc', 'xpath-1.0-vertical.rnc', 'xpath-1.0-data.rnc', 'xpath-1.0-eval.rnc', 'xpath-3.0.rnc', 'xpath-modal.rnc', 'xpath-hybrid.rnc')"/>
select="('xpath-1.0-core.rnc', 'xpath-1.0-downward.rnc', 'xpath-1.0-forward.rnc', 'xpath-1.0-vertical.rnc', 'xpath-patterns.rnc', 'xpath-1.0-data.rnc', 'xpath-1.0-eval.rnc', 'xpath-3.0.rnc', 'xpath-modal.rnc', 'xpath-hybrid.rnc')"/>
<xsl:template match="/">
<xsl:variable name="root" select="/"/>
......@@ -84,7 +84,7 @@
<xsl:when test="matches($f,'.*-core.rnc')">
<xsl:text>,#ccebc5,</xsl:text>
</xsl:when>
<xsl:when test="matches($f,'.*-(downward|forward|vertical).rnc')">
<xsl:when test="matches($f,'.*-(downward|forward|vertical|patterns).rnc')">
<xsl:text>,#b3cde3,</xsl:text>
</xsl:when>
<xsl:when test="matches($f,'.*-(data|eval|leashed).rnc')">
......
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