-
Notifications
You must be signed in to change notification settings - Fork 11
Home
Welcome to the de.setf.wilbur wiki!
Installing Wilbur is easy: it is present in the Quicklisp projects registry. Install Wilbur by running:
(ql:quickload "wilbur")
But you will have to install Quicklisp first.
Original Wilbur API documentation is available at the SourceForge project site.
Wilbur implements a Query Language (WilburQL) which essentially is a simple API on top of the RDF data manager (in "core-data.lisp"). Much of the functionality is modeled after the BEEF frame system. A description of the WilburQL itself can be found in the following paper:
- Ora Lassila: "Taking the RDF Model Theory Out for a Spin", in: Ian Horrocks & James Hendler (eds.): "The Semantic Web - ISWC 2002", Lecture Notes in Computer Science 2342, pp.307-317, Springer Verlag, 2002
Lets grab some data from DBPedia:
wget http://dbpedia.org/data/Semantic_Web.rdf
Wilbur parses RDF/XML graphs from a stream with parse-db-from-stream
function and expects that a graph database is stored in a variable wilbur:*db*
(with-open-file (stream #P"Semantic_Web.rdf" :direction :input)
(setf wilbur:*db*
(wilbur:parse-db-from-stream stream
"http://dbpedia.org/page/Semantic_Web")))
Now we can run queries like:
(wilbur:query nil !rdfs:label nil)
(#<TRIPLE !"http://dbpedia.org/resource/Semantic_Web" !rdfs:label #"Semantisches Web"@de #x18EEC1E6>
#<TRIPLE !"http://dbpedia.org/resource/Semantic_Web" !rdfs:label #"시맨틱 웹"@ko #x18EEC2AE>
#<TRIPLE !"http://dbpedia.org/resource/Semantic_Web" !rdfs:label #"Sémantický web"@cs #x18EEC366>
...)
The output is not very neat, let's add some prefixes to the dictionary:
(wilbur:add-namespace "resource" "http://dbpedia.org/resource/")
Now the query
output will be:
(#<TRIPLE !resource:Semantic_Web !rdfs:label #"Semantisches Web"@de #x1867D45E>
#<TRIPLE !resource:Semantic_Web !rdfs:label #"시맨틱 웹"@ko #x1867D526>
#<TRIPLE !resource:Semantic_Web !rdfs:label #"Sémantický web"@cs #x1867D5DE>
#<TRIPLE !resource:Semantic_Web !rdfs:label #"语义网"@zh #x1867D6A6>
....)
- List of Wilbur related projects
- de.setf.resource: a CLOS projection for RDF repositories
- Page Semantic Web on CLiki