Port RDFReactor project to .Net (written in C#)



Port RDFReactor project to .Net (written in C#)

[About NRDFReactor]:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::


NRDFReactor views the RDF data model through object-oriented .NET/C# proxies and makes RDF easy for C# developers. It is somewhat of RDFReactor(in Java) in .NET/C#. However, It not only implements functions of RDFReactor, it adds some features based on RDFReactor.




  • Think in objects, not statements  (RDFReactor)
  • Dynamic state (RDFReactor)
  • C# interfaces are generated automatically from an RDF    Schema/OWL  (RDFReactor)
  • Context class and related operations.
    • contexts often are used for managing data aggregation and recording provenance like in Redland, Jena etc.


 Version Alpha0.9 code)




NRDFReactor is released under the GNU Lesser General Public License, Version 2.1, Feb. 1999.





 sflogo-type1  rdfreactor-logo  



Steps of jenerating C# classes:

   1.  Write or find an RDF Schema
   2.  Generate API

      CodeGenerator.generate("schema.rdf", "./src", "nrdfreactor.example","rdfs", true, true);


Example Generated APIs:


public class WfMSContext : NRDFReactorBase {
        public WfMSContext(Model model, System.Uri uri)
            : base(model, WfMSCONTEXT, uri){}
        public void AddActivityID(string actID) {
            Add(ACTIVITYID, actID);
        public void AddCurUser(Person p) {
            Add(CURUSER, p);
        public void AddPara1(string para) {
            Add(PARA1, para);

public class Person : NRDFReactorBase {
    public void AddPhone(int value) {
            Add(FOAFPHONE, value);
        public void AddPhone(int value, Context cxt) {
            Add(FOAFPHONE, value, cxt);
        public int GetPhone(){
            return (int)Get(FOAFPHONE);
        public int GetPhone(Context cxt){
            return (int)Get(FOAFPHONE);


3. using NRDFReactor:

Model model = RDFTKWrapper.CreateDefaultModel();
WfMSContext  wfmscxt = new WfMSContext(m,"");
Person p1 = new Person(m, "",wfmscxt);
Person p2 = new Person(m, "",wfmscxt);

Person[] p1friends = p1.getAllKnowsInCxt();
for (int i = 0; i < p1friends.length; i++) {
  System.out.println(p1.getNameInCxt()+" knows "+p1friends[i].getNameInCxt() );




    * Guiling Wang ( AT