sparql-protocol-1.1.0.0: An SPARQL 1.1 Protocol client library.

Safe HaskellNone
LanguageHaskell2010

Database.SPARQL.Protocol.Client

Description

SPARQL 1.1 Protocol client.

All queries are sent using direct POSTs as described in sections 2.1.3 and 2.2.2 of the specification. The results are retrieved in JSON format, as described in the SPARQL 1.1 Query Results JSON Format.

Known limitations and caveats:

  • default-graph-uri and named-graph-uri parameters are not supported.
  • Queries are not validated for correctness.

Synopsis

Documentation

select Source #

Arguments

:: String

The URL of the server to run the query against.

-> ByteString

An SPARQL SELECT query. It's sent as-is to the server.

-> IO (Response SelectResult)

The result of the query.

Runs an SPARQL SELECT query.

ask Source #

Arguments

:: String

The URL of the server to run the query against.

-> ByteString

An SPARQL ASK query. It's sent as-is to the server.

-> IO (Response AskResult)

The result of the query.

Runs an SPARQL ASK query.

construct Source #

Arguments

:: String

The URL of the server to run the query against.

-> ByteString

An SPARQL CONSTRUCT query. It's sent as-is to the server.

-> IO (Response RDFGraph)

The result of the query.

Runs an SPARQL CONSTRUCT query.

describe Source #

Arguments

:: String

The URL of the server to run the query against.

-> ByteString

The URI of the resource to describe.

-> IO (Response RDFGraph)

The result of the query.

Runs an SPARQL DESCRIBE query.

update Source #

Arguments

:: String

The URL of the server to run the query against.

-> ByteString

An SPARQL update query. It's sent as-is to the server.

-> IO (Response ())

The result of the query.

Runs an SPARQL update (INSERT/DELETE) query.

data RDFTerm Source #

Structure of an RDF term, according to section 3.2.2 of the SPARQL 1.1 Query Results JSON Format specification.

Constructors

IRI Text

A resource identifier.

Literal Text

A string literal without language or type.

LiteralLang Text Text

A string literal with an associated language.

LiteralType Text Text

A literal with an associated RDF-compatible type URI.

Blank Text

A blank node.

Instances

Eq RDFTerm Source # 

Methods

(==) :: RDFTerm -> RDFTerm -> Bool #

(/=) :: RDFTerm -> RDFTerm -> Bool #

Show RDFTerm Source # 
FromJSON RDFTerm Source #

Implements the SPARQL 1.1 Query Results JSON Format specification. Literals with associated language may be of type xml:lang or just lang.

newtype AskResult Source #

The boolean result of an ASK query.

Constructors

AskResult Bool