PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX schema: <https://schema.org/>
PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
CONSTRUCT
{
GRAPH ?graph
{
?graph dct:title ?territoryDescription ;
foaf:primaryTopic ?territory .
?territory a schema:City ;
dct:title ?territoryDescription ;
schema:name ?territoryDescription ;
schema:identifier ?territoryID ;
schema:containedInPlace ?region ;
geo:lat ?latitude ;
geo:long ?longitude .
}
}
WHERE
{
?territory_row <#territoryID> ?territoryID ;
<#territoryDescription> ?territoryDescription ;
<#regionID> ?regionID ;
<#latitude> ?latitude ;
<#longitude> ?longitude .
BIND(uri(concat(str($base), "territories/")) AS ?container)
BIND(uri(concat(str(?container), encode_for_uri(?territoryID), "/")) AS ?graph)
BIND(uri(concat(str(?graph), "#this")) AS ?territory)
BIND(uri(concat(str($base), "regions/", encode_for_uri(?regionID), "/#this")) AS ?region)
}