Beispiel #1
0
        public DataDockRepositoryPublishTests()
        {
            _datasetGraphIri = new Uri("http://datadock.io/test/repo/dataset");
            var initGraph = new Graph();

            _publishedSubject = new Uri("http://datadock.io/test/repo/id/subject");
            var s = initGraph.CreateUriNode(_publishedSubject);

            QuinceStore.Assert(s, initGraph.CreateUriNode(new Uri("http://example.org/p1")),
                               initGraph.CreateUriNode(new Uri("http://example.org/o1")), _datasetGraphIri);
        }
        public DataDockRepositoryUpdateSpec()
        {
            _insertGraph = new Graph();
            _insertGraph.Assert(_insertGraph.CreateUriNode(new Uri("http://example.org/s")),
                                _insertGraph.CreateUriNode(new Uri("http://example.org/p")),
                                _insertGraph.CreateUriNode(new Uri("http://example.org/o")));
            _datasetGraphIri = new Uri("http://datadock.io/test/repo/example");
            _metadataGraph   = new Graph();
            _metadataGraph.Assert(
                _metadataGraph.CreateUriNode(_datasetGraphIri),
                _metadataGraph.CreateUriNode(new Uri("http://example.org/properties/foo")),
                _metadataGraph.CreateLiteralNode("foo"));
            _metadataGraphIri = new Uri("http://datadock.io/test/repo/example/metadata");
            _definitionsGraph = new Graph();
            _definitionsGraph.Assert(
                _definitionsGraph.CreateUriNode(_datasetGraphIri),
                _definitionsGraph.CreateUriNode(new Uri("http://example.org/properties/bar")),
                _definitionsGraph.CreateLiteralNode("bar"));
            _definitionsGraphIri = new Uri("http://datadock.io/test/repo/example/definitions");
            _publisherIri        = new Uri("http://datadock.io/test/publisher");
            _publisherInfo       = new ContactInfo {
                Label = "Test Publisher"
            };
            _repositoryTitle       = "Test Repository";
            _repositoryDescription = "Test Repository Description";
            _rootMetadataGraphIri  = new Uri("http://datadock.io/test/repo/metadata");

            // Create some existing triples that we will expect to be retracted
            var initGraph = new Graph();

            initGraph.NamespaceMap.AddNamespace("test", new Uri("http://datadock.io/test/"));
            initGraph.NamespaceMap.AddNamespace("dcterms", new Uri("http://purl.org/dc/terms/"));
            initGraph.NamespaceMap.AddNamespace("rdfs", new Uri("http://www.w3.org/2000/01/rdf-schema#"));
            var repo      = initGraph.CreateUriNode(BaseUri);
            var publisher = initGraph.CreateUriNode(_publisherIri);

            QuinceStore.Assert(
                repo,
                initGraph.CreateUriNode("dcterms:title"),
                initGraph.CreateLiteralNode("Old Title"),
                _rootMetadataGraphIri);
            QuinceStore.Assert(
                repo,
                initGraph.CreateUriNode("dcterms:description"),
                initGraph.CreateLiteralNode("Old Description"),
                _rootMetadataGraphIri);
            QuinceStore.Assert(
                publisher,
                initGraph.CreateUriNode("rdfs:label"),
                initGraph.CreateLiteralNode("Old Publisher"),
                _rootMetadataGraphIri);
        }