From b32a7a349311ae6b91aaebceca06095681fafd5a Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sat, 13 Sep 2014 10:51:18 +0100 Subject: Improve portals query Now each attribute is optional, and it does not have to match all the optional attributes. --- create-data.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'create-data.js') 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: \ PREFIX portals: \ PREFIX geo: \ -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\ }\ }" -- cgit v1.2.3