**3.6.1 Example**

90 Semantics – Advances in Theories and Mathematical Models

However, searching performed over web resources through Boolean queries (keywords conjunction with AND & NOT operators) do not work in a plain page caching system. Because the user query in this case is not a URL, and extracting qualified tuples against an individual keyword or whole query from page headers is not possible (Chidlovskii B and Borghoff U. M., 2000), (Qiong L and Jaffrey F. N., 2001). Semantic cache was introduced as

Web queries over web resources are different than queries posed over databases. As there is no attribute and predicate part in web queries, also it neither contain join operator. And the

There is a lot of research work on semantic caching for web queries. Such as (Chidlovskii B and Borghoff U. M., 2000) addressed both semantic cache management and query processing of web queries for meta-searcher systems. Their technique is based on a signature file method. In which a signature is given to every semantic region for processing

A cache model was proposed for database applications using web techniques (Anton J. et al., 2002). Cache elements were stored as web pages/sub pages called fragments and sub fragments with their header information called template. Fragments can be indexed or shared among different templates. Fragments, sub-fragments and templates were updated or expired based on their unique policy which included expiration, validation and invalidation information. In this case data retrieval is performed by matching template information with requested query and subsequent fragments or sub-fragments are returned. Partial answer retrieval is possible in this technique as sub-fragments alone can be resulted to a user query. But still this technique is closer to page cache technique, where each

The information that is available on the web is unstructured, extensible mark-up language XML is used to provide the structure to the web information/data. As described above the querying mechanism for current web is keyword based search. Keyword based search is considered to be the non-semantic (Mandhani B. and Suciu D., 2005), (Sanaullah, M., 2008).

A novel method of checking containment is proposed by Gang Wu and Juanzi Li (Gang Wu and Juanzi Li, 2010). Each node in the query is assigned a unique prime number and then the product of these prime numbers is calculated by a specific method. This product is called Pattern's Prime producT (PPT). The query is stored in the cache along with this PPT. On each next issued query the same procedure is followed to assign unique prime numbers to each node and if any node of the query matches with any existing stored view's node then the same prime number is assigned to new node as it was allotted to previously stored node. The PPT of the new query is calculated and then divided by the PPT of all stored views. If any of stored views completely divides the PPT of the query then that view is selected and rest are rejected. The selected view further processed to make sure whether the occurrences of the nodes in the query and view is similar, i.e Qk = Vk where k is the

an alternative to plain page caching where cache is managed as semantic regions.

problem of answering web-queries can be reduced to *set containment problem*.

all cases (similar to Figure 1) of containment and intersection.

**3.6 Pattern Prime Product (PPT) reasoning for XML queries** 

position of kth axis node. The PPT of each infix is also checked.

fragment is itself a page.

An XML document is shown in Figure 9. A user issues a query /lib/book and as a result the technique loads all the results of "lib", "book" nodes in the cache and assigns prime numbers to each node i.e. "lib"=2, "book"=3. After assigning the prime numbers a prime product is calculated as follows.

(2\*3), here 6 is the Tree Pattern Prime Product of the view.

Now if the user again issues the query /lib/book/author then each node in the query is assigned the same prime number as it was previously assigned to the nodes in the view. Here 2 is assigned to "lib" and 3 is assigned to "book". "author" appeared first time so a new prime number i.e. 5 is assigned to author node. Dividing the prime product of query (90) by the prime product of view (6) will yields the result 15, means query is completely divided by the view. If the prime product of a view completely divides the prime product of a query then it further checks the following conditions. Whether the order of appearance of each axis node in the view and query is similar and if the answer is true then it means that the query is contained in the view.

## **3.6.2 Example**

If a query contains predicates, for example A[b[b[a]]]/c/d the tree of this query is shown in figure 9. The prime product is calculated as shown below

Fig. 9. Prime Product Calculation.

PPT of b=(2\*3)\*(3\*1)\*(1\*2)\*(2\*7) = 504 PPT of c= (2\*7)\*(7\*1)\*(1\*2)\*(2\*3) = 1176

Now only the PPT of b completely divides the PPT of the query so b is selected in the first condition of the algorithm.

This algorithm retrieves the results of all axis nodes given in the query for example if we issue following query to the document shown in figure 1 "\lib\book[price>30]". Then apart from the presence of a predicate it retrieves all the result of book node and stores it in the cache. This action requires more cache space.

