Пример #1
0
        public void AddNamedGraphToCurrentNodes(string namedGraphUri)
        {
            //as we're using named graphs now, we must use TRIG format
            if (this._outputFormat != ERdfFormat.TriG && this._outputFormat != ERdfFormat.NQuads)
            {
                this._outputFormat = ERdfFormat.TriG;
                Console.WriteLine("Format set to TriG as namedgraph has been asserted.");
            }

            //Load the nodes into a graph, and name it
            var g = GetXmlDocumentAsGraph();

            g.BaseUri = new Uri(namedGraphUri);

            //add to triple store
            if (_store == null)
            {
                _store = new TripleStore();
            }
            _store.Add(g, true);

            //empty the current XmlDocument and restart
            InitialiseRdfOutput(_namespaces);
        }
Пример #2
0
 public RdfOutput(string outputPath, Dictionary <string, string> namespaces, ERdfFormat outputFormat)
 {
     _outputPath = outputPath;
     InitialiseRdfOutput(namespaces);
     _outputFormat = outputFormat;
 }
Пример #3
0
 public RdfOutput(string outputPath, Dictionary<string, string> namespaces,ERdfFormat outputFormat)
 {
     _outputPath = outputPath;
     InitialiseRdfOutput(namespaces);
     _outputFormat = outputFormat;
 }
Пример #4
0
        public void AddNamedGraphToCurrentNodes(string namedGraphUri)
        {
            //as we're using named graphs now, we must use TRIG format
            if (this._outputFormat != ERdfFormat.TriG && this._outputFormat != ERdfFormat.NQuads)
            {
                this._outputFormat = ERdfFormat.TriG;
                Console.WriteLine("Format set to TriG as namedgraph has been asserted.");
            }

            //Load the nodes into a graph, and name it
            var g = GetXmlDocumentAsGraph();
            g.BaseUri = new Uri(namedGraphUri);

            //add to triple store
            if (_store == null)
                _store = new TripleStore();
            _store.Add(g, true);

            //empty the current XmlDocument and restart
            InitialiseRdfOutput(_namespaces);
        }