# Download the RDF data for a particular resource (or, resp., Wikipedia page) from Dpedia, e.g. for http://en.wikipedia.org/wiki/Sankt_P%C3%B6lten:
curl -H "Accept: application/rdf+xml" -L http://live.dbpedia.org/resource/Sankt_Pölten
# Download the results of a query
# e.g. all information about strikers in "La Liga"
# 1) let's start with looking at an example: http://live.dbpedia.org/page/Diego_Costa
# ... here we find that Diego Costa play on position Forward, i.e.
# dbpedia:Diego_Costa prop:position dbpedia:Forward_(association_football) .
# and that his team is
# dbpedia:Diego_Costa dbpedia-owl:team dbpedia:Atl%C3%A9tico_Madrid .
# if we click further on dbpedia:Atl%C3%A9tico_Madrid ... we find that:
# dbpedia:Atl%C3%A9tico_Madrid dbpedia-owl:league dbpedia:La_Liga .
# 2) From this, we can forumlate a SPARQL query
# to ask for strikers playin in La Liga:
PREFIX dbpedia:
PREFIX dbpedia-owl:
PREFIX prop:
SELECT DISTINCT ?X ?T WHERE {
?X prop:position ;
dbpedia-owl:team ?T .
?T dbpedia-owl:league dbpedia:La_Liga .
}
# We can now send this query to live.dbpedia.org via curl:
# ... assuming the query is in the file named 'strikers_from_dbpedia.rq'
curl "http://live.dbpedia.org/sparql" -F 'query=@strikers_from_dbpedia.rq' -H 'Accept: text/csv'