Search code examples
c#rdfontologytriplessemweb

SemWeb - Convert C# object into RDF triples


All i want is to convert a C# class instance into rdf triples using semweb, in order to fill my ontology with data. My class consists of both primitive properties and other classes and i have constructed an ontology with the same structure. e.g.

class Place{

string name;
Image  pic;

}

Is there any resource that could help?

Thanks in advance!


Solution

  • The answer is to use C# reflection in order to investigate the properties and classes of the instance you want to convert and use the:

    store.Add( new Statement( subject, predicate, object ) 
    

    in order to write the triples you want as very well documented in the SemWeb Documentation