hsparql alternatives and similar packages
Based on the "Database" category.
Alternatively, view hsparql alternatives based on common mentions on social networks and blogs.
-
erd
Translates a plain text description of a relational database schema to a graphical entity-relationship diagram. -
persistent-redis
Persistence interface for Haskell allowing multiple storage methods. -
acid-state
Add ACID guarantees to any serializable Haskell data structure -
postgresql-simple
Mid-level client library for accessing PostgreSQL from Haskell -
HDBC-session
This repository includes a joined query generator based on typefull relational algebra, and mapping tools between SQL values list and Haskell record type. -
esqueleto
Bare bones, type-safe EDSL for SQL queries on persistent backends. -
groundhog
This library maps datatypes to a relational model, in a way similar to what ORM libraries do in OOP. See the tutorial https://www.schoolofhaskell.com/user/lykahb/groundhog for introduction -
hw-kafka-client
Kafka client for Haskell, including auto-rebalancing consumers -
mysql-simple
A mid-level client library for the MySQL database, intended to be fast and easy to use. -
postgresql-simple-migration
PostgreSQL Schema Migrations for Haskell -
vcache
large, persistent, memcached values and structure sharing for Haskell -
direct-sqlite
Low-level binding to SQLite3. Includes UTF8 and BLOB support. -
vcache-trie
large, persistent, memcached values and structure sharing for Haskell -
dbmigrations
A library for the creation, management, and installation of schema updates for relational databases. -
postgresql-tx
[Moved to: https://github.com/Simspace/postgresql-tx] -
postgresql-typed
Haskell PostgreSQL library with compile-time type inference -
postgresql-orm
An Haskell ORM (Object Relational Mapping) and migrations DSL for PostgreSQL. -
ampersand
Build database applications faster than anyone else, and keep your data pollution free as a bonus. -
persistent-database-url
Parse DATABASE_URL into configuration types for Persistent
Clean code begins in your IDE with SonarLint
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of hsparql or a related project?
Popular Comparisons
README
Introduction
hsparql
includes a DSL to easily create queries, as well as methods to
submit those queries to a SPARQL server, returning the results as
simple Haskell data structures.
Select Queries
Take the following SPARQL query:
PREFIX dbpedia: <http://dbpedia.org/resource/>
PREFIX dbprop: <http://dbpedia.org/property/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?name ?page
WHERE {
?x dbprop:genre dbpedia:Web_browser
?x foaf:name ?name
?x foaf:page ?page
}
Can be generated using the following Haskell code:
simpleSelect :: Query SelectQuery
simpleSelect = do
resource <- prefix "dbpedia" (iriRef "http://dbpedia.org/resource/")
dbpprop <- prefix "dbprop" (iriRef "http://dbpedia.org/property/")
foaf <- prefix "foaf" (iriRef "http://xmlns.com/foaf/0.1/")
x <- var
name <- var
page <- var
triple_ x (dbpprop .:. "genre") (resource .:. "Web_browser")
triple_ x (foaf .:. "name") name
triple_ x (foaf .:. "page") page
selectVars [name, page]
Construct Queries
Take the following SPARQL query:
PREFIX dbpedia: <http://dbpedia.org/resource/>
PREFIX dbprop: <http://dbpedia.org/property/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX example: <http://www.example.com/>
CONSTRUCT {
?x example:hasName ?name
}
WHERE {
?x dbprop:genre dbpedia:Web_browser
?x foaf:name ?name
?x foaf:page ?page
}
Can be generated using the following Haskell code:
simpleConstruct :: Query ConstructQuery
simpleConstruct = do
resource <- prefix "dbpedia" (iriRef "http://dbpedia.org/resource/")
dbpprop <- prefix "dbprop" (iriRef "http://dbpedia.org/property/")
foaf <- prefix "foaf" (iriRef "http://xmlns.com/foaf/0.1/")
example <- prefix "example" (iriRef "http://www.example.com/")
x <- var
name <- var
page <- var
construct <- constructTriple x (example .:. "hasName") name
triple_ x (dbpprop .:. "genre") (resource .:. "Web_browser")
triple_ x (foaf .:. "name") name
triple_ x (foaf .:. "page") page
return ConstructQuery { queryConstructs = [construct] }
Describe Queries
Take the following SPARQL query:
DESCRIBE <http://dbpedia.org/resource/Edinburgh>
Can be generated using the following Haskell code:
simpleDescribe :: Query DescribeQuery
simpleDescribe = do
resource <- prefix "dbpedia" (iriRef "http://dbpedia.org/resource/")
uri <- describeIRI (resource .:. "Edinburgh")
return DescribeQuery { queryDescribe = uri }
Ask Queries
Take the following SPARQL query:
PREFIX dbprop: <http://dbpedia.org/property/>
ASK { ?x dbprop:genre <http://dbpedia.org/resource/Web_browser> }
Can be generated using the following Haskell code:
simpleAsk :: Query AskQuery
simpleAsk = do
resource <- prefix "dbpedia" (iriRef "http://dbpedia.org/resource/")
dbprop <- prefix "dbprop" (iriRef "http://dbpedia.org/property/")
x <- var
ask <- askTriple x (dbprop .:. "genre") (resource .:. "Web_browser")
return AskQuery { queryAsk = [ask] }
Output Types
Select Queries
SELECT
queries generate a set of sparql query solutions. See:
http://www.w3.org/TR/rdf-sparql-XMLres/
selectExample :: IO ()
selectExample = do
(Just s) <- selectQuery "http://dbpedia.org/sparql" simpleSelect
putStrLn . take 500 . show $ s
Here's the respective type:
selectQuery :: EndPoint -> Query SelectQuery -> IO (Maybe [[BindingValue]])
Construct Queries
CONSTRUCT
queries generate RDF, which is serialized in N3 in this
package. See: http://www.w3.org/TR/rdf-primer/#rdfxml
constructExample :: IO ()
constructExample = do
rdfGraph <- constructQuery "http://dbpedia.org/sparql" simpleConstruct
mapM_ print (triplesOf rdfGraph)
Here's the respective type:
constructQuery :: EndPoint -> Query ConstructQuery -> IO MGraph
Describe Queries
DESCRIBE
queries generate RDF, which is serialized in N3 in this
package. See: http://www.w3.org/TR/rdf-sparql-query/#describe
describeExample :: IO ()
describeExample = do
rdfGraph <- describeQuery "http://dbpedia.org/sparql" simpleDescribe
mapM_ print (triplesOf rdfGraph
Here's the respective type:
describeQuery :: EndPoint -> Query DescribeQuery -> IO MGraph
Ask Queries
ASK
queries inspects whether or not a triple exists. RDF is an
open-world assumption. See: http://www.w3.org/TR/rdf-sparql-query/#ask
askExample :: IO ()
askExample = do
res <- askQuery "http://dbpedia.org/sparql" simpleAsk
putStrLn $ "result: " ++ (show (res::Bool))
Here's the respective type:
askQuery :: EndPoint -> Query AskQuery -> IO Bool
More examples
Some extra examples can be found in [tests](tests/Database/HSparql/QueryGeneratorTest.hs).
TODOs
Opt for a unified Type representation This hsparql package and the RDF4H package use similar, but not identical, types for triples, namespaces, prefixes and so on. Ideally, one type representation for such concepts should be adopted for both packages.
Develop a unified semantic web toolkit for Haskell Combining the RDF4H and hsparql packages seems like a sensible goal to achieve, to provide a semantic web toolkit similar to Jena for Java.
*Note that all licence references and agreements mentioned in the hsparql README section above
are relevant to that project's source code only.