## 5 Land Use Planning: Using the LBCS Ontology
### Queries  
In OWL language it is possible to make queries by defining a class representing the query and asking the reasoner to retrieve all the individuals in that class. These queries can be pre-defined in the ontology or programmatically created in real time as required, using, for example, the OWL API. The expressive power of the OWL language, together with the multidimensionality of the LBCS land use standard, enables very complex queries to be created that can be defined in a very simple and flexible way. These queries can be quite useful for analysing urban space on the basis of the characteristics of its parcels. Queries using the ontologies developed within this research are typically built on restrictions to dimension properties.  
We now explain how each type of restriction can help create useful queries relating to parcels in urban space.  
1. Existential restriction (some): This is perhaps the most common restriction. It enables parcels to be found that have at least one specified category (or any other category that is a subclass of this) in one dimension. For example, the query \"hasFunction some F.GeneralSalesOrServices\" would retrieve all the individuals (represented as parcels on a map) with that function or a subclass of it, such as F.RetailSalesOrService, F.BarOrDrinkingPlace, _etc._ Basically, this function allows the user to automatically find a series of smaller-scale urban elements (parcels) by simply asking for its descendants in the hierarchy. This restriction allows for the automatic location of a range of spatial information.
2. Universal restrictions (only): This kind of restriction can be useful when used together with existential restrictions to specify that a particular dimension can only have a certain class of categories. For example, the query \"hasFunction some F.GeneralSalesOrServices and hasFunction only F.GeneralSalesOrServices\" describes parcels that only have GeneralSalesOrServices or one of their subclasses in the function dimension. Note that OWL follows open world assumptions and the world must therefore be closed in order to infer information based on universal restrictions. For this purpose, it is possible to say, for example, that the only dimensions declared so far are the only ones that exist for every parcel, using cardinality restrictions. This topic will be discussed in further detail below, when describing migrating information from relational databases.
3. Cardinality restrictions (min, max, exactly): These restrictions allow the user to specify how many different categories a parcel should have in one dimension. It may be useful, for example, to find parcels with more than one function: \"hasFunction min 2.\"
4. Qualified cardinality restrictions: These restrictions are an extension of cardinality restrictions, enabling the class of categories to be stated within the restriction. They can be used, for example, to find parcels that have more than one commercial function and at most one residential function.  
Through the logical operators \"**and**\", \"**or**\", and \"**not**\", these restrictions can all be combined to build quite complex queries, for example:  
_\"hasFunction some F.ResidenceOrAccomodationFunction and__hasFunction min 2 and hasStructure some S.MultifamilyStructures and hasOwnership some O.NoConstraints-PrivateOwnership.\"_ This means \"Private residential buildings also with other functions\".