The Semantic Web enables data exchange and knowledge exploitation through SPARQL queries; however, users often encounter difficulties when formulating such queries, leading to unexpected results and iterative trial-and-error processes. These issues are aggravated by incomplete knowledge of the application domain and the underlying ontological schema, frequently causing unnecessary query executions and increased computational load on RDF repositories. This work proposes a method for the prior syntactic and semantic validation of SPARQL queries, based on an ontology and independent of its instances. The method operates before query execution and detects inconsistencies arising from literal writing errors and violations of object property axioms, providing explicit feedback to users. The development of the proposed approach follows a classical methodological framework grounded in the software engineering process. Experimental results show that the additional computational overhead introduced by validation is minimal, while the benefits are significant in scenarios involving incorrect queries. In particular, prior validation prevents the execution of erroneous queries, reduces processing time, and maintains negligible overhead for correct queries, demonstrating a favorable trade-off between computational efficiency and reduced manual intervention. Overall, the results indicate that prior validation improves SPARQL query quality and enhances developer productivity in semantic data–driven applications.
Paper
The full text of this publication is not hosted on 44B due to licensing.
Read it at OpenAlex