File: tests_data.py

package info (click to toggle)
pysesame 0.24-1
  • links: PTS
  • area: main
  • in suites: lenny, squeeze, wheezy
  • size: 76 kB
  • ctags: 91
  • sloc: python: 746; makefile: 30
file content (195 lines) | stat: -rw-r--r-- 7,142 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195


w3c = """<?xml version="1.0"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:dc="http://purl.org/dc/elements/1.1/">
  <rdf:Description rdf:about="http://www.w3.org/">
    <dc:title>World Wide Web Consortium</dc:title> 
  </rdf:Description>
</rdf:RDF>"""

w3cRemoved = '''<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">

</rdf:RDF>'''

w3cResult = '''<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
	xmlns:dc="http://purl.org/dc/elements/1.1/">

<rdf:Description rdf:about="http://www.w3.org/">
	<dc:title>World Wide Web Consortium</dc:title>
</rdf:Description>

</rdf:RDF>'''

# Using Shelley Powers examples from _Practical_RDF_.  Should be
# pretty stable.

postURL = "http://burningbird.net/articles/monsters1.rdf"

serqlSQuery = """
	select date
		from   {Resource} rdf:type {pstcn:Movement};
			pstcn:movementType {"Add"};
			dc:date {date}
		using namespace 
			pstcn = <http://burningbird.net/postcon/elements/1.0/>,
			dc = <http://purl.org/dc/elements/1.1/>
"""

serqlCQuery = """
	construct 
		{Resource} dc:date {date}
	from   
		{Resource} rdf:type {pstcn:Movement};
			pstcn:movementType {"Add"};
			dc:date {date}
	using namespace 
		pstcn = <http://burningbird.net/postcon/elements/1.0/>,
		dc = <http://purl.org/dc/elements/1.1/>
"""

rdqlQuery = """SELECT ?date
WHERE
(?resource, <rdf:type>, <pstcn:Movement>),
(?resource, <pstcn:movementType>,?value),
(?resource, <dc:date>, ?date)
AND (?value eq "Add")
USING pstcn FOR <http://burningbird.net/postcon/elements/1.0/>,
      rdf for <http://www.w3.org/1999/02/22-rdf-syntax-ns#>,
      dc for <http://purl.org/dc/elements/1.1/>"""

rdqlQueryResult = {'header':[u'date'], 'tuples': [[{'type':u'literal','value': '1998-01-01T00:00:00-05:00'}]]}


rdqlQueryRDF = """<?xml version='1.0' encoding='UTF-8'?>
<tableQueryResult>
	<header>
		<columnName>date</columnName>
	</header>
	<tuple>
		<literal>1998-01-01T00:00:00-05:00</literal>
	</tuple>
</tableQueryResult>"""



serqlCQueryRDF = """<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
        xmlns:dcterms="http://purl.org/dc/terms/"
        xmlns:pstcn="http://burningbird.net/postcon/elements/1.0/"
        xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
        xmlns:dc="http://purl.org/dc/elements/1.1/">

<rdf:Description rdf:about="http://www.yasd.com/dynaearth/monsters1.htm">
        <dc:date>1998-01-01T00:00:00-05:00</dc:date>
</rdf:Description>

</rdf:RDF>"""

