rdf-0.1.0.4: Representation and Incremental Processing of RDF Data

CopyrightTravis Whitaker 2016
LicenseMIT
Maintainerpi.boy.travis@gmail.com
StabilityProvisional
PortabilityPortable
Safe HaskellSafe
LanguageHaskell2010

Data.RDF.Graph

Contents

Description

This module provides conversion between RDF triples and fgl graphs. Naturally these functions will force the entire graph into memory.

Synopsis

Documentation

data GNode Source #

An RDF Subject or Object as a Graph node. This common representation is necessary because the Object of one Triple might be the Subject of another.

Instances
Eq GNode Source # 
Instance details

Defined in Data.RDF.Graph

Methods

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

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

Ord GNode Source # 
Instance details

Defined in Data.RDF.Graph

Methods

compare :: GNode -> GNode -> Ordering #

(<) :: GNode -> GNode -> Bool #

(<=) :: GNode -> GNode -> Bool #

(>) :: GNode -> GNode -> Bool #

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

max :: GNode -> GNode -> GNode #

min :: GNode -> GNode -> GNode #

Read GNode Source # 
Instance details

Defined in Data.RDF.Graph

Show GNode Source # 
Instance details

Defined in Data.RDF.Graph

Methods

showsPrec :: Int -> GNode -> ShowS #

show :: GNode -> String #

showList :: [GNode] -> ShowS #

Generic GNode Source # 
Instance details

Defined in Data.RDF.Graph

Associated Types

type Rep GNode :: Type -> Type #

Methods

from :: GNode -> Rep GNode x #

to :: Rep GNode x -> GNode #

NFData GNode Source # 
Instance details

Defined in Data.RDF.Graph

Methods

rnf :: GNode -> () #

type Rep GNode Source # 
Instance details

Defined in Data.RDF.Graph

type GEdge = Predicate Source #

A Graph edge is an RDF Predicate.

Conversion to FGL Graphs

rdfGraph :: DynGraph g => RDFGraph -> (g GNode GEdge, NodeMap GNode) Source #

Convert an RDFGraph into a DynGraph and NodeMap. The graphLabel is discarded.

triplesGraph :: DynGraph g => [Triple] -> (g GNode GEdge, NodeMap GNode) Source #

Convert a list of Triples into a DynGraph and a NodeMap.

Conversion from FGL Graphs

graphRDF :: Graph g => Maybe IRI -> g GNode GEdge -> Either String RDFGraph Source #

Convert a Graph into an RDFGraph. This will fail if the graph contains any LiteralGNodes with an outward degree greater than zero, since such a graph is illegal in RDF.

graphTriples :: Graph g => g GNode GEdge -> Either String [Triple] Source #

Convert a Graph into a list of Triples. This will fail if the graph contains any LiteralGNodes with an outward degree greater than zero, since such a graph is illegal in RDF.