Skip to content

Commit

Permalink
Implement green-public-spaces-present and fix uplift
Browse files Browse the repository at this point in the history
  • Loading branch information
avillar committed Aug 28, 2024
1 parent f01e99e commit e0c841a
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 17 deletions.
8 changes: 5 additions & 3 deletions data/cityjson-uplift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ context:
id: dct:identifier
version: city:version

attributes: '@nest'

CityObjects:
'@id': city:hasObject
'@context':
Expand Down Expand Up @@ -97,6 +99,9 @@ context:
_AbstractCityObject: city:_AbstractCityObject
_AbstractTransportationComplex: city:_AbstractTransportationComplex
'+GenericCityObject': https://www.cityjson.org/extensions/download/generic.ext.json#GenericCityObject

function: city:hasFunction
usage: city:hasUsage

geometry:
'@id': city:hasGeometry
Expand Down Expand Up @@ -147,9 +152,6 @@ context:
'@id': city:boundaries
'@container': '@list'
'@type': '@id'
function: city:hasFunction
usage: city:hasUsage
attributes: '@nest'
parents:
'@id': city:hasParent
'@type': '@id'
Expand Down
2 changes: 1 addition & 1 deletion data/shapes/ascoli-piceno.shacl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ ex:
], [
sh:prefix "attr" ;
sh:namespace "http://example.com/vocab/city/attr#"^^xsd:anyURI ;
];
] ;
.

:BuildingOfInterestPresent
Expand Down
29 changes: 17 additions & 12 deletions data/shapes/green-public-spaces-present.shacl
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,27 @@ ex:
], [
sh:prefix "sd" ;
sh:namespace "https://w3id.org/okn/o/sd#"^^xsd:anyURI ;
];
], [
sh:prefix "attr" ;
sh:namespace "http://example.com/vocab/city/attr#"^^xsd:anyURI ;
] ;
.

:GreenPublicSpaces
a sh:NodeShape ;
sh:targetNode chek:document ;
sh:not [
sh:sparql [
sh:prefixes ex: ;
sh:select """
SELECT $this (rdf:type as ?path) (city:Road as ?value) WHERE {
?s a city:Road
} LIMIT 1
""" ;
] ;
] ;
sh:message "Dataset contains no Road objects" ;
sh:sparql [
sh:prefixes ex: ;
sh:select """
SELECT $this (rdf:type as ?path) ("LandUse objects with function 1110, 3010 or 3030" as ?value) WHERE {
FILTER NOT EXISTS {
?s a city:LandUse ;
city:hasFunction ?function .
FILTER(?function IN ("1110", "3010", "3030"))
}
} LIMIT 1
""" ;
] ;
sh:message "Dataset contains no green public spaces" ;
sh:severity sh:Violation ;
.
5 changes: 4 additions & 1 deletion data/shapes/roads-present.shacl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ ex:
], [
sh:prefix "sd" ;
sh:namespace "https://w3id.org/okn/o/sd#"^^xsd:anyURI ;
];
], [
sh:prefix "attr" ;
sh:namespace "http://example.com/vocab/city/attr#"^^xsd:anyURI ;
] ;
.

:RoadsPresent
Expand Down

0 comments on commit e0c841a

Please sign in to comment.