package rdf

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

Install

Dune Dependency

Authors

Maintainers

Sources

ocaml-rdf-1.1.0.tar.bz2
md5=fdca8ab06da34d9d76fe273f654ec6a1
sha512=fff3ad6cb5978e43ac3c509cc25a01d16be6e21b04df607e0595ec0e7226ba7b6e4e2ec86bbeae4aa3d6a181fa399c7c00a4b1c788ddc98486f5c8badf8867f7

doc/rdf/Rdf/Xml/index.html

Module Rdf.XmlSource

Reading and writing RDF/XML.

Sourceexception Invalid_rdf of string
Sourcemodule SMap : Map.S with type key = string
Sourcetype tree =
  1. | E of Xmlm.tag * tree list
  2. | D of string

The type of XML tree walked through to fill the graph.

Sourceval xml_of_string : string -> tree
  • raises Failure

    in case of invalid XML.

Sourceval get_first_child : tree -> (string * string) -> tree option

get_first tree tag returns the first child with tag s of the given xml tree or None if the given node has no such child.

Sourcetype state = {
  1. subject : Term.term option;
  2. predicate : Iri.t option;
  3. xml_base : Iri.t;
  4. xml_lang : string option;
  5. datatype : Iri.t option;
  6. namespaces : string Iri.Map.t;
}

Type of current state when walking through the xml tree.

Sourcetype global_state = {
  1. blanks : Term.blank_id SMap.t;
  2. gnamespaces : string Iri.Map.t;
}

Global state of the analysis.

Sourceval input_prop : Graph.graph -> state -> (global_state * int) -> tree -> global_state * int

Fill a graph from a current state, a pair (global state, li counter), and a property node.

Sourceval from_string : Graph.graph -> ?base:Iri.t -> string -> unit

Input graph from string. Default base is the graph name.

Sourceval from_file : Graph.graph -> ?base:Iri.t -> string -> unit

Same as from_string but read from the given file.

Sourceval from_input : Graph.graph -> ?base:Iri.t -> Xmlm.input -> unit

Same as from_string but read from the given Xmlm.input handle.

Sourceval from_xml : Graph.graph -> ?base:Iri.t -> tree -> unit

Same as from_string but read from the given Xml tree.

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

Return a RDF/XML representation of the graph in a string.

  • parameter compact

    Default is true. If true and if the graph storage allows it, the returned XML is more compact, with only one node for each subject appearing in the graph triples.

Sourceval to_file : ?compact:bool -> ?namespaces:(Iri.t * string) list -> Graph.graph -> string -> unit

Same as to_string but writes to the given file.

OCaml

Innovation. Community. Security.