Redland RDF Application Framework - C# Interface

This interface is for the ECMA Common Language Infrastructure (CLI) which is implemented as a set of technologies called ".Net" on Microsoft platforms. It was originally written by César Lopez Nataren in April 2004 and updated to work with newer Mono releases. It is written in C# however it shoulde be usable by any of the CLI languages.

Installing the Redland C# interface

This is built if --with-ecma-cli=mono (or dotgnu - this has not been tested recently) is given to the configure, selecting a particular ECMA CLI implementation from those that may be available. The standard 'make' at the top level will build it.

You can also compile the C# interface by hand as follows:

  cd csharp
  make

  # optional, but it may require a top-level 'make install
  # first depending on the operating system and how it
  # handles shared libraries
  make check

To install it system wide do this as root (or maybe via sudo make install):

  root# make install

Which will try to install it in the runtime GAC, registering Redland.dll with it's strong name using the gac utility.

The C# interface for Redland is new and requires Mono 0.96 (Mono 1.0 beta3) or newer. It has been tested on:

1.0 on Linux/x86
0.97 (1.0 RC1) on Linux/x86
0.96 (1.0 beta3) on Linux/x86
0.95 (1.0 beta2) on Linux/x86

It mostly works with Mono 1.0 on OSX/ppc but some tests crash.

Testing the Redland C# interface

If you did the install above, you can try the C# examples and run the unit tests:

  cd examples
  make check

  # Unit tests (using the NUnit framework DLL, supplied)
  make unittests

The result of the nunittests should be something like:

  ...
  Tests run: 13, Failures: 0, Not run: 0, Time: 0.731799 seconds

Redland C# API Introduction

The C# API is an object-based API reflecting the same structure of the Redland objects with simple mappings between them:

ConceptRedland ClassC# ClassPurpose
Resource / Literallibrdf_nodeRedland.Node RDF Model & Syntax nodes
Statement / Triplelibrdf_statementRedland.Statement RDF Model & Syntax arcs (statements, triples) [isa Resource]
Modellibrdf_modelRedland.Model Set of Statements usually held in one Storage.
Storagelibrdf_storageRedland.Storage Storage for Models either persistant or in-memory.
Streamlibrdf_streamRedland.Stream Providing sequences of Statements from Parsers, queries.
Parserlibrdf_parserRedland.Parser Syntaxes parsers delivering Stream of Statements or writing to a Model
Querylibrdf_queryRedland.Query Querying of an Model delivering a QueryResults
QueryResultslibrdf_query_resultsRedland.QueryResults Results of applying an Query to a Model giving either variable bindings with Node values or Stream of Statements
Serializerlibrdf_serializerRedland.Serializer Serializes a Model into a syntax such as RDF/XML
Iteratorlibrdf_iteratorRedland.Iterator Enumerating lists (of Node) from queries.
URIlibrdf_uriRedland.Uri Provides URIs for Resources, Parsers, ...
World Internal RDF wrapper class handling Redland startup/shutdown
Digestlibrdf_digest  Internal content digest class
Hashlibrdf_hash  Internal key:value maps class

Copyright 2004 Dave Beckett, Institute for Learning and Research Technology, University of Bristol