← All compilation units

Flyology_RDF.Quads

Description

Immutable graph names and RDF quads.

"="

function "=" (Left, Right : Graph_Name) return Boolean

Compare two graph names.

Parameters
Left

First graph name

Right

Second graph name

Return value

True when both name the same graph

"="

function "=" (Left, Right : Quad) return Boolean

Compare two quads componentwise.

Parameters
Left

First quad

Right

Second quad

Return value

True when the graph names and statements are equal

Blank_Node_Graph

function Blank_Node_Graph (Value : Terms.Term) return Graph_Name

Name a graph by blank node.

Parameters
Value

A blank node term

Return value

The corresponding graph name

Raised exceptions
Terms

.Invalid_Term Value is not a blank node

Create

function Create
  (Graph     : Graph_Name;
   Subject   : Terms.Term;
   Predicate : IRIs.IRI;
   Object    : Terms.Term) return Quad

Build a quad from a graph name and the three statement components.

Parameters
Graph

The graph the statement belongs to

Subject

Subject term

Predicate

Predicate IRI

Object

Object term

Return value

The corresponding quad

Create

function Create
  (Graph     : Graph_Name;
   Statement : Triples.Triple) return Quad

Build a quad from a graph name and an existing triple.

Parameters
Graph

The graph the statement belongs to

Statement

The triple

Return value

The corresponding quad

Default_Graph

function Default_Graph return Graph_Name

Return the name of the default graph.

Return value

The default graph name

Graph

function Graph (Value : Quad) return Graph_Name

Return a copy of the graph name.

Parameters
Value

Quad to inspect

Return value

The graph name

Graph_Name

type Graph_Name (<>) is private;

The name of a graph within a dataset.

Graph_Name_Kind

type Graph_Name_Kind is
  (Default_Graph_Kind, IRI_Graph_Kind, Blank_Node_Graph_Kind);

What names a graph.

Enumeration literals
Default_Graph_Kind

The unnamed default graph

IRI_Graph_Kind

A graph named by an IRI

Blank_Node_Graph_Kind

A graph named by a blank node

IRI_Graph

function IRI_Graph (Value : IRIs.IRI) return Graph_Name

Name a graph by IRI.

Parameters
Value

The graph IRI

Return value

The corresponding graph name

Kind

function Kind (Value : Graph_Name) return Graph_Name_Kind

Report which of the three kinds this graph name is.

Parameters
Value

Graph name to inspect

Return value

The graph name's kind

Name_Term

function Name_Term (Value : Graph_Name) return Terms.Term

Return a copy of the term naming this graph.

Parameters
Value

Graph name to inspect

Return value

The naming term

Raised exceptions
Terms

.Invalid_Term Value is the default graph, which has no naming term

Object

function Object (Value : Quad) return Terms.Term

Return a copy of the object.

Parameters
Value

Quad to inspect

Return value

The object term

Predicate

function Predicate (Value : Quad) return IRIs.IRI

Return a copy of the predicate.

Parameters
Value

Quad to inspect

Return value

The predicate IRI

Quad

type Quad (<>) is private;

An RDF quad: a triple together with the graph it belongs to.

Query_Components

procedure Query_Components
  (Value   : Quad;
   Process : not null access procedure
     (Graph     : Graph_Name;
      Subject   : Terms.Term;
      Predicate : IRIs.IRI;
      Object    : Terms.Term))

Borrow all four components for the duration of Process, without copying any of them. Prefer this on any path that runs once per statement.

Parameters
Value

Quad to borrow from

Process

Callback receiving the four components

Query_Name_Term

procedure Query_Name_Term
  (Value   : Graph_Name;
   Process : not null access procedure (Name : Terms.Term))

Borrow the naming term for the duration of Process, without copying.

Parameters
Value

Graph name to borrow from

Process

Callback receiving the naming term

Raised exceptions
Terms

.Invalid_Term Value is the default graph

Statement

function Statement (Value : Quad) return Triples.Triple

Return a copy of the statement.

Parameters
Value

Quad to inspect

Return value

The triple

Subject

function Subject (Value : Quad) return Terms.Term

Return a copy of the subject.

Parameters
Value

Quad to inspect

Return value

The subject term