Tamino: Getting there - PowerPoint PPT Presentation

1 / 42
About This Presentation
Title:

Tamino: Getting there

Description:

var db = new TaminoClient('http://flute.its.utexas.edu/tamino/cgp/test2006' ... var qresponse = db.xquery('input()/fragment'); var xqueryResultList = qresponse. ... – PowerPoint PPT presentation

Number of Views:124
Avg rating:3.0/5.0
Slides: 43
Provided by: webspac
Category:
Tags: getting | tamino | var

less

Transcript and Presenter's Notes

Title: Tamino: Getting there


1
Tamino Getting there
Tamino
GETTING THERE
Curtis Pew The University of Texas at
Austin c.pew_at_its.utexas.edu
2
From wherever you may be
3
Preliminaries
4
HyperText Transport Protocol
Server
GET /hello.html HTTP/1.1 Host www.example.com Use
r-Agent Spiffy Browser/1.0
HTTP/1.1 200 OK Date Wed, 18 Oct 2006 131012
GMT Server Spiffy Web Server/1.0 Content-length
136 Content-type text/html lt!DOCTYPE HTML
PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http//www.w3.org/TR/html4/strict.dtd"gt lttitlegtHe
llolt/titlegtltpgtHello, world!
Client
5
HTTP Methods
PUT
create/replace resource
GET
retrieve resource
DELETE
remove resource
POST
do something with resource
6
Tamino and the Web
Tamino user
Tamino user
Tamino user
C API Program
Tamino user
Tamino Database
Web Server
Tamino user
Tamino Database
Web Server
Tamino user
Tamino Database
Tamino user
7
Tamino Organization
8
XQuery
9
GenealogyofXQuery
DSSSL
XSL
XSLT
XPointer
XSL-FO
XSLT
XPath
SQL
XQuery
10
Path Expressions
prefs/favs_at_name "Samuel"/song
ltprefsgt ltfavs name"Samuel"gt ltsonggtOld
McDonaldlt/songgt ltquotegtTo be or not to
be.lt/quotegt lt/favsgt ltfavs name"Jonathan"gt
ltsonggtThe Eensy-weensy spiderlt/songgt
ltsonggtPopcorn poppinglt/songgt lt/favsgt lt/prefsgt
11
Path Expressions
prefs/favs_at_name "Samuel"/song
ltprefsgt ltfavs name"Samuel"gt ltsonggtOld
McDonaldlt/songgt ltquotegtTo be or not to
be.lt/quotegt lt/favsgt ltfavs name"Jonathan"gt
ltsonggtThe Eensy-weensy spiderlt/songgt
ltsonggtPopcorn poppinglt/songgt lt/favsgt lt/prefsgt
12
Path Expressions
prefs/favs_at_name "Samuel"/song
ltprefsgt ltfavs name"Samuel"gt ltsonggtOld
McDonaldlt/songgt ltquotegtTo be or not to
be.lt/quotegt lt/favsgt ltfavs name"Jonathan"gt
ltsonggtThe Eensy-weensy spiderlt/songgt
ltsonggtPopcorn poppinglt/songgt lt/favsgt lt/prefsgt
13
Path Expressions
prefs/favs_at_name "Samuel"/song
ltprefsgt ltfavs name"Samuel"gt ltsonggtOld
McDonaldlt/songgt ltquotegtTo be or not to
be.lt/quotegt lt/favsgt ltfavs name"Jonathan"gt
ltsonggtThe Eensy-weensy spiderlt/songgt
ltsonggtPopcorn poppinglt/songgt lt/favsgt lt/prefsgt
14
FLWOR Expressions
for book in input()/book, author in
input()/author let title book/title, name
author/name where book/author name order
by name return ltauthor-titlegt name,
title lt/author-titlegt
15
Update Expressions
update delete root(input()/fragmenttfgetInoId(.)
12) update insert ltpayment
date"2006-10-01"gt500.00lt/paymentgt into
input()/account_at_acct-id "loan88345"/history u
pdate let p 500.00 for a in
input()/account let b a/_at_balance
where a/_at_acct-id "loan88345" do
(insert ltpayment date"2006-10-01"gtplt/paymentgt
into a/history,
replace b with attribute balance b - p)
16
(No Transcript)
17
X-Machine
18
X-Machine
Client
Tamino Manager
X-Tension
application
XML Parser
Query Interpreter
application
Object Processor
Adabas
X-Node
Object Composer
Oracle
other databases
Tamino Server
19
URL Addressing
http//example.com/tamino/mydb/hr/employee/fred ht
tp//example.com/tamino/mydb/hr/employee/_at_3
mydb
help
hr
department
employee
html
1
3 fred
2
4
20
URL Addressing
http//example.com/tamino/mydb/hr/employee/fred ht
tp//example.com/tamino/mydb/hr/employee/_at_3
mydb
help
hr
department
employee
html
1
3 fred
2
4
21
URL Addressing
http//example.com/tamino/mydb/hr/employee/fred ht
tp//example.com/tamino/mydb/hr/employee/_at_3
mydb
help
hr
department
employee
html
1
3 fred
2
4
22
URL Addressing
http//example.com/tamino/mydb/hr/employee/fred ht
tp//example.com/tamino/mydb/hr/employee/_at_3
mydb
help
hr
department
employee
html
1
3 fred
2
4
23
X-Machine Commands
X-Machine
_commandvalue
GET /tamino/cgp/test2006?_xqueryinput28292ffra
gment HTTP/1.1 Hostname flute.its.utexas.edu
POST /tamino/cgp/test2006 HTTP/1.1 Hostname
flute.its.utexas.edu Content-Type
multipart/form-data boundaryrfj23jjHG Content
-length 142 --rfj23jjHG Content-disposition
form-data name_xquery Content-type
text/plain Content-length 16 input()/fragment --
rfj23jjHG--
24
X-Machine Response
X-Machine
lt?xml version"1.0" encoding"ISO-8859-1"
?gt ltinoresponse xmlnsino"http//namespaces.soft
wareag.com/tamino/response2"
xmlnsxql"http//metalab.unc.edu/xql/"gt
ltxqquery xmlnsxq"http//namespaces.softwareag.c
om/tamino/XQuery/result"gt lt!CDATAinput()/fra
gmentgt lt/xqquerygt ltinomessage
inoreturnvalue"0"gt ltinomessagelinegtXQuery
Request processinglt/inomessagelinegt
lt/inomessagegt ltxqresult xmlnsxq"http//names
paces.softwareag.com/tamino/XQuery/result"gt quer
y result goes here lt/xqresultgt
ltinomessage inoreturnvalue"0"gt
ltinomessagelinegtXQuery Request
processedlt/inomessagelinegt lt/inomessagegt lt/ino
responsegt
25
_process
http//example.com/tamino/mydb/mycoll
ltinorequestgt ltinoobject inodocnamefredgt
first document here lt/inoobjectgt
ltinoobject inodocnametomgt second
document here lt/inoobjectgt ltinoobject
inodocnamebengt third document here
lt/inoobjectgt lt/inorequestgt
26
Schema commands
_defineschema
_undefinecollection/schema-name/doctype
27
Sessions
Server
_connect
Sessionid 5 Sessionkey 3948586
Other commands
_disconnect _sessionid5 _sessionkey5940386
Client
28
Transactions
Atomic Consistent Independent Durable
_commit
_rollback
29
Cursors
Server
_cursoropen _xquery
handle 1
_cursorfetch _handle1 _position10
Client
_cursorclose _handle1
30
Prepared queries
Server
_preparedeclare variable x
handle 2
_executeprepared-xquery _handle2 xvalue
Client
31
APIs
32
Tamino API for C
include ltstdio.hgt include "TaminoAPI4C.h" int
main() TAC_HANDLE handle const char
dbname "cgp" const char collection
"test2006" const char query
"input()/fragment const char response
handle tac_init(dbname) tac_xquery(handle,
collection, query) tac_last_xml_response(handle
, response) printf("s\n", response)
tac_end(handle) return 0
33
Tamino API for Java
final static String QUERY "input()/fragment" f
inal static String DATABASE_URI
"http//flute.its.utexas.edu/tamino/cgp" static
public void main(String args) throws Exception
// Create an object to represent the result
document. We will use JDOM TXMLObject xmlObj
TXMLObject.newInstance(TJDOMObjectModel.getInstanc
e()) // create an object representing the
database connection TConnection dbconnect
TConnectionFactory.getInstance().newConnection
(DATABASE_URI) // an object accessor represents
a collection within the database // and the
Java XML API we'll use to manipulate the
results. TXMLObjectAccessor objAcc
dbconnect.newXMLObjectAccessor(
TAccessLocation.newInstance("test2006"),
TJDOMObjectModel.getInstance()) // create an
object representing the query TXQuery query
TXQuery.newInstance(QUERY) // now we can
actually query the database TResponse tresp
objAcc.xquery(query) // extract the first result
from the response if (tresp.hasFirstXMLObject())
xmlObj tresp.getFirstXMLObject() // use
JDOM methods to process document Element el
(Element)xmlObj.getElement() String content
el.getText() System.out.println(content)
// close the connection dbconnect.close()
34
Tamino API for .Net
TaminoConnection connection new
TaminoConnection("http//flute.its.utexas.edu/tami
no/cgp") connection.Open(TaminoConnectionMode.Aut
oCommit) TaminoCommand cmd connection.CreateCom
mand("test2006") TaminoQuery xquery new
TaminoQuery("input()/fragment") TaminoQueryRespon
se tresp cmd.Query(xquery) foreach (XmlNode
node in tresp) Console.WriteLine(node.OuterX
ml) tresp.Close() connection.Close()
35
HTTP Client API for JScript
lthtmlgt ltheadgtlttitlegtTamino JScript
Demolt/titlegt ltscript typetext/javascript
srcTaminoLib.jsgtlt/scriptgt ltscript
typetext/javascriptgt var db new
TaminoClient("http//flute.its.utexas.edu/tamino/c
gp/test2006") var qresponse db.xquery("input()/
fragment") var xqueryResultList
qresponse.getResult().childNodes //
xqueryResultList contains DOM objects
representing // the result nodes. lt/scriptgt
36
Tamino API for PHP
lt?php require_once("TaminoAPI.php") require_once(
"TaminoHelperFunctions.php") tamino new
TaminoAPI("http//flute.its.utexas.edu", 80,"cg
p","","") tamino-gtsetCollection("test2006") if
(tamino-gtxquery("input()/fragment"))
tamino-gtprintResultBody() else
thfPrintError(tamino) ?gt
37
Tamino API for Perl
use Tamino db Tamino-gtnew("http//flute.its.ut
exas.edu/tamino/cgp") xml db-gtxquery("test200
6", "input()/fragment")
38
Natural
REQUEST DOCUMENT FROM "http//flute.its.utexas
.edu/tamino/cgp/test2006" WITH DATA
NAME '_xquery' VALUE 'input28292ffragm
ent' NAME '_encoding VALUE
'utf-8' RETURN RESPONSE TAMINO-DOCUMENT PAR
SE XML TAMINO-DOCUMENT INTO NAME
ELEM-NAME VALUE XML-TEXT IF ELEM-NAME
'index OR 'author
OR 'text' WRITE ELEM-NAME ''
XML-TEXT END-IF END-PARSE
39
Ruby
require 'tamino/database' require
'tamino/xquery' query_string
'input()/fragment' xquery TaminoXQuery.new('te
st2006', query_string) TaminoDatabase.connect(
'http//flute.its.utexas.edu/tamino/cgp')
db xquery.each_result(db) doc
puts doc
40
Tamino and the Web
Tamino user
Tamino user
Tamino user
C API Program
Tamino user
Tamino Database
Web Server
Tamino user
Tamino Database
Web Server
Tamino user
Tamino Database
Tamino user
41
Questions?
42
Resources
  • Paper https//webspace.utexas.edu/curtispe/NatCon
    f/tam2006paper.html
  • Slides https//webspace.utexas.edu/curtispe/NatCo
    nf/tam2006.ppt
  • My email c.pew_at_its.utexas.edu
  • XQuery http//documentation.softwareag.com/crossv
    ision/ins441/xqueryref/xqr-over.htm
  • X-Machine http//documentation.softwareag.com/cro
    ssvision/ins441/xprog/xpover.htm
  • APIs
  • C http//documentation.softwareag.com/crossvision
    /ins441/inoapi4c/api4c-over.htm
  • Java http//documentation.softwareag.com/crossvis
    ion/ins441/inoapi/apiover.htm
  • .Net http//documentation.softwareag.com/crossvis
    ion/ins441/dotnetapi/apiintro.htm
  • Jscript http//documentation.softwareag.com/cross
    vision/ins441/jsapi/apiover.htm
Write a Comment
User Comments (0)
About PowerShow.com