XQuery collection function
XQ-S-2 Filter WebDAV content content by XQuery
fn:collection usage example
Preliminary
XQuery collection function can be used to get all parsed documents in collection. Virtuoso engine supports several types of collections:
- http://local.virt/DAV/PATHTO - local DAV collection. Contains all documents in DAV collection with path "PATHTO".
- http://host:port/path - any other URL that can be used to access remote WebDAV collections
In this example collection function is used to filter local blog entries and all cached blog entries from subscriptions. search.vsp uses this collection to filter blogs by XPath exression. For instance, search.vsp with '//a' expression returns all link from all blogs.
text.vsp uses collection function to search blogs which contain some word. Note, it uses "contains" predicate to search blogs, this means it is case sensitive.
Prerequisites
This example needs the following VAD packages to be installed:
- Conductor
- Framework
- Briefcase
- Feed Manager
- Weblog
If you do not have permissions to install the above please ask the administrator.
The VAD installation can be done via Conductor (if it's installed) or via ISQL tool using vad_install() API function. For more details on vad installation please read the user manual.
Important: before to run any of the actions bellow you need to setup a ODS account (or use tutorial_demo with password secret). In both cases you will need to login in ODS and create instances of the Briefcase, Feed Manager and Weblog applications.
Using the Feed Manager you should subscribe to some news feeds in RSS, Atom or RDF format.
Using the Briefcase you can upload some sample data in the account's home directory.
Using the Weblog, make few sample blog posts.
Example overview
This example demonstrates:
- XQuery collection function
- XPath extension functions
- WebDAV Resource Filtering and WebDAV Extension Types (DETs)
Example Operation
- Login into ODS using the link bellow, after successfull authentication the ODS login will redirect browser back to this page
- Using the link 'Run' start the search.vsp
- Initially you will have the ODS account's home directory set as a base, so you can change it using the browse button
- If you don't have initial data loaded or data which not satisfies the conditions, the query execution will be produce empty result.
Example Setup
The demo support functions are prepared by loading the supplied SQL file
How to run the examples
- In order to enter the initial data via ODS you need to login and create instances via ODS. After entering the initial data, you will need to go back to this page. If you already done this just skip this step
- In order to run the examples, you need to login in the Web Applications.
- To login you can use the already defined user "tutorial_demo" with password "secret" case sensitive.
- When you click the "Run" link of the search.vsp file the browser will be redirected to ODS login page. After succefull login the browser will be redirected back to this page.
| View the source | Action |
|---|---|
| 1. search.sql | Set the initial state |
| 2. search.vsp | Run |
| 3. text.vsp | Run |
OpenLink Home
Technical Support