Beispiel #1
0
    def test_triple_attribs(self):
        template = ET.fromstring("""
                <triple subj="X" pred="Y" obj="Z" >
                </triple>
            """)

        triple = TemplateTripleNode("triple")
        triple.parse_expression(self._graph, template)
Beispiel #2
0
    def test_triple(self):
        template = ET.fromstring("""
			    <triple>
			        <subj>X</subj>
			        <pred>Y</pred>
			        <obj>Z</obj>
			    </triple>
			""")

        triple = TemplateTripleNode("triple")
        triple.parse_expression(self._graph, template)
Beispiel #3
0
    def test_triple(self):
        template = ET.fromstring("""
			    <triple>
			        <subj>X</subj>
			        <pred>Y</pred>
			        <obj>Z</obj>
			        <id/>
			    </triple>
			""")

        triple = TemplateTripleNode("triple")
        with self.assertRaises(ParserException):
            triple.parse_expression(self._graph, template)
Beispiel #4
0
 def __init__(self, subj=None, pred=None, obj=None):
     TemplateTripleNode.__init__(self, node_name="addtriple", subj=subj, pred=pred, obj=obj)
Beispiel #5
0
 def __init__(self, subj=None, pred=None, obj=None):
     TemplateTripleNode.__init__(self, node_name="deletetriple", subj=subj, pred=pred, obj=obj)
Beispiel #6
0
 def __init__(self, entity=None):
     TemplateTripleNode.__init__(self, node_name="addtriple", entity=entity)
Beispiel #7
0
 def test_children_to_xml_all_there(self):
     node = TemplateTripleNode("triple", subj=TemplateWordNode("S"), pred=TemplateWordNode("P"), obj=TemplateWordNode("O"))
     self.assertEqual("<subj>S</subj><pred>P</pred><obj>O</obj>", node.children_to_xml(self._client_context))