Beispiel #1
0
        /// <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();
            }
        }
Beispiel #2
0
 /// <summary>
 /// Parse the iCal at the given URI and base URI
 /// </summary>
 public void Parse(Uri 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);
     }
 }
Beispiel #3
0
 /// <summary>Fetches RDF from the supplied uri, parses the content and adds any resulting statements into the KnowledgeBase</summary>
 /// <param name="uri">The URI of the RDF data.</param>
 public virtual void Include(Uri uri)
 {
     try {
         DereferencerResponse response = itsDereferencer.Dereference(uri);
         if (response.HasContent)
         {
             Parser parser = GetParser();
             parser.NewStatement += itsAssertions.GetStatementHandler();
             parser.Parse(response.Stream, uri.ToString());
             response.Stream.Close();
             parser.NewStatement -= itsAssertions.GetStatementHandler();
         }
     }
     catch (ParserException e) {
         throw new KnowledgeBaseException("Problem including RDF from " + uri, e);
     }
 }