Number of business entities by NACE activity and NUTS level 3 (STIRData)
Transform output data structure definition to graph
Transform output dataset definition to graph
Execute query tasks to get number of business entities per activity and administrative regions
Prepare query tasks to get number of business entities per activity and administrative regions
Prepare output data structure definition
Extract compliant endpoints from catalog
Union LAU, and number of business entities
PREFIX st: <http://ns.inria.fr/sparql-template/> 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:> CONSTRUCT { ?observation a qb:Observation ; qb:dataSet ?qbDataSet ; sdmx-dimension:refArea ?adminUnitNuts ; sdmx-dimension:refPeriod ?refPeriod ; stirdata:activity ?activity ; stirdata:sourceBusinessEntitiesDataSet ?sourceDataSet ; stirdata:numberOfBusinessEntities ?numberOfBusinessEntitiesNuts . } WHERE { { SELECT ?sourceDataSet ?adminUnitNuts ?activity (SUM(?numberOfBusinessEntities) AS ?numberOfBusinessEntitiesNuts) WHERE { [] :adminUnit ?adminUnitLau ; :numberOfBusinessEntities ?numberOfBusinessEntities ; :dataset ?sourceDataSet ; :activity ?activity . ?adminUnitLau skos:inScheme <https://w3id.org/stirdata/resource/lau/scheme/LAU2021> ; skos:broadMatch ?adminUnitNuts . } GROUP BY ?sourceDataSet ?adminUnitNuts ?activity } ?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(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 { ?activity a skos:Concept ; :dataset <""", STR(?dataset) ,"""> ; :endpoint <""", STR(?uritext) ,"""> . } WHERE { ?activity skos:broader/skos:topConceptOf [] . FILTER EXISTS { [] legal:companyActivity ?activity . } } """) as ?query) }
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 ?activity ?numberOfBusinessEntities WHERE { ?observation a qb:Observation ; qb:dataSet ?qbDataSet ; sdmx-dimension:refArea ?refArea ; sdmx-dimension:refPeriod ?refPeriod ; stirdata:activity ?activity ; stirdata:sourceBusinessEntitiesDataSet ?sourceBusinessEntitiesDataSet ; stirdata:numberOfBusinessEntities ?numberOfBusinessEntities . }
PREFIX skos: <http://www.w3.org/2004/02/skos/core#> 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 { ?naceLevel2 a skos:Concept ; :endpoint ?uritext ; :dataset ?dataset ; 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 ?adminUnit ; :activity <""", STR(?naceLevel2) ,"""> ; :numberOfBusinessEntities ?numberOfBusinessEntities ; :dataset <""", STR(?dataset) ,"""> . } WHERE { { SELECT ?adminUnit (COUNT(DISTINCT ?resource) AS ?numberOfBusinessEntities) WHERE { ?resource a legal:LegalEntity ; legal:companyActivity ?activity . { ?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 . ?activity skos:broader/skos:broader* <""", STR(?naceLevel2) ,"""> . } GROUP BY ?adminUnit } }""") as ?query) }
@prefix qb: <http://purl.org/linked-data/cube#> . <https://stirdata.opendata.cz/resource/dataset/number-of-business-entities-in-nace2-and-nuts3> a qb:DataSet; qb:structure <https://stirdata.opendata.cz/resource/dsd/number-of-business-entities-in-nace2-and-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-nace2-and-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:activity ; qb:order 3 ]; qb:component [ qb:dimension stirdata:sourceBusinessEntitiesDataSet ; qb:order 4 ]; qb:component [ qb:measure stirdata:numberOfBusinessEntities ] . stirdata:activity a rdf:Property, qb:DimensionProperty ; rdfs:label "Activity"@en ; rdfs:comment "Activity of legal entities as a NACE code."@en . 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: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 skos: <http://www.w3.org/2004/02/skos/core#> 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(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 ?adminUnit ; :activity ?activity ; :numberOfBusinessEntities ?numberOfBusinessEntities ; :dataset <""", STR(?dataset) ,"""> . } WHERE { { SELECT ?activity ?adminUnit (COUNT(DISTINCT ?resource) AS ?numberOfBusinessEntities) WHERE { ?resource a legal:LegalEntity ; legal:companyActivity ?activity . { ?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 ?activity ?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> .