#### **3.7 Subsumption analysis reasoning**

Description logics (a language of logic family) DL claims that it can express the conceptual domain model/ontology of the data source and provide evaluation techniques. Since structured query language (SQL) is a structured format, it can be classified under

Semantic Cache Reasoners 93

In this chapter we demonstrated several reasoning techniques of query processing in semantic cache. This chapter provides overview of semantic cache application in different domains such as relational databases, web queries, answering from views, xml based

Semantic cache query processing techniques are unstructured-semantics approaches, in which semantics are extracted from structured representations that have no semantics

We would like to acknowledge Mr. Ishtique Ahmad for providing help on XML based semantic cache, Mr. Tariq Ali for DL based subsumption analysis, and Mr. Munir Ahmed

A. Klug, "On Conjunctive Queries Containing Inequalities," *ACM,* vol. 35, no. 1, pp. 146-160,

Ahmad, M and Qadir, M.A., (2008). "Query Processing Over Relational Databases with

Ahmad, M and Qadir, M.A., "Query Processing and Enhanced Semantic Indexing for

Ahmed M. U., Zaheer R. A., and Qadir M. A., "Intelligent Cache Management for Data

Ali, T., Qadir, M. A., Ahmed, M., Translation of Relational Queries into Description Logic

Andrade H., Kurc T., Sussman A., Saltz J., "Active semantic caching to optimize

Anton J., Jacobs L., Liu X., Parker J., Zeng Z. and Zhong T., "Web caching for database

Baader, F., Hollunder, B., A terminological knowledge representation system with complete

Mohammad Ali Jinnah University, Islamabad, Pakistan 2007.

Journal on Parallel Computing, volume 33, pp 497-520, 2007.

Emerging Technologies (ICIET) 2010.

Semantic Cache: A Survey", 12th IEEE International Multitopic Conference 2008,

Relational Data Semantic Cache", Center for Distributed and Semantic Computing,

Grid", Australasian Workshop on Grid Computing and e-Research (AusGrid 2005).

for semantic Cache Query Processing, International Conference on Information and

multidimensional data analysis in parallel and distributed environments" Elsevier

applications with Oracle Web Cache", Proceedings of the 2002 ACM SIGMOD international conference on Management of data, June 03-06, 2002, Madison,

inference algorithm. In: Proc. Workshop on Processing Declarative Knowledge, PDK-91Lecture Notes in Artificial Intelligence, Springer, Berlin, pp. 67–86, 1991. Baader, F., Hanschke, P. A schema for integrating concrete domains into concept languages.

In Proc. of the 12th Int. Joint Conf. on Artificial Intelligence (IJCAI'91), pages452–

**4. Conclusion** 

queries and description logic based queries.

within their representations.

for providing useful feedbacks.

Jan. 1988.

INMIC08.

Wisconsin.

457, 1991.

**5. Acknowledgment** 

**6. References** 

subsumption relationship. A well known technique named Tabulex provides structural subsumption of concepts. Description logic (DL) is assumed to be useful for semantic cache query processing and management (Ali et al. 2010). The relational queries can be modelled / translated in DL and DL inference algorithms can be used to find query containments. The translation of relational query to DL may have not the same spirit as that of querying languages for DL systems, but is sufficient for finding the query containment of relational queries (Ali et al. 2010). The subsumption reasoning (containment) of the semantics of the data to be cached is very useful in eliminating the redundant semantics and minimizing the size of semantic cache for the same amount of data.

The tableaux algorithm (Baader et al., 1991a) (Hollunder et al., 1990) is instrumental to devise a reasoning service for knowledge base represented in description logic. All the facts of knowledge base are represented in a tree of branches with intra-branch logical AND between the facts and inter-branch logical OR, organized as per the rules of tableaux algorithm (Baader et al., 2003). A clash in a branch represents an inconsistency in that branch and the model in that branch can be discarded. The proof of subsumption or unsatisfiability can be obtained if all the models (all the branches) are discarded this way (Baader et al., 2003).

The proposed solution (Ali et al. 2010) consists of two basic steps: First user query (relational) is translated into DL. The translated query is then evaluated for subsumption relationship with previously stored query in the cache by using the sound and complete subsumption algorithm given in (Baader et al., 91b) (Lutz et al., 2005).
