API
This site provides instructions for the access of one or multiple ontologies.
Examples
Example 1 (default) Download the latest version of the Cinelab ontology as RDFXML
curl -L "http://archivo.dbpedia.org/download?o=http://advene.org/ns/cinelab/ld"
Example 2 Download the latest version of the Cinelab ontology as Turtle
curl -L "http://archivo.dbpedia.org/download?o=http://advene.org/ns/cinelab/ld&f=ttl"
Example 3 Download a specific version of the Datashapes ontology as RDFXML
curl -L "http://archivo.dbpedia.org/download?o=http://datashapes.org/dash&v=2020.07.16-115638"
API pattern explained
http://archivo.dbpedia.org/download?o={ontology-URI}&f={file-extension}&v={timestamp}
with:
- o={ontology-uri} the URI of your desired ontology (e.g http://xmlns.com/foaf/0.1/). If the URI contains problematic
characters like
#
you may encode the query with URL-encode.
- f={file-extension} currently supported: owl, ttl and nt; default: owl
- v={timestamp} no parameter selects latest, otherwise the timestamp of the ontology snapshot. To see
what timestamps are available check out the View Ontology of your ontology and copy it
from the Version column
- Add &dev to the request uri to access the dev version of the ontlogy (only works if there is a
dev version; to see what dev versions are available check out the dev list)
Another way is searching your ontology in the
complete list of Archivo ontologies
which also provides the latest download links.
Archivo is powered by DBpedia Databus, which enables the creation of collection (custom data catalogues). Custom
collections can be created and edited
here. A
few useful collections were already created:
Additionally the files in a collection can be downloaded with a few simple bash commands (can be copied from each
specific collection page):
# load the query of a collection via curl
query=$(curl -H "Accept:text/sparql" <COLLECTION-URI>)
# fetch the files via wget
files=$(curl -H "Accept: text/csv" --data-urlencode "query=${query}" https://databus.dbpedia.org/repo/sparql | tail -n+2 | sed 's/"//g')
while IFS= read -r file ; do wget $file; done <<< "$files"
Virtuoso
quickstart docker of the DBpedia Stack starts a Virtuoso instance and all latest ontologies will be deployed
automagically by feeding the collection URI. Requirements for this are a proper installation of
docker and
docker-compose on your machine.
Example: Load latest versions of official ontology graphs in an virtuoso endpoint.
git clone https://github.com/dbpedia/virtuoso-sparql-endpoint-quickstart.git
cd virtuoso-sparql-endpoint-quickstart
COLLECTION_URI=https://databus.dbpedia.org/denis/collections/latest_ontologies_as_nt VIRTUOSO_ADMIN_PASSWD=secret docker-compose up
NOTE: The Virtuoso SPARQL endpoint will be available at
http://localhost:8890/sparql.
-
Using
wget
the raw databus interface
downloads all archived versions with all augmentation files of all ontologies:
wget --no-parent --mirror https://raw.databus.dbpedia.org/ontologies/
- Using the Databus Client: Generates a local file
dump of a SPARQL query
Example Download as N-Triples:
# download and build the client
git clone https://github.com/dbpedia/databus-client.git
cd databus-client
mvn clean install
# download the latest version of the official ontology release as turtle files
bin/DatabusClient -f ttl -s https://databus.dbpedia.org/denis/collections/latest_ontologies_as_nt