By prodatamarket_publisher
Copied from SoE-UC5

Last modification over 5 years ago -  2017-03-06 09:31:34 UTC

Show a map of municipalities coloured by the amount of state owned buildings for each owner. (Group by ministry and owner.)

Query text

PREFIX prodm-cad: <>
PREFIX prodm-com: <>
PREFIX prodm-soe: <>
PREFIX schema: <>
PREFIX gsp: <>
PREFIX sf: <>
PREFIX cp: <>
PREFIX dul: <>
PREFIX dbo: <>
PREFIX dcterms: <>
PREFIX rdfs: <>
PREFIX rdf: <>
PREFIX au: <>

SELECT DISTINCT ?name ?code ?coords ?owner ?min (count(?bygg) as ?totalAmount)
SELECT ?name ?code ?coords ?owner ?min ?bygg WHERE {
?cp a prodm-cad:CadastralParcel;
prodm-com:isStateOwned true ;

dcterms:coverage ?au.

?bygg a prodm-cad:Building ;
prodm-cad:isBuiltOn ?cp .
?rr a prodm-cad:RealRights;
dul:defines ?cp;
dul:defines ?org.

?org a prodm-cad:RightsHolderOrganization;
schema:legalName ?owner ;
schema:parentOrganization ?parent .
?parent a prodm-cad:RightsHolderOrganization;
schema:legalName ?min .
?au a au:AdministrativeUnit;
au:nationalCode ?code;
rdfs:label ?name ;
gsp:hasGeometry [ gsp:asWKT ?coords ;].
#LIMIT 5000
GROUP BY ?name ?code ?coords ?owner ?min
ORdER BY ?code