Przykład 3b
a. Warunek
Compact URI prefixes:
bks expands into http://example.com/books#
auth expands into http://example.com/authors#
cpt expands into http://example.com/concepts#
curr expands into http://example.com/currencies#
RIF condition:
And (Exists ?Buyer ?P (
?P#"cpt:purchase"^^rif:iri["cpt:buyer"^^rif:iri->?Buyer
"cpt:seller"^^rif:iri->?Seller
"cpt:item"^^rif:iri->"cpt:book"^^rif:iri(cpt:author->?Author
cpt:title->"bks:LeRif"^^rif:iri)
"cpt:price"^^rif:iri->"49"^^xsd:integer
"cpt:currency"^^rif:iri->"curr:USD"^^rif:iri])
?Seller=?Author)
b. Serializacja XML
<And>
<formula>
<Exists>
<declare><Var>Buyer</Var></declare>
<declare><Var>P</Var></declare>
<formula>
<Frame>
<object>
<Member>
<lower><Var>P</Var></lower>
<upper><Const type="rif:iri">cpt:purchase</Const></upper>
</Member>
</object>
<slot>
<Prop>
<key><Const type="rif:iri">cpt:buyer</Const></key>
<val><Var>Buyer</Var></val>
</Prop>
</slot>
<slot>
<Prop>
<key><Const type="rif:iri">cpt:seller</Const></key>
<val><Var>Seller</Var></val>
</Prop>
</slot>
<slot>
<Prop>
<key><Const type="rif:iri">cpt:item</Const></key>
<val>
<Expr>
<op><Const type="rif:iri">cpt:book</Const></op>
<slot>
<Prop>
<key><Name>cpt:author</Name></key>
<val><Var>Author</Var></val>
</Prop>
</slot>
<slot>
<Prop>
<key><Name>cpt:title</Name></key>
<val><Const type="rif:iri">bks:LeRif</Const></val>
</Prop>
</slot>
</Expr>
</val>
</Prop>
</slot>
<slot>
<Prop>
<key><Const type="rif:iri">cpt:price</Const></key>
<val><Const type="xsd:integer">49</Const></val>
</Prop>
</slot>
<slot>
<Prop>
<key><Const type="rif:iri">cpt:currency</Const></key>
<val><Const type="rif:iri">curr:USD</Const></val>
</Prop>
</slot>
</Frame>
</formula>
</Exists>
</formula>
<formula>
<Equal>
<side><Var>Seller</Var></side>
<side><Var>Author</Var></side>
</Equal>
</formula>
</And>
Powrót do dokumentu