예제 #1
0
        public void Concept_gets_broaderTransitive()
        {
            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#broaderTransitive> <http://example.com/concept2> .
");

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

            Assert.Same(resource, skosResource);
        }
예제 #2
0
        public void Concept_gets_topConceptOf()
        {
            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#topConceptOf> <http://example.com/conceptScheme> .
");

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

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

            skosGraph.LoadFromString(@"
<http://example.com/orderedCollection> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2004/02/skos/core#OrderedCollection> .
<http://example.com/orderedCollection> <http://www.w3.org/2004/02/skos/core#memberList> _:list .
_:list <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/concept> .
_:list <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
");

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

            Assert.Same(resource, skosResource);
        }