rdf-0.1.0.1: 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.

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.