Example #1
0
        public RdfACoreParserContext(IRdfHandler handler, IRdfAHostLanguage language, TextReader reader, bool traceParsing)
        {
            this._handler      = handler;
            this._traceParsing = traceParsing;
            this._language     = language;

            //Set up the Event Queue
            IEventGenerator <IRdfAEvent> generator = this._language.GetEventGenerator(reader);

            if (generator is IJitEventGenerator <IRdfAEvent> )
            {
                this._events = new StreamingEventQueue <IRdfAEvent>((IJitEventGenerator <IRdfAEvent>)generator);
            }
            else if (generator is IPreProcessingEventGenerator <IRdfAEvent, RdfACoreParserContext> )
            {
                this._events = new EventQueue <IRdfAEvent>(generator);
                ((IPreProcessingEventGenerator <IRdfAEvent, RdfACoreParserContext>)generator).GetAllEvents(this);
            }
            this._events = new DualEventQueue <IRdfAEvent>(this._events);

            //Setup final things
            this._baseUri         = new NestedReference <Uri>((this._language.InitialBaseUri != null ? this._language.InitialBaseUri : this._handler.GetBaseUri()));
            this._defaultVocabUri = new NestedReference <Uri>(this._language.DefaultVocabularyUri);
        }
Example #2
0
 public RdfACoreParserContext(IRdfHandler handler, IRdfAHostLanguage language, TextReader reader)
     : this(handler, language, reader, false)
 {
 }
Example #3
0
 public RdfACoreParserContext(IGraph g, IRdfAHostLanguage language, TextReader reader)
     : this(g, language, reader, false)
 {
 }
Example #4
0
 public RdfACoreParserContext(IGraph g, IRdfAHostLanguage language, TextReader reader, bool traceParsing)
     : this(new GraphHandler(g), language, reader, traceParsing)
 {
 }