← All compilation units

Flyology_N3.Writers

Description

Notation3 serialization.

To_N3

function To_N3
  (Value : Model.Term;
   Style : Verb_Style := Shorthand_Verbs) return String

Serialize a formula as an N3 document.

The outermost formula is written as a document -- its statements at the top level, without enclosing braces -- because that is what parsing a document produces.

Parameters
Value

Formula to serialize

Style

Whether to use the shorthand verbs

Return value

The N3 text

Raised exceptions
Model

.Invalid_Term Value is not a formula

Verb_Style

type Verb_Style is (Shorthand_Verbs, Explicit_Verbs);

Whether to write the shorthand forms of the well-known predicates.

N3 writes rdf:type as "a", log:implies as "=>", and owl:sameAs as "=". The shorthands are what the language is for; the long forms exist here because a round-trip test that reads its own shorthand proves less than one that reads both.

Enumeration literals
Shorthand_Verbs

Write a, => and =

Explicit_Verbs

Write every predicate as an IRI

Write_Term

function Write_Term
  (Value : Model.Term;
   Style : Verb_Style := Shorthand_Verbs) return String

Serialize a single term, as it would appear inside a statement.

Parameters
Value

Term to serialize

Style

Whether to use the shorthand verbs

Return value

The N3 text