From 9d4e6632c1548802427457774ee51c70f47e08ce Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Fri, 8 Nov 2002 01:07:10 +0000 Subject: [PATCH] Add Zthes example --- examples/.cvsignore | 2 + examples/zthes/Makefile | 10 ++++ examples/zthes/Zthes.abs | 5 ++ examples/zthes/dino.tree | 118 +++++++++++++++++++++++++++++++++++++ examples/zthes/records/.cvsignore | 1 + examples/zthes/tagsetg.tag | 41 +++++++++++++ examples/zthes/tree2xml.pl | 90 ++++++++++++++++++++++++++++ examples/zthes/zebra.cfg | 4 ++ 8 files changed, 271 insertions(+) create mode 100644 examples/.cvsignore create mode 100644 examples/zthes/Makefile create mode 100644 examples/zthes/Zthes.abs create mode 100644 examples/zthes/dino.tree create mode 100644 examples/zthes/records/.cvsignore create mode 100644 examples/zthes/tagsetg.tag create mode 100755 examples/zthes/tree2xml.pl create mode 100644 examples/zthes/zebra.cfg diff --git a/examples/.cvsignore b/examples/.cvsignore new file mode 100644 index 0000000..282522d --- /dev/null +++ b/examples/.cvsignore @@ -0,0 +1,2 @@ +Makefile +Makefile.in diff --git a/examples/zthes/Makefile b/examples/zthes/Makefile new file mode 100644 index 0000000..51e59ca --- /dev/null +++ b/examples/zthes/Makefile @@ -0,0 +1,10 @@ +recdA-0.mf: records/dino.xml + zebraidx init + zebraidx update records + +records/dino.xml: tree2xml.pl dino.tree + ./tree2xml.pl dino.tree > records/dino.xml + +clean: + rm -f records/dino.xml *.mf *..LCK zebrasrv.pid + diff --git a/examples/zthes/Zthes.abs b/examples/zthes/Zthes.abs new file mode 100644 index 0000000..a27b11d --- /dev/null +++ b/examples/zthes/Zthes.abs @@ -0,0 +1,5 @@ +attset bib1.att +tagset tagsetg.tag +xpath enable + +elm (2,1) title ! diff --git a/examples/zthes/dino.tree b/examples/zthes/dino.tree new file mode 100644 index 0000000..ee95adc --- /dev/null +++ b/examples/zthes/dino.tree @@ -0,0 +1,118 @@ +Dinosauria The MRCA of Saurischia and Ornithischia, and its descendants + *** Eoraptor The most basal known dinosaur + Saurischia + Sauropodomorpha + Brontosauria + Plateosauria + Massospondylidae + Yunnanosaurinae + *** Yunnanosaurus + Sauropoda + Eusauropoda + *** Jobaria + Neosauropoda + Diplodocimorpha + Rebbachisauridae + Rebbachisaurinae + *** Rebbachisaurus + Macronaria + Camarasauromorpha + Titanosauriformes + Brachiosauridae + *** Sauroposeidon + Titanosauria + Eutitanosauria + *** Argentinosaurus + Theropoda + Neotheropoda + Ceratosauria + Coelophysoidea + Coelophysidae + Coelophysinae + *** Dilophosaurus + Neoceratosauria + *** Xenotarsosaurus + Tetanurae + Spinosauria + Spinosauridae + Spinosaurinae + Irritatorini + *** Irritator + Avetheropoda aka. Neotetanurae + Carnosauria Previously used just to mean "large theropods" + *** Fukuiraptor + Allosauroidea + Allosauridae + Carcharodontosaurinae Some consider these animals derived abelisaurs + *** Giganotosaurus Probably the heaviest known theropod + Coelurosauria Previously used just to mean "small theropods" + Maniraptoriformes + [unnamed] Unnamed clade {Ornithomimosauria+Tyrannosauria} + Arctometatarsalia + Ornithomimosauria + *** Harpymimus + Tyrannosauroidea + Tyrannosauridae + Tyrannosaurinae + Tyrannosaurini + *** Tyrannosaurus + Maniraptora + Oviraptorosauria + Oviraptoridae + *** Oviraptor + Therizinosauria + Therizinosauroidea + Therizinosauridae + *** Nanshiungosaurus + Paraves + Eumaniraptora + Deinonychosauria + Troodontidae + *** Byronosaurus + Dromaeosauridae + Velociraptorinae + *** Velociraptor + Avialae + Aves + Metornithes + Alvarezsauria + Alvarezsauridae + Mononykinae + *** Parvicursor + Ornithischia + Genasauria + Thyreophora + Thyreophoroidea + Eurypoda + Stegosauria + Stegosauridae + *** Kentrosaurus + Ankylosauria + *** Minmi + Cerapoda + Marginocephalia + Ceratopsia + Neoceratopsia + *** Udanoceratops + Coronosauria + Ceratopsoidea + Ceratopsomorpha + *** Zuniceratops + Pachycephalosauria + *** Wannanosaurus + Ornithopoda + *** Qantassaurus + Euornithopoda + Iguanodontia + Euiguanodontia + Dryomorpha + Ankylopollexia + Styracosterna + *** Lurdosaurus + Iguanodontoidea + Hadrosauroidea + Hadrosauridae + Euhadrosauria + Lambeosaurinae + Lambeosaurini + *** Corythosaurus diff --git a/examples/zthes/records/.cvsignore b/examples/zthes/records/.cvsignore new file mode 100644 index 0000000..54eeda1 --- /dev/null +++ b/examples/zthes/records/.cvsignore @@ -0,0 +1 @@ +dino.xml diff --git a/examples/zthes/tagsetg.tag b/examples/zthes/tagsetg.tag new file mode 100644 index 0000000..6536cfe --- /dev/null +++ b/examples/zthes/tagsetg.tag @@ -0,0 +1,41 @@ +# TagSet-G Tags +# $Id: tagsetg.tag,v 1.1 2002-11-08 01:07:10 mike Exp $ +name tagsetg +reference TagsetG +type 2 + +tag 1 termName string +tag 2 author string +tag 3 publicationPlace string +tag 4 publicationDate/date-of-publication string +tag 5 documentId string +tag 6 abstract string +tag 7 name string +tag 8 dateTime generalizedtime +tag 9 displayObject octetstring +tag 10 organization/organisation string +tag 11 postalAddress string +tag 12 networkAddress string +tag 13 eMailAddress string +tag 14 phoneNumber/telephone string +tag 15 faxNumber/fax string +tag 16 country string +tag 17 description string +tag 18 time intunit +tag 19 documentcontent octetstring +tag 20 language string +tag 21 subject string +tag 22 resourceType string +tag 23 city string +tag 24 stateOrProvince string +tag 25 zipOrPostalCode string +tag 26 cost string +tag 27 format string +tag 28 identifier string +tag 29 rights string +tag 30 relation string +tag 31 publisher string +tag 32 contributor string +tag 33 source string +tag 34 coverage string +tag 35 private string diff --git a/examples/zthes/tree2xml.pl b/examples/zthes/tree2xml.pl new file mode 100755 index 0000000..92544a9 --- /dev/null +++ b/examples/zthes/tree2xml.pl @@ -0,0 +1,90 @@ +#!/usr/bin/perl -w + +use strict; + + +package Node; + +sub new { + my $class = shift(); + my($name, $id, $parent, $note) = @_; + + my $this = bless { name => $name, + id => $id, + parent => $parent, + children => [], + note => $note }, $class; + push @{ $parent->{children} }, $this + if defined $parent; + + return $this; +} + +sub walk { + my $this = shift(); + my($coderef) = @_; + + &$coderef($this); + foreach my $child (@{ $this->{children} }) { + $child->walk($coderef) + } +} + +sub write_zthes { + my $this = shift(); + + print "\n"; + $this->write_term(1); + my $note = $this->{note}; + print " $note\n" if defined $note; + my $parent = $this->{parent}; + if (defined $parent) { + $parent->write_relation('BT'); + } + foreach my $child (@{ $this->{children} }) { + $child->write_relation('NT'); + } + print "\n"; +} + +sub write_relation { + my $this = shift(); + my($type) = @_; + + print " \n"; + print " $type\n"; + $this->write_term(2); + print " \n"; +} + +sub write_term { + my $this = shift(); + my($level) = @_; + + print ' ' x $level, "", $this->{id}, "\n"; + print ' ' x $level, "", $this->{name}, "\n"; + print ' ' x $level, "PT\n"; +} + + +package main; + +my @stack; +my $id = 1; + +while (<>) { + chomp(); + s/\t/ /g; + s/^( *)//; + my $level = length($1); + s/^\*+ //; + my $note = undef; + if (s/[ \t]+(.*)//) { + $note = $1; + } + my $parent = undef; + $parent = $stack[$level-1] if $level > 0; + $stack[$level] = new Node($_, $id++, $parent, $note); +} + +$stack[0]->walk(\&Node::write_zthes); diff --git a/examples/zthes/zebra.cfg b/examples/zthes/zebra.cfg new file mode 100644 index 0000000..b7cf63b --- /dev/null +++ b/examples/zthes/zebra.cfg @@ -0,0 +1,4 @@ +# $Id: zebra.cfg,v 1.1 2002-11-08 01:07:10 mike Exp $ +profilePath: .:../../tab +recordType: grs.sgml +attset: bib1.att -- 1.7.10.4