@Override public LiteralNode getDeepLiteralNode(XDIAddress literalNodeXDIAddress) { return this.getRootContextNode(false).getDeepLiteralNode(literalNodeXDIAddress); }
@Override public LiteralNode getDeepLiteralNode(XDIAddress literalNodeXDIAddress, boolean subgraph) { return this.getRootContextNode(false).getDeepLiteralNode(literalNodeXDIAddress, subgraph); }
ContextNode abcPassportV2ContextNode = abcPassportVContextNode.getContextNode(XDIArc.create("*!:uuid:2222")); Relation abcPassportV2RelationDollar = abcPassportV2ContextNode.getRelation(XDIAddress.create("$")); LiteralNode abcPassport1LiteralNumber = abcPassport1ContextNode.getDeepLiteralNode(XDIAddress.create("<#number>&")); LiteralNode abcPassport1LiteralCountry = abcPassport1ContextNode.getDeepLiteralNode(XDIAddress.create("<#country>&")); LiteralNode abcPassport1LiteralD = abcPassport1ContextNode.getDeepLiteralNode(XDIAddress.create("<$t>&")); LiteralNode abcPassport2LiteralNumber = abcPassport2ContextNode.getDeepLiteralNode(XDIAddress.create("<#number>&")); LiteralNode abcPassport2LiteralCountry = abcPassport2ContextNode.getDeepLiteralNode(XDIAddress.create("<#country>&")); LiteralNode abcPassport2LiteralD = abcPassport2ContextNode.getDeepLiteralNode(XDIAddress.create("<$t>&")); ContextNode abcPassportC1ContextNode = abcPassportCContextNode.getContextNode(XDIArc.create("*!:uuid:1111")); ContextNode abcPassportC2ContextNode = abcPassportCContextNode.getContextNode(XDIArc.create("*!:uuid:2222")); LiteralNode abcPassportC1LiteralD = abcPassportC1ContextNode.getDeepLiteralNode(XDIAddress.create("<$t>&")); LiteralNode abcPassportC2LiteralD = abcPassportC2ContextNode.getDeepLiteralNode(XDIAddress.create("<$t>&")); Relation abcPassportRelationV = abcPassportContextNode.getRelation(XDIAddress.create("[$v]")); Relation abcPassportRelation1 = abcPassportContextNode.getRelation(XDIAddress.create("@~1"));
public void testDelete() throws Exception { Graph graph26 = this.getGraphFactory().openGraph(this.getClass().getName() + "-graph-26"); ContextNode root = graph26.getRootContextNode(); root.setContextNode(XDIArc.create("+a")); assertTrue(root.containsContextNode(XDIArc.create("+a"))); assertNotNull(root.getContextNode(XDIArc.create("+a"))); root.delContextNode(XDIArc.create("+a")); assertFalse(graph26.getRootContextNode().containsContextNode(XDIArc.create("+a"))); assertFalse(root.containsContextNode(XDIArc.create("+a"))); assertNull(graph26.getRootContextNode().getContextNode(XDIArc.create("+a"))); assertNull(root.getContextNode(XDIArc.create("+a"))); root.setRelation(XDIAddress.create("+a"), XDIAddress.create("#b")); assertTrue(root.containsRelation(XDIAddress.create("+a"), XDIAddress.create("#b"))); assertNotNull(root.getRelation(XDIAddress.create("+a"), XDIAddress.create("#b"))); root.delRelation(XDIAddress.create("+a"), XDIAddress.create("#b")); assertFalse(root.containsRelation(XDIAddress.create("+a"), XDIAddress.create("#b"))); assertNull(root.getRelation(XDIAddress.create("+a"), XDIAddress.create("#b"))); root.setDeepContextNode(XDIAddress.create("<#a>")).setLiteralNode("a"); assertTrue(root.getDeepContextNode(XDIAddress.create("<#a>")).containsLiteralNode("a")); assertNotNull(root.getDeepContextNode(XDIAddress.create("<#a>")).getLiteralNode("a")); assertNotNull(root.getDeepLiteralNode(XDIAddress.create("<#a>&"))); root.getDeepContextNode(XDIAddress.create("<#a>")).delLiteralNode(); assertFalse(root.getDeepContextNode(XDIAddress.create("<#a>")).containsLiteralNode("a")); assertNull(root.getDeepContextNode(XDIAddress.create("<#a>")).getLiteralNode("a")); assertNull(root.getDeepLiteralNode(XDIAddress.create("<#a>&"))); root.getContextNode(XDIArc.create("#b")).delete(); root.getDeepContextNode(XDIAddress.create("<#a>")).delete(); assertTrue(root.isEmpty()); graph26.close(); }
assertEquals(b.getDeepContextNode(XDIAddress.create("+c")).getRelation(XDIAddress.create("#x#y")), r); assertEquals(graph15.getDeepLiteralNode(XDIAddress.create("+a+b+c+d<$t>&")), l); assertEquals(a.getDeepLiteralNode(XDIAddress.create("+b+c+d<$t>&")), l); assertEquals(b.getDeepLiteralNode(XDIAddress.create("+c+d<$t>&")), l);
ContextNode abcPassportV2ContextNode = abcPassportVContextNode.getContextNode(XDIArc.create("*!:uuid:2222")); Relation abcPassportV2RelationDollar = abcPassportV2ContextNode.getRelation(XDIAddress.create("$")); LiteralNode abcPassport1NumberLiteral = abcPassport1ContextNode.getDeepLiteralNode(XDIAddress.create("<#number>&")); LiteralNode abcPassport1CountryLiteral = abcPassport1ContextNode.getDeepLiteralNode(XDIAddress.create("<#country>&")); LiteralNode abcPassport1DLiteral = abcPassport1ContextNode.getDeepLiteralNode(XDIAddress.create("<$t>&")); LiteralNode abcPassport2NumberLiteral = abcPassport2ContextNode.getDeepLiteralNode(XDIAddress.create("<#number>&")); LiteralNode abcPassport2CountryLiteral = abcPassport2ContextNode.getDeepLiteralNode(XDIAddress.create("<#country>&")); LiteralNode abcPassport2DLiteral = abcPassport2ContextNode.getDeepLiteralNode(XDIAddress.create("<$t>&")); ContextNode abcPassportC1ContextNode = abcPassportCContextNode.getContextNode(XDIArc.create("*!:uuid:1111")); ContextNode abcPassportC2ContextNode = abcPassportCContextNode.getContextNode(XDIArc.create("*!:uuid:2222")); LiteralNode abcPassportC1DLiteral = abcPassportC1ContextNode.getDeepLiteralNode(XDIAddress.create("<$t>&")); LiteralNode abcPassportC2DLiteral = abcPassportC2ContextNode.getDeepLiteralNode(XDIAddress.create("<$t>&")); Relation abcPassportRelationV = abcPassportContextNode.getRelation(XDIAddress.create("[$v]")); Relation abcPassportRelation1 = abcPassportContextNode.getRelation(XDIAddress.create("@~1"));
ContextNode abcPassportV2ContextNode = abcPassportVContextNode.getContextNode(XDIArc.create("*!:uuid:2222")); Relation abcPassportV2RelationDollar = abcPassportV2ContextNode.getRelation(XDIAddress.create("$")); LiteralNode abcPassport1NumberLiteral = abcPassport1ContextNode.getDeepLiteralNode(XDIAddress.create("<#number>&")); LiteralNode abcPassport1CountryLiteral = abcPassport1ContextNode.getDeepLiteralNode(XDIAddress.create("<#country>&")); LiteralNode abcPassport1LiteralD = abcPassport1ContextNode.getDeepLiteralNode(XDIAddress.create("<$t>&")); LiteralNode abcPassport2LiteralNumber = null; LiteralNode abcPassport2LiteralCountry = null; ContextNode abcPassportC1ContextNode = abcPassportCContextNode.getContextNode(XDIArc.create("*!:uuid:1111")); ContextNode abcPassportC2ContextNode = abcPassportCContextNode.getContextNode(XDIArc.create("*!:uuid:2222")); LiteralNode abcPassportC1LiteralD = abcPassportC1ContextNode.getDeepLiteralNode(XDIAddress.create("<$t>&")); LiteralNode abcPassportC2LiteralD = abcPassportC2ContextNode == null ? null : abcPassportC2ContextNode.getDeepLiteralNode(XDIAddress.create("<$t>&")); Relation abcPassportRelationV = abcPassportContextNode.getRelation(XDIAddress.create("[$v]")); Relation abcPassportRelation1 = abcPassportContextNode.getRelation(XDIAddress.create("@~1"));
assertNull(markus.getDeepLiteralNode(XDIAddress.create("<*!not>&"))); assertEquals(markus.getAllLiteralCount(), 0);