PREFIX ns: PREFIX dh: PREFIX foaf: PREFIX dct: PREFIX schema: PREFIX geo: PREFIX xsd: PREFIX rdf: PREFIX sioc: CONSTRUCT { GRAPH ?item { ?item a dh:Item ; sioc:has_container ?container ; dct:title ?name ; dh:slug ?id ; foaf:primaryTopic ?playground . ?playground a ns:Playground ; geo:lat ?lat ; geo:long ?long ; dct:identifier ?id ; dct:title ?name ; schema:streetAddress ?address_description; foaf:based_near [ dct:title ?area ] ; rdf:type [ dct:title ?playground_type ] ; schema:typicalAgeRange ?age_group ; dct:description ?description ; foaf:page ?link . } } WHERE { ?playground_row <#FID> ?id ; <#name> ?name ; <#address_description> ?address_description ; <#lat> ?lat_string ; <#long> ?long_string . OPTIONAL { ?playground_row <#area> ?area} OPTIONAL { ?playground_row <#playground_type> ?playground_type} OPTIONAL { ?playground_row <#age_group> ?age_group} OPTIONAL { ?playground_row <#description> ?description} OPTIONAL { ?playground_row <#link> ?linkString BIND (URI(?linkString) AS ?link)} BIND(uri(concat(str($base), "playgrounds/")) AS ?container) BIND(uri(concat(str(?container), encode_for_uri(?id), "/")) AS ?item) BIND(uri(concat(str(?item), "#this")) AS ?playground) BIND(xsd:float(?lat_string) AS ?lat) . BIND(xsd:float(?long_string) AS ?long) . }