Package org.mantikhor.llapi

Examples of org.mantikhor.llapi.ResourceNode


    {
        assertNotNull(this.treeI);
       
        Namenode nameNode = this.treeI.getNamenode();
       
        ResourceNode fromNameNode =
            ResourceNodeImpl.getInstanceWithPropertiesAndKhorID(
                    nameNode.getResourceURI(),
                    nameNode.getProperties(),
                    nameNode.getKhorID(),
                    true);
       
        ResourceNode resNode = (ResourceNode)this.getNode(TreeImplTest.NODES.NAME_NODE_TREEI);
       
        assertTrue(fromNameNode.hasSameContents(resNode));
        assertTrue(resNode.hasSameContents(fromNameNode));
       
        assertTrue(nameNode.hasSameContents(resNode));
        assertTrue(resNode.hasSameContents(nameNode));

        assertTrue(resNode.isContentContainedBy(nameNode));
        assertTrue(nameNode.isContentContainedBy(resNode));

        assertTrue(fromNameNode.isContentContainedBy(nameNode));
        assertTrue(nameNode.hasSameContents(fromNameNode));
    }
View Full Code Here


       
        for (int ndx = 0; ndx < this.numberOfTerminatingNodes; ndx++)
        {
            Path path = arrayOfPaths[ndx];
            assertTrue(path.getProperties().size() == 2);
            ResourceNode resNode = path.getStartNode();
            ResourceNode nameNode = (ResourceNode)getNode(TreeImplTest.NODES.NAME_NODE_TREEI);
            assertTrue(resNode.getProperties().containsAll(nameNode.getProperties()));
            assertTrue(nameNode.getProperties().containsAll(resNode.getProperties()));
        }
    }
View Full Code Here

        assertTrue(arrayOfPaths.length == 3);
        for (int ndx = 0; ndx < 3; ndx++)
        {
            Path path = arrayOfPaths[ndx];
            assertTrue(path.getProperties().size() == 1);
            ResourceNode resNode = path.getStartNode();
            ResourceNode nameNode = (ResourceNode)getNode(TreeImplTest.NODES.A);
            assertTrue(resNode.getProperties().containsAll(nameNode.getProperties()));
            assertTrue(nameNode.getProperties().containsAll(resNode.getProperties()));
        }
    }
