package rdf

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

Install

Dune Dependency

Authors

Maintainers

Sources

ocaml-rdf-0.13.0.tar.gz
md5=98a004fb30bb175b9b50cbe99f48f15e
sha512=ffc1a0e67683773294d73d0dfa6aa32a046e5bcdc54c9879c16fd375a0d8269048a5600f91dd9af7af981214d1704fb86ce8713cfeba042d11ebae5457ed2ee5

doc/rdf/Rdf/Term/index.html

Module Rdf.TermSource

RDF terms.

Sourcetype literal = {
  1. lit_value : string;
  2. lit_language : string option;
  3. lit_type : Iri.t option;
}

Literal terms contain a value, an optional language and an optional data type IRI.

Sourcetype blank_id

Type for blank node ids.

Sourcetype term =
  1. | Iri of Iri.t
  2. | Literal of literal
  3. | Blank
  4. | Blank_ of blank_id

Various kinds of terms.

Sourceval compare : term -> term -> int
Sourcemodule Ordered_term : sig ... end
Sourcemodule TSet : Set.S with type elt = term
Sourcemodule TMap : Map.S with type key = term
Sourcetype triple = term * Iri.t * term

A RDF triple is triple (term, iri, term).

Sourcetype datetime = {
  1. stamp : Ptime.t;
  2. tz : Ptime.tz_offset_s option;
}
Sourceval string_of_datetime : datetime -> string

Return RFC 3339 representation of datetime.

Sourceval datetime_of_string : string -> datetime

Read datetime from RFC 3339 representation.

Sourceval string_of_blank_id : blank_id -> string

Get a string from a blank term id.

Sourceval blank_id_of_string : string -> blank_id

Make a blank term id from a string.

Sourceval blank : string -> term

Make a blank node with given string id.

Sourceval blank_ : blank_id -> term

Make a blank node with given id.

Sourceval term_of_iri_string : string -> term

Shortcut for Iri (Iri.of_string string).

Sourceval mk_literal : ?typ:Iri.t -> ?lang:string -> string -> literal

Creation of a literal.

Sourceval now : unit -> datetime
Sourceval mk_literal_datetime : ?d:datetime -> unit -> literal

Create a datetime literal with type iri from the given datetime d. If no date is given, now() is used.

Sourceval term_of_datetime : ?d:datetime -> unit -> term

Create a literal term from the given datetime. (see mk_literal_datetime).

Sourceval datetime_of_literal : literal -> datetime

Parse a literal to get a datetime.

Sourceval mk_literal_bool : bool -> literal

Create a boolean literal with type iri from the given boolean.

Sourceval mk_literal_int : ?typ:Iri.t -> int -> literal

Create an integer literal. Default typ is Rdf.xsd_integer.

Sourceval mk_literal_double : float -> literal

Create a double literal.

Sourceval bool_of_literal : literal -> bool

Parse a literal to get a boolean.

Sourceval term_of_literal_string : ?typ:Iri.t -> ?lang:string -> string -> term

Shortcut for Literal (mk_literal ?typ ?lang string)

Sourceval term_of_int : ?typ:Iri.t -> int -> term

Shortcut for Literal (mk_literal ?typ int).

Sourceval term_of_double : float -> term

Shortcut for Literal (mk_literal ~typ: Rdf.xsd_double float)

Sourceval term_of_bool : bool -> term

Create a literal term from the given boolean. (see mk_literal_bool).

Sourceval quote_str : string -> string

quote_str str returns the given string str between quotes, with correct literal string escapes.

Sourceval string_of_literal : literal -> string

Create a string from the given RDF literal, using turtle syntax.

Sourceval string_of_term : term -> string

Create a string for the given term, using RDF turtle syntax conventions.

Sourceval term_hash : term -> int64

term_hash term returns an int64 identifiying (hopefully unically)) a given term.

Sourceval lit_true : literal

Literal "true" with according type.

Sourceval lit_false : literal

Literal "false" with according type.

OCaml

Innovation. Community. Security.