Number of business entities (STIRData) and population (Wikidata) by NUTS level 3
Prepare output data structure definition
Transform output dataset definition to graph
Transform output data structure definition to graph
Extract compliant endpoints from catalog
Union LAU, population and number of business entities
Execute query tasks to get the number of business entities in administrative regions
Prepare query tasks to get number of business entities in administrative regions
Extract population in NUTS from Wikidata
@prefix qb: <http://purl.org/linked-data/cube#> . <https://stirdata.opendata.cz/resource/dataset/number-of-business-entities-and-population-in-nuts3> a qb:DataSet; qb:structure <https://stirdata.opendata.cz/resource/dsd/number-of-business-entities-and-population-in-nuts3> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix qb: <http://purl.org/linked-data/cube#> . @prefix sdmx-dimension: <http://purl.org/linked-data/sdmx/2009/dimension#> . @prefix stirdata: <https://w3id.org/stirdata/vocabulary/statistical/> . <https://stirdata.opendata.cz/resource/dsd/number-of-business-entities-and-population-in-nuts3> a qb:DataStructureDefinition ; # The dimensions qb:component [ qb:dimension sdmx-dimension:refArea ; qb:order 1 ]; qb:component [ qb:dimension sdmx-dimension:refPeriod ; qb:order 2 ]; qb:component [ qb:dimension stirdata:sourceBusinessEntitiesDataSet ; qb:order 3 ]; # The measures qb:component [ qb:measure stirdata:population ] ; qb:component [ qb:measure stirdata:numberOfBusinessEntities ] . stirdata:sourceBusinessEntitiesDataSet a rdf:Property, qb:DimensionProperty ; rdfs:label "Source data set"@en ; rdfs:comment "The data set that is the source of the data about business entities used to compute the statistics."@en . stirdata:population a rdf:Property, qb:MeasureProperty ; rdfs:label "Population"@en ; rdfs:comment "The population in a given administrative unit"@en . stirdata:numberOfBusinessEntities a rdf:Property, qb:MeasureProperty ; rdfs:label "Number of business entities"@en ; rdfs:comment "The number of business entities"@en .
PREFIX qb: <http://purl.org/linked-data/cube#> PREFIX sdmx-dimension: <http://purl.org/linked-data/sdmx/2009/dimension#> PREFIX stirdata: <https://w3id.org/stirdata/vocabulary/statistical/> SELECT ?sourceBusinessEntitiesDataSet ?refArea ?refPeriod ?population ?numberOfBusinessEntities WHERE { ?observation a qb:Observation ; qb:dataSet ?qbDataSet ; sdmx-dimension:refArea ?refArea ; sdmx-dimension:refPeriod ?refPeriod ; stirdata:sourceBusinessEntitiesDataSet ?sourceBusinessEntitiesDataSet ; stirdata:population ?population ; stirdata:numberOfBusinessEntities ?numberOfBusinessEntities . }
PREFIX dcterms: <http://purl.org/dc/terms/> PREFIX dcat: <http://www.w3.org/ns/dcat#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> CONSTRUCT { ?endpoint <urn:stirdata:endpoint> ?endpointString ; <urn:stirdata:dataset> ?dataset . } WHERE { ?dataset a dcat:Dataset ; dcterms:title ?title ; dcterms:conformsTo <https://stirdata.github.io/data-specification/> ; dcat:distribution/dcat:accessService ?service . ?service a dcat:DataService ; dcterms:conformsTo <https://www.w3.org/TR/sparql11-protocol/> ; dcat:endpointURL ?endpoint . FILTER(langMatches(LANG(?title), "en")) BIND(STR(?endpoint) AS ?endpointString) }
<https://obchodní-rejstřík.stirdata.opendata.cz/sparql> <urn:stirdata:endpoint> "https://obchodní-rejstřík.stirdata.opendata.cz/sparql" . <https://stirdata-semantic.ails.ece.ntua.gr/api/content/ee/sparql> <urn:stirdata:endpoint> "https://stirdata-semantic.ails.ece.ntua.gr/api/content/ee/sparql" . <https://stirdata-semantic.ails.ece.ntua.gr/api/content/be/sparql> <urn:stirdata:endpoint> "https://stirdata-semantic.ails.ece.ntua.gr/api/content/be/sparql" . <https://stirdata-semantic.ails.ece.ntua.gr/api/content/uk/sparql> <urn:stirdata:endpoint> "https://stirdata-semantic.ails.ece.ntua.gr/api/content/uk/sparql" . <https://stirdata-semantic.ails.ece.ntua.gr/api/content/be/sparql> <urn:stirdata:endpoint> "https://stirdata-semantic.ails.ece.ntua.gr/api/content/be/sparql" . <https://stirdata-semantic.ails.ece.ntua.gr/api/content/el/sparql> <urn:stirdata:endpoint> "https://stirdata-semantic.ails.ece.ntua.gr/api/content/el/sparql" . <https://stirdata-semantic.ails.ece.ntua.gr/api/content/fi/sparql> <urn:stirdata:endpoint> "https://stirdata-semantic.ails.ece.ntua.gr/api/content/fi/sparql" . <https://stirdata-semantic.ails.ece.ntua.gr/api/content/md/sparql> <urn:stirdata:endpoint> "https://stirdata-semantic.ails.ece.ntua.gr/api/content/md/sparql" . <https://stirdata-semantic.ails.ece.ntua.gr/api/content/lv/sparql> <urn:stirdata:endpoint> "https://stirdata-semantic.ails.ece.ntua.gr/api/content/lv/sparql" . <https://stirdata-semantic.ails.ece.ntua.gr/api/content/fr/sparql> <urn:stirdata:endpoint> "https://stirdata-semantic.ails.ece.ntua.gr/api/content/fr/sparql" . <https://stirdata-semantic.ails.ece.ntua.gr/api/content/cy/sparql> <urn:stirdata:endpoint> "https://stirdata-semantic.ails.ece.ntua.gr/api/content/cy/sparql" . <https://stirdata-semantic.ails.ece.ntua.gr/api/content/no/sparql> <urn:stirdata:endpoint> "https://stirdata-semantic.ails.ece.ntua.gr/api/content/no/sparql" . <https://stirdata-semantic.ails.ece.ntua.gr/api/content/nl/sparql> <urn:stirdata:endpoint> "https://stirdata-semantic.ails.ece.ntua.gr/api/content/nl/sparql" . <https://stirdata-semantic.ails.ece.ntua.gr/api/content/ro/sparql> <urn:stirdata:endpoint> "https://stirdata-semantic.ails.ece.ntua.gr/api/content/ro/sparql" .
PREFIX qb: <http://purl.org/linked-data/cube#> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> PREFIX skos: <http://www.w3.org/2004/02/skos/core#> PREFIX sdmx-dimension: <http://purl.org/linked-data/sdmx/2009/dimension#> PREFIX stirdata: <https://w3id.org/stirdata/vocabulary/statistical/> PREFIX : <urn:stirdata:> PREFIX wd: <urn:stirdata:wikidata:> CONSTRUCT { ?observation a qb:Observation ; qb:dataSet ?qbDataSet ; sdmx-dimension:refArea ?adminUnitNuts ; sdmx-dimension:refPeriod ?refPeriod ; stirdata:sourceBusinessEntitiesDataSet ?sourceDataSet ; stirdata:population ?population ; stirdata:numberOfBusinessEntities ?numberOfBusinessEntitiesNuts . } WHERE { { SELECT ?sourceDataSet ?adminUnitNuts (SUM(?numberOfBusinessEntities) AS ?numberOfBusinessEntitiesNuts) WHERE { ?adminUnitLau :numberOfBusinessEntities ?numberOfBusinessEntities ; :dataset ?sourceDataSet . ?adminUnitLau skos:inScheme <https://w3id.org/stirdata/resource/lau/scheme/LAU2021> ; skos:broadMatch ?adminUnitNuts . } GROUP BY ?sourceDataSet ?adminUnitNuts } ?wdAdminUnit wd:nuts ?adminUnitNuts ; wd:population ?population . ?qbDataSet a qb:DataSet . BIND(IRI(CONCAT("https://stirdata.opendata.cz/resource/observation/", STRUUID())) AS ?observation) BIND(STRDT(REPLACE(STR(NOW()), "^([0-9]{4}-[0-9]{2}-[0-9]{2})T.*$", "$1"), xsd:date) AS ?refPeriod) }
PREFIX esl: <http://plugins.linkedpipes.com/ontology/e-sparqlEndpointList#> PREFIX : <urn:stirdata:> CONSTRUCT { ?task a esl:Task ; esl:query ?query ; esl:group ?uritext ; esl:endpoint ?uritext . } WHERE { ?s :endpoint ?uritext ; :dataset ?dataset . BIND("numberOfLegalEntities" AS ?metric) BIND(UUID() AS ?task) BIND(IRI(?uritext) as ?uri) BIND(CONCAT("""PREFIX : <urn:stirdata:> PREFIX legal: <http://www.w3.org/ns/legal#> PREFIX m8g: <http://data.europa.eu/m8g/> PREFIX org: <http://www.w3.org/ns/org#> PREFIX locn: <http://www.w3.org/ns/locn#> PREFIX skos: <http://www.w3.org/2004/02/skos/core#> PREFIX stirdata: <https://w3id.org/stirdata/vocabulary/> CONSTRUCT { ?adminUnit a skos:Concept ; :numberOfBusinessEntities ?numberOfBusinessEntities ; :dataset <""", STR(?dataset) ,"""> . } WHERE { { SELECT ?adminUnit (COUNT(DISTINCT ?resource) AS ?numberOfBusinessEntities) WHERE { ?resource a legal:LegalEntity . { ?resource m8g:registeredAddress ?registeredAddress . } UNION { ?resource stirdata:postalAddress ?postalAddress . } UNION { ?resource stirdata:streetAddress ?streetAddress . } UNION { ?resource org:hasRegisteredSite/org:siteAddress ?registeredSiteAddress . } UNION { ?resource org:hasSite/org:siteAddress ?siteAddress . } BIND(COALESCE(?registeredAddress,?postalAddress,?streetAddress,?registeredSiteAddress,?siteAddress) AS ?address) . ?address m8g:adminUnit ?adminUnit . } GROUP BY ?adminUnit } }""") as ?query) }
<https://obchodní-rejstřík.stirdata.opendata.cz/sparql> <urn:stirdata:endpoint> "https://obchodní-rejstřík.stirdata.opendata.cz/sparql" ; <urn:stirdata:dataset> <https://stirdata.opendata.cz/resource/dataset/czechia/obchodní-rejstřík/ebg> .
PREFIX wdt: <http://www.wikidata.org/prop/direct/> PREFIX wd: <urn:stirdata:wikidata:> CONSTRUCT { ?region wd:nuts ?nuts ; wd:population ?population . } WHERE { ?region wdt:P605 ?nutsCode ; wdt:P1082 ?population . BIND(IRI(CONCAT("http://data.europa.eu/nuts/code/", ?nutsCode)) AS ?nuts) }