Subject:Create RDF for xml Author:Muhammad Akram Date:24 Sep 2007 04:56 PM
HI
I want to do something like this but i am not aware of how to create RDF using Stylus studio, or may be some other way.. and how to associate this RDF to XML file.. I could understand the query but will i be able to do it in stylus studio.. I tried to find creating RDF in stylus studio, but did not find any help relating this..Below is the example code and working...
<products>
<product><name>Water Corola</name>
<price>15<price>
</product >
<product> </product>
</products>
--------------------------------------------
This XMl file is associated to the following RDF description.
Catalog.xml#product1 lastUpdate 10/1/2005.
Catalog.xml#product2 lastUpdate 10/2/1990.
----------------------------------------------
To get products which lastupdate is before 1990, the query is as follows:
for $p in doc(http://.../catalog.xml) //product
metadata $p in
SELECT ?p
WHERE (?p lastUpdate ?u)
AND ?u < 1/1/1990
return $p
------------------------------------
In this query, variable $p stores the product elements
of the document (line 1). The SPARQL query (lines
3 and 4) stores in variable ?p elements which last
update, stored in variable ?u, is before 1990. The
content of variable $p in the external XQuery query
is intersected with the content of the ?p variable in
internal SPARQL query, yielding the set of desired
products.
------------------------------------