Examples

The main goal of current Web navigation languages is to retrieve set of nodes reachable from a given node. No information is provided about the fragments of the Web navigated to reach these nodes. In other words, information about their connections is lost.

New semantics (Visited and Successful) of NautiLOD has been implemented to face these issues which enable to extract a Web fragment navigated by a NautiLOD expression.

Note that data may frequently change and that  LOD servers may temporarily be unavailable.

In the following some additional examples of usage of swget are reported.

 

Influence network
Suppose that we want to extract two fragments of the Web of Data including scientists directly and inderectly influenced by Stanley Kubrick and Tim Berners-Lee up to distance 6 , respectively. 1) The command starts with the URI of Kubrick and Berners-Lee in DBPedia: http://dbpedia.org/resource/Stanley_Kubrick

and

http://dbpedia.org/resource/Tim_berners-Lee

The property dbp:influenced is exploited to obtain people influenced by them. Then we have:

swget http://dbpedia.org/resource/Stanley_Kubrick -p <http://dbpedia.org/property/influenced><1-6>[Test]

swget http://dbpedia.org/resource/Tim_Berners-Lee -p <http://dbpedia.org/property/influenced><1-6>[Test]

Test= ASK {?ctx <http://www.w3.org/1999/02/22-rdf-syntax-ns#type&gt; <http://dbpedia.org/resource/Scientist&gt;.}

2) By not specifyng the option -recon (or by checking the checkbox ‘Visited’ in the GUI) the fragment according to the Visited semantics is obtained. Otherwise, the fragment according to the Successful semantics is built. The fragments obtained for Tim Berners-Lee are reported in the following figure:

The fragments obtained for Stanley Kubrick are reported in the following figure:

You can download the script for specifying the region of SK from here and the region of TBL from here. You can download the fragment of SK obtained according to the Visited semantics from here and the one obtained according to the Successful semantics from here. You can download the fragment of TBL obtained according to the Visited semantics from here and the one obtained according to the Successful semantics from here.

 

Co-author subgraph from Alberto Mendelzon
Suppose we want to extract the fragment of the Web including co-authors of Alberto Mendelzon up to depth 2 but only for publications between 1980 and 1990. Note that there are tools (e.g., Microsoft Academic Search)  that enable to visualize the co-author graph of an author. However, these are tools and not languages in the sense that it is not possible to declaratively specify the structure of the wanted co-author subgraph. In this example, for instance, we want to consider only papers in a given range even if we could have put any other kind of constraint (e.g., affiliation, age, publication venue). Note that with the following NautiLOD expression one can retrieve A. Mendelzon‘s co-authors satisfying the constraint:swget dblp:Alberto_O._Mendelzon -p (<http://xmlns.com/foaf/0.1/maker>[ASK{ ?p <http://purl.org/dc/terms/issued> ?y.

FILTER( ?y>”1980″^^<xsd:gYear>).

FILTER(?y<“1990″^^<xsd:gYear>).}]

/<http://xmlns.com/foaf/0.1/maker>)<2-2>   

The notation <2-2> means that the expression within parentheses is repeated two times. From papers reached after evaluating the ASK query it is possible to get their authors, which are direct or indirect co-authors of A. Mendelzon. While the standard semantics of NautiLOD returning endpoints enables to collect the set of co-authors, no information about their connections is provided. For instance, while R. Fagin and J. Ullman would appear in the result of the evaluation of the NautiLOD expression, it is not possible to know whether they are direct or indirect co-authors of A. Mendelzon or through which sequence of papers they are connected. On the other hand, with the new semantics (Visited and Successful) it is possible to obtain the result shown in the figure below. Here it can be observed that A. MendelzonR. Fagin and J. Ullman are direct co-authors in 1982 of a paper appeared in the TODS journal. The following figure shows the Web fragment obtained according to the Successful semantics.

Screen Shot 2014-04-16 at 11.43.17

 

List of co-authors in DBLP sent by email
Suppose that we want to know the name of our co-authors as in the previous case, but we want the system to send these names via email as soon as it obtains them.1) The first part of the command is the same as above:swget http://dblp.l3s.de/d2r/resource/authors/Giuseppe_Pirr%C3%B2 

-p <http://xmlns.com/foaf/0.1/maker><2-2>

2) We need to specify an action in the navigational path. In particular the action has to send an email with the names of our co-authors. Of course we need to obtain them! How can we do ? Note that at the end of the previous expression we had information about our co-authors; what we need now are their names and to command the action to send the email. With swget this can be done as follows:

/ACT[select ?n where {?x <http://xmlns.com/foaf/0.1/name> ?n}::sendEmail(xxx@yyy.zz)]

where /ACT[test::command] is the action. In this case the test, selects the <foaf:name> of our co-author and the built-inf function sendEmail (xxx@yyy.zz), thames data from the SELECT in the test. The final swget command is:

swget http://dblp.l3s.de/d2r/resource/authors/Giuseppe_Pirr%C3%B2 -p <http://xmlns.com/foaf/0.1/maker><2-2>/ACT[select ?n where {?x <http://xmlns.com/foaf/0.1/name> ?n}::sendEmail(xxx@yyy.zz)]

Try it with your name 😉

 

Advertisements
%d bloggers like this: