| Did you know ... | Search Documentation: |
| Pack sindice -- prolog/sindice.pl |
This module provides the ability to formulate queries to the Sindice semantic web search engine, and to analyse the results obtained. It is based on an original module by Yves Raimond, but mostly rewritten by Samer Abdallah.
Sindice queries have serveral components:
Other parameters determine what and how much information is returned:
Results are retreived as a named RDF graph. To interpret this, it is necessary to understand the Sindice ontology. The results consist of a set of resources of the class sindice:Result. Each item has the following properties:
As well as information about each item, the results also contain data about the search itself, which is represented as a resource of class sindice:Query, and data about the returned page, represented as a resource of class sindice:Page. The sindice:Query has the following properties
literal(integer)literal(integer)The sindice:Page has the following properties:
The core predicate for running a Sindice query is si_with_graph/4, which formulates
a query from a term of type si_request and a list of options, and then
loads into the RDF store, temporarily, a named graph containing the results.
The last argument to si_with_graph/4 is a goal which is called with the results
graph in context. The graph is only available to this goal, and is unloaded after
si_with_graph/4 finished. You may use any RDF-related predicates to interrogate
the graph.
On top of this is built a high-abstraction: si_with_result/5, which hides the details of large, multi-page result sets and calls a supplied goal once (disjunctively) for each result, automatically issuing multiple Sindice requests to iterate through multiple pages. You may interrogate the properties of each result only within the supplied goal. For convenience, the si_facet/2 allows a number of properties to be extracted from the RDF graph with type conversions from RDF literals to Prolog values where appropriate.
The three main parts of a Sindice query are represented by a term of
type si_request, which has several forms. Currently, these
are
si_request ---> keyword(atom)
; keywords(list(atom))
; uri(resource).
A resource can be an atomic URI or a Prefix:Suffix term as understood by rdf_global_id/2. Eventually, Sindice's full query syntax, including ntriple queries and Boolean operators, will be implemented.
@seealso http://sindice.com/ http://sindice.com/developers/queryLanguage#QueryLanguage
Samer Abdallah, UCL, University of London; Yves Raimond, C4DM, Queen Mary, University of London
si_facet ---> link(url)
; cache(url)
; rank(nonneg)
; title(atom)
; class(resource)
; predicate(resource)
; formats(list(atom))
; explicit_content_size(nonneg)
; explicit_content_length(nonneg)
.