/// <summary> /// Parse the RDF using the string paramater as a URI /// </summary> public void Parse(string uri, string baseUri) { DereferencerResponse response = itsDereferencer.Dereference(uri); if (response.HasContent) { Parse(response.Stream, uri.ToString()); } response.Stream.Close(); }
/// <summary> /// Parse the RDF at the given URI /// </summary> public void Parse(Uri uri, string baseUri) { DereferencerResponse response = itsDereferencer.Dereference(uri); if (response.HasContent) { Stream contentStream = response.Stream; this.Parse(contentStream, baseUri); contentStream.Close(); } }
/// <summary> /// Parse the iCal using the string paramater as a URI and base URI /// </summary> public void Parse(string uri, string baseUri) { try { DereferencerResponse response = itsDereferencer.Dereference(uri); if (response.HasContent) { Stream contentStream = response.Stream; this.Parse(contentStream, baseUri); contentStream.Close(); } } catch (Exception e) { throw new ParserException("Could not parse content because " + e); } }
/// <summary>Fetches RDF from the supplied uri, parses the content and adds any resulting statements into the KnowledgeBase</summary> /// <param name="uri">A string verson of the URI of RDF data.</param> public virtual void IncludeSchema(string uri) { try { DereferencerResponse response = itsDereferencer.Dereference(uri); if (response.HasContent) { Parser parser = GetParser(); parser.NewStatement += itsSchemas.GetStatementHandler(); parser.Parse(response.Stream, uri.ToString()); response.Stream.Close(); parser.NewStatement -= itsSchemas.GetStatementHandler(); } } catch (ParserException e) { throw new KnowledgeBaseException("Problem including RDF from " + uri, e); } }