From: Rob V. <rv...@do...> - 2013-01-23 10:39:43
|
Hey Ryan What exactly do you want to do here? You can easily parse this RDF/XML as triples into dotNetRDF like so: Graph g = new Graph(); g.LoadFromFile("your-file.rdf"); And then you can find the expression string either with a SPARQL query or using the Graph API to select the relevant pieces of data e.g. IEnumerable<ILiteralNode> ns = g.GetTriplesWithPredicate(g.CreateUriNode("kb:expression_string")).Select(t => t.Object).OfType<ILiteralNode>(); foreach (ILiteralNode n in ns) { //The variable n holds the literal representing your let expression //Access it's value like so String exprStr = n.Value; //Do something with the expression string } However there is no support for parsing these let expressions, I assume these are some sort of Protégé specific feature? You can easily access this data as I demonstrated but I'm afraid you would be on your own for parsing it and interpreting it. If you have more specific questions we may be able to provide you with more specific answers, Regards, Rob From: Ryan Minor <mi...@ya...> Reply-To: Ryan Minor <mi...@ya...>, dotNetRDF User Help and Support <dot...@li...> Date: Wednesday, January 23, 2013 12:07 AM To: "dot...@li..." <dot...@li...> Subject: [dotNetRDF-Support] parsing RDF > Hi there > > I am new to RDF. I am trying to use dotnetrdf to parse a file creating using > Protege (Stanford). > > The following is an excerpt from my file: > > <?xml version='1.0' encoding='UTF-8'?> > <!DOCTYPE rdf:RDF [ > <!ENTITY rdf 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'> > <!ENTITY a 'http://protege.stanford.edu/system#'> > <!ENTITY kb 'http://protege.stanford.edu/kb#'> > <!ENTITY rdfs 'http://www.w3.org/2000/01/rdf-schema#'> > ]> > > <rdf:RDF xmlns:rdf="&rdf;" > xmlns:a="&a;" > xmlns:kb="&kb;" > xmlns:rdfs="&rdfs;"> > > <kb:Let_Expression rdf:about="&kb;CoughStudy3_00730" > kb:identifier="coughStartTime" > kb:name="Current cough start time" > rdfs:label="Current cough start time"> > <kb:expression_string>selectAttribute("low", selectAttribute("critical_time", > selectAttribute("value", latest cough where time of it >= > now)))</kb:expression_string> > </kb:Let_Expression> > > > The last paragraph is describing something called a Let_Expression. > > Any suggestions on parsing this in dotnetrdf? > > > ------------------------------------------------------------------------------ > Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, > Windows 8 Apps, JavaScript and much more. Keep your skills current with > LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and > experts. ON SALE this month only -- learn more at: > http://p.sf.net/sfu/learnnow-d2d______________________________________________ > _ dotNetRDF-Support mailing list dot...@li... > https://lists.sourceforge.net/lists/listinfo/dotnetrdf-support |