This version is a prototype and does not adhere to the current version of the CSD profile.
Submit a POST request to index.php with your document. Some sample documents are found in test_csdq
You can test this with, for example:
curl -X POST -d @/home/ubuntu/CSD/test_csdq/stats_named.xq.xml \
Named/Canned Xquery searches are made available under queries/search via the web dav server. If there is a file queries/search/blah/blah.xq, you can access it as http://csd.ohie.org/CSD/index.php/search/blah/blah.xq. The dynamic context of the search is the published CSD document at time of the zorba server initialization. For the time being, and GET variables are passed on to the query. This is wide open at the moment and we need to lock it down.
Named/Canned Xquery used to query against any source documents are made available under queries/exec via the web dav server. If there is a file queries/exec/blah/blah.xq, you can access it as http://csd.ohie.org/CSD/index.php/edit/blah/blah.xq. Each document under "docs" is available to the xquery. For example "docs/source_data.xml" would be available as "doc('source_data.xml')"
Currently there is one script queries/exec/fred_conversion.xq to test translation of the FRED-API XML Endpoint to CSD.
Named/Canned Xquery use to publish CSD documents are made available under queries/publish via the web dav server. If there is a file queries/publish/blah/blah.xq, you can access it as http://csd.ohie.org/CSD/index.php/publish/blah/blah.xq. Each document under "docs" is available to the xquery. For example "docs/source_data.xml" would be available as "doc('source_data.xml')" If the resulting document passes validation via the .xsd it is published to the webdav server at docs/CSD.xml
Currently there is one publishing script queries/publish/simple_merge.xq
Currently, there is no way to tell the zorba server to reload/refresh the CSD source document after publication. You need to login to the server and restart the "zorba_server/init.php" process manually.
Named/Canned Xquery use to publish CSD documents are made available under queries/publish via the web dav server. If there is a file queries/publish/blah/blah.xq, you can access it as http://csd.ohie.org/CSD/index.php/update/blah/blah.xq. Each document under "docs" is available to the xquery. For example "docs/source_data.xml" would be available as "doc('source_data.xml')". The document "CSD.xml" is set to be the default context. If the resulting document passes validation via the .xsd it is published to the web dav server.
There are no update scripts as of yet. The intention is that scripts here are used to update the currently published CSD.xml, for example with an update of facilities. How this update occurs is defined by the update script. An example workflow would be:
The subversion repository where docs are stored has an xml log format. This log format is transformed by XSLT to an RSS feed. You can see the current changes as index.php/rss.
The XSL document is pulled (and cached) from https://github.com/nexml/nexml/blob/master/xslt/svnlog.xslt (Thanks to Rutger Vos for sharing). You can substitute your own XSLT if you wish.
misspelling of encryptioinCertificate in XSD
query result error should have a code
On the test server the repo lives under /home/ubuntu/CSD .
Subversion is used to hold the source code and the source CSD documents. In deployment the php source code and CSD documents should not be in the same repository.
These POSTs are, by default, performed against a zorba instance listening over TCP/IP under:
To POST to zorba linked over a Unix Domain Socket
To POST to exist-db, use:
All searches are, by default, performed against a zorba instance listening over TCP/IP under:
To perform a search on zorba over a Unix Domain Socket
To perform a search on exist-db
zorba does not install exactly according to the instructions found online. In particular make sure you:
There is a server script to keep an instance of zorba running with the CSD loaded in memory. There are actually two, one that binds to a TCP/IP socket on localhost which can be started:
php init.php > /tmp/zorba_server.out &
and one AF_UNIX that opens a socket on /tmp/zorba_server.sock
sudo -u www-data rm /tmp/zorba_server.sock
sudo -u www-data php init_uds.php > /tmp/zorba_server_uds.out &
Currently there are no indices are the zorba server's data store.
Results on an Amazon m1.large instance:
$ httperf --hog --server localhost --uri /CSD/index.php/search/search_by_nid.xq?nid=1197580084757020 --num-conn 500
httperf --hog --client=0/1 --server=localhost --port=80 --uri=/CSD/index.php/search/search_by_nid.xq?nid=1197580084757020 --send-buffer=4096 --recv-buffer=16384 --num-conns=500 --num-calls=1
httperf: warning: open file limit > FD_SETSIZE; limiting max. # of open files to FD_SETSIZE
Maximum connect burst length: 1
Total: connections 500 requests 500 replies 500 test-duration 5.260 s
Connection rate: 95.1 conn/s (10.5 ms/conn, <=1 concurrent connections)
Connection time [ms]: min 5.1 avg 10.5 max 16.9 median 10.5 stddev 1.0
Connection time [ms]: connect 0.2
Connection length [replies/conn]: 1.000
Request rate: 95.1 req/s (10.5 ms/req)
Request size [B]: 120.0
Reply rate [replies/s]: min 95.0 avg 95.0 max 95.0 stddev 0.0 (1 samples)
Reply time [ms]: response 10.3 transfer 0.0
Reply size [B]: header 193.0 content 281.0 footer 0.0 (total 474.0)
Reply status: 1xx=0 2xx=500 3xx=0 4xx=0 5xx=0
CPU time [s]: user 0.98 system 3.38 (user 18.6% system 64.3% total 82.9%)
Net I/O: 55.1 KB/s (0.5*10^6 bps)
Errors: total 0 client-timo 0 socket-timo 0 connrefused 0 connreset 0
Errors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0
This work is licensed under a Creative Commons Attribution 4.0 International License.