#10 RDFSH- rdfshell

open
8
2007-06-08
2007-06-08
No

This is it. The thing that I have been working towards.
It is a RDF shell that iteracts with the redland lib.

It supports some gcc extensions that need to be extracted into something more reusable.

The idea is that you will be able to define new commands that are based on an ontology, define queries attached to them and basically make the iteraction with the gcc introspection data completly data driven.

The current version has a nice function get_structs that queries the structures. It is used like this in a one liner script :

perl -I /mnt/gcc/gcc/introspector -Mrdfsh -e RDF::Shell::Main::main "storage TREE_NODE; prefix its http://introspector.sf.net/2007/04/02/introspector-gcc-base.owl#; prefix data1 file:///mnt/gcc/gcc/svn/build2/gcc/tree-dump-split/TREE_NODE.rdf#; set_prefix data1; get_structs;" > test.txt

The pointer and ref types are not emitted just yet :
here is a struct that can be recreated out of the rdf.

typedef struct
{
int words;;
int nregs;;
int regno;;
int fastcall;;
int sse_words;;
int sse_nregs;;
int warn_sse;;
int warn_mmx;;
int sse_regno;;
int mmx_words;;
int mmx_nregs;;
int mmx_regno;;
int maybe_vaarg;;
int float_in_sse;
} ix86_args;

Discussion

  • the first version of the RDF shell

     
    Attachments
  • Logged In: YES
    user_id=147871
    Originator: YES

    The current wrapping results,
    The bitfields and function pointers are hacked.
    this should not be a problem for generating the next stage of dumper functions.

    next step is to wrap all the functions!!
    File Added: wrap_results.h

     
  • current wrap results

     
    Attachments
  • Load a dataset and dump the structures

     
    Attachments
  • Logged In: YES
    user_id=147871
    Originator: YES

    This its_dump_tree.rdfsh script loads a dataset and dumps out the nodes as a c decl

    File Added: its_dump_tree.rdfsh

     
  • Logged In: YES
    user_id=147871
    Originator: YES

    This preload script loads the introspector predicates.
    It is the beginning of the ontology markup.
    later we will be able to define all the gcc specific defined functions in this file :

    ideas:
    1. map a owl:class onto a perl module
    2. be able to attach user code via perl modules into shell
    3. be able to describe the traversal structure in an ontology

    File Added: its_preload.rdfsh

     
  • introspector ontology preload script

     
    Attachments
  • new version of rdfsh

     
    Attachments
  • Logged In: YES
    user_id=147871
    Originator: YES

    New version of the rdf shell,
    contains code to generate the c headers.

    next version is to move out that generation code into a separate module and load it it.
    Be able to change the syntax into :
    1. perl output : emit a set of perl classes to wrap these structures
    2. owl output : emit a owl ontology based on the header
    3. c-dumper code : emit a new set of dumper functions for the gcc wrapper
    4. sparql queries : emit a set of sparql queries that would query instances of these data objects

    be able to define a traversal path for how the structures are connected.

    File Added: rdfsh.pm