Examples

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

Note that data may frequently change and that dbpedia.org and the other LOD servers may temporarily be unavailable.

List of co-authors in DBLP
Suppose that we want to know the name of our co-authors by exploiting information in the Linked Open Data version of DBLP.

1) Start from the URI that identifies you in DBLP. In my case this URI is: http://dblp.l3s.de/d2r/resource/authors/Giuseppe_Pirr%C3%B22) This dataset exploits the RDF predicate <foaf:maker> to relate an author with her/his papers. Hence, by issuing the swget command:

swget http://dblp.l3s.de/d2r/resource/authors/Giuseppe_Pirr%C3%B2 -p <foaf:maker>

With this command I can obtain the list of my papers.

3) By exploiting again the predicate <foaf:maker> it is possible to obtain the list of coauthor. The command is:

swget http://dblp.l3s.de/d2r/resource/authors/Giuseppe_Pirr%C3%B2 -p <foaf:maker><2-2>

Note that <2-2> tells to recursive expand two levels of <foaf:maker>

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 <foaf: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 <foaf: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 <foaf:maker><2-2>/ACT[select ?n where {?x <foaf:name> ?n}::sendEmail(xxx@yyy.zz)]

Try it with your name ;)

Retrieve a sub-Web of Data
Suppose that we want to locally construct a sub-Web of Data starting from a URI and a navigational expression. As an example, I want to have the network of people directly influenced by Stanley Kubrick. Besides, I want to locally have their RDF graphs.

1) The command starts with the uRI of Kubrick in DBPedia: http://dbpedia.org/resource/Stanley_Kubrick

2) The property <dbpo:influenced> can eve exploited to obtain people influenced by Kubrick. Then we have:

swget http://dbpedia.org/resource/Stanley_Kubrick -p <dbpo:influenced>

3) However, we want to locally store all the graph associated to each dereferenced URI. For this, we can use the swget option -saveGraph. The command becomes:

swget http://dbpedia.org/resource/Stanley_Kubrick -saveGraph -p <dbpo:influenced>

Note that the final graph will be the UNION of all the dereferenced URIs. Try it with the GUI ;)

Follow

Get every new post delivered to your Inbox.