rdf4h-1.3.0: A library for RDF processing in Haskell

Safe HaskellNone
LanguageHaskell98

Data.RDF.Query

Contents

Synopsis

Query functions

equalSubjects :: Triple -> Triple -> Bool Source

Determine whether two triples have equal subjects. Note that it doesn't perform namespace expansion!

equalPredicates :: Triple -> Triple -> Bool Source

Determine whether two triples have equal predicates. Note that it doesn't perform namespace expansion!

equalObjects :: Triple -> Triple -> Bool Source

Determine whether two triples have equal objects. Note that it doesn't perform namespace expansion!

subjectOf :: Triple -> Node Source

Answer the subject node of the triple.

predicateOf :: Triple -> Node Source

Answer the predicate node of the triple.

objectOf :: Triple -> Node Source

Answer the object node of the triple.

isEmpty :: RDF rdf => rdf -> Bool Source

Determines whether the RDF contains zero triples.

rdfContainsNode :: forall rdf. RDF rdf => rdf -> Node -> Bool Source

Answer if rdf contains node.

tripleContainsNode :: Node -> Triple -> Bool Source

Answer if triple contains node. Note that it doesn't perform namespace expansion!

listSubjectsWithPredicate :: RDF rdf => rdf -> Predicate -> [Subject] Source

Lists of all subjects of triples with the given predicate.

listObjectsOfPredicate :: RDF rdf => rdf -> Predicate -> [Object] Source

Lists of all objects of triples with the given predicate.

RDF graph functions

isIsomorphic :: forall rdf1 rdf2. (RDF rdf1, RDF rdf2) => rdf1 -> rdf2 -> Bool Source

This determines if two RDF representations are equal regardless of blank node names, triple order and prefixes. In math terms, this is the simeq latex operator, or ~=

expandTriples :: RDF rdf => rdf -> Triples Source

Expand the triples in a graph with the prefix map and base URL for that graph.

fromEither :: RDF rdf => Either ParseFailure rdf -> rdf Source

Convert a parse result into an RDF if it was successful and error and terminate if not.

Miscellaneous functions

expandTriple :: PrefixMappings -> Triple -> Triple Source

Expand the triple with the prefix map.

expandNode :: PrefixMappings -> Node -> Node Source

Expand the node with the prefix map. Only UNodes are expanded, other kinds of nodes are returned as-is.

expandURI :: PrefixMappings -> Text -> Text Source

Expand the URI with the prefix map. Also expands "a" to "http://www.w3.org/1999/02/22-rdf-syntax-ns#type".