package rdf

  1. Overview
  2. Docs
OCaml library to manipulate RDF graphs; implements SPARQL

Install

Dune Dependency

Authors

Maintainers

Sources

ocaml-rdf-1.0.0.tar.gz
md5=43ce517489f775e6b65fcdef5e713e74
sha512=6130e46d186ca4abf0c44a35ab040f696f8b4d10fd16db9212e8280500f8263626f0ab8d53479b926924b41e45ae4793251727de725c03c409052a96ad2d40bd

doc/rdf/Rdf/Dot/index.html

Module Rdf.DotSource

Dump in graphviz format.

Sourceval apply_namespaces : (string * string) list -> string -> string * string

apply_namespaces ns iri return a pair (prefix, suffix) representing the given iri and using one of the namespaces ns, of the form (prefix, iri). If a namespace (pref, iri) exists such that iri is a prefix of iri2, then apply_namespaces ns iri2 = (prefix, rel), with rel being the suffix of iri2 relative to iri.

Sourceval build_namespaces : ?namespaces:(Iri.t * string) list -> Graph.graph -> (string * string) list

build_namespaces graph returns the list namespaces of the graph, as a list of pairs (prefix, iri) usable by apply_namespaces.

  • parameter namespaces

    is used to specify additional namespaces.

Sourceval dot_of_graph : ?namespaces:(Iri.t * string) list -> ?href:(Term.term -> string option) -> Graph.graph -> string

dot_of_graph graph returns the Graphviz code to represent the given graph.

  • parameter namespaces

    is used so specified namespaces in the form (iri, name); in this case, the abbreviated form ns:suffix is used in labels of IRI nodes, when possible. The namespaces of the graph are also used anyway.

  • parameter href

    can specify a function to call on each node, which can return an url (as a string), to add a href attribute to the node in the graphviz code. This is useful to provide clickable nodes in SVG output, for example.

Sourceval dot_of_iri : ?namespaces:(Iri.t * string) list -> ?href:(Term.term -> string option) -> Graph.graph -> Iri.t -> string

Same as dot_of_graph but return code to represent only the triples having the given IRI as subject or object.

OCaml

Innovation. Community. Security.