|
1 <?xml version="1.0"?> |
|
2 <?xml-stylesheet href="chrome://global/skin" type="text/css"?> |
|
3 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?> |
|
4 |
|
5 <!-- |
|
6 query - triple object to subject |
|
7 --> |
|
8 |
|
9 <window title="XUL Template Tests" width="500" height="600" |
|
10 onload="test_template();" |
|
11 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> |
|
12 <script type="application/javascript" |
|
13 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> |
|
14 |
|
15 <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/> |
|
16 |
|
17 <data id="output"> |
|
18 <label step="-1" id="http://www.some-fictitious-zoo.com/humans/robert" value="Robert"/> |
|
19 <label step="2" id="http://www.some-fictitious-zoo.com/humans/robert" value="Robert"/> |
|
20 <label id="http://www.some-fictitious-zoo.com/humans/sarah" value="Sarah"/> |
|
21 </data> |
|
22 |
|
23 <script src="templates_shared.js"/> |
|
24 |
|
25 <script> |
|
26 <![CDATA[ |
|
27 SimpleTest.waitForExplicitFinish(); |
|
28 |
|
29 var testid ="query - triple object to subject"; |
|
30 var queryType = "rdf"; |
|
31 var isTreeBuilder = false; |
|
32 var needsOpen = false; |
|
33 var notWorkingYet = false; |
|
34 var notWorkingYetDynamic = true; |
|
35 var expectedOutput = document.getElementById("output"); |
|
36 |
|
37 var changes = [ |
|
38 // step 1 |
|
39 function(targetds, root) { |
|
40 targetds.Unassert(RDF.GetResource(ZOO_NS + 'humans/robert'), |
|
41 RDF.GetResource(ZOO_NS + 'rdf#favoriteAnimal'), |
|
42 RDF.GetResource(ZOO_NS + 'arachnids/tarantula'), true); |
|
43 }, |
|
44 // step 2 |
|
45 function(targetds, root) { |
|
46 targetds.Assert(RDF.GetResource(ZOO_NS + 'humans/robert'), |
|
47 RDF.GetResource(ZOO_NS + 'rdf#favoriteAnimal'), |
|
48 RDF.GetResource(ZOO_NS + 'mammals/lion'), true); |
|
49 } |
|
50 ]; |
|
51 ]]> |
|
52 </script> |
|
53 |
|
54 <vbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="root" datasources="rdf:null" ref="http://www.some-fictitious-zoo.com/arachnids/tarantula"> |
|
55 <template id="template"> |
|
56 <query> |
|
57 <content uri="?uri"/> |
|
58 <triple subject="?human" predicate="http://www.some-fictitious-zoo.com/rdf#favoriteAnimal" object="?uri"/> |
|
59 <triple subject="?human" predicate="http://www.some-fictitious-zoo.com/rdf#name" object="?humanname"/> |
|
60 </query> |
|
61 <action> |
|
62 <label uri="?human" value="?humanname"/> |
|
63 </action> |
|
64 </template> |
|
65 </vbox> |
|
66 |
|
67 </window> |