[redland-dev] parse "ntriple" string into model error

Wang GuiLing wgling at csnet4.cs.tsinghua.edu.cn
Wed Jun 7 08:44:17 BST 2006


I want to parse a ntriple file into Redland model in .net platform using
redland dotnet binding API like this. But It doesn't work.  I don't know
why?

As for the "rdfxml" file, it can work.

How can I parse ntriple string into a Redland model?

Thank you in advance!

 

 

 

String lang = null;

schemaFileName = "dc.nt";

 

Redland.Storage storage = new Storage("memory", "test", null);

Redland.Model model = new Model(storage);

 

StreamReader sr = File.OpenText(schemaFileName);

String s = sr.ReadToEnd();            

 

if (schemaFileName.EndsWith(".nt"))

      lang = "ntriples";

else if (schemaFileName.EndsWith(".rdf"))

      lang = "rdfxml";

else if (schemaFileName.EndsWith(".ttl"))

     lang = "turtle";                       

 

Redland.Uri baseuri = new Redland.Uri("http://xx/xx#");

Redland.Parser parser = new Parser(lang);          

parser.ParseStringIntoModel(s, baseuri, model);

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.gnomehack.com/pipermail/redland-dev/attachments/20060607/fbd4611a/attachment.htm


More information about the redland-dev mailing list