package rdf

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

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.