Rechercher une page de manuel

Chercher une autre page de manuel:

stag-db.1p

Langue: en

Version: 2008-12-23 (debian - 07/07/09)

Section: 1 (Commandes utilisateur)

NAME

stag-db - persistent storage and retrieval for stag data (xml, sxpr, itext)

SYNOPSIS

   stag-db -r person -k social_security_no -i ./person-idx myrecords.xml
   stag-db -i ./person-idx -q 999-9999-9999 -q 888-8888-8888
 
 

DESCRIPTION

Builds a simple file-based database for persistent storage and retrieval of nodes from a stag compatible document.

Imagine you have a very large file of data, in a stag compatible format such as XML. You want to index all the elements of type person; each person can be uniquely identified by social_security_no, which is a direct subnode of person

The first thing to do is to build an index file, which will be stored in your current directory:

   stag-db -r person -k social_security_no -i ./person-idx myrecords.xml
 
 

You can then use the index ``person-idx'' to retrieve person nodes by their social security number

   stag-db -i ./person-idx -q 999-9999-9999 > some-person.xml
 
 

You can export using different stag formats

   stag-db -i ./person-idx -q 999-9999-9999 -w sxpr > some-person.xml
 
 

You can retrieve multiple nodes (although these need to be rooted to make a valid file)

   stag-db -i ./person-idx -q 999-9999-9999 -q 888-8888-8888 -top personset
 
 

Or you can use a list of IDs from a file (newline delimited)

   stag-db -i ./person-idx -qf my_ss_nmbrs.txt -top personset
 
 

ARGUMENTS

-i INDEXFILE

This file will be used as the persistent index for storage/retrieval

-r RELATION-NAME

This is the name of the stag node (XML element) that will be stored in the index; for example, with the XML below you may want to use the node name person and the unique key id

   <person_set>
     <person>
       <id>...</id>
     </person>
     <person>
       <id>...</id>
     </person>
     ...
   </person_set>
 
 

This flag should only be used when you want to store data

-k UNIQUE-KEY

This node will be used as the unique/primary key for the data

This node should be nested directly below the node that is being stored in the index - if it is more that one below, specify a path

This flag should only be used when you want to store data

-u UNIQUE-KEY

Synonym for -k

-p PARSER

This can be the name of a stag supported format (xml, sxpr, itext) - XML is assumed by default

It can also be a module name - this module is used to parse the input file into a stag stream; see Data::Stag::BaseGenerator for details on writing your own parsers/event generators

This flag should only be used when you want to store data

-q QUERY-ID

Fetches the relation/node with unique key value equal to query-id

Multiple arguments can be passed by specifying -q multple times

This flag should only be used when you want to query data

-top NODE-NAME

If this is specified in conjunction with -q or -qf then all the query result nodes will be nested inside a node with this name (ie this provides a root for the resulting document tree)

-qf QUERY-FILE

This is a file of newline-seperated IDs; this is useful for querying the index in batch

-keys

This will write a list of all primary keys in the index

-w WRITER

This format will be used to write the data; can be any stag format (xml, sxpr, itext) - default XML.

Can also be a module that catches the incoming stag event stream and does something with it (for example, this could be a module you write yourself that transforms the stag events into HTML)

SEE ALSO

Data::Stag

For more complex stag to database mapping, see DBIx::DBStag and the scripts

stag-storenode

selectall_xml

AVGVSTIDVNENSISOPVSTIBISOLVOSYAGRI

D I V S A P E X A D A M V T F E C I T D A T S O M N I A D O N E C
A V v l s a c o s t a p l a s m A t a e s t e v a n e c i n p A R
F e L i c e s p a r i t e r d i P l o i d e l v c i s o p e R t I
O r e C o r v s c a n t e s i n T e r p i a r v r a i v g A l e S
R i p a E i v c v n d a e n a r I g r a t a a v r a r e D i b a T
T v r i s D e l i c i a e s a t V r a b a n t v b e r E f l a t V
V n a f o v E n s a m b o s f l O r o s a s e d e v O l v p t a S
N o t a b o n I s r e g i o p a S c e b a t t e m P e b e a t o S
A t c v m t a m M a g n o p o l L e r e n t m a I v s h o n o r E
T o t a h o m i n V m m i r e p A r e b a t t E r r a d v o r v M
O c c v l t v s m e N d a x m o X e x e r i T a r m a v e n e n I
S e r p e n s e l a t V s z e l A t o r l A r v e v s h o s t i S
A t r o x i n n o c v o S e v i N c e n S f e l l e n o c e n t I
C o n l i s i t s v a s v Q v o S g r A t i a d i v a b e a r a T
E t h o m o d e t e r r a t V m D e N v o d e c i d i t i l l v C
R e p t a n t i s q d o l o e O O I s e x c l v d i t v r o r t V
H a c n a t i m o r i m v r d a M n a t i l e g e p a r e n t v M
A t d e v s e x c e l l e n s A I E e t d e l v m i n e l v m e N
E c a e l i s o l i o d v m M v N e R a p r o v i d e t v l t r O
C a s t a e c a r n e r v D i v I v a X i n t r o i i t a g n v S
P r o d i i t i n d e s A l v s M a t v T i n i v e l v c e r n A
I n t a c t a e p a r T v l v x E r v i t E x c i t a m v s d v M
A p a t r e i v r e D s h o m o D e h i n c C a r n e v s a l v O
V t n o s e r i p E r e t v i l I s e d e t r A h i t a v c t o R
O r e g i s v e N a l e c a p v T q v o d d e c R v c e f i x i T
T e l o v o c E m a n v m a l f A c t v s v e r b E r e f e l l E
A c t v h a C s o l v i s c a p T i v o s s o r t e C r e a t o R
S e r o v E r a d a t a e s t v I t a l i s e m p t i O m o r t E
Y m n o S v n d e d e o l o q v O r a b s o l v e n t e R e a t V
A t v O s a e t e r n a e s v f F v l t i l a v d e c o r O n a E
G a L l o r v m r a d i i v o b I s q v o f v l g e a t e t N o X
R V m p i t e l o r a i v g i s E r s v m i t i s a r m a d i E I
I P S A V E L I B E R T A S V O S L I B E R A T A T Q B E A B I T

-- Fortunatus, Venantius Honorius Clementianus