# Ontology-Based Spatial Data Quality Assessment Framework
## 2 Materials and Methods
### Framework
#### 2.3.5 Rules for Quality Assessment  
The role of SfOs for quality assessment involves the definition and enforcement of rules that ensure the adherence of spatial data to specified constraints and requirements. These rules are designed to evaluate the spatial data against the specifications and provide insights into the data quality. The rules can be defined and managed within the framework using a combination of spatial relations, constraints, and ontology modeling techniques. They are typically implemented in SDQO with SWRL. Basic rules are shown in Table 7. Rule 8 gives equivalent features. The specification hierarchy classes within an SfO represent various levels of constraints and requirements for spatial data. These classes have superclasses that link to corresponding classes in the SDQO, thereby establishing a connection to quality assessment concepts and definitions. Their relationship with the SDQO classes serves as the basis for defining rules and constraints specific to the spatial domain. SDQO utilizes spatial and non-spatial relationships between feature classes to define quality assessment rules. Spatial relations, such as \"Overlaps\", \"Crosses\", or \"Contains\" are defined using OGC standards [41]. The integration of data ontologies with SfOs, and therefore SDQO, allows for comprehensive quality assessment by combining spatial relations and constraints with actual data instances. Ontology editing tools such as Protege enable the manipulation of the class hierarchy in SfOs, which translate to addition or modification of constraints. The domain experts can easily sustain the integrity of the relationships between classes, ensuring that moving classes does not break the relationships established within the ontology. The framework facilitates the identification of feature pairs causing errors, allowing for targeted quality improvement effort. It allows institutional users to pinpoint and flag violations effectively. A sample for relevant class hierarchies is given below for \"Geometric classes with Forbidden relation\" case with the associated SWRL rules. Subclass relation is denoted by the \"\(<\)\" sign. \"Inter-object Must Not\" can easily be updated by updating the subclass relations of the specification classes or creating new classes with the appropriate subclass relations. \"If a and x, despite being in sdqo:ClassCross1 and sdqo:ClassCross2, respectively, still cross over each other, an error is present\". Sample class hierarchy paths:  
* [noitemsep]
* sfo:Road < sfo:ClassCrf07 < sdqo:ClassCross1 < sdqo:Cross < sdqo:InterObjectPrRF < sdqo:RestrictedFeature < ogc:Feature < ogc:SpatialObject < owl:Thing \begin{table}
\begin{tabular}{l l} \hline \hline
**No.** & **SWRL Expression** \\ \hline \multirow{2}{*}{1} & RestrictedFeature(?x) \textasci{}hasGeometry(?x,?g) \textasci{}asWKT(?g,?w) \textasci{}swrlb:contains(?w, “POLYGON”) \\  & -> CalcPoly(?x) \\ \hline \multirow{2}{*}{2} & iande (?x,?a) \textasci{}iande(?a,?x) \textasci{}-> crossesOrOverlaps (?x,?a) \\ \hline \multirow{2}{*}{3} & crossesOrOverlaps(?x,?y) \textasci{}CalcPoly(?x) \textasci{}CalcPoly(?y) \textasci{}-> sfOverlaps(?x,?y) \\ \hline \multirow{2}{*}{4} & crossesOrOverlaps(?x,?y) \textasci{}CalcLine(?x) \textasci{}CalcPoly(?y) \textasci{}-> sfCrosses(?x,?y) \\ \hline \multirow{2}{*}{5} & noie(?x,?a) \textasci{}nobe(?x,?a)-> sfWithin(?x,?a) \\ \hline \multirow{2}{*}{6} & swrlb:stringConcat(?aap,?p, \", \"\textasci{}xsd:string,?aa) \textasci{}hasMessage(?r,?aa) \textasci{}hasProbName(?t,?p)\textasci{} hasResult(?t,?r) \textasci{}-> elementHasMessage(?t,?aap) \\ \hline \multirow{2}{*}{7} & errorCode(?r,?n) \textasci{}resultForData(?r,?a) \textasci{}-> dataHasErrorWithCode(?a,?n) \\ \hline \multirow{2}{*}{8} & noie(?x,?a) \textasci{}nobe(?x,?a) \textasci{}noie(?a,?x) \textasci{}nobe(?a,?x)\textasci{}>sfEquals(?x,?a) \\ \hline \hline \end{tabular}
\end{table} 
Table 7: A subset of rules in SDQO. Croses to a string involving the ids of the features.