Beispiel #1
0
        public void BuildFileSystemInfo()
        {
            //data store
            var rdf = new RdfData(new NodeFactory());

            //read info
            var g = rdf.GetBlankGraph(nameof(BuildFileSystemInfo));

            g.Update.For(g.Uri(_rootFolder.AsUri()))
            .With("app:root", out _)
            .Add(true)
            .Add(g.Uri(_rootFolder.AsUri()));

            var q = new Queue <DirectoryInfo>();

            q.Enqueue(_rootFolder);

            //limit depth so not too long.
            BreadthFirstReadInfo(q, g.Update, rdf, 2);

            //save data
            _dataFile.EnsureDelete();
            var rdfFile = new NTripleFile(_dataFile);

            rdfFile.Write(g).Wait();

            Assert.IsTrue(_dataFile.Exists());
        }
        public void AsUri_FolderEnding()
        {
            var target = new DirectoryInfo("c:/temp");

            var result = target.AsUri();

            Assert.IsTrue(result.ToString().EndsWith('/'),
                          "Folder should end with slash");
        }