예제 #1
0
        public void Graph_gets_orderedCollection()
        {
            var skosGraph = new SkosGraph();

            skosGraph.LoadFromString(@"
<http://example.com/> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2004/02/skos/core#OrderedCollection> .
");

            var resource     = skosGraph.Triples.SubjectNodes.Single();
            var skosResource = skosGraph.OrderedCollections.Single().Resource;

            Assert.Same(resource, skosResource);
        }
예제 #2
0
        public void ConceptScheme_gets_hasTopConcept()
        {
            var skosGraph = new SkosGraph();

            skosGraph.LoadFromString(@"
<http://example.com/conceptScheme> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2004/02/skos/core#ConceptScheme> .
<http://example.com/conceptScheme> <http://www.w3.org/2004/02/skos/core#hasTopConcept> <http://example.com/concept> .
");

            var resource     = skosGraph.GetUriNode(new Uri("http://example.com/concept"));
            var skosResource = skosGraph.ConceptSchemes.Single().HasTopConcept.Single().Resource;

            Assert.Same(resource, skosResource);
        }
예제 #3
0
        public void Concept_gets_relatedMatch()
        {
            var skosGraph = new SkosGraph();

            skosGraph.LoadFromString(@"
<http://example.com/concept1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2004/02/skos/core#Concept> .
<http://example.com/concept1> <http://www.w3.org/2004/02/skos/core#relatedMatch> <http://example.com/concept2> .
");

            var resource     = skosGraph.GetUriNode(new Uri("http://example.com/concept2"));
            var skosResource = skosGraph.Concepts.Single().RelatedMatch.Single().Resource;

            Assert.Same(resource, skosResource);
        }
예제 #4
0
        public void Collection_gets_member()
        {
            var skosGraph = new SkosGraph();

            skosGraph.LoadFromString(@"
<http://example.com/collection> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2004/02/skos/core#Collection> .
<http://example.com/collection> <http://www.w3.org/2004/02/skos/core#member> <http://example.com/concept> .
");

            var resource     = skosGraph.GetUriNode(new Uri("http://example.com/concept"));
            var skosResource = skosGraph.Collections.Single().Member.Single().Resource;

            Assert.Same(resource, skosResource);
        }
예제 #5
0
        public void Concept_gets_scopeNote()
        {
            var skosGraph = new SkosGraph();

            skosGraph.LoadFromString(@"
<http://example.com/concept> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2004/02/skos/core#Concept> .
<http://example.com/concept> <http://www.w3.org/2004/02/skos/core#scopeNote> """" .
");

            var resource     = skosGraph.Nodes.LiteralNodes().Single();
            var skosResource = skosGraph.Concepts.Single().ScopeNote.Single();

            Assert.Same(resource, skosResource);
        }