openbudgets / datasets

OpenBudgets.eu datasets
5 stars 3 forks source link

Aragon 2007 expenditure budgetaryUnit missing #83

Closed larjohn closed 7 years ago

larjohn commented 7 years ago

There is no value set for dataset-attached property budgetaryUnit, which leads to empty facts result (in order to avoid OPTIONAL modifiers in SPARQL)

fathoni commented 7 years ago

hi @larjohn , according to D1.5, the budgetaryUnit property is deprecated.

Use obeu-dimension:organization instead. This property was deprecated because it was not sufficiently distinct from the obeu-dimension:organization, which is more generic, hence applicable in more contexts.

In the dataset, the obeu-dimension:organization is provided as a replacement. Shall I add the obeu-dimension:budgetaryUnit in Aragon dataset as well?

larjohn commented 7 years ago

If it is deprecated, it should be removed from the dsd, as it gets included in the generated SPARQL query, and given that no value is assigned, an empty result set is returned.

fathoni commented 7 years ago

I see, I will update the Aragon DSDs accordingly and push them once it is finished.

fathoni commented 7 years ago

DSDs have been updated (both in Github and Virtuoso), @larjohn could you please recheck?

larjohn commented 7 years ago

I can still see nasty budgetary units in the DSD


PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX qb: <http://purl.org/linked-data/cube#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xro: <http://purl.org/xro/ns#>

SELECT DISTINCT ?attribute (GROUP_CONCAT (distinct ?labels;
    separator ='||') AS ?labels) ?attachment (SAMPLE (?_propertyType) AS ?propertyType) ?shortName ?dataset WHERE {
    ?dsd qb:component ?component .
    ?dataset a qb:DataSet ;
        qb:structure ?dsd .
    ?component ?componentProperty ?attribute .
    ?componentProperty rdfs:subPropertyOf qb:componentProperty .
    OPTIONAL {
        ?attribute rdfs:label ?label .
    }
    OPTIONAL {
        ?component qb:componentAttachment ?attachment .
    }
    OPTIONAL {
        ?attribute a ?_propertyType .
        FILTER (?_propertyType in (qb:CodedProperty, qb:MeasureProperty, qb:DimensionProperty))
    }
    FILTER (?name = 'aragon-2014-expenditure__0377c') BIND (REPLACE (str (?attribute), '^.*(#|/)', "") AS ?shortName) BIND (CONCAT (REPLACE (str (?dataset), '^.*(#|/)', ""), '__', SUBSTR (MD5 (STR (?dataset)),1,5)) AS ?name) BIND (CONCAT (LANG (?label),' =', ?label) AS ?labels)
}
GROUP BY ?attribute ?shortName ?attachment ?dataset
fathoni commented 7 years ago

Fixed, please let me know otherwise!