• Keine Ergebnisse gefunden

Simulation Based Experiments

Im Dokument Querying a Web of Linked Data (Seite 170-0)

II. Execution of Queries over a Web of Linked Data 97

6. A Traversal-Based Strategy 111

7.3. Experimental Analysis

7.3.3. Simulation Based Experiments

To answer Questions 7.1 to 7.7 we set up a controlled environment that allows us to simulate multiple Webs of Linked Data. Based on this environment, we conducted a series of experiments during which we executed all possible query plans for particular CLD(M) queries over different simulated Webs. In the following we first describe the experimental setup, that is, the simulation environment, the simulated Webs of Linked Data, and the test queries; thereafter, we discuss the experiments and their results.

Simulation Environment

For the simulation environment, we developed a Java servlet calledWODSim (which is available at the SQUIN Web site [68]). This servlet simulates a (finite) Web of Linked Data by answering all URI lookup requests that Web clients may send to potential Web servers in the simulated Web. The basis of such a simulated Web are (gzip-compressed) RDF documents stored in a particular structure of subdirectories in the file system of the servlet container that deploys WODSim. More precisely, each of these documents contains the data for an LD document of the simulated Web. When WODSim serves such document (on behalf of a simulated Web server), it transforms the data of the document by prefixing any URI mentioned in the document with the URL at which

7.3. Experimental Analysis the WODSim instance is deployed on the WWW. This transformation ensures that all URIs that appear in the simulated Web refer back to the WODSim instance hosting the simulation. Hence, systems built for accessing Linked Data on the WWW (such as SQUIN) may traverse the simulated Web without crossing over to the wider WWW.

For the experiments, we deployed WODSim using an Apache Tomcat Web server (version 6.0.33) on a second virtual machine. This virtual machine has the same config-uration and runs on the same server as the virtual machine that hosts our SQUIN-based benchmark system (cf. Section7.3.1, page152f).

Simulated Webs of Linked Data

The overall goal of our experiments is to investigate the effects of using link traversing iterators for queries over a Web of Linked Data. However, the observability of these effects may be highly dependent on how such a queried Web is structured and how data is distributed. Therefore, we used multiple Webs of Linked Data for all of our experiments.

In fact, some of the experiments (in particular, those related to Questions 7.3 and 7.4) inherently require executing the same query plans in different Webs. To be able to meaningfully compare such executions over different Webs, we generated each of these Webs using the same base dataset.

This base dataset consists of synthetic RDF data created with the data generator that is part of the Berlin SPARQL Benchmark (BSBM) suite [19]. The data describes entities in a fictitious distributed e-commerce scenario, including different producers and vendors, products, product offers, and reviews from multiple reviewing sites. Figure7.7 illustrates the RDF vocabulary used for these descriptions.

To obtain the particular BSBM dataset based on which we generated our test Webs, we executed the BSBM data generator using a scaling factor of 200. The resulting base dataset consists of 75,150 RDF triples and describes 7,329 entities (namely: 21 product types, 999 product features, 5 producers, 200 products, 2 vendors, 4,000 offers, and 1 rating site with 101 reviewers and 2,000 reviews). Each of these entities is identified by a single, unique URI. We denote the set of these URIs by Utest (i.e., Utest ⊆ U and

|Utest|= 7,329), and the base dataset byGtest.

Each test Web that we generated from the base dataset consists of 7,329 LD docu-ments, each of which is authoritative for a different URI uUtest. To distribute the base dataset Gtest over these documents, we partitioned Gtest into 7,329 (potentially overlapping) subsets. While the particular partitioning process differed for the different test Webs (as described in the following), we ensured that every RDF triple in the sub-set for the LD document generated for URI uUtest hasu as subject or as object (as encouraged by the Linked Data principles [14]). As a result, every test Web is a Web of Linked DataWtest= (D, data, adoc) that has the following six properties:

1. D= 7,329.

2. For each URI uUtest,adoc(u)D.

3. For each pair of distinct URIs u, u0Utest (i.e.,u6=u0),adoc(u)6=adoc(u0).

Figure 7.7.: An entity-relationship model that illustrates the RDF vocabulary used for BSBM datasets. Entity sets represent classes; relationship sets represent properties. Attributes represent additional properties whose ranges are lit-erals. Key attributes (representing the URI of each entity) are omitted.

4. For each URI u /Utest,adoc(u) =⊥.

5. AllData(Wtest) =Gtest.

6. For every URIuUtest and RDF triple (s, p, o)∈data adoc(u),u∈ {s, o}.

Property5shows that all RDF triples in our test Webs come from the base dataset and, conversely, each RDF triple from the base dataset is available in every test Web.

Since none of the RDF triples generated by the BSBM data generator contains a blank node, the base dataset consists of two types of RDF triples only: RDF triples from the setU × U × U, henceforth referred to asURI-only triples, and RDF triples from the set U × U × L, henceforth referred to asliteral triples.

