Logging to rdf file

Hi

I have been thinking about this before and I haven't found an answer on google.

Do you guys know whether there is a ready solution for logging to RDF files (or other writable RDF source) for .NET? Popular frameworks are log4net and NLog, which support extending with appenders and targets respectively. Has anyone implemented such thing using RDF?

Also is there a well known vocabulary for possible log data? Usually that would include log level, message, source, timestamp and more. I have found Sticky logging but it seems unmaintained and not really created for such purpose.

Tom

The NIF (NLP Interchanged Format) working group has defined RDF logging ontology called RLOG.

Given the apparent lack of a pre-built ontology I would suggest you consider writing your own preferably based upon an existing ontology which would give you some of the core stuff you require.

For example the Event Ontology does what the name suggests - models events. You can use this as the basis for logging and then add your own logging specific vocabularly on top of this e.g.

@prefix event: <http://purl.org/NET/c4dm/event.owl#>.
@prefix foaf: <http://xmlns.com/foaf/0.1/>.
@prefix tl: <http://purl.org/NET/c4dm/timeline.owl#>.
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
@prefix log: <http://example.org/logging#>.

[] a event:Event;
event:agent [
a foaf:Agent;
foaf:name "program.exe";
];
event:time [
a tl:Interval;
tl:at "2007-10-15T12:00:00"^^xsd:dateTime;
tl:duration "PT1H"^^xsd:duration;
];
log:level log:Debug ;
log:message "Something happened" ;
log:threadID 12345 ;
log:sourceClass "Namespace.Class"
.

You likely want to have more of a think about what the logging properties would model and be named to cover everything a logging framework can produce.

One thing you should think about is that since RDF is unordered you would probably want to always log the date time as otherwise you'll just have a mass of triples with no notion of what happened when making the logging fairly useless.

Take a look at the HTTP RDF Vocabulary

http://www.w3.org/TR/HTTP-in-RDF10/

Essentially it provides a means to model HTTP requests and responses as RDF, ideal for web server logs.