Graphics Reference
In-Depth Information
dbpedia.org is an online resource of structured data from Wikipedia.
DBpedia can be queried to extract data, including graph data sets. You can
findanoverviewofDBpedia'sdatasetsat http://wiki.dbpedia.org/Datasets .
You can enter a simple query at http://dbpedia.org/snorql/ .
As an example, if you want to focus on science fiction writers and their
influences, you can see the data collected for a sample writer such as
Stephen King ( http://dbpedia.org/page/Stephen_King ) . One of the fields is
influencedby , which is a list of other science fiction writers that Stephen
King wasinfluenced by.(Thismeans thatdataforasocial network ofwriters
is in DBpedia.) To extract data from DBpedia, you use the query language
SPARQL. (SPARQL and related graph database technology is discussed
more in Chapter 14, “Big Data.”) For example, you can enter the following
SPARQL query on http://dbpedia.org/snorql (note that data and fields on
DBpedia can change—scripts may not necessarily work as is):
SELECT * WHERE {
?subject dbpedia2:genre :Science_fiction.
?subject rdf:type foaf:Person.
?subject <http://dbpedia.org/ontology/influencedBy>
?influence.
}
Tip
You can use SPARQL queries directly in Gephi with the Semantic Web
Import plug-in.
The resulting data is a set of links with the author being the source node,
and the corresponding influence being the target node. While this query
generates afairly simple data set,thequery can beenhanced toaddavariety
of additional data attributes. For example, data available may include
birthdate, nationality, description, nicely formatted label, list of works, and
so on.
Given the file of links, the programming task is to extract a set of nodes. The
approach used here is as follows:
1. Open the link file.
Search WWH ::




Custom Search