Number of business entities registered in given months by activity
Prepare output data structure definition
Transform output data structure definition to graph
Prepare configuration of output RDF file
Extract compliant endpoints from catalog
Execute query tasks to get number of registered business entities per activity
Prepare query tasks to get number of registered business entities per activity
@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-by-activity> a qb:DataStructureDefinition ; # The dimensions qb:component [ qb:dimension sdmx-dimension:refPeriod ; qb:order 1 ]; qb:component [ qb:dimension stirdata:activity ; qb:order 2 ]; qb:component [ qb:dimension stirdata:sourceBusinessEntitiesDataSet ; qb:order 3 ]; qb:component [ qb:measure stirdata:numberOfNewBusinessEntities ] . 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:numberOfNewBusinessEntities a rdf:Property, qb:MeasureProperty ; rdfs:label "Number of new business entities"@en ; rdfs:comment "The number of newly registered 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 ?refPeriod ?activity ?numberOfNewBusinessEntities WHERE { ?observation a qb:Observation ; qb:dataSet ?qbDataSet ; sdmx-dimension:refPeriod ?refPeriodFull ; stirdata:activity ?activity ; stirdata:sourceBusinessEntitiesDataSet ?sourceBusinessEntitiesDataSet ; stirdata:numberOfNewBusinessEntities ?numberOfNewBusinessEntities . BIND(SUBSTR(STR(?refPeriodFull), 1, 7) AS ?refPeriod) } ORDER BY ?activity ?refPeriod
PREFIX rtf: <http://plugins.linkedpipes.com/ontology/t-rdfToFile#> PREFIX : <urn:stirdata:> CONSTRUCT { :config a rtf:Configuration ; rtf:fileName ?fileName ; rtf:fileNameControl <http://plugins.linkedpipes.com/resource/configuration/None> ; rtf:fileType "text/turtle" ; rtf:fileTypeControl <http://plugins.linkedpipes.com/resource/configuration/None> ; rtf:graphUriControl <http://plugins.linkedpipes.com/resource/configuration/None> . } WHERE { { SELECT (GROUP_CONCAT(STR(?registrationMonth); SEPARATOR="-") AS ?registrationMonths) WHERE { ?config :registrationMonth ?registrationMonthWithDay . BIND(SUBSTR(STR(?registrationMonthWithDay), 1, 7) AS ?registrationMonth) } GROUP BY ?config } BIND(CONCAT("number-of-business-entities-registered-in-", STR(?registrationMonths), "-by-activity.ttl") AS ?fileName) }
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX qb: <http://purl.org/linked-data/cube#> PREFIX esl: <http://plugins.linkedpipes.com/ontology/e-sparqlEndpointList#> PREFIX : <urn:stirdata:> CONSTRUCT { ?dataSet a qb:DataSet ; rdfs:label ?label ; qb:structure <https://stirdata.opendata.cz/resource/dsd/number-of-business-entities-by-activity> . } WHERE { { SELECT (GROUP_CONCAT(STR(?registrationMonth); SEPARATOR="-") AS ?registrationMonths) (GROUP_CONCAT(STR(?registrationMonth); SEPARATOR=", ") AS ?registrationMonthsLabel) WHERE { ?config :registrationMonth ?registrationMonthWithDay . BIND(SUBSTR(STR(?registrationMonthWithDay), 1, 7) AS ?registrationMonth) } GROUP BY ?config } BIND(IRI(CONCAT("https://stirdata.opendata.cz/resource/dataset/number-of-business-entities-registered-in-", STR(?registrationMonths), "-by-activity")) AS ?dataSet) BIND(CONCAT("Number of business entities registered in ", STR(?registrationMonthsLabel), " by activity") AS ?label) }
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . [] <urn:stirdata:registrationMonth> "2023-04-01"^^xsd:date, "2023-05-01"^^xsd:date .
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:refPeriod ?refPeriod ; stirdata:activity ?activity ; stirdata:numberOfNewBusinessEntities ?numberOfBusinessEntities ; stirdata:sourceBusinessEntitiesDataSet ?sourceDataSet ; } WHERE { [] :activity ?activity ; :numberOfBusinessEntities ?numberOfBusinessEntities ; :refPeriod ?refPeriod ; :dataset ?sourceDataSet . ?qbDataSet a qb:DataSet . BIND(IRI(CONCAT("https://stirdata.opendata.cz/resource/observation/", STRUUID())) AS ?observation) }
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 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 . [] :registrationMonth ?registrationMonth . BIND(UUID() AS ?task) BIND(IRI(?uritext) as ?uri) BIND(CONCAT("""PREFIX : <urn:stirdata:> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> PREFIX m8g: <http://data.europa.eu/m8g/> PREFIX legal: <http://www.w3.org/ns/legal#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX skos: <http://www.w3.org/2004/02/skos/core#> CONSTRUCT { [] :activity ?activity ; :numberOfBusinessEntities ?numberOfBusinessEntities ; :refPeriod \"""", STR(?registrationMonth), """\"^^xsd:date ; :dataset <""", STR(?dataset) ,"""> . } WHERE { { SELECT ?activity (COUNT(DISTINCT ?resource) AS ?numberOfBusinessEntities) WHERE { ?resource a legal:LegalEntity ; m8g:registrationDate ?registrationDate ; legal:companyActivity ?activity . FILTER(CONTAINS(STR(?registrationDate), \"""", SUBSTR(STR(?registrationMonth), 1, 7), """\")) } GROUP BY ?activity } }""") 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> .