27.03.2014 Views

SEKE 2012 Proceedings - Knowledge Systems Institute

SEKE 2012 Proceedings - Knowledge Systems Institute

SEKE 2012 Proceedings - Knowledge Systems Institute

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

query into several sub-queries without any Alternative Graph<br />

Pattern.<br />

B. Indices Creation of SPARQL Query<br />

Based on SPARQL basics as discussed above, we present a<br />

method to create indices for a given SPARQL query to locate<br />

useful ontology for it. The method just concerns the query<br />

without Alternative Graph Pattern because the query with such<br />

pattern can be broken into se veral sub-queries without such<br />

pattern to substitute for it. It consists of the following steps:<br />

1) given a SPARQL query, extracts its graph pattern GP.<br />

2) from graph pattern GP, removes Optional and Named<br />

Graph Patterns in it, as a graph pattern G.<br />

3) converts graph pattern G into a tr iple pattern TP. For<br />

example, the conversion from Figure 1 to Figure 2.<br />

4) from each triple T in triple pattern TP, first takes out<br />

each RDF term tm, which are not blank nodes, variables, or<br />

vocabularies of ontology language, such as OWL. Then,<br />

records RDF term tm and its role Ro(as one of subject,<br />

predicate, and object) in the triple T as a pair . Thus,<br />

given a query’s triple pattern, we can obtain a pair set, called<br />

tmRoPairs.<br />

RDF terms in pairs in tmRoPairs are also referred to as<br />

entities, which are classes, properties, or individuals in web<br />

ontology to express the notions in domain. Here, each pair in<br />

tmRoPairs is reviewed as an index of its SPARQL query.<br />

Based on S PARQL basics as discussed in subsection 3.1, we<br />

can draw a conclusion as follows:<br />

Conclusion 1: If a web ontology is likely reasoned out<br />

results for a q uery, then for each pair P in the query’s<br />

tmRoPairs, the ontology must specify or can be reasoned out a<br />

triple T, which contains the RDF term tm in pair P, and tm’s<br />

role in triple T is identical to the role in pair P.<br />

For a pair P in a query’s tmRoPairs, if a web ontology<br />

neither specify nor can be reasoned out such a triple T, it means<br />

that a triple in the query’s triple pattern, from which pair P is<br />

constructed, must not be matched in the ontology. So, the<br />

ontology must not be reasoned out solutions for the query.<br />

C. Web Ontology Publication<br />

To locate web ontologies according to conclusion 1, we<br />

publish an ontology based on each entity and one of its possible<br />

roles which appear in a specified or implied RDF triple in the<br />

ontology. The process is listed as follows:<br />

1) given sharable ontology O, extracts the entities as a set<br />

enSet, which appear in ontology O.<br />

2) for each entity E in set enSet, reasons the ontology to<br />

determine whether there is at least one specified or implied<br />

triple where entity E’s role is subject (predicate, or object). If<br />

such a triple exists, puts E into subSet (preSet, or objSet).<br />

3) takes each element E in set subset (objSet, proSet) and<br />

its corresponding role subject (predicate, object) as a pair . Then, views the pair as an<br />

index idx of ontology O.<br />

4) according to each idx, publishes the IRI onto of<br />

ontology O by using the function pubOnto(idx, onto) as<br />

discussed in subsection 2.1.<br />

D. Web Ontology Location<br />

Based on conclusion 1 and ontology publication method in<br />

subsection 3.3, we design algorithm ontoLocating in Figure 3<br />

to locate ontologies useful to a given SPAQRL query. Its basic<br />

idea is that, given a query Q, we first discover ontologies based<br />

on each pair P in its tmRoPairs defined in subsection 3.2, and<br />

then intersect them as a set of useful ontologies to process<br />

query Q.<br />

1. Algorithm ontoLocating<br />

2. Input qry: a given SPARQL query.<br />

3. Output ontos: a set of IRIs of ontologies useful to query qry.<br />

4. Begin<br />

5. sets integer i=0 ;<br />

6. parses out set tmRoPairs from graph pattern of qry;<br />

7. For each pair p in set tmRoPairs Do<br />

8. i=i+1;<br />

9. creates a index idx based on the entity and its role in p;<br />

10. retrieves a set ontoSet by using function lookupOnto (idx);<br />

11. If i=1 Then ontos = ontoSet Else<br />

12. ontos = ontoSetontos<br />

13. End If<br />

14. End Do<br />

15. Return ontos;<br />

16. End<br />

Figure 3. Algorithm: ontoLocating<br />

In this algorithm, to process a given query, the number that<br />

the algorithms access P2P network is the number of pairs in<br />

tmRoPairs.<br />

IV. EVALUATION<br />

To evaluate our approach, first we have implemented it.<br />

Then, design the following two experiments to evaluate its<br />

efficiency:<br />

1) Experiment 1 evaluates our approach’s consumption of<br />

network resources when ontology is published.<br />

2) Experiment 2 evaluates our approach’s consumption of<br />

network resources when query is processed.<br />

A. Experiment Set Up<br />

In our experiments, first we downloaded 16 web ontologies<br />

from TONES [13], an ontology repository, as experimental<br />

data, which are listed in Table I. Then, we design 15 SPARQL<br />

queries using the entities, which come from the ontologies in<br />

Table I.<br />

In addition, we compare the consumption of network<br />

resources of our approach M1 with approach M2 and M3. For a<br />

same task, if an approach consumes fewer resources, it will be<br />

superior. Here, the consumption of network resources refers to<br />

the number of accesses to P2P network and quantity of values<br />

publishing on o r retrieving from P2P network when a web<br />

ontology is published, or a query is processed. As far as<br />

approach M2 and M3 are concerned, they are all implemented<br />

based on RDFPeers [14], a structured P2P-based RDF<br />

repositories. RDFPeers stores each RDF triple at three places<br />

619

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!