Esempio n. 1
0
        /// <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();
        }
Esempio n. 2
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();
            }
        }
Esempio n. 3
0
 /// <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);
     }
 }
Esempio n. 4
0
 /// <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);
     }
 }