To ensure Properties 5 and 6 for every test Web, we always added each of the literal triples to the data of the LD document generated for the subject URI of that triple; i.e., for each literal triple t = (s, p, o) ∈ Gtest, we ensured that tdata adoc(s) holds for every test WebWtest= (D, data, adoc).

7.3. Experimental Analysis For any URI-only triple tGtest, it was possible to either add t only to the LD document for the subject oft, addtonly to the LD document for the object of t, or add tto both of these documents. The first of these three options establishes asubject-based data link pointing to the LD document for the object of t, the second option establishes an object-based data link to the LD document for the subject oft, and the third option establishes both the subject-based and the object-based data link. It is easy to see that choosing among these three options (where the choice may differ for each URI-only triple) may have a significant impact on the structure of the resulting test Web.

We applied a random-based approach to choose among these three options for any URI-only triple. This approach is based on the following two metrics (which we shall use to characterize the structure of our test Webs): Informally, the bidirectional inter-linkage (or simplyb-interlinkage) of a test Web is the percentage of all URI-only triples that establish both a subject-based and an object-based data link; thenon-bidirectional, subject-based interlinkage (or simplynbsb-interlinkage) of a test Web is the percentage of the remaining URI-only triples that establish a subject-based data link (and not an object-based data link). Formally, we define these metrics for an arbitrary Web of Linked Data (not just our test Webs) as follows:

Definition 7.3 (b-interlinkage and nbsb-interlinkage). Let W = (D, data, adoc) be a Web of Linked Data and letTor,Tand, and Tsubj be the following sets of (URI-only) RDF triples in AllData(W):

Tor =n(s, p, o)∈ U × U × U(s, p, o)∈data adoc(s)or (s, p, o)∈data adoc(o)o, Tand=n(s, p, o)∈ U × U × U(s, p, o)∈data adoc(s)and (s, p, o)∈data adoc(o)o, Tsubj=n(s, p, o)∈ U × U × U(s, p, o)∈data adoc(s)and (s, p, o)∈/ data adoc(o)o. Then, theb-interlinkageofW, denoted by bi(W), and thenbsb-interlinkageofW, denoted by nbsbi(W), are defined as follows:

bi(W) := 100%·|Tand|

|Tor| and nbsbi(W) := 100%· |Tsubj|

|Tor\Tand|. 2 We emphasize that there exists exactly one test Web with a b-interlinkage of 0% and an nbsb-interlinkage of 100%. In this test Web, hereafter denoted by Wtest0,100, any base dataset triple is contained only in the LD document generated for the subject of that triple. Similarly, there exists exactly one test Web,Wtest0,0, with both a b-interlinkage of 0% and an nbsb-interlinkage of 0%, and there exists exactly one test Web, Wtest100, with 100% b-interlinkage (nbsb-interlinkage is irrelevant for the latter).

Any other pair of b-interlinkage and nbsb-interlinkage does not uniquely determine a particular test Web. Instead, for any such pair (b, n), there exist multiple test Webs, each of which has a b-interlinkage ofb and an nbsb-interlinkage of n. These test Webs have link graphs that are very similar to each other. When we partitioned the base dataset Gtest to generate such a test Web Wtestb,n = (D, data, adoc), we used a

random-based approach. That is, for each URI-only triple (s, p, o)∈Gtest, werandomly selected one of the aforementioned three options (i.e., adding the triple to LD documentadoc(s), to LD document adoc(o), or to both) such that the resulting test Web has the given pair of b-interlinkage b and nbsb-interlinkage n. Hence, each of the three options had a certain probability of being (randomly) selected; essentially, these probabilities are a function of the given interlinkage values b and n (i.e., we used b as the probability for choosing to add a URI-only triple (s, p, o) ∈Gtest to both LD documents ds =adoc(s) and do =adoc(o), and we usednas the conditional probability for choosing to add the triple to ds if it has not been added to bothds and do).

For most of our evaluation questions, we are interested in test Webs whose pair of interlinkage values is most representative of the interlinkage values of (real) Linked Data on the WWW. To determine such representative interlinkage values we analyzed a comprehensive corpus of real Linked Data that has been crawled for the Billion Triple Challenge 2011 [64]. This corpus consists of about 7.9 million LD documents; the overall number of RDF triples distributed over these documents is 2.15 billion (where the overall number of unique RDF triples is 1.97 billion) and the number of URIs mentioned in these triples is 103 million. For this corpus of real Linked Data, we determined a b-interlinkage of 62% and an nbsb-interlinkage of 47%.

Given this pair of values, we generated ten different test Webs using the random-based approach as outlined before. Thus, each of these ten Webs has a b-interlinkage of 62%

