|
From: Yuqian (M. L. <yl...@au...> - 2015-06-17 02:24:08
|
Hi dotNetRDF Team,
I am using dotNetRDF library to process my ontology in RDF/XML format.
Following the tutorials on your website, I can easily get a triple from my
graph and further get the INode I am interested in. Then I would like to
retrieve the actual value from the resultant INode no matter it is actually
a UriNode or a LiteralNode. So I was wondering if there is some method in
dotNetRDF that I can use to extract the value from INode?
Below is the code:
IUriNode rdfType = g.CreateUriNode("rdf:type");
IUriNode projectType = g.CreateUriNode("ms:Project");
IEnumerable<Triple> ts =
g.GetTriplesWithPredicateObject(rdfType, projectType);
foreach (var triple in ts)
{
* //UriNode is in the format of [PrefixNamespaceURI]value.*
* //LiteralNode is in the format of
value^^[URIoftheBuiltinDataType]*
INode subject = triple.Subject;
* //Here I need some method to extract the value only*
* ……………………………………*
}
It would be much appreciated if you could provide some information on this.
I am looking forward to hearing from you.
Best regards,
Michael
|