PREFIX ns: <https://copenhagen.demo.linkeddatahub.com/ns#>
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#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX dh: <https://www.w3.org/ns/ldt/document-hierarchy#>
PREFIX sioc: <http://rdfs.org/sioc/ns#>
CONSTRUCT
{
GRAPH ?item
{
?item a dh:Item ;
sioc:has_container ?container ;
dh:slug ?id ;
dct:title ?name ;
foaf:primaryTopic ?parking .
?parking a ns:ParkingFacility ;
geo:lat ?lat ;
geo:long ?long ;
dct:title ?name ;
schema:streetAddress ?address ;
schema:postalCode ?postcode ;
schema:maximumAttendeeCapacity ?spaces ;
schema:additionalProperty ?parkingType ;
schema:comment ?information ;
schema:identifier ?id .
?owner a ?ownerType ;
schema:owns ?parking .
}
}
WHERE
{
?parking_row <#FID> ?id ;
<#name> ?name ;
<#address> ?address ;
<#lat> ?lat_string ;
<#postcode> ?postcode ;
<#parkingSpace> ?spaces_string ;
<#parkingType> ?parkingType ;
<#information> ?information ;
<#long> ?long_string .
{
?parking_row <#owner> 'Privat' .
BIND(BNODE() AS ?owner)
BIND(schema:Corporation AS ?ownerType)
}
UNION
{
?parking_row <#owner> 'Kommune' .
BIND (<http://www.wikidata.org/entity/Q504125> AS ?owner) # Copenhagen Municipality
}
BIND(uri(concat(str($base), "parking-facilities/")) AS ?container)
BIND(uri(concat(str(?container), encode_for_uri(?id), "/")) AS ?item)
BIND(uri(concat(str(?item), "#this")) AS ?parking)
BIND(xsd:float(?lat_string) AS ?lat)
BIND(xsd:float(?long_string) AS ?long)
BIND(xsd:integer(?spaces_string) AS ?spaces)
}