Number of business entities (STIRdata) and GDP (Eurostat) by NUTS level 3
Decompress Eurostat GDP NUTS3 ZIP archive statistics
Transform Eurostat GDP NUTS3 RDF file to graph
Download Eurostat GDP NUTS3 ZIP archive statistics
Transform output dataset definition to graph
Transform output data structure definition to graph
Transform Eurostat GDP NUTS3 XML SDMX file to RDF file
Prepare output data structure definition
Extract compliant endpoints from catalog
Union LAU, GDP 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
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 ?gdp ?numberOfBusinessEntities WHERE { ?observation a qb:Observation ; qb:dataSet ?qbDataSet ; sdmx-dimension:refArea ?refArea ; sdmx-dimension:refPeriod ?refPeriod ; stirdata:sourceBusinessEntitiesDataSet ?sourceBusinessEntitiesDataSet ; stirdata:gdp ?gdp ; stirdata:numberOfBusinessEntities ?numberOfBusinessEntities . }
@prefix qb: <http://purl.org/linked-data/cube#> . <https://stirdata.opendata.cz/resource/dataset/number-of-business-entities-and-gdp-in-nuts3> a qb:DataSet; qb:structure <https://stirdata.opendata.cz/resource/dsd/number-of-business-entities-and-gdp-in-nuts3> .
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sdmx="http://www.SDMX.org/resources/SDMXML/schemas/v2_0/message" xmlns:data="urn:sdmx:org.sdmx.infomodel.keyfamily.KeyFamily=EUROSTAT:nama_10r_3gdp_DSD:compact"> <xsl:output method="text" encoding="UTF-8"/> <xsl:template match="/"> <xsl:text>@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .</xsl:text> <xsl:text>@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .</xsl:text> <xsl:text>@prefix eurostat: <http://eurostat.linked-statistics.org/ontology#> .</xsl:text> <xsl:text>@prefix observation: <http://eurostat.linked-statistics.org/data/observation#> .</xsl:text> <xsl:text>@prefix geo: <http://eurostat.linked-statistics.org/data/geo#> .</xsl:text> <xsl:text>@prefix nuts: <http://data.europa.eu/nuts/code/> .</xsl:text> <xsl:text> </xsl:text> <xsl:apply-templates select="//data:DataSet/data:Series[@unit='MIO_EUR']"/> </xsl:template> <xsl:template match="data:Series"> <xsl:variable name="geo" select="@geo"/> <xsl:for-each select="data:Obs[@TIME_PERIOD='2020']"> <xsl:text>observation:</xsl:text><xsl:value-of select="generate-id()"/><xsl:text> rdf:type eurostat:Observation ;</xsl:text> <xsl:text> </xsl:text> <xsl:text> eurostat:refArea nuts:</xsl:text><xsl:value-of select="$geo"/><xsl:text> ;</xsl:text> <xsl:text> </xsl:text> <xsl:text> eurostat:refPeriod "P1Y"^^xsd:duration ;</xsl:text> <xsl:text> </xsl:text> <xsl:text> eurostat:value "</xsl:text><xsl:value-of select="@OBS_VALUE"/><xsl:text>"^^xsd:decimal .</xsl:text> <xsl:text> </xsl:text> </xsl:for-each> </xsl:template> </xsl:stylesheet>
@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-gdp-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:gdp ] ; 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:gdp a rdf:Property, qb:MeasureProperty ; rdfs:label "GDP"@en ; rdfs:comment "The gross domestic product (GDP) 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 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) }
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 . #; # dcterms:title ?title . } 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) }
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 eurostat: <http://eurostat.linked-statistics.org/ontology#> PREFIX : <urn:stirdata:> CONSTRUCT { ?observation a qb:Observation ; qb:dataSet ?qbDataSet ; sdmx-dimension:refArea ?adminUnitNuts ; sdmx-dimension:refPeriod ?refPeriod ; stirdata:sourceBusinessEntitiesDataSet ?sourceDataSet ; stirdata:gdp ?gdp ; 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 } ?eurostatObservation eurostat:refArea ?adminUnitNuts ; eurostat:value ?gdp . ?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> .