Not logged in : Login
(Sponging disallowed)

About: http://demo.openlinksw.com/tutorial/xmlsql/ms_a_3a/ms_a_3a.vsp     Goto   Sponge   NotDistinct   Permalink

An Entity of Type : foaf:Document, within Data Space : linkeddata.uriburner.com:28898 associated with source document(s)

AttributesValues
type
Title
content
  • Example. The schema in this example includes a 'Customer' element with 'CustomerID' and 'ContactName' child elements and an OrderIDList attribute of IDREFS type. The 'Customer' element maps to the Customers table. By default, the scope of this mapping applies to all the child elements or attributes unless sql:relation is specified on the child element or attribute, in which case, the appropriate primary-key/foreign-key relationship must be defined using the 'relationship' element. And the child element or attribute, which specifies the different table using the relation annotation, must also specify the relationship annotation. <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sql="urn:schemas-microsoft-com:mapping-schema"> <xsd:annotation> <xsd:appinfo> <sql:relationship name="CustOrders" parent="Demo.demo.Customers" parent-key="CustomerID" child="Demo.demo.Orders" child-key="CustomerID" /> </xsd:appinfo> </xsd:annotation> <xsd:element name="Customer" sql:relation="Demo.demo.Customers" type="CustomerType" /> <xsd:complexType name="CustomerType" > <xsd:sequence> <xsd:element name="ContactName" type="xsd:string" /> <xsd:element name="CompanyName" type="xsd:string" /> <xsd:element name="City" type="xsd:string" /> </xsd:sequence> <xsd:attribute name="OrderIDList" type="xsd:IDREFS" sql:relation="Demo.demo.Orders" sql:field="OrderID" sql:relationship="CustOrders" > </xsd:attribute> <xsd:attribute name="CustomerID" type="xsd:string" /> </xsd:complexType> </xsd:schema> Let the schema is written to the file 'Cust_Order_attr.xsd', then after loading this file by xml_load_mapping_schema_decl function, the first example will produce a result for the XPath query: XPATH [__view 'Cust_Order_attr'] /Customer[@CustomerID="QUEEN"] the second example will produce a result for the XQuery query: select xquery_eval('<doc>{for $r in xmlview("Cust_Order_attr")/*[@CustomerID="QUEEN"] return $r}</doc>', xtree_doc('<q/>'));
has container
description
  • Using sql:relationship to Specify Relationship on an attribute
dcterms:created_at
  • Fri, 27 Dec 2019 14:12:54 GMT
content:encoded
  • Example. The schema in this example includes a &#39;Customer&#39; element with &#39;CustomerID&#39; and &#39;ContactName&#39; child elements and an OrderIDList attribute of IDREFS type. The &#39;Customer&#39; element maps to the Customers table. By default, the scope of this mapping applies to all the child elements or attributes unless sql:relation is specified on the child element or attribute, in which case, the appropriate primary-key/foreign-key relationship must be defined using the &#39;relationship&#39; element. And the child element or attribute, which specifies the different table using the relation annotation, must also specify the relationship annotation. &lt;xsd:schema xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:sql=&quot;urn:schemas-microsoft-com:mapping-schema&quot;&gt; &lt;xsd:annotation&gt; &lt;xsd:appinfo&gt; &lt;sql:relationship name=&quot;CustOrders&quot; parent=&quot;Demo.demo.Customers&quot; parent-key=&quot;CustomerID&quot; child=&quot;Demo.demo.Orders&quot; child-key=&quot;CustomerID&quot; /&gt; &lt;/xsd:appinfo&gt; &lt;/xsd:annotation&gt; &lt;xsd:element name=&quot;Customer&quot; sql:relation=&quot;Demo.demo.Customers&quot; type=&quot;CustomerType&quot; /&gt; &lt;xsd:complexType name=&quot;CustomerType&quot; &gt; &lt;xsd:sequence&gt; &lt;xsd:element name=&quot;ContactName&quot; type=&quot;xsd:string&quot; /&gt; &lt;xsd:element name=&quot;CompanyName&quot; type=&quot;xsd:string&quot; /&gt; &lt;xsd:element name=&quot;City&quot; type=&quot;xsd:string&quot; /&gt; &lt;/xsd:sequence&gt; &lt;xsd:attribute name=&quot;OrderIDList&quot; type=&quot;xsd:IDREFS&quot; sql:relation=&quot;Demo.demo.Orders&quot; sql:field=&quot;OrderID&quot; sql:relationship=&quot;CustOrders&quot; &gt; &lt;/xsd:attribute&gt; &lt;xsd:attribute name=&quot;CustomerID&quot; type=&quot;xsd:string&quot; /&gt; &lt;/xsd:complexType&gt; &lt;/xsd:schema&gt; Let the schema is written to the file &#39;Cust_Order_attr.xsd&#39;, then after loading this file by xml_load_mapping_schema_decl function, the first example will produce a result for the XPath query: XPATH [__view &#39;Cust_Order_attr&#39;] /Customer[@CustomerID=&quot;QUEEN&quot;] the second example will produce a result for the XQuery query: select xquery_eval(&#39;&lt;doc&gt;{for $r in xmlview(&quot;Cust_Order_attr&quot;)/*[@CustomerID=&quot;QUEEN&quot;] return $r}&lt;/doc&gt;&#39;, xtree_doc(&#39;&lt;q/&gt;&#39;));
is container of of
Faceted Search & Find service v1.17_git144 as of Jul 26 2024


Alternative Linked Data Documents: iSPARQL | ODE     Content Formats:   [cxml] [csv]     RDF   [text] [turtle] [ld+json] [rdf+json] [rdf+xml]     ODATA   [atom+xml] [odata+json]     Microdata   [microdata+json] [html]    About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] Valid XHTML + RDFa
OpenLink Virtuoso version 08.03.3331 as of Aug 25 2024, on Linux (x86_64-ubuntu_noble-linux-glibc2.38-64), Single-Server Edition (378 GB total memory, 62 GB memory in use)
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2024 OpenLink Software