Class MaterializeRDFViewFromRML

java.lang.Object
org.apache.jena.cmd.CommandLineBase
org.apache.jena.cmd.CmdLineArgs
org.apache.jena.cmd.CmdMain
org.apache.jena.cmd.CmdArgModule
org.apache.jena.cmd.CmdGeneral
arq.cmdline.CmdARQ
se.liu.ida.hefquin.cli.MaterializeRDFViewFromRML

public class MaterializeRDFViewFromRML extends arq.cmdline.CmdARQ
A command-line tool to materialize an RDF view from an RML mapping. The tool reads an RDF document containing one or more RML Triples Maps, converts them into a mapping algebra expression, evaluates the mapping against provided data sources and materializes the resulting RDF graph. The output RDF can be written in different serialization formats and optionally stored in a file or printed to standard output.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final org.apache.jena.cmd.ArgDecl
     
    protected final org.apache.jena.cmd.ArgDecl
     
    protected final org.apache.jena.cmd.ArgDecl
     
    protected final arq.cmdline.ModLangOutput
     
    protected final arq.cmdline.ModTime
     

    Fields inherited from class arq.cmdline.CmdARQ

    cmdStrictMode, modContext

    Fields inherited from class org.apache.jena.cmd.CmdGeneral

    cmdName, modGeneral, modVersion

    Fields inherited from class org.apache.jena.cmd.CmdLineArgs

    argMap, args, positionals
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Constructor that initializes the command-line tool with necessary argument modules for output format and timing options and defines command-line options for the RML mapping file, output destination and base IRI.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    Parses command-line arguments and prepares execution parameters for the RML materialization process.
    protected void
    exec(org.apache.jena.rdf.model.Model rmlDescr, org.apache.jena.graph.Node baseIRI, OutputStream out)
    Executes the RML materialization process.
    protected String
    Returns the usage summary string of the command, showing the required and optional arguments.
    static void
    main(String[] args)
    Main entry point of the tool, accepting command-line arguments to specify the mapping details and output format options.

    Methods inherited from class arq.cmdline.CmdARQ

    getCommandName, processModulesAndArgs

    Methods inherited from class org.apache.jena.cmd.CmdGeneral

    add, addModule, getUsage, help, isDebug, isQuiet, isVerbose, printHelp, usage, usage

    Methods inherited from class org.apache.jena.cmd.CmdArgModule

    process

    Methods inherited from class org.apache.jena.cmd.CmdMain

    cmdError, cmdError, mainAndExit, mainMethod, mainRun, mainRun, mainRun

    Methods inherited from class org.apache.jena.cmd.CmdLineArgs

    add, add, add, addArg, addArg, addPositional, clear, contains, contains, containsMultiple, containsMultiple, getArg, getArg, getNumPositional, getPositional, getPositionalArg, getPositionalOrStdin, getValue, getValue, getValues, getValues, handleUnrecognizedArg, hasArg, hasArg, hasArgs, hasPositional, hasValueOfFalse, hasValueOfTrue, indirect, indirect, matchesIndirect, matchesIndirect, removeArg, removeArg, removeArgAll, reset, toString

    Methods inherited from class org.apache.jena.cmd.CommandLineBase

    apply, getArg, getArgList, setArgs

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • modTime

      protected final arq.cmdline.ModTime modTime
    • modLangOut

      protected final arq.cmdline.ModLangOutput modLangOut
    • argRdfFile

      protected final org.apache.jena.cmd.ArgDecl argRdfFile
    • argOutputToFile

      protected final org.apache.jena.cmd.ArgDecl argOutputToFile
    • argBaseIRI

      protected final org.apache.jena.cmd.ArgDecl argBaseIRI
  • Constructor Details

    • MaterializeRDFViewFromRML

      protected MaterializeRDFViewFromRML(String[] argv)
      Constructor that initializes the command-line tool with necessary argument modules for output format and timing options and defines command-line options for the RML mapping file, output destination and base IRI.
      Parameters:
      argv - Command-line arguments.
  • Method Details

    • main

      public static void main(String[] args)
      Main entry point of the tool, accepting command-line arguments to specify the mapping details and output format options.
      Parameters:
      args - Command-line arguments.
    • getSummary

      protected String getSummary()
      Returns the usage summary string of the command, showing the required and optional arguments.
      Specified by:
      getSummary in class org.apache.jena.cmd.CmdGeneral
      Returns:
      A string that describes the usage of the command.
    • exec

      protected void exec()
      Parses command-line arguments and prepares execution parameters for the RML materialization process.

      This includes loading the RML mapping file into a Jena Model, determining the base IRI and configuring the output destination. The actual materialization logic is delegated to exec(Model, Node, OutputStream).

      Specified by:
      exec in class org.apache.jena.cmd.CmdMain
    • exec

      protected void exec(org.apache.jena.rdf.model.Model rmlDescr, org.apache.jena.graph.Node baseIRI, OutputStream out)
      Executes the RML materialization process.

      The method performs the full pipeline of reading an RDF file containing RML triples maps, converting each triples map into a mapping expression, combining all expressions into a single union expression and evaluating the resulting mapping against a fixed JSON data source.

      The evaluation result is transformed into an RDF dataset, which is then serialized and written either to standard output or to a user-specified file. Optionally, a base IRI can be provided for the mapping process; otherwise, a default base IRI is used.