View Full Code Here

     * Test method for {@link org.mantikhor.llapi.impl.TreeImpl#getSubgraphPathset(org.mantikhor.llapi.ResourceNode)}.
     */
    public void testGetSubgraphPathset()
    {
        assertNotNull(this.treeI);
        ResourceNode resNode = (ResourceNode)getNode(TreeImplTest.NODES.C);
        Set<Path> paths = this.treeI.getSubgraphPathset(resNode);
        assertTrue(paths.size() == 3);
        Path[] arrayOfPaths = new Path[paths.size()];
        paths.toArray(arrayOfPaths);
        assertTrue(arrayOfPaths.length == 3);
        for (int ndx = 0; ndx < 3; ndx++)
        {
            Path path = arrayOfPaths[ndx];
            assertTrue(path.getProperties().size() == 1);
            ResourceNode node = path.getStartNode();
            ResourceNode nameNode = (ResourceNode)getNode(TreeImplTest.NODES.C);
            assertTrue(node.getProperties().containsAll(nameNode.getProperties()));
            assertTrue(nameNode.getProperties().containsAll(node.getProperties()));
        }
    }
View Full Code Here

     * Test method for {@link org.mantikhor.llapi.impl.TreeImpl#getSubgraph(org.mantikhor.llapi.ResourceNode)}.
     */
    public void testGetSubgraph()
    {
        assertNotNull(this.treeI);
        ResourceNode nodeA = (ResourceNode)getNode(TreeImplTest.NODES.A);
        Graph graph1 = this.treeI.getSubgraph(nodeA);
        assertNotNull(graph1);
        TreeImpl tree1 = TreeImpl.valueByResourceNode((ResourceNode)graph1.getNamenode());
        GraphInformation graphInformation1 = tree1.getGraphInformation();
        assertTrue(graphInformation1.getBaseProperties().size() == 3);
        assertTrue(graphInformation1.getBaseValNodes().size() == 4);
        assertTrue(graphInformation1.getPropertyDefinitions().size() == 3);
        assertTrue(graphInformation1.getPropertiesThatAreKhoronItems().size() == 3);
        assertTrue(graphInformation1.getTerminatingBaseProperties().size() == 3);
        assertTrue(graphInformation1.getValNodesThatAreBursts().size() == 4);
       
        ResourceNode nodeF = (ResourceNode)getNode(TreeImplTest.NODES.F);
        Graph graph2 = this.treeI.getSubgraph(nodeF);
        assertNotNull(graph2);
       
        TreeImpl treeIsubgraphFromF = TreeImpl.valueByResourceNode((ResourceNode)graph2.getNamenode());
        GraphInformation graphInformation2 = treeIsubgraphFromF.getGraphInformation();
View Full Code Here

        assertTrue(allTree1Properties.containsAll(burst.getProperties()));
        assertTrue(burst.getProperties().containsAll(allTree1Properties));

        createResourceNodeTreeIII(); // same URI as treeI but ALL properties A ... L
       
        ResourceNode resNode =
            (ResourceNode)getNode(TreeImplTest.NODES.NAME_NODE_TREEIII);
       
        System.out.println(resNode.getProperties().size());
        System.out.println(properties.size());
       
        assertTrue(resNode.getProperties().containsAll(properties));
        assertTrue(properties.containsAll(resNode.getProperties()));
       
        assertTrue(burst.isContentContainedBy(resNode));
        assertFalse(resNode.isContentContainedBy(burst));
       
        //                           ______nameNode______
        //                         / | | | | | | | | | | \
        //                        A  B C | | | | | | | | |          Paths
        //                        |  | | D E F | | | | | |
View Full Code Here

        this.properties = new HashMap<Integer, BaseProperty>(this.numberOfProperties);
        this.resourceNodes = new HashMap<Integer, BaseValNode>(this.numberOfNodes);
       
        for (int ndx = TreeImplTest.PROPERTIES.D.ordinal(); ndx <= TreeImplTest.PROPERTIES.L.ordinal(); ndx++)
        {
            ResourceNode resNode =
                ResourceNodeImpl.getInstanceWithPropertiesAndKhorID(
                        this.getURI(TreeImplTest.URI.values()[ndx]),
                        new ArrayList<BaseProperty>(),
                        KhoronImpl.getInstance().nextKhorID(),
                        true);
View Full Code Here

           
            baseProperties.add(this.getProperty(TreeImplTest.PROPERTIES.values()[(ndx+1)*3 + 0]));
            baseProperties.add(this.getProperty(TreeImplTest.PROPERTIES.values()[(ndx+1)*3 + 1]));
            baseProperties.add(this.getProperty(TreeImplTest.PROPERTIES.values()[(ndx+1)*3 + 2]));

            ResourceNode resNode =
                ResourceNodeImpl.getInstanceWithPropertiesAndKhorID(
                        this.getURI(TreeImplTest.URI.values()[ndx]),
                        baseProperties,
                        KhoronImpl.getInstance().nextKhorID(),
                        true);
View Full Code Here

        {
            return false;
        }
       
        // Try to see if the content of "this" object is in the other object - other is a ResourceNode.
        ResourceNode otherNode = (ResourceNode)other;
       
        if (this.domainURI == null)
        {
            if (otherNode.getResourceURI() != null)
            {
                // this URI is not in the other object
                return false;
            }
        }
        else
        {
            if (!this.domainURI.equals(otherNode.getResourceURI()))
            {
                // this URI is not in the other object
                return false;
            }
        }
       
        // ok, domainURI is the same.
        // skip khoron ID -- it is for IDENTITY not EQUALITY
        // so, all of the state we have is in the Bursts
       
        if (!otherNode.getProperties().containsAll(this.getProperties()))
        {
            // some of the properties in "this" object are not in the other object
            return false;
        }
       
View Full Code Here

       
       
        // make State Items
       
        // start nodes
        ResourceNode commonStart = null;
        ResourceNode firstNotSecondStart = null;
        ResourceNode secondNotFirstStart = null;
       
        if (
                (
                    this.getStartNode() == null
                    &
View Full Code Here

TOP

Related Classes of org.mantikhor.llapi.ResourceNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.