Index: Makefile.in =================================================================== diff -u -rf3b7952aabc9e4f9079febd1f5b7f5fb833fd50c -rb07223692b7ed8b9b1cfc81f202f73c066456c7c --- Makefile.in (.../Makefile.in) (revision f3b7952aabc9e4f9079febd1f5b7f5fb833fd50c) +++ Makefile.in (.../Makefile.in) (revision b07223692b7ed8b9b1cfc81f202f73c066456c7c) @@ -355,22 +355,22 @@ $(TCLSH) $(src_test_dir_native)/interceptor-slot.tcl -libdir $(PLATFORM_DIR) $(TESTFLAGS) $(TCLSH) $(src_test_dir_native)/aliastest.tcl -libdir $(PLATFORM_DIR) $(TESTFLAGS) $(TCLSH) $(src_test_dir_native)/protected.tcl -libdir $(PLATFORM_DIR) $(TESTFLAGS) - $(TCLSH) $(src_lib_dir)/xotcl/tests/testx.xotcl -libdir $(PLATFORM_DIR) $(TESTFLAGS) - $(TCLSH) $(src_lib_dir)/xotcl/tests/testo.xotcl -libdir $(PLATFORM_DIR) $(TESTFLAGS) - $(TCLSH) $(src_test_dir_native)/speedtest.xotcl -libdir $(PLATFORM_DIR) $(TESTFLAGS) - $(TCLSH) $(src_test_dir_native)/forwardtest.xotcl -libdir $(PLATFORM_DIR) $(TESTFLAGS) + $(TCLSH) $(src_test_dir_native)/forwardtest.tcl -libdir $(PLATFORM_DIR) $(TESTFLAGS) $(TCLSH) $(src_test_dir_native)/mixinoftest.tcl -libdir $(PLATFORM_DIR) $(TESTFLAGS) $(TCLSH) $(src_test_dir_native)/slottest.xotcl -libdir $(PLATFORM_DIR) $(TESTFLAGS) + $(TCLSH) $(src_lib_dir)/xotcl/tests/speedtest.xotcl -libdir $(PLATFORM_DIR) $(TESTFLAGS) + $(TCLSH) $(src_lib_dir)/xotcl/tests/testx.xotcl -libdir $(PLATFORM_DIR) $(TESTFLAGS) + $(TCLSH) $(src_lib_dir)/xotcl/tests/testo.xotcl -libdir $(PLATFORM_DIR) $(TESTFLAGS) test-http: $(TCLSH_PROG) $(TCLSH) $(src_lib_dir)/xotcl/tests/xocomm.test -libdir $(PLATFORM_DIR) $(TESTFLAGS) test-actiweb: $(TCLSH_PROG) - $(TCLSH) $(src_test_dir_native)/actiweb.test -libdir $(PLATFORM_DIR) $(TESTFLAGS) - $(TCLSH) $(src_test_dir_native)/persistence.test -libdir $(PLATFORM_DIR) $(TESTFLAGS) - $(TCLSH) $(src_test_dir_native)/UNIVERSAL.test -libdir $(PLATFORM_DIR) $(TESTFLAGS) - $(TCLSH) $(src_test_dir_native)/xoRDF.test -libdir $(PLATFORM_DIR) $(TESTFLAGS) + $(TCLSH) $(src_lib_dir)/xotcl/tests/actiweb.test -libdir $(PLATFORM_DIR) $(TESTFLAGS) + $(TCLSH) $(src_lib_dir)/xotcl/tests/persistence.test -libdir $(PLATFORM_DIR) $(TESTFLAGS) + $(TCLSH) $(src_lib_dir)/xotcl/tests/UNIVERSAL.test -libdir $(PLATFORM_DIR) $(TESTFLAGS) + $(TCLSH) $(src_lib_dir)/xotcl/tests/xoRDF.test -libdir $(PLATFORM_DIR) $(TESTFLAGS) @rm -rf receiver depend: Index: TODO =================================================================== diff -u -rf3b7952aabc9e4f9079febd1f5b7f5fb833fd50c -rb07223692b7ed8b9b1cfc81f202f73c066456c7c --- TODO (.../TODO) (revision f3b7952aabc9e4f9079febd1f5b7f5fb833fd50c) +++ TODO (.../TODO) (revision b07223692b7ed8b9b1cfc81f202f73c066456c7c) @@ -890,7 +890,6 @@ - adjusted regression test and old documentation system to work with new structure - old structure xotcl apps @@ -946,7 +945,10 @@ unix win +- moved some more xotcl specfic tests to library/xotcl +- transformed forwardtest from xotcl to next + TODO: - nameing * .c-code: Index: library/xotcl/tests/UNIVERSAL.test =================================================================== diff -u --- library/xotcl/tests/UNIVERSAL.test (revision 0) +++ library/xotcl/tests/UNIVERSAL.test (revision b07223692b7ed8b9b1cfc81f202f73c066456c7c) @@ -0,0 +1,48 @@ +# -*- Tcl -*- +#if {[set ::tcl_platform(platform)] == "windows"} {lappend auto_path .} + +package require XOTcl; namespace import -force xotcl::* +set pkgdir [file dir [info script]]/.. +lappend auto_path $pkgdir + +package require nx::test + +set tclsh [info nameofexecutable] +set dir [file dir [info script]] +set univApps $dir/../apps/actiweb/univ + +set startCmd "$tclsh $univApps/UNIVERSAL.xotcl \ + -instanceFile $univApps/UNIVERSAL.rdf \ + -cssFile UNIVERSAL.css \ + -root $dir/../apps/actiweb/univ \ + -pkgdir $pkgdir" +puts stderr "starting $startCmd" +set PIPE [open "|$startCmd"] + +package require xotcl::comm::httpAccess +proc printError msg {puts stderr !!!$msg!!!} + +Class T -superclass Test -parameter { + {count 1} + {errorReport { + puts "\tcontent-length: \[r0::sink set contentLength\]\n\ + \tstatus-code: \[\[r0 set token\] set responseCode\]\n\[r0 getContent]" + }}} + +T new -msg "Load homepage frame von univ ... " \ + -setResult {expr [r0::sink set contentLength] == 358} \ + -cmd [list SimpleRequest r0 -url http://localhost:8095/ ] +T new -msg "Load Catalog ... " \ + -setResult {expr [r0::sink set contentLength] == 1744} \ + -cmd [list SimpleRequest r0 -url http://localhost:8095/univ+catalog ] +T new -msg "Detail Page ... " \ + -setResult {expr [r0::sink set contentLength] == 2327} \ + -cmd [list SimpleRequest r0 -url http://localhost:8095/univ+details+http://nm.wu-wien.ac.at/Lehre/oo1/] +T new -msg "terminate" -cmd [list SimpleRequest r0 -url http://localhost:8095/receiver::exit] \ + -setResult {set x 1} \ + -post {catch {close $::PIPE}; exit} + +after 1000 {Test run} +vwait forever + + Index: library/xotcl/tests/actiweb.test =================================================================== diff -u --- library/xotcl/tests/actiweb.test (revision 0) +++ library/xotcl/tests/actiweb.test (revision b07223692b7ed8b9b1cfc81f202f73c066456c7c) @@ -0,0 +1,83 @@ +# -*- Mode: tcl -*- +# regression test for actiweb examples +#if {[set ::tcl_platform(platform)] == "windows"} { +# lappend auto_path . +#} +package require XOTcl; namespace import -force ::xotcl::* +set pkgDir [file dirname [info script]]/.. +lappend auto_path $pkgDir +package require nx::test +#package require xotcl::package; package verbose 1 +package require xotcl::comm::httpAccess +#package require xotcl::trace + +set tclsh [info nameofexecutable] +set dir [file dir [info script]] +set actiwebApps $dir/../apps/actiweb + +# remove persitent vars to get reproducible behavior +catch [file delete -force receiver] +proc terminate {} { + catch [file delete -force receiver] + exit +} + +puts "$tclsh ${actiwebApps}/Counter.xotcl" +puts "------------------------------------ $tclsh ${actiwebApps}/Counter.xotcl -pkgdir $pkgDir" +set PIPE1 [open "| $tclsh ${actiwebApps}/Counter.xotcl -pkgdir $pkgDir"] +set PIPE2 [open "| $tclsh ${actiwebApps}/Counter2.xotcl -pkgdir $pkgDir"] +set PIPE3 [open "| $tclsh ${actiwebApps}/Counter3.xotcl -pkgdir $pkgDir"] +set PIPE4 [open "| $tclsh ${actiwebApps}/Counter4.xotcl -pkgdir $pkgDir"] +set PIPE5 [open "| $tclsh ${actiwebApps}/MC.xotcl -pkgdir $pkgDir"] + +proc printError msg {puts stderr !!!$msg!!!} + +Class T -superclass Test -parameter { + {count 1} + {errorReport { + puts "\tcontent-length: \[r0::sink set contentLength\]\n\ + \tstatus-code: \[\[r0 set token\] set responseCode\]" + }}} + + +T new -msg "Trying Counter.xotcl ... " \ + -setResult {regexp {^The value in counter-1.html is now: 0} [r0::sink set d]} \ + -cmd [list SimpleRequest r0 -url http://localhost:8090/counter-1.html] +T new -msg "terminate Counter" -setResult {set x 1} \ + -cmd [list SimpleRequest r0 -url http://localhost:8090/receiver::exit] \ + -post {catch {close $::PIPE1}} + +T new -msg "Trying Counter2.xotcl ... " \ + -setResult {r0 getContentLength} \ + -expected 238 \ + -cmd [list SimpleRequest r0 -url http://localhost:8091/web-c1] +T new -msg "terminate Counter1" -setResult {set x 1} \ + -cmd [list SimpleRequest r0 -url http://localhost:8091/receiver::exit] \ + -post {catch {close $::PIPE2}} + +T new -msg "Trying Counter3.xotcl ... " \ + -setResult {r0 getContentLength} \ + -expected 122 \ + -cmd [list SimpleRequest r0 -url http://localhost:8093/c1] +T new -msg "terminate Counter3" -setResult {set x 1} \ + -cmd [list SimpleRequest r0 -url http://localhost:8093/receiver::exit] \ + -post {catch {close $::PIPE3}} + +T new -msg "Trying Counter4.xotcl (a) ... " \ + -setResult {r0 getContentLength} \ + -expected 126 \ + -cmd [list SimpleRequest r0 -url http://localhost:8094/wc1] +T new -msg "terminate Counter4" -setResult {set x 1} \ + -cmd [list SimpleRequest r0 -url http://localhost:8094/receiver::exit] \ + -post {catch {close $::PIPE4}} + +T new -msg "Trying MC.xotcl ... " \ + -setResult {r0 getContentLength} \ + -expected 1767 \ + -cmd [list SimpleRequest r0 -url http://localhost:8092/Gustaf.html ] +T new -msg "terminate MC" -setResult {set x 1} \ + -cmd [list SimpleRequest r0 -url http://localhost:8092/receiver::exit] \ + -post {catch {close $::PIPE5}; exit} + +after 4000 {Test run} +catch {vwait forever} Index: library/xotcl/tests/persistence.test =================================================================== diff -u --- library/xotcl/tests/persistence.test (revision 0) +++ library/xotcl/tests/persistence.test (revision b07223692b7ed8b9b1cfc81f202f73c066456c7c) @@ -0,0 +1,401 @@ +#!../../src/xotclsh +# -*- Tcl -*- +package require XOTcl; namespace import -force xotcl::* + +@ @File { + description { + Several tests for persistent stores and performance comparison. + The "-bigdb" command line option additionally starts a (longer) + big database test. The test automatically detects which storages + are avaiable. + } +} +array set opt {-bigdb 0 -bench 0} +array set opt $argv + +lappend auto_path [file dir [info script]]/.. + +#set auto_path ".. ../../src $auto_path" +#package require xotcl::package;package verbose 1 + +set storageCandidates {Sdbm Jufgdbm Mem Gdbm TextFile} +set storageCandidates {Sdbm Mem Gdbm TextFile} +#set storageCandidates {Gdbm} +set stores "" + +foreach store $storageCandidates { + if {![catch {package require xotcl::store::[string tolower $store]}]} { + lappend stores $store + } else { + puts "FAILED: package require xotcl::store::[string tolower $store]" + } +} + +puts "\nPersistence Test\n\nUsing the following Storages: \n $stores\n" + +set ::tests { + testStorageFeatures + Stores + Traverse + Store_Fetch_List + Store_Fetch_List_Same_Key + SimplePersistentObjects + LotsOfObjects +} + +if {$opt(-bigdb)} { + lappend ::tests bigdb + puts " ... bigdb test enabled.\n" +} else { + puts " ... bigdb test disabled.\n" +} +if {$opt(-bench)} { + set ::runs 10 + # don't use number >= 1000 because of SDBMs's char key length with the + # test SimplePersistentObjects + # don't use number > 272 because of SDBMs's key pairs max length of 1024 + # FIX THIS in FUTURE RELEASES!! + set ::iterations 272 +} else { + set ::runs 1 + set ::iterations 10 +} + +#package require xotcl::store::trace +#Storage=Gdbm instmixin TraceStorage + + +package require xotcl::store::persistence + +proc ::errorCheck {got expected msg} { + if {$got != $expected} { + puts stderr "FAILED: $msg\nGot: $got\nExpected: $expected" + exit -1 + } +} +proc ::errorCheckList {got expected msg} { + if {[lsort $got] != [lsort $expected]} { + puts stderr "FAILED: $msg\nGot: $got\nExpected: $expected" + exit -1 + } +} + +Class PersistenceTest + +@ Class PersistenceTest + +PersistenceTest instproc init args { + next +} + +PersistenceTest instproc testStorageFeatures {store} { + Storage=$store s + s open testDB + s set "{::a::s x} {x}" {a b c d} + s set "::a::s x" {{r t} a b c r} + s set ::a::t 7 + set result [s set ::a::t] + errorCheck $result 7 "Failed fetch ::a::t" + set result [s set "{::a::s x} {x}"] + errorCheck $result "a b c d" "Failed fetch {::a::s x} {x}" + set result [s set "::a::s x"] + errorCheck $result "{r t} a b c r" "Failed fetch ::a::s x" + + errorCheckList [s names] "{::a::s x} {{::a::s x} {x}} ::a::t" "Failed list -- all" + + set keys [list [s firstkey]] + while {[set nk [s nextkey]] != ""} {lappend keys $nk} + set keys [lappend keys [s firstkey]] + while {[set nk [s nextkey]] != ""} {lappend keys $nk} + + errorCheckList $keys "{{::a::s x} {x}} {::a::s x} ::a::t {{::a::s x} {x}} {::a::s x} ::a::t" "First/next key traversal failed." + + s unset "{::a::s x} {x}" + errorCheckList [s names] "{::a::s x} ::a::t" "Failed delete {::a::s x} {x}" + s unset "::a::s x" + errorCheckList [s names] "::a::t" "Failed delete ::a::s x" + + s close + s destroy + return " PASSED with $store" +} + +PersistenceTest instproc Traverse { store} { + Storage=$store s + s open testDB + for {set i 0} {$i < $::iterations} {incr i} { + set key "::a${i}" + set value "An value for the test $i $i $i\0" + s set $key $value + lappend resultKeys $key + lappend resultValues $value + } + + set keys [list [s firstkey]] + set values [list [s set $keys]] + while {[set nk [s nextkey]] != ""} { + lappend keys $nk + lappend values [s set $nk] + } + errorCheckList $keys $resultKeys "Failed Traverse keys" + errorCheckList $values $resultValues "Failed Traverse values" + s close + s destroy + return " PASSED with $store" +} + +PersistenceTest instproc Stores {store} { + Storage=$store s + s open testDB + for {set i 0} {$i < $::iterations} {incr i} { + s set "::a${i}" "An value for the test $i $i $i" + } + set list [s names] + errorCheck [llength $list] $::iterations "Failed Stores $::iterations -- Wrong \# of stored elements" + s close + s destroy + return " PASSED with $store" +} + +PersistenceTest instproc Store_Fetch_List {store} { + Storage=$store s + s open testDB + for {set i 0} {$i < $::iterations} {incr i} { + set key "::a${i}" + set value "An value for the test $i $i $i" + s set $key $value + set list [s names] + errorCheck [llength $list] [expr $i +1] "Failed Store_Fetch_List $::iterations -- Wrong \# of stored elements" + set result [s set $key] + errorCheck $result $value "Failed fetch Store_Fetch_List current key" + set result [s set "::a0"] + errorCheck $result "An value for the test 0 0 0" "Failed fetch Store_Fetch_List first key" + } + s close + s destroy + return " PASSED with $store" +} + +PersistenceTest instproc Store_Fetch_List_Same_Key {store} { + Storage=$store s + s open testDB + set key "Always the same key" + for {set i 0} {$i < $::iterations} {incr i} { + set value "An value for the test $i $i $i" + s set $key $value + set list [s names] + errorCheck [llength $list] 1 "Failed Store_Fetch_List_Same_Key $::iterations -- Wrong \# of stored elements" + set result [s set $key] + errorCheck $result $value "Failed fetch Store_Fetch_List_Same_Key current key" + } + + s close + s destroy + return " PASSED with $store" +} + +# +# tests dependent on the Persistence package +# + +PersistenceTest instproc SimplePersistentObjects {store} { + set ox 1; set oy 1; set py 1; set px 1; + set oza 1; set ozb 1; set onames [list a b] + set pza 1; set pzb 1; set pnames [list a b] + + + + #puts stderr mixin=[pmgr info mixin] + #pmgr mixin [concat TraceStorage [pmgr info mixin]] + + for {set i 0} {$i < $::iterations} {incr i} { + PersistenceMgr pmgr -dirName . \ + -fileName testDB -dbPackage $store + # Two example objects with variables set to default values + Object o + o set x 1 + o set y 1 + o set threeLines "a +b +c" + + o array set z {a 1 b 1} + Object p + p set x 1 + p set y 1 + p array set z {a 1 b 1} + + o mixin Persistent=Eager + p mixin Persistent=Lazy + # for the mem storage Lazy Persistence makes not much sense + if {$store == "Mem"} {p mixin Persistent=Eager} + + o persistenceMgr pmgr + p persistenceMgr pmgr + o persistent {x y z threeLines} + p persistent {x y z} + + o incr x 2 + incr ox 2 + o append y 1 + append oy 1 + p incr x 3 + incr px 3 + p append y 2 + append py 2 + + o incr z(a) 2 + incr oza 2 + o append z(b) 1 + append ozb 1 + o set z($i) 5 + lappend onames $i + + p incr z(a) 2 + incr pza 2 + p append z(b) 1 + append pzb 1 + p set z($i) 5 + lappend pnames $i + + errorCheck [o set x] $ox "Persistence: o->x Failed" + errorCheck [o set y] $oy "Persistence: o->y Failed" + errorCheck [o set z(a)] $oza "Persistence: o->z(a) Failed" + errorCheck [o set z(b)] $ozb "Persistence: o->z(b) Failed" + errorCheckList [o array names z] $onames "Array indizes got lost - o -" + errorCheck [p set x] $px "Persistence: p->x Failed" + errorCheck [p set y] $py "Persistence: p->y Failed" + errorCheckList [o array names z] $onames "Array indizes got lost" + errorCheck [p set z(a)] $pza "Persistence: p->z(a) Failed" + errorCheck [p set z(b)] $pzb "Persistence: p->z(b) Failed" + errorCheckList [p array names z] $pnames "Array indizes got lost - p -" + + errorCheck [o set threeLines] {a +b +c} "Three Lines Failed" + + o destroy + p destroy + pmgr destroy + } + + #errorCheck $ox 21 "Persistence: o->x End Result Failed" + #errorCheck $oy 11111111111 "Persistence: o->y End Result Failed" + #errorCheck $px 31 "Persistence: p->x End Result Failed" + #errorCheck $py 12222222222 "Persistence: p->y End Result Failed" + + return " PASSED with $store" +} + +PersistenceTest instproc LotsOfObjects {store} { + set secondLoopMax 1 + PersistenceMgr pmgr -dirName . \ + -fileName testDB -dbPackage $store + for {set i 0} {$i < $::iterations} {incr i} { + # we create 10 objects per iteration + for {set j 0} {$j < $secondLoopMax} {incr j} { + Object iHaveaVeryLongName${i}${j} + Object iHaveaVeryLongName${i}${j}::meToo${i}${j} + iHaveaVeryLongName${i}${j} mixin Persistent=Eager + iHaveaVeryLongName${i}${j} persistenceMgr pmgr + iHaveaVeryLongName${i}${j}::meToo${i}${j} mixin Persistent=Eager + iHaveaVeryLongName${i}${j}::meToo${i}${j} persistenceMgr pmgr + foreach var {a b c d e f g h i j k l m n o p} { + iHaveaVeryLongName${i}${j} set $var " some useless test ...... + with spaces and lines breaks iHaveaVeryLongName$i $var $i + " + iHaveaVeryLongName${i}${j} persistent $var + iHaveaVeryLongName${i}${j}::meToo${i}${j} set $var " some useless test ...... + with spaces and lines breaks iHaveaVeryLongName$i $var $i + " + iHaveaVeryLongName${i}${j}::meToo${i}${j} persistent $var + } + } + } + pmgr destroy + return " PASSED with $store" +} + +PersistenceTest instproc random modulo { ;### random number generator + [self] instvar seed + set seed [expr {($seed*12731+34197) % 21473}] + return [expr {$seed % $modulo}] +} + +PersistenceTest instproc bigdb {store} { + Storage=$store s + s open testDB + set max 100000 + [self] set seed 4711 + for {set i 0} {$i < $max} {incr i} { + s set $i $i + } + [self] set seed 4711 + for {set i 0} {$i < $max} {incr i} { + set key [[self] random $max] + set r [s set $key] + errorCheck $r $key "Failed bigdb $::iterations -- Wrong result $r instead of $key" + } + s close + s destroy + return " PASSED with $store" +} + + + +PersistenceTest instproc runOnce {} { + eval file delete -force testDB [glob -nocomplain testDB*] + catch {xotcl::memStoragePool remove testDB} + foreach test $::tests { + puts "[[self] set run]: $test $::iterations" + foreach s $::stores { + set t [time {set result [[self] $test $s]}] + [self] report $test $s $t $result + eval file delete -force testDB [glob -nocomplain testDB*] + catch {xotcl::memStoragePool remove testDB} + } + } +} +PersistenceTest instproc run {runs} { + [self] instvar run + for {set run 1} {$run<=$runs} {incr run} { + pt runOnce + } +} + +PersistenceTest instproc report {test store time result} { + if {![regexp {^(-?[0-9]+) +(.*)$} $time _ ms string]} { + puts stderr "time <$time> could not be parsed" + return + } + set key bench($test,$store) + set better " " + if {[[self] exists $key]} { + if {[[self] set $key] > $ms} { + [self] set $key $ms + set better "+" + } + } else { + [self] set $key $ms + } + puts "[[self] set run]: [format %-22s $result]\ + $better[format %10d $ms] $string" +} + +PersistenceTest instproc table {} { + set f [open "persistent.cvs" w] + foreach test $::tests { + set values "" + foreach store $::stores { + lappend values [[self] set bench($test,$store)] + } + puts "[format %-30s $test];[join $values {;}]" + puts $f "[format %-30s $test];[join $values {;}]" + } + close $f +} + +PersistenceTest pt -run $::runs +if {$opt(-bench)} { + pt table +} Index: library/xotcl/tests/speedtest.xotcl =================================================================== diff -u --- library/xotcl/tests/speedtest.xotcl (revision 0) +++ library/xotcl/tests/speedtest.xotcl (revision b07223692b7ed8b9b1cfc81f202f73c066456c7c) @@ -0,0 +1,547 @@ +#memory trace on +package require XOTcl; namespace import ::xotcl::* + +package require nx::test +Test parameter count 1000 + +@ @File {description { + Regression and speed test for various ways to achieve a similar + behaviour. + } +} + +set ccount 20 +#set ocount 1014 +#set ocount [expr {$ccount + 206}] +#set ocount [expr {$ccount + 15}] +set ocount [expr {$ccount + 7}] + +Class M1; Class M2 +Class C -parameter {{p 99} {q 98} r} +C instproc f args {next} +C instproc init args { + my instvar n v + #for {set i 1} {$i<1000} {incr i} {set n($i) 1} + #for {set i 1} {$i<1000} {incr i} {Object [self]::$i} + for {set i 0} {$i<$::ccount} {incr i} {set n($i) 1} + for {set i 0} {$i<$::ccount} {incr i} {Object [self]::$i} + set v 1 +} + +C instproc mixinappend m { + my mixin [concat [my info mixin] $m] + my info mixin +} +C instproc ma m { + set mix [my info mixin] + my mixin [lappend mix $m] + my info mixin +} + +C instproc existsViaInstvar {} { + my instvar v + info exists v +} +C instproc existsViaMyInstvar {} { + my instvar v + info exists v +} +C instproc existsViaExistsMethod {} { + [self] exists v +} +C instproc existsViaMyExistsMethod {} { + my exists v +} +C instproc existsViaDotExistsMethod {} { + :exists v +} +C instproc existsViaResolver {} { + info exists :v +} +C instproc notExistsViaInstvar {} { + my instvar xxx + info exists xxx +} +C instproc notExistsViaExistsMethod {} { + my exists xxx +} + +C instproc existsAndReturnValue1 {} { + if {[my exists v]} { + my set v + } +} +C instproc existsAndReturnValue3 {} { + if {[my exists v]} { + set x [my set v] + } +} + +C instproc setViaInstvar x { + my instvar v + set v $x +} +C instproc setViaSetMethod x { + my set v $x +} +C instproc setViaParameter x { + my r $x +} +C instproc testAndSetViaInstvar x { + my instvar v + if {[info exists v]} {set v $x} +} +C instproc testAndSetViaSetMethod x { + if {[my info vars v] ne ""} {my set v $x} +} + +C instproc readViaInstvar {} { + my instvar p + set p +} +C instproc readViaSetMethod {} { + my set p +} +C instproc readViaSetMethodNoSelf {} { + ::c set p +} +C instproc readViaParameter {} { + my p +} + +C instproc readTwiceViaInstvar {} { + my instvar p + set p + set p +} +C instproc readTwiceViaSetMethod {} { + my set p + my set p +} +C instproc readTwiceViaSetMethodNoSelf {} { + ::c set p + ::c set p +} +C instproc readTwiceViaParameter {} { + my p + my p +} +C instproc readTwovarsViaInstvar {} { + my instvar p q + set p + set q +} +C instproc readTwovarsViaSetMethod {} { + my set p + my set q +} +C instproc readTwovarsViaSetMethodNoSelf {} { + ::c set p + ::c set q +} +C instproc readTwovarsViaParameter {} { + my p + my q +} + +C instproc instvarAlias {} { + my instvar {a b} + set b 1 + my exists a +} + + +C instproc explicitReturn {} { + return [set i 1] +} +C instproc implicitReturn {} { + set i 1 +} +C instproc explicitReturnFromVar {} { + set i 1 + return $i +} +C instproc implicitReturnFromVar {} { + set i 1 + set i +} + +C instproc childNodeNamespace {} { + Object [self]::13 +} +C instproc childNodeNamespaceCreate {} { + Object create [self]::13 +} +C instproc createVolatileRc {} { + Object new -volatile + return 2 +} + +C c +Class D -superclass C +D instproc init args {} +D d + +#Test new -cmd {llength [c info children]} -count 1 -expected 999 +#Test new -cmd {set x [llength [c info children]]} -count 1 -expected 999 +Test new -cmd {llength [c info children]} -count 1 -expected $ccount +Test new -cmd {set x [llength [c info children]]} -count 1 -expected $ccount +puts stderr XXX-[llength [Object info instances]]-[lsort [Object info instances]] +Test new -cmd {set x [llength [Object info instances]]} -count 1 -expected $ocount +Test new -cmd {llength [Object info instances]} -count 1 -expected $ocount + +Test new -cmd {d istype D} -expected 1 + +Test new -cmd {c setViaInstvar 100} -expected 100 +Test new -cmd {c setViaSetMethod 100} -expected 100 +Test new -cmd {c setViaParameter 100} -expected 100 + +Test new -cmd {c existsViaInstvar} +Test new -cmd {c existsViaMyInstvar} +Test new -cmd {c existsViaExistsMethod} +Test new -cmd {c existsViaMyExistsMethod} +Test new -cmd {c existsViaDotExistsMethod} +Test new -cmd {c existsViaResolver} +Test new -cmd {c exists v} +Test new -cmd {c notExistsViaInstvar} -expected 0 +Test new -cmd {c notExistsViaExistsMethod} -expected 0 +Test new -cmd {c exists xxx} -expected 0 + +Test new -cmd {c existsAndReturnValue1} -expected 100 +Test new -cmd {c existsAndReturnValue3} -expected 100 + +Test new -cmd {c testAndSetViaInstvar 100} -expected 100 +Test new -cmd {c testAndSetViaSetMethod 100} -expected 100 + +Test new -cmd {c readViaInstvar} -expected 99 +Test new -cmd {c readViaSetMethod} -expected 99 +Test new -cmd {c readViaParameter} -expected 99 +Test new -cmd {c readViaSetMethodNoSelf} -expected 99 + +Test new -cmd {c readTwiceViaInstvar} -expected 99 +Test new -cmd {c readTwiceViaSetMethod} -expected 99 +Test new -cmd {c readTwiceViaParameter} -expected 99 +Test new -cmd {c readTwiceViaSetMethodNoSelf} -expected 99 + +Test new -cmd {c readTwovarsViaInstvar} -expected 98 +Test new -cmd {c readTwovarsViaSetMethod} -expected 98 +Test new -cmd {c readTwovarsViaParameter} -expected 98 +Test new -cmd {c readTwovarsViaSetMethodNoSelf} -expected 98 + +Test new -cmd {c instvarAlias} + +Test new -cmd {c incr v} -post {c set v 1} -expected 101 +Test new -cmd {c unset v; set r [c exists v]; c set v 1; set r} -expected 0 + +Test new -cmd {llength [Object info instances]} -count 1 -expected $ocount +Test new -cmd {set x [llength [Object info instances]]} -count 1 -expected $ocount + +Test new -cmd {c explicitReturn} +Test new -cmd {c implicitReturn} +Test new -cmd {c explicitReturnFromVar} +Test new -cmd {c implicitReturnFromVar} + +Test new -cmd {llength [Object info instances]} -count 1 -expected $ocount +Test new -cmd {set x [llength [Object info instances]]} -count 1 -expected $ocount + +Test new -cmd {c childNodeNamespace} -expected ::c::13 +Test new -cmd {llength [Object info instances]} -count 1 -expected $ocount +Test new -cmd {c childNodeNamespaceCreate} -expected ::c::13 +Test new -cmd {llength [Object info instances]} -expected $ocount +Test new -cmd {c createVolatileRc} -expected 2 + +# should be still the same number as above +Test new -count 1 -cmd {llength [Object info instances]} -expected $ocount + +Test new -cmd {Object new -volatile} -expected ::nx::core::__\#F9 -count 2000 \ + -post {foreach o [Object info instances ::nx::core::__*] {$o destroy}} + +# should be still the same number as above +Test new -count 1 -cmd {llength [Object info instances]} -expected $ocount + +Test new -cmd {Object new} -expected ::nx::core::__\#lQ -count 2000 \ + -post {foreach o [Object info instances ::nx::core::__*] {$o destroy}} + +# should be still the same number as above +Test new -count 1 -cmd {llength [Object info instances]} -expected $ocount + +Test new -cmd {Object new -childof o} -expected ::o::__\#0Hh \ + -pre {Object o} -post {o destroy} + +# should be still the same number as above +Test new -count 1 -cmd {llength [Object info instances]} -expected $ocount + +Test new -count 1000 -pre {::set ::count 0} \ + -cmd {Object create [incr ::count]} \ + -expected ::1 \ + -post {::unset ::count} +Test new -count 1000 -pre {::set ::count 0} \ + -cmd {[incr ::count] destroy} \ + -post {::unset ::count} \ + -expected "" +# +Test new -count 1 -cmd {llength [Object info instances]} -expected $ocount +# we create another object +set ocount [expr {$ocount + 1}] +Test new -cmd {Object create x} -expected ::x +Test new -count 1 -cmd {llength [Object info instances]} -expected $ocount + +Test new -cmd {Object create x -set a -1 -set b ,, -set c a--} \ + -expected ::x +Test new -count 1 -cmd {llength [Object info instances]} -expected $ocount + +Test new -cmd {expr {[c array names n 5] ne ""}} + +Test new -count 1 -cmd {llength [Object info instances]} -expected $ocount +Test new -cmd {info exists c::n(5)} +Test new -count 1 -cmd {llength [Object info instances]} -expected $ocount +Test new -cmd {c exists n(5)} + +Test new -cmd {llength [c info children]} -expected $ccount +Test new -cmd {c info children ::c::5} -expected ::c::5 + +Test new -count 1 -cmd {llength [Object info instances]} -expected $ocount + +Test new -cmd {Object info instances ::c::5*} -expected ::c::5 +Test new -cmd {Object info instances ::c::5} -expected ::c::5 +Test new -cmd {Object info instances ::c::5000} -expected "" + +Test new -count 100 -pre {set ::c::l ""} \ + -cmd {lappend ::c::l 1} \ + -post {c unset l} + +Test new \ + -count 100 \ + -cmd {c mixinappend M1} \ + -expected ::M1 \ + -post {c mixin ""} + +Test new \ + -count 100 \ + -cmd {c ma M1} \ + -expected ::M1 \ + -post {c mixin ""} + +Test new \ + -count 100 \ + -cmd {c mixin add M1} \ + -expected "" \ + -post {c mixin ""} + +Test new \ + -count 100 \ + -cmd {c mixinappend M1; c mixinappend M2} \ + -expected {::M1 ::M2} \ + -post {c mixin ""} + +Test new \ + -count 100 \ + -cmd {c ma M1; c ma M2} \ + -expected {::M1 ::M2} \ + -post {c mixin ""} + +Test new \ + -count 100 \ + -pre {Class D; Class E; Object o -mixin {D E}} \ + -cmd {o info mixin D} \ + -expected {::D} \ + -post {foreach o {D E o} {$o destroy}} + +Test new \ + -count 100 \ + -pre {Class D; Class E; Object o -mixin {D E}} \ + -cmd {o info mixin E} \ + -expected {::E} \ + -post {foreach o {D E o} {$o destroy}} + +Test new \ + -count 100 \ + -pre {Class D; Class E; Object o -mixin {D E}} \ + -cmd {o info mixin ::E*} \ + -expected {::E} \ + -post {foreach o {D E o} {$o destroy}} + +Test new \ + -count 100 \ + -pre {Class D; Class E; Class E1; Object o -mixin {D E E1}} \ + -cmd {o info mixin ::E*} \ + -expected {::E ::E1} \ + -post {foreach o {D E E1 o} {$o destroy}} + +Test new \ + -count 100 \ + -pre {Class D; Class E; Class X -instmixin {D E}} \ + -cmd {X info instmixin D} \ + -expected {::D} \ + -post {foreach o {D E X} {$o destroy}} + +Test new \ + -count 100 \ + -pre {Class D; Class E; Class X -instmixin {D E}} \ + -cmd {X info instmixin E} \ + -expected {::E} \ + -post {foreach o {D E X} {$o destroy}} + +Test new \ + -count 100 \ + -pre {Class D; Class E; Class E1; Class X -instmixin {D E E1}} \ + -cmd {X info instmixin ::E*} \ + -expected {::E ::E1} \ + -post {foreach o {D E E1 X} {$o destroy}} + +Test new \ + -count 100 \ + -pre {Class D; Class E; Class X -instmixin {D E}} \ + -cmd {X info instmixin ::E*} \ + -expected {::E} \ + -post {foreach o {D E X} {$o destroy}} + +Test new \ + -count 100 \ + -pre {Class D; Class E; Class X} \ + -cmd {X instmixin {D E}; X instmixin delete ::E; X info instmixin} \ + -expected {::D} \ + -post {foreach o {D E X} {$o destroy}} + +Test new \ + -count 100 \ + -pre {Class D; Class E; Class X} \ + -cmd {X instmixin {D E}; X instmixin delete E; X info instmixin} \ + -expected {::D} \ + -post {foreach o {D E X} {$o destroy}} + +Test new \ + -count 100 \ + -pre {Class D; Class E; Class E1; Class X} \ + -cmd {X instmixin {D E E1}; catch {X instmixin delete ::E*}; X info instmixin} \ + -expected {::D} \ + -post {foreach o {D E E1 X} {$o destroy}} + +Test new \ + -count 100 \ + -pre {Class D; Class E; Class E1; Class X} \ + -cmd {X instmixin {D E E1}; catch {X instmixin delete E*}; X info instmixin} \ + -expected {::D} \ + -post {foreach o {D E E1 X} {$o destroy}} + +Test new \ + -cmd {C instfilter f; C info instfilter} \ + -expected f \ + -post {C instfilter ""} + +Test new -pre {set s \#hallo} -cmd {string match "\#*" $s} +Test new -pre {set s \#hallo} -cmd {regexp {^\#} $s} +Test new -pre {set s \#hallo} -cmd {expr {[string first "\#" $s] == 0}} +Test new -pre {set s \#hallo} -cmd {expr {[string range $s 0 0] == "\#"}} + +Test new -pre {set s \#hallo} -cmd {regexp {^\#.*a} $s} +Test new -pre {set s \#hallo} -cmd {regexp {^\#.*a.*o} $s} +Test new -pre {set s \#hallo} -cmd {regexp {^\#.*a(.*)o} $s} +Test new -pre {set s \#hallo} -cmd {regexp {^\#.*a(.*)o} $s _} +Test new -pre {set s \#hallo} -cmd {regexp {^\#.*a(.*)o} $s _ out} + +Test new -msg {call proc of subobject directly} \ + -pre {C c2; C c2::o; c2::o proc f a {incr a}} \ + -cmd {c2::o::f 10} -expected 11 -count 5000 \ + -post {c2 destroy} +Test new -msg {call proc of subobject via dispatch} \ + -pre {C c2; C c2::o; c2::o proc f a {incr a}} \ + -cmd {c2::o f 10} -expected 11 -count 5000 \ + -post {c2 destroy} +Test new -msg {call proc of object and subobject via dispatch} \ + -pre {C c2; C c2::o; c2::o proc f a {incr a}} \ + -cmd {c2 o f 10} -expected 11 -count 5000 \ + -post {c2 destroy} + +Test new -msg {dispatch subobject directy via [self]} \ + -pre {C c2; C c2::o; c2::o proc f a {incr a}; c2 proc t a {[self]::o f $a}} \ + -cmd {c2 t 12} -expected 13 -count 5000 \ + -post {c2 destroy} +Test new -msg {dispatch subobject via my} \ + -pre {C c2; C c2::o; c2::o proc f a {incr a}; c2 proc t a {my o f $a}} \ + -cmd {c2 t 12} -expected 13 -count 5000 \ + -post {c2 destroy} + + +###### insttclcmd tests +set cnt 10000 +#Test new -msg {call insttclcmd (append) and check created variable} \ + -pre {Object o} \ + -cmd {o append X 1; o exists X} -expected 1 \ + -post {o destroy} +#Test new -msg {call tclcmd (regexep) and check created variable} \ + -pre {Object o; o tclcmd regexp} \ + -cmd {o regexp (a) a _ x; o exists x} -expected 1 -count $cnt \ + -post {o destroy} +Test new -msg {call forwarder for (append) and check created variable} \ + -pre {Object o; o forward append -objscope} \ + -cmd {o append X 1; o exists X} -expected 1 \ + -post {o destroy} +Test new -msg {call forwarder (regexep) and check created variable} \ + -pre {Object o; o forward regexp -objscope} \ + -cmd {o regexp (a) a _ x; o exists x} -expected 1 -count $cnt \ + -post {o destroy} +Test new -msg {call forwarder to another obj} \ + -pre {Object o; Object t; o forward set t set; t set x 100} \ + -cmd {o set x} -expected 100 -count $cnt \ + -post {o destroy} + +set cnt 100000 +Test new -msg {call handcoded incr} \ + -pre {Class C; C create o; o set x 1} \ + -cmd {o incr x 77} -expected 78 -count $cnt \ + -post {o destroy} +Test new -msg {call incr via instforward} \ + -pre {Class C; C instforward ::incr -objscope; C create o; o set x 1} \ + -cmd {o incr x 77} -expected 78 -count $cnt \ + -post {o destroy} +Test new -msg {call incr via forward} \ + -pre {Class C; C create o; o forward ::incr -objscope; o set x 1} \ + -cmd {o incr x 77} -expected 78 -count $cnt \ + -post {o destroy} +set cnt 10000 +Test new -msg {call obj with namespace via forward} \ + -pre {Object n; Object n::x; Object o -forward ::n::x} \ + -cmd {o x self} -expected ::n::x -count $cnt \ + -post {o destroy} +Test new -msg {call obj with namespace via instforward} \ + -pre {Object n; Object n::x; Class C; C create o; C instforward ::n::x} \ + -cmd {o x self} -expected ::n::x -count $cnt \ + -post {o destroy} +Test new -msg {call obj with namespace via instforward and mixinclass} \ + -pre {Object n; Object n::x; Class M -instforward ::n::x; + Class C -instmixin M; C create o } \ + -cmd {o x self} -expected ::n::x -count $cnt \ + -post {o destroy} +Test new -msg {call obj with namespace via instforward and next from proc} \ + -pre { + Object n; Object n::x; + Class C -instforward ::n::x; + C create o -proc x args {next} } \ + -cmd {o x self} -expected ::n::x -count $cnt \ + -post {o destroy} +Test new -msg {call obj with namespace via instforward and next from instproc} \ + -pre { + Object n; Object n::x; + Class C -instforward ::n::x; + Class D -superclass C -instproc x args {next}; + D create o } \ + -cmd {o x self} -expected ::n::x -count $cnt \ + -post {o destroy} +Test new -msg {call obj with namespace via mixin and instforward and next} \ + -pre {Object n; Object n::x; + Class M -instforward ::n::x; + Class N -superclass M -instproc x args {next}; + Class C -instmixin N; C create o} \ + -cmd {o x self} -expected ::n::x -count $cnt \ + -post {o destroy} +Test new -msg {return -code break} \ + -pre {Class A -instproc br {} {return -code break}; A create a1} \ + -cmd {catch {a1 br}} -expected 3 -count 2 \ + -post {A destroy; a1 destroy} + + +Test run; exit + + + Index: library/xotcl/tests/xoRDF.test =================================================================== diff -u --- library/xotcl/tests/xoRDF.test (revision 0) +++ library/xotcl/tests/xoRDF.test (revision b07223692b7ed8b9b1cfc81f202f73c066456c7c) @@ -0,0 +1,1661 @@ +# -*- Tcl -*- +# +package require XOTcl; namespace import -force xotcl::* + +lappend auto_path [file dir [info script]]/.. +#package require package;package verbose 1 +package require xotcl::rdf::parser +package require xotcl::rdf::recreatorVisitor +package require xotcl::rdf::triple + +proc errorCheck {expected result msg} { + set expected [string trim $expected \n] + set result [string trim $result \n] + foreach e [split $expected \n] r [split $result \n] { + set e [string trim $e] + set r [string trim $r] + if {$e != $r} { + puts stderr "FAILED: $msg\nGot: '$r'\nExpected: '$e'" + puts stderr "Full Result:\n$result" + puts stderr "RAW Triples:" + foreach t [lsort [tripleVisitor::db getTriples]] { + puts -nonewline stderr [$t dump] + } + exit -1 + return + } + } +} + +Class TestVisitor -superclass NodeTreeVisitor +TestVisitor instproc visit objName { + my append result [string trim [$objName print]] \n +} +TestVisitor instproc interpretNodeTree {node} { + my set result "" + $node accept [self] + return [my set result] +} + +TestVisitor testVisitor +RDFRecreatorVisitor reVisitor +TripleVisitor tripleVisitor +tripleVisitor proc interpret {parser topNode {asBag 1}} { + set result "" + my descriptionAsBag $asBag + my reset + my interpretNodeTree $topNode + return [[self]::db prettyTriples] + # foreach t [lsort [[self]::db getTriples]] { + # append result [string trim [$t dump]]\n + # } + # return $result +} + +RDFParser rp +rp proc time {cmd time} { + upvar $time ms + regexp {^(-?[0-9]+) } [::time {set r [eval $cmd]}] _ ms + return $r +} + +rp proc test {name text nodeResult tripleResult {descriptionAsBagResult ""}} { + my reset + foreach time {nodeTime recreateTime tripleTime} { + if {![my exists $time]} {my set $time 0} + } + my parse $text + set r [rp time [list testVisitor interpretNodeTree [self]::topNode1] ct] + regsub -all "[self]::topNode1" $r "" r + ::errorCheck $nodeResult $r "RDF Node Creation: $name" + + #set r [time [list reVisitor interpretNodeTree [self]::topNode1] rt] + #::errorCheck $recreateResult $r "RDF Recreation: $name" + set r [rp time [list tripleVisitor interpret rp [self]::topNode1 0] tt] + ::errorCheck $tripleResult $r "RDF Triples: $name" + if {$descriptionAsBagResult != ""} { + set r [tripleVisitor interpret rp [self]::topNode1 1] + ::errorCheck $descriptionAsBagResult $r "RDF Triples -- Description as Bag: $name" + } + + # test recreation by recreating XML text and by parsing + # and testing it again + set recreatedText [rp time [list reVisitor interpretNodeTree [self]::topNode1] rt] + [self]::topNode1 destroy + + my reset + my parse $recreatedText + + #puts "RECREATED: \n$recreatedText" + + # test recreated node tree + set r [testVisitor interpretNodeTree [self]::topNode1] + regsub -all "[self]::topNode1" $r "" r + ::errorCheck $nodeResult $r "RDF Node Recreation: $name" + set r [tripleVisitor interpret rp [self]::topNode1 0] + + ::errorCheck $tripleResult $r "RDF Triple Recreation: $name" + + my incr nodeTime $ct + my incr recreateTime $rt + my incr tripleTime $tt + puts "PASSED: $name ($ct + $rt + $tt)" +} + +############################################################################## +rp test "Namespace" { + + + + + xyz + dfg + + + + +} { +::xotcl::rdf::parser::RDFTag- --- RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- Description +ATTR: about = http://www.w3.org/Home/Lassila +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:Creator +::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1 --- Description +ATTR: ID = nsd +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop1 --- s:ABC +PCDATA: +xyz +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2 --- fromXYZ +PCDATA: +dfg +} { + http://www.w3.org/Home/Lassila http://description.org/schema/Creator nsd + nsd http://description.org/schema/ABC xyz + nsd http://xyz.com/fromXYZ dfg +} + +############################################################################## +rp test descriptionNestedNS { + + + Ora Lassila + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = http://www.w3.org/Home/Lassila +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:Creator +PCDATA: +Ora Lassila +} { + http://www.w3.org/Home/Lassila http://description.org/schema/Creator Ora Lassila +} { + http://www.w3.org/Home/Lassila http://description.org/schema/Creator Ora Lassila + +=================== unreferenced: + rdfdoc#id1 #type #Bag + rdfdoc#id1 #_1 rdfdoc#id2 + rdfdoc#id2 #predicate http://description.org/schema/Creator + rdfdoc#id2 #subject http://www.w3.org/Home/Lassila + rdfdoc#id2 #object Ora Lassila + rdfdoc#id2 #type #Statement +} + +############################################################################## +rp test NSDescription { + + + Ora Lassila + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = http://www.w3.org/Home/Lassila +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:Creator +PCDATA: +Ora Lassila +} { + http://www.w3.org/Home/Lassila http://description.org/schema/Creator Ora Lassila +} + +############################################################################## +rp test PropertyAttr { + + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = http://www.w3.org/Home/Lassila +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:Creator +PCDATA: +Ora Lassila +} { + http://www.w3.org/Home/Lassila s:Creator Ora Lassila +} + +############################################################################## +rp test properties { + + + World Wide Web Consortium + W3C Home Page + 1998-10-03T02:27 + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = http://www.w3.org +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:Publisher +PCDATA: +World Wide Web Consortium +::xotcl::rdf::parser::RDFProperty-::res1::prop2 --- s:Title +PCDATA: +W3C Home Page +::xotcl::rdf::parser::RDFProperty-::res1::prop3 --- s:Date +PCDATA: +1998-10-03T02:27 +} { + http://www.w3.org s:Publisher World Wide Web Consortium + http://www.w3.org s:Title W3C Home Page + http://www.w3.org s:Date 1998-10-03T02:27 +} + +############################################################################## +rp test propertyAttr2 { + + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = http://www.w3.org +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:Publisher +PCDATA: +World Wide Web Consortium +::xotcl::rdf::parser::RDFProperty-::res1::prop2 --- s:Title +PCDATA: +W3C Home Page +::xotcl::rdf::parser::RDFProperty-::res1::prop3 --- s:Date +PCDATA: +1998-10-03T02:27 +} { + http://www.w3.org s:Publisher World Wide Web Consortium + http://www.w3.org s:Title W3C Home Page + http://www.w3.org s:Date 1998-10-03T02:27 +} + +############################################################################## +rp test bag1 { + + + + + + + + + + + + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = http://mycollege.edu/courses/6.001 +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:students +::xotcl::rdf::parser::RDFBag-::res1::prop1::res1 --- rdf:Bag +TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop1 --- rdf:li +ATTR: resource = http://mycollege.edu/students/Amy +MEMBER-INDEX: rdf:_1 +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop2 --- rdf:li +ATTR: resource = http://mycollege.edu/students/Tim +MEMBER-INDEX: rdf:_2 +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop3 --- rdf:li +ATTR: resource = http://mycollege.edu/students/John +MEMBER-INDEX: rdf:_3 +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop4 --- rdf:li +ATTR: resource = http://mycollege.edu/students/Mary +MEMBER-INDEX: rdf:_4 +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop5 --- rdf:li +ATTR: resource = http://mycollege.edu/students/Sue +MEMBER-INDEX: rdf:_5 +} { + http://mycollege.edu/courses/6.001 s:students rdfdoc#id2 + rdfdoc#id2 #type #Bag + rdfdoc#id2 #_1 http://mycollege.edu/students/Amy + rdfdoc#id2 #_2 http://mycollege.edu/students/Tim + rdfdoc#id2 #_3 http://mycollege.edu/students/John + rdfdoc#id2 #_4 http://mycollege.edu/students/Mary + rdfdoc#id2 #_5 http://mycollege.edu/students/Sue +} + + +############################################################################## +rp test bagGivenAsType1 { + + + + + + + + + + + + + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = http://mycollege.edu/courses/6.001 +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:students +::xotcl::rdf::parser::RDFBag-::res1::prop1::res1 --- rdf:Bag +TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop1 --- rdf:li +ATTR: resource = http://mycollege.edu/students/Amy +MEMBER-INDEX: rdf:_1 +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop2 --- rdf:li +ATTR: resource = http://mycollege.edu/students/Tim +MEMBER-INDEX: rdf:_2 +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop3 --- rdf:li +ATTR: resource = http://mycollege.edu/students/John +MEMBER-INDEX: rdf:_3 +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop4 --- rdf:li +ATTR: resource = http://mycollege.edu/students/Mary +MEMBER-INDEX: rdf:_4 +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop5 --- rdf:li +ATTR: resource = http://mycollege.edu/students/Sue +MEMBER-INDEX: rdf:_5 +} { + http://mycollege.edu/courses/6.001 s:students rdfdoc#id2 + rdfdoc#id2 #type #Bag + rdfdoc#id2 #_1 http://mycollege.edu/students/Amy + rdfdoc#id2 #_2 http://mycollege.edu/students/Tim + rdfdoc#id2 #_3 http://mycollege.edu/students/John + rdfdoc#id2 #_4 http://mycollege.edu/students/Mary + rdfdoc#id2 #_5 http://mycollege.edu/students/Sue +} + +############################################################################## +rp test bagGivenAsType2 { + + + + + + + + + + + + + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = http://mycollege.edu/courses/6.001 +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:students +::xotcl::rdf::parser::RDFBag-::res1::prop1::res1 --- rdf:Bag +TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop1 --- rdf:li +ATTR: resource = http://mycollege.edu/students/Amy +MEMBER-INDEX: rdf:_1 +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop2 --- rdf:li +ATTR: resource = http://mycollege.edu/students/Tim +MEMBER-INDEX: rdf:_2 +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop3 --- rdf:li +ATTR: resource = http://mycollege.edu/students/John +MEMBER-INDEX: rdf:_3 +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop4 --- rdf:li +ATTR: resource = http://mycollege.edu/students/Mary +MEMBER-INDEX: rdf:_4 +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop5 --- rdf:li +ATTR: resource = http://mycollege.edu/students/Sue +MEMBER-INDEX: rdf:_5 +} { + http://mycollege.edu/courses/6.001 s:students rdfdoc#id2 + rdfdoc#id2 #type #Bag + rdfdoc#id2 #_1 http://mycollege.edu/students/Amy + rdfdoc#id2 #_2 http://mycollege.edu/students/Tim + rdfdoc#id2 #_3 http://mycollege.edu/students/John + rdfdoc#id2 #_4 http://mycollege.edu/students/Mary + rdfdoc#id2 #_5 http://mycollege.edu/students/Sue +} + + +############################################################################## +rp test bagAndAltGivenAsType { + + + + + + + + + + + + + + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = http://mycollege.edu/courses/6.001 +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:students +::xotcl::rdf::parser::RDFAlt-::res1::prop1::res1 --- rdf:Alt +TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Alt http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop1 --- rdf:li +ATTR: resource = http://mycollege.edu/students/Amy +MEMBER-INDEX: rdf:_1 +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop2 --- rdf:li +ATTR: resource = http://mycollege.edu/students/Tim +MEMBER-INDEX: rdf:_2 +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop3 --- rdf:li +ATTR: resource = http://mycollege.edu/students/John +MEMBER-INDEX: rdf:_3 +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop4 --- rdf:li +ATTR: resource = http://mycollege.edu/students/Mary +MEMBER-INDEX: rdf:_4 +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop5 --- rdf:li +ATTR: resource = http://mycollege.edu/students/Sue +MEMBER-INDEX: rdf:_5 +} { + http://mycollege.edu/courses/6.001 s:students rdfdoc#id2 + rdfdoc#id2 #type #Alt + rdfdoc#id2 #type #Bag + rdfdoc#id2 #_1 http://mycollege.edu/students/Amy + rdfdoc#id2 #_2 http://mycollege.edu/students/Tim + rdfdoc#id2 #_3 http://mycollege.edu/students/John + rdfdoc#id2 #_4 http://mycollege.edu/students/Mary + rdfdoc#id2 #_5 http://mycollege.edu/students/Sue +} + +############################################################################## +rp test alt1 { + + + + + + + + + + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = http://x.org/packages/X11 +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:DistributionSite +::xotcl::rdf::parser::RDFAlt-::res1::prop1::res1 --- rdf:Alt +TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Alt +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop1 --- rdf:li +ATTR: resource = ftp://ftp.x.org +MEMBER-INDEX: rdf:_1 +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop2 --- rdf:li +ATTR: resource = ftp://ftp.cs.purdue.edu +MEMBER-INDEX: rdf:_2 +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop3 --- rdf:li +ATTR: resource = ftp://ftp.eu.net +MEMBER-INDEX: rdf:_3 +} { + http://x.org/packages/X11 s:DistributionSite rdfdoc#id2 + rdfdoc#id2 #type #Alt + rdfdoc#id2 #_1 ftp://ftp.x.org + rdfdoc#id2 #_2 ftp://ftp.cs.purdue.edu + rdfdoc#id2 #_3 ftp://ftp.eu.net +} + +############################################################################## +rp test bag2 { + + + + + + + + Ora Lassila + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFBag-::res1 --- rdf:Bag +ATTR: ID = pages +TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag +::xotcl::rdf::parser::RDFMember-::res1::prop1 --- rdf:li +ATTR: resource = http://foo.org/foo.html +MEMBER-INDEX: rdf:_1 +::xotcl::rdf::parser::RDFMember-::res1::prop2 --- rdf:li +ATTR: resource = http://bar.org/bar.html +MEMBER-INDEX: rdf:_2 +::xotcl::rdf::parser::RDFDescription-::res2 --- rdf:Description +ATTR: about = #pages +::xotcl::rdf::parser::RDFProperty-::res2::prop1 --- s:Creator +PCDATA: +Ora Lassila +} { +=================== unreferenced: + rdfdoc#pages #type #Bag + rdfdoc#pages #_1 http://foo.org/foo.html + rdfdoc#pages #_2 http://bar.org/bar.html + rdfdoc#pages s:Creator Ora Lassila +} + +############################################################################## +rp test aboutEach { + + + (c) 1998, The Foo Organization + + + (c) 1998, The Foo Organization + + + + + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: aboutEachPrefix = http://foo.org/doc +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:Copyright +PCDATA: +(c) 1998, The Foo Organization +::xotcl::rdf::parser::RDFDescription-::res2 --- rdf:Description +ATTR: aboutEach = #docpages +::xotcl::rdf::parser::RDFProperty-::res2::prop1 --- s:Copyright +PCDATA: +(c) 1998, The Foo Organization +::xotcl::rdf::parser::RDFBag-::res3 --- rdf:Bag +ATTR: ID = docpages +TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag +::xotcl::rdf::parser::RDFMember-::res3::prop1 --- rdf:li +ATTR: resource = http://foo.org/doc/page1 +MEMBER-INDEX: rdf:_1 +::xotcl::rdf::parser::RDFMember-::res3::prop2 --- rdf:li +ATTR: resource = http://foo.org/doc/page2 +MEMBER-INDEX: rdf:_2 +} { + http://foo.org/doc/page1 http://description.org/schema/Copyright (c) 1998, The Foo Organization + http://foo.org/doc/page2 http://description.org/schema/Copyright (c) 1998, The Foo Organization + +=================== unreferenced: + rdfdoc#docpages #type #Bag + rdfdoc#docpages #_1 http://foo.org/doc/page1 + rdfdoc#docpages #_2 http://foo.org/doc/page2 +} + +############################################################################## +rp test "BagID on List" { + + + + + + + + + Me + + + + + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: aboutEach = #docpages +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:somebag +::xotcl::rdf::parser::RDFBag-::res1::prop1::res1 --- rdf:Bag +TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop1 --- rdf:li +ATTR: resource = http://foo.org/foo.html +MEMBER-INDEX: rdf:_1 +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop2 --- rdf:li +ATTR: resource = http://bar.org/bar.html +MEMBER-INDEX: rdf:_2 +::xotcl::rdf::parser::RDFProperty-::res1::prop2 --- s:Creator +PCDATA: +Me +::xotcl::rdf::parser::RDFBag-::res2 --- rdf:Bag +ATTR: ID = docpages +TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag +::xotcl::rdf::parser::RDFMember-::res2::prop1 --- rdf:li +ATTR: resource = http://foo.org/doc/page1 +MEMBER-INDEX: rdf:_1 +::xotcl::rdf::parser::RDFMember-::res2::prop2 --- rdf:li +ATTR: resource = http://foo.org/doc/page2 +MEMBER-INDEX: rdf:_2 +} { + http://foo.org/doc/page1 http://description.org/schema/somebag rdfdoc#id2 + rdfdoc#id2 #type #Bag + rdfdoc#id2 #_1 http://foo.org/foo.html + rdfdoc#id2 #_2 http://bar.org/bar.html + http://foo.org/doc/page1 http://description.org/schema/Creator Me + http://foo.org/doc/page2 http://description.org/schema/somebag rdfdoc#id2 + http://foo.org/doc/page2 http://description.org/schema/Creator Me + +=================== unreferenced: + rdfdoc#docpages #type #Bag + rdfdoc#docpages #_1 http://foo.org/doc/page1 + rdfdoc#docpages #_2 http://foo.org/doc/page2 +} + +############################################################################## +rp test "Sharing Values" { + + + + + + + + + + + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFSeq-::res1 --- rdf:Seq +ATTR: ID = JSPapersByDate +TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq +::xotcl::rdf::parser::RDFMember-::res1::prop1 --- rdf:li +ATTR: resource = http://www.dogworld.com/Aug96.doc +MEMBER-INDEX: rdf:_1 +::xotcl::rdf::parser::RDFMember-::res1::prop2 --- rdf:li +ATTR: resource = http://www.webnuts.net/Jan97.html +MEMBER-INDEX: rdf:_2 +::xotcl::rdf::parser::RDFMember-::res1::prop3 --- rdf:li +ATTR: resource = http://www.carchat.com/Sept97.html +MEMBER-INDEX: rdf:_3 +::xotcl::rdf::parser::RDFSeq-::res2 --- rdf:Seq +ATTR: ID = JSPapersBySubj +TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq +::xotcl::rdf::parser::RDFMember-::res2::prop1 --- rdf:li +ATTR: resource = http://www.carchat.com/Sept97.html +MEMBER-INDEX: rdf:_1 +::xotcl::rdf::parser::RDFMember-::res2::prop2 --- rdf:li +ATTR: resource = http://www.dogworld.com/Aug96.doc +MEMBER-INDEX: rdf:_2 +::xotcl::rdf::parser::RDFMember-::res2::prop3 --- rdf:li +ATTR: resource = http://www.webnuts.net/Jan97.html +MEMBER-INDEX: rdf:_3 +} { +=================== unreferenced: + rdfdoc#JSPapersByDate #type #Seq + rdfdoc#JSPapersByDate #_1 http://www.dogworld.com/Aug96.doc + rdfdoc#JSPapersByDate #_2 http://www.webnuts.net/Jan97.html + rdfdoc#JSPapersByDate #_3 http://www.carchat.com/Sept97.html + rdfdoc#JSPapersBySubj #type #Seq + rdfdoc#JSPapersBySubj #_1 http://www.carchat.com/Sept97.html + rdfdoc#JSPapersBySubj #_2 http://www.dogworld.com/Aug96.doc + rdfdoc#JSPapersBySubj #_3 http://www.webnuts.net/Jan97.html +} + +############################################################################## + +rp test "aggregates" { + + + + + Mary Andrew + Jacky Crystal + + + + + + + + + + + + + The Coolest Web Page + Il Pagio di Web Fuba + + + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = http://www.foo.com/cool.html +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- dc:Creator +::xotcl::rdf::parser::RDFSeq-::res1::prop1::res1 --- rdf:Seq +ATTR: ID = CreatorsAlphabeticalBySurname +TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop1 --- rdf:li +PCDATA: +Mary Andrew +MEMBER-INDEX: rdf:_1 +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop2 --- rdf:li +PCDATA: +Jacky Crystal +MEMBER-INDEX: rdf:_2 +::xotcl::rdf::parser::RDFProperty-::res1::prop2 --- dc:Identifier +::xotcl::rdf::parser::RDFBag-::res1::prop2::res1 --- rdf:Bag +ATTR: ID = MirroredSites +TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag +::xotcl::rdf::parser::RDFMember-::res1::prop2::res1::prop1 --- rdf:li +ATTR: rdf:resource = http://www.foo.com.au/cool.html +MEMBER-INDEX: rdf:_1 +::xotcl::rdf::parser::RDFMember-::res1::prop2::res1::prop2 --- rdf:li +ATTR: rdf:resource = http://www.foo.com.it/cool.html +MEMBER-INDEX: rdf:_2 +::xotcl::rdf::parser::RDFProperty-::res1::prop3 --- dc:Title +::xotcl::rdf::parser::RDFAlt-::res1::prop3::res1 --- rdf:Alt +TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Alt +::xotcl::rdf::parser::RDFMember-::res1::prop3::res1::prop1 --- rdf:li +ATTR: xml:lang = en +PCDATA: +The Coolest Web Page +MEMBER-INDEX: rdf:_1 +::xotcl::rdf::parser::RDFMember-::res1::prop3::res1::prop2 --- rdf:li +ATTR: xml:lang = it +PCDATA: +Il Pagio di Web Fuba +MEMBER-INDEX: rdf:_2 +} { + http://www.foo.com/cool.html http://purl.org/metadata/dublin_core#Creator rdfdoc#CreatorsAlphabeticalBySurname + rdfdoc#CreatorsAlphabeticalBySurname #type #Seq + rdfdoc#CreatorsAlphabeticalBySurname #_1 Mary Andrew + rdfdoc#CreatorsAlphabeticalBySurname #_2 Jacky Crystal + http://www.foo.com/cool.html http://purl.org/metadata/dublin_core#Identifier rdfdoc#MirroredSites + rdfdoc#MirroredSites #type #Bag + rdfdoc#MirroredSites #_1 http://www.foo.com.au/cool.html + rdfdoc#MirroredSites #_2 http://www.foo.com.it/cool.html + http://www.foo.com/cool.html http://purl.org/metadata/dublin_core#Title rdfdoc#id4 + rdfdoc#id4 #type #Alt + rdfdoc#id4 #_1 The Coolest Web Page + rdfdoc#id4 #_2 Il Pagio di Web Fuba +} + +############################################################################## +rp test "bagReification" { + + + + literal, well-formed tag + + + xyz + + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFBag-::res1 --- rdf:Bag +TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag +::xotcl::rdf::parser::RDFMember-::res1::prop1 --- rdf:li +ATTR: parseType = Literal +PCDATA: + + literal, well-formed tag + +MEMBER-INDEX: rdf:_1 +::xotcl::rdf::parser::RDFMember-::res1::prop2 --- rdf:li +MEMBER-INDEX: rdf:_2 +::xotcl::rdf::parser::RDFDescription-::res1::prop2::res1 --- rdf:Description +::xotcl::rdf::parser::RDFProperty-::res1::prop2::res1::prop1 --- s:x +PCDATA: +xyz +} { +=================== unreferenced: + rdfdoc#id1 #type #Bag + rdfdoc#id1 #_1 + literal, well-formed tag + + rdfdoc#id1 #_2 rdfdoc#id2 + rdfdoc#id2 http://description.org/schema/x xyz +} + +# the following reification is done by SirPac, but it does not seem necessary +# (uncomment reify property in RDFTriple, if needed +#{ +#=================== unreferenced: +# rdfdoc#id1 #type #Bag +# rdfdoc#id1 #_1 +# literal, well-formed tag +# +# rdfdoc#id1 #_2 rdfdoc#id2 +# rdfdoc#id2 http://description.org/schema/x xyz +# rdfdoc#id3 #predicate http://description.org/schema/x +# rdfdoc#id3 #subject rdfdoc#id2 +# rdfdoc#id3 #object xyz +# rdfdoc#id3 #type #Statement +#} + +############################################################################## +rp test "parseLiteral" { + + + + xyz + + + + + + + xyz + + + + + + + + + + + + + + literal, well-formed tag + + + literal, well-formed tag + + + xyz + + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = http://mycollege.edu/ +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:students +ATTR: parseType = Literal +PCDATA: + + xyz +::xotcl::rdf::parser::RDFDescription-::res2 --- rdf:Description +ATTR: about = http://mycollege.edu/ +::xotcl::rdf::parser::RDFProperty-::res2::prop1 --- s:students +ATTR: parseType = Literal +PCDATA: + + + xyz + + + + + + + + +::xotcl::rdf::parser::RDFBag-::res3 --- rdf:Bag +TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag +::xotcl::rdf::parser::RDFMember-::res3::prop1 --- rdf:li +ATTR: parseType = Literal +PCDATA: + + literal, well-formed tag + +MEMBER-INDEX: rdf:_1 +::xotcl::rdf::parser::RDFMember-::res3::prop2 --- rdf:li +ATTR: parseType = AllOtherMustbeLiteral +PCDATA: + + literal, well-formed tag + +MEMBER-INDEX: rdf:_2 +::xotcl::rdf::parser::RDFMember-::res3::prop3 --- rdf:li +MEMBER-INDEX: rdf:_3 +::xotcl::rdf::parser::RDFDescription-::res3::prop3::res1 --- rdf:Description +::xotcl::rdf::parser::RDFProperty-::res3::prop3::res1::prop1 --- s:x +PCDATA: +xyz +} { + http://mycollege.edu/ http://description.org/schema/students + xyz + + http://mycollege.edu/ http://description.org/schema/students + + xyz + + + + + + + + + + +=================== unreferenced: + rdfdoc#id3 #type #Bag + rdfdoc#id3 #_1 + literal, well-formed tag + + rdfdoc#id3 #_2 + literal, well-formed tag + + rdfdoc#id3 #_3 rdfdoc#id4 + rdfdoc#id4 http://description.org/schema/x xyz +} + +############################################################################## +rp test typedNode1 { + + + + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = http://www.xyz.com +TYPES: http://purl.org/dc/elements/1.0/typed +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- DC:Creator +ATTR: rdf:resource = http://www.xyz.com/homepage/ +} { + http://www.xyz.com http://purl.org/dc/elements/1.0/Creator http://www.xyz.com/homepage/ + http://www.xyz.com #type http://purl.org/dc/elements/1.0/typed +} + +################################################################### +## UWE: im wiedererzeugten XML/RDF fehlt m.M. das parseType="Resosurce" + +rp test nestedProperty { + + + + + +} { +::xotcl::rdf::parser::RDFTag- --- RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- Description +ATTR: about = http://www.webnuts.net/Jan97.html +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- dc:Subject +::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1 --- rdf:Description +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop1 --- value +PCDATA: +020 - Library Science +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2 --- l:Classification +PCDATA: +Dewey Decimal Code +} { + http://www.webnuts.net/Jan97.html http://purl.org/metadata/dublin_core#Subject rdfdoc#id2 + rdfdoc#id2 #value 020 - Library Science + rdfdoc#id2 http://mycorp.com/schemas/my-schema#Classification Dewey Decimal Code +} + + +rp test nestedProperty2 { + + + + 020 - Library Science + Dewey Decimal Code + + + +} { +::xotcl::rdf::parser::RDFTag- --- RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- Description +ATTR: about = http://www.webnuts.net/Jan97.html +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- dc:Subject +::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1 --- rdf:Description +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop1 --- value +PCDATA: +020 - Library Science +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2 --- l:Classification +PCDATA: +Dewey Decimal Code +} { + http://www.webnuts.net/Jan97.html http://purl.org/metadata/dublin_core#Subject rdfdoc#id2 + rdfdoc#id2 #value 020 - Library Science + rdfdoc#id2 http://mycorp.com/schemas/my-schema#Classification Dewey Decimal Code + +} + +rp test nestedProperty3 { + + + + + 020 - Library Science + Dewey Decimal Code + + + + +} { +::xotcl::rdf::parser::RDFTag- --- RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- Description +ATTR: about = http://www.webnuts.net/Jan97.html +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- dc:Subject +::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1 --- Description +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop1 --- value +PCDATA: +020 - Library Science +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2 --- l:Classification +PCDATA: +Dewey Decimal Code +} { + http://www.webnuts.net/Jan97.html http://purl.org/metadata/dublin_core#Subject rdfdoc#id2 + rdfdoc#id2 #value 020 - Library Science + rdfdoc#id2 http://mycorp.com/schemas/my-schema#Classification Dewey Decimal Code + +} + +rp test nestedProperty4 { + + + + 020 - Library Science + + en + Dewey Decimal Code + + + + +} { +::xotcl::rdf::parser::RDFTag- --- RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- Description +ATTR: about = http://www.webnuts.net/Jan97.html +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- dc:Subject +::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1 --- rdf:Description +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop1 --- value +PCDATA: +020 - Library Science +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2 --- l:Classification +::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1::prop2::res1 --- rdf:Description +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2::res1::prop1 --- l:lang +PCDATA: +en +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2::res1::prop2 --- l:string +PCDATA: +Dewey Decimal Code +} { + http://www.webnuts.net/Jan97.html http://purl.org/metadata/dublin_core#Subject rdfdoc#id2 + rdfdoc#id2 #value 020 - Library Science + rdfdoc#id2 http://mycorp.com/schemas/my-schema#Classification rdfdoc#id3 + rdfdoc#id3 http://mycorp.com/schemas/my-schema#lang en + rdfdoc#id3 http://mycorp.com/schemas/my-schema#string Dewey Decimal Code +} + +rp test thirdAbbrev1 { + + + + + + Ora Lassila + lassila@w3.org + + + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = http://www.w3.org/Home/Lassila +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:Creator +::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1 --- rdf:Description +ATTR: about = http://www.w3.org/staffId/85740 +TYPES: http://description.org/schema/Person +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop1 --- s:Name +PCDATA: +Ora Lassila +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2 --- s:Email +PCDATA: +lassila@w3.org +} { + http://www.w3.org/Home/Lassila http://description.org/schema/Creator http://www.w3.org/staffId/85740 + http://www.w3.org/staffId/85740 http://description.org/schema/Name Ora Lassila + http://www.w3.org/staffId/85740 http://description.org/schema/Email lassila@w3.org + http://www.w3.org/staffId/85740 #type http://description.org/schema/Person +} + +rp test thirdAbbrev2 { + + + + + + Ora Lassila + lassila@w3.org + + + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = http://www.w3.org/Home/Lassila +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:Creator +::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1 --- rdf:Description +TYPES: http://description.org/schema/Person +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop1 --- s:Name +PCDATA: +Ora Lassila +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2 --- s:Email +PCDATA: +lassila@w3.org +} { + http://www.w3.org/Home/Lassila http://description.org/schema/Creator rdfdoc#id2 + rdfdoc#id2 http://description.org/schema/Name Ora Lassila + rdfdoc#id2 http://description.org/schema/Email lassila@w3.org + rdfdoc#id2 #type http://description.org/schema/Person +} + +rp test thirdAbbrev3 { + + + + + Ora Lassila + lassila@w3.org + + + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = http://www.w3.org/Home/Lassila +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:Creator +::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1 --- rdf:Description +ATTR: about = http://www.w3.org/staffId/85740 +TYPES: http://description.org/schema/Person +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop1 --- s:Name +PCDATA: +Ora Lassila +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2 --- s:Email +PCDATA: +lassila@w3.org +} { + http://www.w3.org/Home/Lassila http://description.org/schema/Creator http://www.w3.org/staffId/85740 + http://www.w3.org/staffId/85740 http://description.org/schema/Name Ora Lassila + http://www.w3.org/staffId/85740 http://description.org/schema/Email lassila@w3.org + http://www.w3.org/staffId/85740 #type http://description.org/schema/Person +} + +rp test thirdAbbrev4 { + + + + + Ora Lassila + lassila@w3.org + + + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = http://www.w3.org/Home/Lassila +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:Creator +::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1 --- rdf:Description +TYPES: http://description.org/schema/Person +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop1 --- s:Name +PCDATA: +Ora Lassila +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2 --- s:Email +PCDATA: +lassila@w3.org +} { + http://www.w3.org/Home/Lassila http://description.org/schema/Creator rdfdoc#id2 + rdfdoc#id2 http://description.org/schema/Name Ora Lassila + rdfdoc#id2 http://description.org/schema/Email lassila@w3.org + rdfdoc#id2 #type http://description.org/schema/Person +} + + +rp test secondAbbrev1 { + + + + + Ora Lassila + lassila@w3.org + + + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = http://www.w3.org/Home/Lassila +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:Creator +::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1 --- rdf:Description +ATTR: about = http://www.w3.org/staffId/85740 +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop1 --- s:Name +PCDATA: +Ora Lassila +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2 --- s:Email +PCDATA: +lassila@w3.org +} { + http://www.w3.org/Home/Lassila http://description.org/schema/Creator http://www.w3.org/staffId/85740 + http://www.w3.org/staffId/85740 http://description.org/schema/Name Ora Lassila + http://www.w3.org/staffId/85740 http://description.org/schema/Email lassila@w3.org +} + +rp test secondAbbrev2 { + + + + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = http://www.w3.org/Home/Lassila +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:Creator +::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1 --- rdf:Description +ATTR: about = http://www.w3.org/staffId/85740 +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop1 --- s:Name +PCDATA: +Ora Lassila +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2 --- s:Email +PCDATA: +lassila@w3.org +} { + http://www.w3.org/Home/Lassila http://description.org/schema/Creator http://www.w3.org/staffId/85740 + http://www.w3.org/staffId/85740 http://description.org/schema/Name Ora Lassila + http://www.w3.org/staffId/85740 http://description.org/schema/Email lassila@w3.org +} + +rp test secondAbbrev3 { + + + + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = http://www.w3.org/Home/Lassila +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:Creator +::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1 --- rdf:Description +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop1 --- s:Name +PCDATA: +Ora Lassila +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2 --- s:Email +PCDATA: +lassila@w3.org +} { + http://www.w3.org/Home/Lassila http://description.org/schema/Creator rdfdoc#id2 + rdfdoc#id2 http://description.org/schema/Name Ora Lassila + rdfdoc#id2 http://description.org/schema/Email lassila@w3.org +} + + +################################################################### +rp test resource1 { + + + + + + + Ora Lassila + lassila@w3.org + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = http://www.w3.org/Home/Lassila +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:Creator +ATTR: rdf:resource = http://www.w3.org/staffId/85740 +::xotcl::rdf::parser::RDFDescription-::res2 --- rdf:Description +ATTR: about = http://www.w3.org/staffId/85740 +::xotcl::rdf::parser::RDFProperty-::res2::prop1 --- v:Name +PCDATA: +Ora Lassila +::xotcl::rdf::parser::RDFProperty-::res2::prop2 --- v:Email +PCDATA: +lassila@w3.org +} { + http://www.w3.org/Home/Lassila http://schema.org/Creator http://www.w3.org/staffId/85740 + http://www.w3.org/staffId/85740 v:Name Ora Lassila + http://www.w3.org/staffId/85740 v:Email lassila@w3.org +} + +################################################################### +rp test resource2 { + + + + + Ora Lassila + lassila@w3.org + + + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = http://www.w3.org/Home/Lassila +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:Creator +::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1 --- rdf:Description +ATTR: about = http://www.w3.org/staffId/85740 +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop1 --- v:Name +PCDATA: +Ora Lassila +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2 --- v:Email +PCDATA: +lassila@w3.org +} { + http://www.w3.org/Home/Lassila http://schema.org/Creator http://www.w3.org/staffId/85740 + http://www.w3.org/staffId/85740 v:Name Ora Lassila + http://www.w3.org/staffId/85740 v:Email lassila@w3.org +} + + + +################################################################### +rp test typedNode1 { + + + Uwe Zdun + uwe@xotcl.org + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = http://www.xotcl.org/uwe +TYPES: http://description.org/schema/Person +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:Name +PCDATA: +Uwe Zdun +::xotcl::rdf::parser::RDFProperty-::res1::prop2 --- s:Email +PCDATA: +uwe@xotcl.org +} { + http://www.xotcl.org/uwe http://description.org/schema/Name Uwe Zdun + http://www.xotcl.org/uwe http://description.org/schema/Email uwe@xotcl.org + http://www.xotcl.org/uwe #type http://description.org/schema/Person +} + +rp test typedNode2 { + + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: rdf:about = http://www.xotcl.org/uwe +TYPES: http://description.org/schema/Person +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- Name +PCDATA: +Uwe Zdun +::xotcl::rdf::parser::RDFProperty-::res1::prop2 --- Email +PCDATA: +uwe@xotcl.org +} { + http://www.xotcl.org/uwe http://description.org/schema/Name Uwe Zdun + http://www.xotcl.org/uwe http://description.org/schema/Email uwe@xotcl.org + http://www.xotcl.org/uwe #type http://description.org/schema/Person +} + +################################################################### +rp test complexListItems { + + + + + en + Object Oriented Design and System Development + + + + + en + Introduction to the concepts of object-oriented programing + + + de + Einf�hrung in die Konzepte objekt-orientierter Programmierung + + + + + +} { +::xotcl::rdf::parser::RDFTag- --- RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = http://nm.wu-wien.ac.at/Lehre/oo1/ +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- gen:Title +::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1 --- rdf:Description +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop1 --- xml:lang +PCDATA: +en +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2 --- gen:String +PCDATA: +Object Oriented Design and System Development +::xotcl::rdf::parser::RDFProperty-::res1::prop2 --- gen:Description +::xotcl::rdf::parser::RDFBag-::res1::prop2::res1 --- rdf:Bag +TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag +::xotcl::rdf::parser::RDFMember-::res1::prop2::res1::prop1 --- rdf:li +MEMBER-INDEX: rdf:_1 +::xotcl::rdf::parser::RDFDescription-::res1::prop2::res1::prop1::res1 --- rdf:Description +::xotcl::rdf::parser::RDFProperty-::res1::prop2::res1::prop1::res1::prop1 --- xml:lang +PCDATA: +en +::xotcl::rdf::parser::RDFProperty-::res1::prop2::res1::prop1::res1::prop2 --- gen:String +PCDATA: +Introduction to the concepts of object-oriented programing +::xotcl::rdf::parser::RDFMember-::res1::prop2::res1::prop2 --- rdf:li +MEMBER-INDEX: rdf:_2 +::xotcl::rdf::parser::RDFDescription-::res1::prop2::res1::prop2::res1 --- rdf:Description +::xotcl::rdf::parser::RDFProperty-::res1::prop2::res1::prop2::res1::prop1 --- xml:lang +PCDATA: +de +::xotcl::rdf::parser::RDFProperty-::res1::prop2::res1::prop2::res1::prop2 --- gen:String +PCDATA: +Einf�hrung in die Konzepte objekt-orientierter Programmierung +} { + http://nm.wu-wien.ac.at/Lehre/oo1/ http://universal.org/metadata/ims#Title rdfdoc#id2 + rdfdoc#id2 xml:lang en + rdfdoc#id2 http://universal.org/metadata/ims#String Object Oriented Design and System Development + http://nm.wu-wien.ac.at/Lehre/oo1/ http://universal.org/metadata/ims#Description rdfdoc#id3 + rdfdoc#id3 #type #Bag + rdfdoc#id3 #_1 rdfdoc#id4 + rdfdoc#id4 xml:lang en + rdfdoc#id4 http://universal.org/metadata/ims#String Introduction to the concepts of object-oriented programing + rdfdoc#id3 #_2 rdfdoc#id5 + rdfdoc#id5 xml:lang de + rdfdoc#id5 http://universal.org/metadata/ims#String Einf�hrung in die Konzepte objekt-orientierter Programmierung +} + +################################################################### +rp test complexListItems2 { + + + + + en + Object Oriented Design and System Development + + + + + + en + Introduction to the concepts of object-oriented programing + + + + de + Einf�hrung in die Konzepte objekt-orientierter Programmierung + + + + + +} { +::xotcl::rdf::parser::RDFTag- --- RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = http://nm.wu-wien.ac.at/Lehre/oo1/ +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- gen:Title +::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1 --- rdf:Description +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop1 --- xml:lang +PCDATA: +en +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2 --- gen:String +PCDATA: +Object Oriented Design and System Development +::xotcl::rdf::parser::RDFProperty-::res1::prop2 --- gen:Description +::xotcl::rdf::parser::RDFSeq-::res1::prop2::res1 --- rdf:Seq +TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq +::xotcl::rdf::parser::RDFMember-::res1::prop2::res1::prop1 --- rdf:li +MEMBER-INDEX: rdf:_1 +::xotcl::rdf::parser::RDFDescription-::res1::prop2::res1::prop1::res1 --- rdf:Description +::xotcl::rdf::parser::RDFProperty-::res1::prop2::res1::prop1::res1::prop1 --- cls:entry +::xotcl::rdf::parser::RDFDescription-::res1::prop2::res1::prop1::res1::prop1::res1 --- rdf:Description +::xotcl::rdf::parser::RDFProperty-::res1::prop2::res1::prop1::res1::prop1::res1::prop1 --- gen:language +PCDATA: +en +::xotcl::rdf::parser::RDFProperty-::res1::prop2::res1::prop1::res1::prop1::res1::prop2 --- gen:String +PCDATA: +Introduction to the concepts of object-oriented programing +::xotcl::rdf::parser::RDFMember-::res1::prop2::res1::prop2 --- rdf:li +MEMBER-INDEX: rdf:_2 +::xotcl::rdf::parser::RDFDescription-::res1::prop2::res1::prop2::res1 --- rdf:Description +::xotcl::rdf::parser::RDFProperty-::res1::prop2::res1::prop2::res1::prop1 --- xml:lang +PCDATA: +de +::xotcl::rdf::parser::RDFProperty-::res1::prop2::res1::prop2::res1::prop2 --- gen:String +PCDATA: +Einf�hrung in die Konzepte objekt-orientierter Programmierung +} { + http://nm.wu-wien.ac.at/Lehre/oo1/ http://universal.org/metadata/ims#Title rdfdoc#id2 + rdfdoc#id2 xml:lang en + rdfdoc#id2 http://universal.org/metadata/ims#String Object Oriented Design and System Development + http://nm.wu-wien.ac.at/Lehre/oo1/ http://universal.org/metadata/ims#Description rdfdoc#id3 + rdfdoc#id3 #type #Seq + rdfdoc#id3 #_1 rdfdoc#id4 + rdfdoc#id4 cls:entry rdfdoc#id5 + rdfdoc#id5 http://universal.org/metadata/ims#language en + rdfdoc#id5 http://universal.org/metadata/ims#String Introduction to the concepts of object-oriented programing + rdfdoc#id3 #_2 rdfdoc#id6 + rdfdoc#id6 xml:lang de + rdfdoc#id6 http://universal.org/metadata/ims#String Einf�hrung in die Konzepte objekt-orientierter Programmierung +} + +################################################################### +rp test dmoz { + + + + Computers + + + + +} { +::xotcl::rdf::parser::RDFTag- --- r:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- r:Description +ATTR: r:ID = Top/Computers +TYPES: http://dmoz.org/rdf/Topic +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- tag +::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1 --- r:Description +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop1 --- catid +PCDATA: +4 +::xotcl::rdf::parser::RDFProperty-::res1::prop2 --- d:Title +PCDATA: +Computers +::xotcl::rdf::parser::RDFProperty-::res1::prop3 --- link +ATTR: r:resource = http://www.cs.tcd.ie/FME/ +::xotcl::rdf::parser::RDFProperty-::res1::prop4 --- link +ATTR: r:resource = http://pages.whowhere.com/computers/pnyhlen/Timeline.html +} { + Top/Computers http://dmoz.org/rdf/tag rdfdoc#id2 + rdfdoc#id2 http://dmoz.org/rdf/catid 4 + Top/Computers http://purl.org/dc/elements/1.0/Title Computers + Top/Computers http://dmoz.org/rdf/link http://www.cs.tcd.ie/FME/ + Top/Computers http://dmoz.org/rdf/link http://pages.whowhere.com/computers/pnyhlen/Timeline.html + Top/Computers #type http://dmoz.org/rdf/Topic +} + +############################################################################## +rp test "IDforNestedDescription" { + + + + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = page +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- g2k:area +ATTR: rdf:ID = b14711 +::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1 --- rdf:Description +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop1 --- g2k:term +PCDATA: +Hessen +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2 --- g2k:type +PCDATA: +Land +} { + b14711 http://g2k-schema#term Hessen + b14711 http://g2k-schema#type Land + page http://g2k-schema#area b14711 +} + +puts "FINISHED TEST! ([rp set nodeTime] + [rp set recreateTime] + [rp set tripleTime] = [expr {[rp set nodeTime] + [rp set recreateTime] + [rp set tripleTime]}])" + Fisheye: Tag b07223692b7ed8b9b1cfc81f202f73c066456c7c refers to a dead (removed) revision in file `tests/UNIVERSAL.test'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag b07223692b7ed8b9b1cfc81f202f73c066456c7c refers to a dead (removed) revision in file `tests/actiweb.test'. Fisheye: No comparison available. Pass `N' to diff? Index: tests/forwardtest.tcl =================================================================== diff -u --- tests/forwardtest.tcl (revision 0) +++ tests/forwardtest.tcl (revision b07223692b7ed8b9b1cfc81f202f73c066456c7c) @@ -0,0 +1,390 @@ +# -*- Tcl -*- +package require nx; namespace import ::nx::* +package require nx::test + +########################################### +# trivial object delegation +########################################### +Test case delegation { + Object create dog + Object create tail { + :method wag args { return $args } + } + dog forward wag tail %proc + + ? {dog wag 100} 100 +} + + +########################################### +# evaluating in scope +########################################### +Test case inscope { + Class create X { + :attribute {x 1} + :forward Incr -objscope incr + } + + X create x1 -x 100 + x1 Incr x + x1 Incr x + x1 Incr x + ? {x1 x} 103 +} + +########################################### +# adding +########################################### +Test case adding { + Object create obj { + :forward addOne expr 1 + + } + + ? {obj addOne 5} 6 +} + +########################################### +# more arguments +########################################### +Test case multiple-args { + Object create target { + :method foo args {return $args} + } + Object create obj { + :forward foo target %proc %self a1 a2 + } + + ? {obj foo x1 x2} [list ::obj a1 a2 x1 x2] + + obj forward foo target %proc %self %%self %%p + ? {obj foo x1 x2} [list ::obj %self %p x1 x2] +} + +########################################### +# mixin example +########################################### +Test case mixin-via-forward { + Object create mixin { + :method unknown {m args} {return [concat [self] $m $args]} + } + + Object create obj { + :forward Mixin mixin %1 %self + } + + ? {obj Mixin add M1} [list ::mixin add ::obj M1] + ? {catch {obj Mixin}} 1 + + obj forward Mixin mixin "%1 {Getter Setter}" %self + ? {obj Mixin add M1} [list ::mixin add ::obj M1] + ? {obj Mixin M1} [list ::mixin Setter ::obj M1] + ? {obj Mixin} [list ::mixin Getter ::obj] +} + + +########################################### +# sketching extensibe info +########################################### +Test case info-via-forward { + Object create Info { + :method @mixin {o} { + $o info mixin + } + :method @class {o} { ;# without prefix, doing here a [Info class] wod be wrong + $o info class + } + :method @help {o} { ;# define a new subcommand for info + foreach c [:info methods] {lappend result [string range $c 1 end]} + return $result + } + } + Object forward Info -methodprefix @ Info %1 %self + + Class create X { + :create x1 + } + ? {x1 Info class} ::X + ? {x1 Info help} [list help mixin class] +} + +########################################### +# variations of placement of options +########################################### +Test case incr { + Object create obj { + set :x 1 + :forward i1 -objscope incr x + } + + ? {obj i1} 2 +} + +########################################### +# introspeciton options +########################################### +Test case introspection { + Class create C { + :forward Info -methodprefix @ Info %1 %self + } + + ? {C info forward} Info + C forward XXXo x + ? {lsort [C info forward]} [list Info XXXo] + + ? {C info forward X*} [list XXXo] + ? {lsort [C info forward *o]} [list Info XXXo] + + # delete the forwarder + C method XXXo {} {} + ? {C info forward} [list Info] + + # get the definition of a instforwarder + ? {C info method definition Info} [list ::C forward Info -methodprefix @ Info %1 %self] + + # check introspection for objects + Object create obj { + :forward i1 -objscope incr x + :forward Mixin mixin %1 %self + :forward foo target %proc %self %%self %%p + :forward addOne expr 1 + + } + + ? {lsort [obj info forward]} "Mixin addOne foo i1" + ? {obj info forward -definition Mixin} "mixin %1 %self" + ? {obj info forward -definition addOne} "expr 1 +" + ? {obj info forward -definition foo} "target %proc %self %%self %%p" + ? {obj info forward -definition i1} "-objscope ::incr x" +} + +########################################### +# test serializer +########################################### +package require nx::serializer +Test case serializer { + Object create obj { + :method test {} {puts "i am [self proc]"} + } + set ::a [Serializer deepSerialize obj] + #puts <<$::a>> + eval $::a + ? {set ::a} [Serializer deepSerialize obj] +} + +########################################### +# test optional target cmd +########################################### +Test case optional-target { + Object create obj { + set :x 2 + :forward append -objscope + } + ? {obj append x y z} 2yz + + Object create n; Object create n::x {:method self {} {self}} + Object create o + o forward ::n::x + ? {o x self} ::n::x +} + +########################################### +# arg including instvar +########################################### +Test case percent-cmd { + Object create obj { + set :x 10 + :forward x* expr {%:eval {set :x}} * + } + ? {obj x* 10} "100" +} + +########################################### +# positional arguments +########################################### +Test case positioning-args { + Object create obj + obj forward @end-13 list {%@end 13} + ? {obj @end-13 1 2 3 } [list 1 2 3 13] + + obj forward @-1-13 list {%@-1 13} + ? {obj @-1-13 1 2 3 } [list 1 2 13 3] + + obj forward @1-13 list {%@1 13} + ? {obj @1-13 1 2 3 } [list 13 1 2 3] + ? {obj @1-13} [list 13] + + obj forward @2-13 list {%@2 13} + ? {obj @2-13 1 2 3 } [list 1 13 2 3] + + obj forward @list 10 {%@0 list} {%@end 99} + ? {obj @list} [list 10 99] + ? {obj @list a b c} [list 10 a b c 99] + + obj forward @list {%@end 99} {%@0 list} 10 + ? {obj @list} [list 10 99] + ? {obj @list a b c} [list 10 a b c 99] + + obj forward @list {%@2 2} {%@1 1} {%@0 list} + ? {obj @list} [list 1 2] + ? {obj @list a b c} [list 1 2 a b c] + + obj forward @list x y z {%@0 list} {%@1 1} {%@2 2} + ? {obj @list} [list 1 2 x y z] + ? {obj @list a b c} [list 1 2 x y z a b c] + + obj forward @list x y z {%@2 2} {%@1 1} {%@0 list} + ? {obj @list} [list x 1 y 2 z] + ? {obj @list a b c} [list x 1 y 2 z a b c] + + # adding some test cases which cover the interactions + # between %@POS and %1 substitutions + # + + obj forward @end-13 list {%@end 13} %1 %self + ? {obj @end-13 1 2 3 } [list 1 ::obj 2 3 13] + + obj forward @end-13 list %1 {%@end 13} %self + ? {obj @end-13 1 2 3 } [list 1 ::obj 2 3 13] + + obj forward @end-13 list {%@end 13} %1 %1 %1 %self + ? {obj @end-13 1 2 3 } [list 1 1 1 ::obj 2 3 13] + + obj forward @end-13 list {%@-1 13} %1 %self + ? {obj @end-13 1 2 3 } [list 1 ::obj 2 13 3] + + obj forward @end-13 list {%@1 13} %1 %self + ? {obj @end-13 1 2 3 } [list 13 1 ::obj 2 3] +} + +############################################### +# substitution depending on number of arguments +############################################### +Test case num-args { + Object create obj { + :forward f %self [list %argclindex [list a b c]] + :method a args {return [list [self proc] $args]} + :method b args {return [list [self proc] $args]} + :method c args {return [list [self proc] $args]} + } + ? {obj f} [list a {}] + ? {obj f 1 } [list b 1] + ? {obj f 1 2} [list c {1 2}] + ? {catch {obj f 1 2 3}} 1 +} + +############################################### +# option earlybinding +############################################### +Test case earlybinding { + Object create obj { + :forward s -earlybinding ::set ::X + } + ? {obj s 100} 100 + ? {obj s} 100 + + Object method f args { next } + + Class create NS + Class create NS::Main { + :object method m1 {} { :m2 } + :object method m2 {} { + ? {namespace eval :: {Object create toplevelObj1}} ::toplevelObj1 + + ? [list set _ [namespace current]] ::NS + ? [list set _ [NS create m1]] ::NS::m1 + NS filter f + ? [list set _ [NS create m2]] ::NS::m2 + NS filter "" + + namespace eval ::test { + ? [list set _ [NS create m3]] ::test::m3 + NS filter f + ? [list set _ [NS create m4]] ::test::m4 + NS filter "" + } + + namespace eval test { + ? [list set _ [NS create m5]] ::NS::test::m5 + NS filter f + ? [list set _ [NS create m6]] ::NS::test::m6 + NS filter "" + } + } + + :method i1 {} { :i2 } + :method i2 {} { + ? {namespace eval :: {Object create toplevelObj2}} ::toplevelObj2 + + ? [list set _ [namespace current]] ::NS + ? [list set _ [NS create i1]] ::NS::i1 + NS filter f + ? [list set _ [NS create i2]] ::NS::i2 + NS filter "" + + namespace eval ::test { + ? [list set _ [NS create i3]] ::test::i3 + NS filter f + ? [list set _ [NS create i4]] ::test::i4 + NS filter "" + } + + namespace eval test { + ? [list set _ [NS create i5]] ::NS::test::i5 + NS filter f + ? [list set _ [NS create i6]] ::NS::test::i6 + NS filter "" + } + + } + } + + #puts ==== + NS::Main m1 + NS::Main create m + m i1 + + #puts ==== + ? [list set _ [NS create n1]] ::n1 + NS filter f + ? [list set _ [NS create n2]] ::n2 + NS filter "" + + #puts ==== + namespace eval test { + ? [list set _ [NS create n1]] ::test::n1 + ? [list set _ [NS create n3]] ::test::n3 + NS filter f + ? [list set _ [NS create n4]] ::test::n4 + NS filter "" + } +} +########################################### +# forward to expr + callstack +########################################### +Test case callstack { + Object forward expr -objscope + + Class create C { + :method xx {} {self} + :object method t {o expr} { + return [$o expr $expr] + } + } + C create c1 + + ? {c1 expr {[self]}} ::c1 + ? {c1 expr {[self] == "::c1"}} 1 + ? {c1 expr {[:xx]}} ::c1 + ? {c1 expr {[:info class]}} ::C + ? {c1 expr {[:info is type C]}} 1 + ? {c1 expr {[:info is type ::C]}} 1 + + ? {C t ::c1 {[self]}} ::c1 + ? {C t ::c1 {[self] == "::c1"}} 1 + ? {C t ::c1 {[:xx]}} ::c1 + ? {C t ::c1 {[:info class]}} ::C + ? {C t ::c1 {[:info is type C]}} 1 + ? {C t ::c1 {[:info is type ::C]}} 1 + + Object method expr {} {} + +} \ No newline at end of file Fisheye: Tag b07223692b7ed8b9b1cfc81f202f73c066456c7c refers to a dead (removed) revision in file `tests/forwardtest.xotcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag b07223692b7ed8b9b1cfc81f202f73c066456c7c refers to a dead (removed) revision in file `tests/persistence.test'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag b07223692b7ed8b9b1cfc81f202f73c066456c7c refers to a dead (removed) revision in file `tests/speedtest.xotcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag b07223692b7ed8b9b1cfc81f202f73c066456c7c refers to a dead (removed) revision in file `tests/xoRDF.test'. Fisheye: No comparison available. Pass `N' to diff?