Strabon

view scripts/example-query.py @ 1459:0825ee10ae10

changed the tests of the temporal relation functions in order to be compliant with the
way the spatial tests are organized by grouping the functions.
Also, since the bug with the time zones has not been solved, I removed the time zone
information from the test dataset. Finally, I added the results for some of the queries
which had empty results in the .srx file.
author Stella Giannakopoulou <sgian@di.uoa.gr>
date Thu Jan 22 13:24:43 2015 +0200 (2015-01-22)
parents
children
line source
1 #!/usr/bin/env python
3 import sys, re, os
4 import os
5 import glob
6 import time
7 import shutil
8 import httplib, urllib
10 def main(argv):
12 query = 'PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX strdf: <http://strdf.di.uoa.gr/ontology#> PREFIX noa: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#> SELECT ?H (strdf:transform(?HGEO, <http://www.opengis.net/def/crs/EPSG/0/4326>) AS ?GEO) WHERE { ?H rdf:type noa:Hotspot . ?H noa:hasAcquisitionTime ?HAT . FILTER(str(?HAT) = "2010-08-21T21:20:00") . ?H noa:isDerivedFromSensor ?HS . FILTER(str(?HS) = "MSG1_RSS" ) . ?H noa:hasGeometry ?HGEO . }'
13 params = urllib.urlencode({'SPARQLQuery': query, 'format': "XML"})
14 headers = {"Content-type": "application/x-www-form-urlencoded", "Accept": "text/xml"}
16 #conn = httplib.HTTPConnection("papos.space.noa.gr:8080")
17 #conn.request("POST", "/endpoint/Query", params, headers)
19 conn = httplib.HTTPConnection("test.strabon.di.uoa.gr")
20 conn.request("POST", "/NOA/Query", params, headers)
22 response = conn.getresponse()
23 print response.status, response.reason
24 print response.msg
25 print response.read()
26 return 0
28 if __name__ == "__main__":
29 sys.exit(main(sys.argv))