summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <cb15g11@soton.ac.uk>2014-09-13 10:51:18 +0100
committerChristopher Baines <cb15g11@soton.ac.uk>2014-09-13 10:51:18 +0100
commitb32a7a349311ae6b91aaebceca06095681fafd5a (patch)
tree7e11ebfd8597a5f5589eb044b4406900228264c6
parent19df6870f488e5bc3689b597820eb384f1346e2c (diff)
downloadleaflet-soton-b32a7a349311ae6b91aaebceca06095681fafd5a.tar
leaflet-soton-b32a7a349311ae6b91aaebceca06095681fafd5a.tar.gz
Improve portals query
Now each attribute is optional, and it does not have to match all the optional attributes.
-rwxr-xr-xcreate-data.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/create-data.js b/create-data.js
index 6ba0408..698c63e 100755
--- a/create-data.js
+++ b/create-data.js
@@ -1072,14 +1072,20 @@ function getPortals(callback) {
var query = "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\
PREFIX portals: <http://purl.org/openorg/portals/>\
PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>\
-SELECT * WHERE {\
+SELECT DISTINCT * WHERE {\
?portal a portals:BuildingEntrance;\
portals:connectsBuilding ?building;\
OPTIONAL {\
?portal rdfs:comment ?comment .\
+ }\
+ OPTIONAL {\
?portal rdfs:label ?label .\
+ }\
+ OPTIONAL {\
?portal geo:lat ?lat .\
?portal geo:long ?long .\
+ }\
+ OPTIONAL {\
?portal portals:connectsFloor ?floor\
}\
}"