The cl-sparql Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The cl-sparql Reference Manual

This is the cl-sparql Reference Manual, version 0.0.1, generated automatically by Declt version 3.0 "Montgomery Scott" on Fri Jun 26 10:35:55 2020 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

CL-SPARQL

SPARQL query builder for Common Lisp.

Syntax

(sparql (:select * :where (?x ?y ?z)))
 (sparql 
    (:select *
        :where (?x ?y ?z)
        :limit 20
        :offset 10))

Subqueries

(sparql 
    (:select *
        :where (?x ?y ?z)
            (:select *
                :where (?x ?y ?z)
                :limit 20
                :offset 10)
        :limit 20
        :offset 10))

URI syntax

Enable special URI syntax with (sparql:enable-uri-syntax).

After that, you can write uris like:

#u<rdf:type>

and you get the expanded uri:

#<PURI:URI http://www.w3.org/1999/02/22-rdf-syntax-ns#type>.

Use define-uri-prefix to define new uri prefixes expansions, like:

(define-uri-prefix rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#")
(define-uri-prefix xsd "http://www.w3.org/2001/XMLSchema#")
(define-uri-prefix ex "http://www.franz.com/things#")  
(define-uri-prefix rdfs "http://www.w3.org/2000/01/rdf-schema#")  
(define-uri-prefix fn "http://www.w3.org/2005/xpath-functions#") 
(define-uri-prefix err "http://www.w3.org/2005/xqt-errors#")  
(define-uri-prefix owl "http://www.w3.org/2002/07/owl#")  
(define-uri-prefix xs "http://www.w3.org/2001/XMLSchema#")

Those are already defined.

Implementation technique

I think the embedded domain specific language technique used is interesting. parser-combinators library is used, but, instead of using for parsing strings, it is used for parsing already read Lisp lists.

License

MIT


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 cl-sparql

Author

Mariano Montone <marianomontone@gmail.com>

License

MIT

Description

SPARQL query builder for Common Lisp

Version

0.0.1

Dependencies
Source

cl-sparql.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 cl-sparql.asd

Location

cl-sparql.asd

Systems

cl-sparql (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.2 cl-sparql/package.lisp

Parent

cl-sparql (system)

Location

package.lisp

Packages

sparql


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.3 cl-sparql/sparql.lisp

Dependency

package.lisp (file)

Parent

cl-sparql (system)

Location

sparql.lisp

Exported Definitions
Internal Definitions

Previous: , Up: Lisp files   [Contents][Index]

3.1.4 cl-sparql/uri.lisp

Dependency

sparql.lisp (file)

Parent

cl-sparql (system)

Location

uri.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 sparql

Source

package.lisp (file)

Use List
Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Macros

Macro: define-uri-prefix URI-PREFIX VALUE &optional DOCUMENTATION
Package

sparql

Source

uri.lisp (file)

Macro: sparql SPARQL
Package

sparql

Source

sparql.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.2 Functions

Function: enable-uri-syntax ()
Package

sparql

Source

uri.lisp (file)

Function: get-uri-prefix URI-PREFIX
Package

sparql

Source

uri.lisp (file)

Function: make-uri PREFIX URI &rest ARGS
Package

sparql

Source

uri.lisp (file)

Function: parse-literal LITERAL
Package

sparql

Source

uri.lisp (file)

Function: sparql-compile SPARQL
Package

sparql

Source

sparql.lisp (file)

Function: sparql-eval SPARQL
Package

sparql

Source

sparql.lisp (file)


Previous: , Up: Exported definitions   [Contents][Index]

5.1.3 Generic functions

Generic Function: render-literal VALUE
Package

sparql

Methods
Method: render-literal (X symbol)
Source

uri.lisp (file)

Method: render-literal (X (eql nil))
Source

uri.lisp (file)

Method: render-literal (X (eql t))
Source

uri.lisp (file)

Method: render-literal (URI uri)
Source

uri.lisp (file)

Method: render-literal (VALUE string)
Source

uri.lisp (file)

Method: render-literal (VALUE integer)
Source

uri.lisp (file)

Method: render-literal VALUE
Source

uri.lisp (file)


Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Special variables

Special Variable: *eval*
Package

sparql

Source

sparql.lisp (file)

Special Variable: *uri-prefixes*
Package

sparql

Source

uri.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.2 Functions

Function: clean-literal LITERAL
Package

sparql

Source

uri.lisp (file)

Function: display-uri-prefixes ()
Package

sparql

Source

uri.lisp (file)

Function: expand TERM
Package

sparql

Source

sparql.lisp (file)

Function: in-list PARSER
Package

sparql

Source

sparql.lisp (file)

Function: parse-boolean-literal LITERAL
Package

sparql

Source

uri.lisp (file)

Function: parse-typed-literal LITERAL
Package

sparql

Source

uri.lisp (file)

Function: parse-uri URI
Package

sparql

Source

uri.lisp (file)

Function: reduce-strings LIST

Join adjacent strings in a list, leave other values intact.

Package

sparql

Source

sparql.lisp (file)

Function: render-sparql SPARQL
Package

sparql

Source

sparql.lisp (file)

Function: sparql-delete-data ()
Package

sparql

Source

sparql.lisp (file)

Function: sparql-filter-exists ()
Package

sparql

Source

sparql.lisp (file)

Function: sparql-filter-not-exists ()
Package

sparql

Source

sparql.lisp (file)

Function: sparql-insert-data ()
Package

sparql

Source

sparql.lisp (file)

Function: sparql-limit ()
Package

sparql

Source

sparql.lisp (file)

Function: sparql-minus ()
Package

sparql

Source

sparql.lisp (file)

Function: sparql-offset ()
Package

sparql

Source

sparql.lisp (file)

Function: sparql-optional ()
Package

sparql

Source

sparql.lisp (file)

Function: sparql-order-arg ()
Package

sparql

Source

sparql.lisp (file)

Function: sparql-order-by ()
Package

sparql

Source

sparql.lisp (file)

Function: sparql-order-term ()
Package

sparql

Source

sparql.lisp (file)

Function: sparql-parser ()
Package

sparql

Source

sparql.lisp (file)

Function: sparql-select ()
Package

sparql

Source

sparql.lisp (file)

Function: sparql-subselect ()
Package

sparql

Source

sparql.lisp (file)

Function: sparql-triple ()
Package

sparql

Source

sparql.lisp (file)

Function: sparql-union ()
Package

sparql

Source

sparql.lisp (file)

Function: sparql-var ()

Parser: parse a SPARQL variable.

Package

sparql

Source

sparql.lisp (file)

Function: sparql-where ()
Package

sparql

Source

sparql.lisp (file)

Function: sparql-where-graph ()
Package

sparql

Source

sparql.lisp (file)

Function: strcat ARGS

Concatenate a list of strings into a single one.

Package

sparql

Source

sparql.lisp (file)

Function: transform TRANSFORM

Parser: transform and return the result, when the transformation applies (not null)

Package

sparql

Source

sparql.lisp (file)

Function: triple-object ()
Package

sparql

Source

sparql.lisp (file)

Function: triple-predicate ()
Package

sparql

Source

sparql.lisp (file)

Function: triple-subject ()
Package

sparql

Source

sparql.lisp (file)

Function: triples-block ()
Package

sparql

Source

sparql.lisp (file)

Function: uri-reader STREAM SUB-CHAR NUMARG
Package

sparql

Source

uri.lisp (file)

Function: where-body ()
Package

sparql

Source

sparql.lisp (file)

Function: where-triple ()
Package

sparql

Source

sparql.lisp (file)


Previous: , Up: Internal definitions   [Contents][Index]

5.2.3 Generic functions

Generic Function: expand-term TYPE TERM
Package

sparql

Methods
Method: expand-term (TYPE (eql offset)) OFFSET
Source

sparql.lisp (file)

Method: expand-term (TYPE (eql limit)) LIMIT
Source

sparql.lisp (file)

Method: expand-term (TYPE (eql desc)) ASC
Source

sparql.lisp (file)

Method: expand-term (TYPE (eql asc)) ASC
Source

sparql.lisp (file)

Method: expand-term (TYPE (eql order-by)) ORDER-BY
Source

sparql.lisp (file)

Method: expand-term (TYPE (eql options)) OPTIONS
Source

sparql.lisp (file)

Method: expand-term (TYPE (eql minus)) MINUS
Source

sparql.lisp (file)

Method: expand-term (TYPE (eql filter-not-exists)) FILTER-NOT-EXISTS
Source

sparql.lisp (file)

Method: expand-term (TYPE (eql filter-exists)) FILTER-EXISTS
Source

sparql.lisp (file)

Method: expand-term (TYPE (eql optional)) OPTIONAL
Source

sparql.lisp (file)

Method: expand-term (TYPE (eql union)) UNION
Source

sparql.lisp (file)

Method: expand-term (TYPE (eql triple)) TRIPLE
Source

sparql.lisp (file)

Method: expand-term (TYPE (eql graph)) GRAPH
Source

sparql.lisp (file)

Method: expand-term (TYPE (eql where)) WHERE
Source

sparql.lisp (file)

Method: expand-term (TYPE (eql eval)) FORM
Source

sparql.lisp (file)

Method: expand-term (TYPE (eql var)) VAR
Source

sparql.lisp (file)

Method: expand-term (TYPE (eql vars)) VARS
Source

sparql.lisp (file)

Method: expand-term (TYPE (eql subselect)) TERM
Source

sparql.lisp (file)

Method: expand-term (TYPE (eql delete-data)) TERM
Source

sparql.lisp (file)

Method: expand-term (TYPE (eql insert-data)) TERM
Source

sparql.lisp (file)

Method: expand-term (TYPE (eql select)) TERM
Source

sparql.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   C   F   L  
Index Entry  Section

C
cl-sparql.asd: The cl-sparql․asd file
cl-sparql/package.lisp: The cl-sparql/package․lisp file
cl-sparql/sparql.lisp: The cl-sparql/sparql․lisp file
cl-sparql/uri.lisp: The cl-sparql/uri․lisp file

F
File, Lisp, cl-sparql.asd: The cl-sparql․asd file
File, Lisp, cl-sparql/package.lisp: The cl-sparql/package․lisp file
File, Lisp, cl-sparql/sparql.lisp: The cl-sparql/sparql․lisp file
File, Lisp, cl-sparql/uri.lisp: The cl-sparql/uri․lisp file

L
Lisp File, cl-sparql.asd: The cl-sparql․asd file
Lisp File, cl-sparql/package.lisp: The cl-sparql/package․lisp file
Lisp File, cl-sparql/sparql.lisp: The cl-sparql/sparql․lisp file
Lisp File, cl-sparql/uri.lisp: The cl-sparql/uri․lisp file

Jump to:   C   F   L  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   C   D   E   F   G   I   M   P   R   S   T   U   W  
Index Entry  Section

C
clean-literal: Internal functions

D
define-uri-prefix: Exported macros
display-uri-prefixes: Internal functions

E
enable-uri-syntax: Exported functions
expand: Internal functions
expand-term: Internal generic functions
expand-term: Internal generic functions
expand-term: Internal generic functions
expand-term: Internal generic functions
expand-term: Internal generic functions
expand-term: Internal generic functions
expand-term: Internal generic functions
expand-term: Internal generic functions
expand-term: Internal generic functions
expand-term: Internal generic functions
expand-term: Internal generic functions
expand-term: Internal generic functions
expand-term: Internal generic functions
expand-term: Internal generic functions
expand-term: Internal generic functions
expand-term: Internal generic functions
expand-term: Internal generic functions
expand-term: Internal generic functions
expand-term: Internal generic functions
expand-term: Internal generic functions
expand-term: Internal generic functions
expand-term: Internal generic functions

F
Function, clean-literal: Internal functions
Function, display-uri-prefixes: Internal functions
Function, enable-uri-syntax: Exported functions
Function, expand: Internal functions
Function, get-uri-prefix: Exported functions
Function, in-list: Internal functions
Function, make-uri: Exported functions
Function, parse-boolean-literal: Internal functions
Function, parse-literal: Exported functions
Function, parse-typed-literal: Internal functions
Function, parse-uri: Internal functions
Function, reduce-strings: Internal functions
Function, render-sparql: Internal functions
Function, sparql-compile: Exported functions
Function, sparql-delete-data: Internal functions
Function, sparql-eval: Exported functions
Function, sparql-filter-exists: Internal functions
Function, sparql-filter-not-exists: Internal functions
Function, sparql-insert-data: Internal functions
Function, sparql-limit: Internal functions
Function, sparql-minus: Internal functions
Function, sparql-offset: Internal functions
Function, sparql-optional: Internal functions
Function, sparql-order-arg: Internal functions
Function, sparql-order-by: Internal functions
Function, sparql-order-term: Internal functions
Function, sparql-parser: Internal functions
Function, sparql-select: Internal functions
Function, sparql-subselect: Internal functions
Function, sparql-triple: Internal functions
Function, sparql-union: Internal functions
Function, sparql-var: Internal functions
Function, sparql-where: Internal functions
Function, sparql-where-graph: Internal functions
Function, strcat: Internal functions
Function, transform: Internal functions
Function, triple-object: Internal functions
Function, triple-predicate: Internal functions
Function, triple-subject: Internal functions
Function, triples-block: Internal functions
Function, uri-reader: Internal functions
Function, where-body: Internal functions
Function, where-triple: Internal functions

G
Generic Function, expand-term: Internal generic functions
Generic Function, render-literal: Exported generic functions
get-uri-prefix: Exported functions

I
in-list: Internal functions

M
Macro, define-uri-prefix: Exported macros
Macro, sparql: Exported macros
make-uri: Exported functions
Method, expand-term: Internal generic functions
Method, expand-term: Internal generic functions
Method, expand-term: Internal generic functions
Method, expand-term: Internal generic functions
Method, expand-term: Internal generic functions
Method, expand-term: Internal generic functions
Method, expand-term: Internal generic functions
Method, expand-term: Internal generic functions
Method, expand-term: Internal generic functions
Method, expand-term: Internal generic functions
Method, expand-term: Internal generic functions
Method, expand-term: Internal generic functions
Method, expand-term: Internal generic functions
Method, expand-term: Internal generic functions
Method, expand-term: Internal generic functions
Method, expand-term: Internal generic functions
Method, expand-term: Internal generic functions
Method, expand-term: Internal generic functions
Method, expand-term: Internal generic functions
Method, expand-term: Internal generic functions
Method, expand-term: Internal generic functions
Method, render-literal: Exported generic functions
Method, render-literal: Exported generic functions
Method, render-literal: Exported generic functions
Method, render-literal: Exported generic functions
Method, render-literal: Exported generic functions
Method, render-literal: Exported generic functions
Method, render-literal: Exported generic functions

P
parse-boolean-literal: Internal functions
parse-literal: Exported functions
parse-typed-literal: Internal functions
parse-uri: Internal functions

R
reduce-strings: Internal functions
render-literal: Exported generic functions
render-literal: Exported generic functions
render-literal: Exported generic functions
render-literal: Exported generic functions
render-literal: Exported generic functions
render-literal: Exported generic functions
render-literal: Exported generic functions
render-literal: Exported generic functions
render-sparql: Internal functions

S
sparql: Exported macros
sparql-compile: Exported functions
sparql-delete-data: Internal functions
sparql-eval: Exported functions
sparql-filter-exists: Internal functions
sparql-filter-not-exists: Internal functions
sparql-insert-data: Internal functions
sparql-limit: Internal functions
sparql-minus: Internal functions
sparql-offset: Internal functions
sparql-optional: Internal functions
sparql-order-arg: Internal functions
sparql-order-by: Internal functions
sparql-order-term: Internal functions
sparql-parser: Internal functions
sparql-select: Internal functions
sparql-subselect: Internal functions
sparql-triple: Internal functions
sparql-union: Internal functions
sparql-var: Internal functions
sparql-where: Internal functions
sparql-where-graph: Internal functions
strcat: Internal functions

T
transform: Internal functions
triple-object: Internal functions
triple-predicate: Internal functions
triple-subject: Internal functions
triples-block: Internal functions

U
uri-reader: Internal functions

W
where-body: Internal functions
where-triple: Internal functions

Jump to:   C   D   E   F   G   I   M   P   R   S   T   U   W  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   *  
S  
Index Entry  Section

*
*eval*: Internal special variables
*uri-prefixes*: Internal special variables

S
Special Variable, *eval*: Internal special variables
Special Variable, *uri-prefixes*: Internal special variables

Jump to:   *  
S  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   C   P   S  
Index Entry  Section

C
cl-sparql: The cl-sparql system

P
Package, sparql: The sparql package

S
sparql: The sparql package
System, cl-sparql: The cl-sparql system

Jump to:   C   P   S