Skip to main content

module lang::rsf::IO

rascal-0.34.0

Usage

import lang::rsf::IO;

function readRSF

Read an RSF file.

Read relations from an RSF file. An RSF file contains tuples of binary relations in the following format: RelationName Arg1 Arg2 where each field is separated by a tabulation character (\t). One file may contain tuples for more than one relation. readRSF takes an RSF file nameRSFFile and generates a map[str,rel[str,str]] that maps each relation name to the actual relation.

map[str, rel[str,str]] readRSF(loc nameRSFFile)

map[str, rel[str,str]] readRSF(loc nameRSFFile)

function getRSFTypes

map[str, type[value]] getRSFTypes(loc location)

function readRSFRelation

&T readRSFRelation(type[&T] result, str name, loc location)

function generate

The RSF schema should be given as: rsf+rascal-file-uri where rascal-file-uri is a standard Rascal URI, for instance: rsf+file:///tmp/myRSFFile.rsf or rsf+project://MyProject/src/data/myRSFFile.rsf

str generate(str moduleName, loc uri)