and an nbsb-interlinkage of 47% (and the aforementioned six properties). Furthermore, although they differ slightly, the link graphs of these ten Webs are very similar to each other. For instance, for an arbitrarily specified path, the prior probability that this path exists in the respective link graph is the same for each of these test Webs (and different from the corresponding prior probability that we may find for any test Web that has another pair of interlinkage values). Hereafter, we denote these ten test Webs by Wtest62,47,1,Wtest62,47,2, . . . ,Wtest62,47,10.

In addition to these, structurally very similar test Webs, we are interested in a set of test Webs that covers a wide variety of link graphs (in order to study Question7.4). For this purpose, we randomly generated another ten test Webs based on tendifferent pairs of b-interlinkage and nbsb-interlinkage. We denote these test Webs by Wtest0,33, Wtest0,66, Wtest33,0,Wtest33,33,Wtest33,66,Wtest33,100,Wtest66,0,Wtest66,33,Wtest66,66, and Wtest66,100, where the superscript identifies the corresponding pair of b-interlinkage and nbsb-interlinkage. Finally, we complemented this set of test Webs for Question7.4 by adding the aforementioned test Webs Wtest0,0,Wtest0,100, and Wtest100.

We materialized each of the 23 generated test Webs into a separate structure of sub-directories in the file system of our WODSim-based simulation server. Hence, switching from one of the test Webs to another is a matter of restarting the WODSim servlet with a particular configuration parameter that points to the corresponding directory.

Queries and Query Plans

As a basis for the simulation-based experiments we used six CLD(M)queries, SQ1to SQ6, which can be found in the Appendix (cf. Section D.3, page 216f). These queries differ w.r.t. their structural properties, as summarized in Table7.2.

7.3. Experimental Analysis

Table 7.2.: Structural properties of the test queries used for the simulation-based experiments.

In addition to the structural diversity, these queries also differ w.r.t. the types of paths that establish the query-specific reachable subwebs of our test Webs. For instance, for query SQ2, any such path needs to start with a subject-based data link from the author-itative document forReview110to a document for the product associated with the review;

from there, paths may alternate between subject-based data links from documents for products to documents for product features and object-based data links from documents for product features to documents for products. In contrast, for query SQ3, such paths can only have a length of 1 and need to consist of an object-based data link from the authoritative document for Product128to a document for a review about the product.

For each of the six test queries we generated all possible query plans, each of which presents a different permutation of the set of triple patterns as given for the respective query. As a result, we obtained an overall number of 90 query plans (six for the three queries with three triple patterns and 24 for the three queries with four triple patterns).

Procedure

For the simulation-based experiments we used SQUIN to perform different query execu-tion runs. Each of these runs consists of executing the 90 query plans over a particular test Web. As for the WWW-based experiment, we avoided measuring artifacts of con-current query executions by executing all query plans sequentially, one after another, and we excluded possible interference between subsequent query executions by using SQUIN in its primary mode of operation (i.e., for each query plan, SQUIN starts with an initially empty query-local dataset). Another aspect that might limit the comparability of our measurements is the nondeterministic behavior of link traversing iterators (as discussed in the context of Example7.4, page139). Since this type of nondeterminism is irrelevant for testing Hypothesis7.1, we deliberately ignored it for the WWW-based experiments.

However, for the simulation-based experiments, we need to take the nondeterministic behavior of link traversing iterators into consideration.

To investigate whether this nondeterministic behavior has a practical impact (cf. Ques-tion 7.6), we added two deterministic implementations of a link traversing iterator to SQUIN. These implementations represent any set of precomputed solutions (i.e., the set

tmp in Listing7.4, page 135) as a list and return such solutions in the order in which they appear in the list. The particular (total) order used for the list is based on how SQUIN represents valuations internally and is irrelevant for our discussion. While both deterministic implementations use this (artificial) order, one of them always returns the precomputed solutions starting from the begin of the list, whereas the other implemen-tation always starts from the end. Consequently, we refer to query execution runs for which we use these (deterministic) implementations as ascending runs and descending runs, respectively. Nondeterministic runs, in contrast, use the standard, nondetermin-istic implementation.

We performed these runs for all of the aforementioned 23 test Webs. During the execution of each of the 90 query plans in such a run, we measured the number of documents retrieved and the number of solutions returned. We do not report query execution times here because, as per Hypothesis 7.1 (which we have verified by the WWW-based experiment), measuring query execution times basically means measuring the response time of our WODSim-based simulation environment. Furthermore, we emphasize that due to the reliability of this environment, SQUIN did not observe any URI lookup failures or timeouts during the simulation-based experiments. Thus, all measurements presented in the following section are error-free.

