OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

ebxml-regrep message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]


Subject: Proposal From XMLSolutions


 <<ebxml.dtd>>  <<samples.txt>> 
Fellow RegRepers,
 
Attached to this e-mail are two documents.  One includes an XML DTD
specifying the vocabulary for an XML representation of the modified SQL-92
as per the .84 specification.  Also attached is a set of sample SQL
statements and their XML equivalents.

Yes, these are more verbose, but in my opinion, they offer 1) the semantic
benefits of SQL, without the lexical implications and 2) the XML is an
implementation neutral format that can be translated to just about any other
syntax with minimal work.

Please consider this as a proposal for Rep/Rep query syntax.

Regards,
JP

=============================
JP Morgenthal
CTO
XMLSolutions Corporation
VM: (703) 506-1111 x 7306
C: (703) 298-5630
E: jp.morgenthal@xmls.com

ebxml.dtd

SELECT assoc FROM Association WHERE Association.sourceObject = 3
-----------------------
<Query>
	<Select>
		<SelectCols colName="assoc"/>
		<TableList>
			<TableRef name="Association"/>
		</TableList>
		<Where>
			<Expr>
				<ColRef name="sourceObject" prefix="Association"/>
				<CompareOp operator="="/>
				<Literal value="3"/>
			</Expr>
		</Where>	
	</Select>
</Query>


SELECT FROM ClassificationNode WHERE parent IS NULL
---------------------
<Query>
	<Select>
		<SelectCols/>
		<TableList>
			<TableRef name="ClassificationNode"/>
		</TableList>
		<Where>
			<Expr>
				<IsNullClause colName="parent"/>
			</Expr>
		</Where>
	</Select>
</Query>


SELECT DISTINCT assoc FROM Association WHERE Assoc.sourceObject = 
3 AND assoc.sourceRole = 'buysFrom' AND assoc.targetRole = 
'sellsTo'
-------------------
<Query>
	<Select>
		<SelectCols distinct="true" colName="assoc"/>
		<TableList>
			<TableRef name="Association"/>
		</TableList>
		<Where>
			<AndExpr>
				<Expr>
					<ColRef name="sourceObject" prefix="Assoc"/>
					<CompareOp operator="="/>
					<Literal value="3"/>
				</Expr>
				<Expr>
					<ColRef name="sourceRole" prefix="assoc"/>
					<CompareOp operator="="/>
					<Literal value="'buysFrom'"/>
				</Expr>
				<Expr>
					<ColRef name="targetRole" prefix="assoc"/>
					<CompareOp operator="="/>
					<Literal value="'sellsTo'"/>
				</Expr>
			</AndExpr>
		</Where>	
	</Select>
</Query>


SELECT DISTINCT obj FROM Object WHERE obj.name LIKE '%bicycle%' AND 
obj.majorVersion >= 1 AND (obj.majorVersion >= 2 OR  obj.minorVersion > 
3)
----------------
<Query>
	<Select>
		<SelectCols distinct="true" colName="obj"/>
		<TableList>
			<TableRef name="Object"/>
		</TableList>
		<Where>
			<AndExpr>
				<Expr>
					<ColRef name="name" prefix="obj"/>
					<LikeClause pattern="'%bicycle%'"/>
				</Expr>
				<Expr>
					<ColRef name="majorVersion" prefix="obj"/>
					<CompareOp operator=">="/>
					<Literal value="1"/>
				</Expr>
				<OrExpr>
					<Expr>
						<ColRef name="majorVersion" prefix="obj"/>
						<CompareOp operator=">="/>
						<Literal value="2"/>
					</Expr>
					<Expr>
						<ColRef name="minorVersion" prefix="obj"/>
						<CompareOp operator=">="/>
						<Literal value="3"/>
					</Expr>
				</OrExpr>
			</AndExpr>
		</Where>	
	</Select>
</Query>



SELECT DISTINCT eo FROM ExtrinsicObject eo, ClassificationNode auto, 
ClassificationNode geo WHERE (geo IN (eo.classificationNodes) AND 
geo.path = 'Geography.Asia.Japan') AND (auto IN (eo.classificationNodes) 
AND auto.path = 'Industry.Automotive')", 
----------------------
<Query>
	<Select> 
		<SelectCols distinct="true" colName="eo"/>
		<TableList>
			<TableRef name="ExtrinsicObject" alias="eo"/>
			<TableRef name="ClassificationNode" alias="auto"/>
			<TableRef name="ClassificationNode" alias="geo"/>
		</TableList>
		<Where>
			<AndExpr>
				<AndExpr>
					<Expr>
						<ColRef name="geo"/>
						<InClause>
							<ColRef name="classificationNodes" prefix="eo"/>
						</InClause>
					</Expr>
					<Expr>
						<ColRef name="path" prefix="geo"/>
						<CompareOp operator="="/>
						<Literal value="'Geography.Asia.Japan'"/>
					</Expr>
				</AndExpr>
				<AndExpr>	
					<Expr>
						<ColRef name="auto"/>
						<InClause>
							<ColRef name="classificationNodes" prefix="eo"/>
						</InClause>
					</Expr>
					<Expr>
						<ColRef name="path" prefix="auto"/>
						<CompareOp operator="="/>
						<Literal value="'Industry.Automotive'"/>
					</Expr>
				</AndExpr>
			</AndExpr>
		</Where>	
	</Select>
</Query>



SELECT p FROM Package p, ExtrinsicObject obj WHERE obj.ID = 3 AND 
p IN (obj.packages) AND p.name LIKE '%RosettaNet%' AND p.status != 
'DEPRECATED'
------------------------------
<Query>
	<Select>
		<SelectCols colName="eo"/>
		<TableList>
			<TableRef name="Package" alias="p"/>
			<TableRef name="ExtrinsicObject" alias="obj"/>
		</TableList>
		<Where>
			<AndExpr>
				<Expr>
					<ColRef name="ID" prefix="obj"/>
					<CompareOp operator="="/>
					<Literal value="3"/>
				</Expr>
				<Expr>
					<ColRef name="p"/>
					<InClause>
						<ColRef name="packages" prefix="obj"/>
					</InClause>
				</Expr>
				<Expr>
					<ColRef name="name" prefix="p"/>
					<LikeClause pattern="%RosettaNet%"/>
				</Expr>
				<Expr>
					<ColRef name="status" prefix="p"/>
					<CompareOp operator="!="/>
					<Literal value="'DEPRECATED'"/>
				</Expr>
			</AndExpr>
		</Where>	
	</Select>
</Query>




[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]

Search: Match: Sort by:
Words: | Help


Powered by eList eXpress LLC