PREFIX ns: <https://copenhagen.demo.linkeddatahub.com/ns#>
PREFIX schema: <https://schema.org/>
PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
PREFIX dh: <https://www.w3.org/ns/ldt/document-hierarchy#>
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX sioc: <http://rdfs.org/sioc/ns#>
CONSTRUCT
{
GRAPH ?item
{
?item a dh:Item ;
sioc:has_container ?container ;
dct:title ?name ;
dh:slug ?id ;
foaf:primaryTopic ?place .
?place a ns:Place ;
geo:lat ?lat ;
geo:long ?long ;
dct:identifier ?id ;
dct:title ?name ;
dct:subject [ skos:prefLabel ?category_name ] .
}
}
WHERE
{
?place_row <#FID> ?id ;
<#name> ?name ;
<#lat> ?lat_string ;
<#long> ?long_string
OPTIONAL
{ ?place_row <#category> ?category_name }
BIND(uri(concat(str($base), "places/")) AS ?container)
BIND(uri(concat(str(?container), encode_for_uri(?id), "/")) AS ?item)
BIND(uri(concat(str(?item), "#this")) AS ?place)
BIND(xsd:float(?lat_string) AS ?lat)
BIND(xsd:float(?long_string) AS ?long)
}