For some of our evaluation questions (in particular, for Questions7.1,7.2,7.3, and7.4) we need to know what the (complete) query result of our 6 test queries over each of the test Webs is and how many of the 7,329 LD documents of each test Web are reachable in the context of each test query. However, these numbers cannot be measured during ascending, descending, or nondeterministic runs (because link traversing iterators cannot guarantee completeness). Hence, to obtain these numbers we performed an additional completeness run for each test Web. During such a run we executed each of the 6 test queries using a two-phase algorithm that is similar to the algorithm implemented by the 2P machine (cf. Algorithm 4.1, page 88). That is, given a test query, the algorithm first retrieves all reachable LD documents by traversing data links that qualify according to reachability criterion cMatch (recall that our test queries are CLD(M) queries; hence, cMatch-semantics applies). Second, the algorithm evaluates the BGP of the test query over all data from the retrieved documents and, thus, computes the (complete) query result. Since the algorithm is a straightforward adaptation of Algorithm 4.1, we omit proving its properties (soundness, completeness, and termination for any Web of Linked Data that is finite such as our test Webs); instead, we refer to the formal discussion of Algorithm 4.1(in particular, Lemmas4.2,4.3, and 4.4; cf. pages 88 to89).

Measurements

The measurements that we obtained using test Webs Wtest62,47,1 to Wtest62,47,10 are very similar to each other. Therefore, this section presents detailed measurements for test Web Wtest62,47,1 only. Thereafter, we discuss our observations and refer to the measurements obtained using the other test Webs when necessary.

The charts in Figures 7.8and 7.9depict these measurements (cf. pages166and 167).

More precisely, Figures7.8(a), 7.8(c),7.8(e),7.8(g), 7.9(a), and7.9(c) report the number

7.3. Experimental Analysis of solutions returned by executing the query plans for test query SQ1, SQ2, SQ3, SQ4, SQ5, and SQ6 over test Web Wtest62,47,1, respectively. The corresponding numbers of retrieved documents can be seen in Figures 7.8(b), 7.8(d), 7.8(f),7.8(h), 7.9(b), and 7.9(d). The x-axises in these charts represent the query plans. Labels on these axises (given in parentheses) indicate a specific structural property of the plans that is relevant for our discussion below; we shall introduce this property in the context of this discussion.

The bars in these charts represent the respective measurements obtained during the ascending, descending, and nondeterministic run; the corresponding measurements of the completeness run are represented as a dotted line that stretches across the bars (because, for each test query, the cardinality of the complete query result is independent of the query plan used, and so is the number of reachable documents).

For instance, from Figures7.8(a) and7.8(b) we see that the complete query result for test query SQ1 (over test WebWtest62,47,1) consists of 563 solutions and the corresponding reachable subweb of the test Web comprises 3,834 documents. During the ascending run, the first plan for query SQ1 discovered and retrieved 2,201 of the 3,834 reachable documents and returned 482 of the 563 solutions (see the leftmost bars in the figures).

Discussion of Questions 7.1 and 7.2

The first and most striking observation from our measurements in Figures7.8and7.9is that the lack of semantic equivalence between different logical plans for a query (as shown theoretically in Section 7.2.1, page137ff) has asignificant practical impact. For any of the six test queries, the degree of completeness of the computed query results differs drastically between the different execution plans, and so does the number of discovered documents. For all test queries except SQ4, there exist plans that return empty query results. In contrast, other plans achieve degrees of result completeness of up to 86%, 86%, 100%, 94%, 50%, and 78% for query SQ1to query SQ6, respectively.

Table7.3(on page168) shows that we observed similar differences (as well as similar minimum and maximum degrees of result completeness) in the other test Webs generated with 62% b-interlinkage and 47% nbsb-interlinkage. While we shall discuss reasons for these differences below, these differences show that it is impossible to provide a general answer for Questions 7.1 and 7.2 (other than that the percentages may range from 0%

to 100%). Therefore, in the remainder of this section we focus on the other evaluation questions and discuss them one after another.

Discussion of Question 7.3

To investigate whether link traversing iterator based query plans exhibit a correlation between (i) the degree of result completeness and (ii) the percentage of reachable doc-uments discovered (Question 7.3), we computed these two numbers for each of the 90 query plans for every ascending run (i.e., over any of our test Webs); we then plotted the resulting pairs of numbers as points in scatter charts.

(a)(c)(e) (b)(d)(f) forquerySQ1forquerySQ2forquerySQ3 (g) (h) forquerySQ4 Figure7.8.:MeasurementsforqueryingtestWebW62,47,1 testusingallpossiblequeryplansfortestqueriesSQ1toSQ4.

7.3. Experimental Analysis

(a) (b) forquerySQ5 (c) (d) forquerySQ6 Figure7.9.:MeasurementsforqueryingtestWebW62,47,1 testusingallpossiblequeryplansfortestqueriesSQ5andSQ6.

Im Dokument Querying a Web of Linked Data (Seite 170-0)