postcon = """<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:pstcn="http://burningbird.net/postcon/elements/1.0/"
  xmlns:dcterms="http://purl.org/dc/terms/"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xml:base="http://burningbird.net/articles/">

  <pstcn:Resource rdf:about="monsters1.htm">

<!-- Resource Biographical Information -->
     <pstcn:bio rdf:parseType="Resource">
        <dc:title>Tale of Two Monsters: Legends</dc:title>
     	  <dcterms:abstract>
            When I think of "monsters" I think of the creatures of 
            legends and tales, from the books and movies, and 
            I think of the creatures that have entertained me for years.
     	  </dcterms:abstract>
        <dc:description>
            Part 1 of four-part series on cryptozoology, legends, 
            Nessie the Loch Ness Monster and the giant squid.
        </dc:description>
     	  <dc:created>1999-08-01T00:00:00-06:00</dc:created>
     	  <dc:creator>Shelley Powers</dc:creator>
     	  <dc:publisher>Burningbird Network</dc:publisher>
      </pstcn:bio>

<!-- Resource's relevancy at time RDF/XML document was built -->
      <pstcn:relevancy rdf:parseType="Resource">
     	   <pstcn:currentStatus>Active</pstcn:currentStatus>
     	   <dcterms:valid>2003-12-01T00:00:00-06:00</dcterms:valid>
     	   <dc:subject>legends</dc:subject>
     	   <dc:subject>giant squid</dc:subject>
     	   <dc:subject>loch ness monster</dc:subject>
     	   <dc:subject>Architeuthis Dux</dc:subject>
     	   <dc:subject>Nessie</dc:subject>
	   <dcterms:isReferencedBy>http://www.pibburns.com/cryptozo.htm</dcterms:isReferencedBy>
	   <dcterms:references>http://www.nrcc.utmb.edu/</dcterms:references>
      </pstcn:relevancy>

<!-- Presentation/consumption information about resource -->
      <pstcn:presentation rdf:parseType="Resource">
         <dc:format>text/html</dc:format>
         <dcterms:conformsTo>XHTML 1.0 Strict</dcterms:conformsTo>
         <dcterms:conformsTo>CSS Validation</dcterms:conformsTo>
         <dcterms:requires>HTML User agent</dcterms:requires>
	   <pstcn:requires rdf:parseType="Resource">
            <pstcn:type>stylesheet</pstcn:type>
            <rdf:value>http://burningbird.net/de.css</rdf:value>
         </pstcn:requires>
         <pstcn:requires rdf:parseType="Resource">
            <pstcn:type>logo</pstcn:type>
            <rdf:value>http://burningbird.net/mm/dynamicearth.jpg</rdf:value>
         </pstcn:requires>
      </pstcn:presentation>

<!-- History of events of resource -->
     <pstcn:history>
       <rdf:Seq>
        <rdf:_1 rdf:resource="http://www.yasd.com/dynaearth/monsters1.htm" />
        <rdf:_2 rdf:resource="http://www.dynamicearth.com/articles/monsters1.htm" />
        <rdf:_3 rdf:resource="http://burningbird.net/articles/monsters1.htm" />
      </rdf:Seq>    
     </pstcn:history>

<!-- Resource internal to PostCon that are related to resource -->
     <pstcn:related rdf:resource="monsters2.htm" />
     <pstcn:related rdf:resource="monsters3.htm" />
     <pstcn:related rdf:resource="monsters4.htm" />
  </pstcn:Resource>

<!-- Related resources -->
  <pstcn:Resource rdf:about="monsters2.htm">
     <dc:title>Cryptozooloy</dc:title>
     <pstcn:reason>First in the Tale of Two Monsters series.</pstcn:reason>
  </pstcn:Resource>
  <pstcn:Resource rdf:about="monsters3.htm">
     <dc:title>A Tale of Two Monsters: Architeuthis Dux (Giant Squid)</dc:title>
     <pstcn:reason>Second in the Tale of Two Monsters series.</pstcn:reason>
  </pstcn:Resource>
  <pstcn:Resource rdf:about="monsters4.htm">
     <dc:title>Nessie, the Loch Ness Monster </dc:title>
     <pstcn:reason>Fourth in the Tale of Two Monsters series.</pstcn:reason>
  </pstcn:Resource>

<!-- Resource events -->
  <pstcn:Movement rdf:about="http://www.yasd.com/dynaearth/monsters1.htm">
      <pstcn:movementType>Add</pstcn:movementType>
      <pstcn:reason>New Article</pstcn:reason>
      <dc:date>1998-01-01T00:00:00-05:00</dc:date>
  </pstcn:Movement>
  <pstcn:Movement rdf:about="http://www.dynamicearth.com/articles/monsters1.htm">
      <pstcn:movementType>Move</pstcn:movementType>
      <pstcn:reason>Moved to separate dynamicearth.com domain</pstcn:reason>
      <dc:date>1999-10-31:T00:00:00-05:00</dc:date>
  </pstcn:Movement>
  <pstcn:Movement rdf:about="http:/burningbird.net/articles/monsters1.htm">
     <pstcn:movementType>Move</pstcn:movementType>
     <pstcn:reason>Collapsed into Burningbird</pstcn:reason>
     <dc:date>2002-11-01</dc:date> 
  </pstcn:Movement>

</rdf:RDF>"""