コード例 #1
0
def _annotation(ap, ao, s, p, o):
    n0 = rdflib.BNode()
    yield n0, rdf.type, owl.Axiom
    yield n0, owl.annotatedSource, s
    yield n0, owl.annotatedProperty, p
    yield n0, owl.annotatedTarget, check_value(o)
    yield n0, ap, check_value(ao)
コード例 #2
0
def annotations(pairs, s, p, o):
    n0 = rdflib.BNode()
    yield n0, rdf.type, owl.Axiom
    yield n0, owl.annotatedSource, s
    yield n0, owl.annotatedProperty, p
    yield n0, owl.annotatedTarget, check_value(o)
    for predicate, object in pairs:
        yield n0, predicate, check_value(object)
コード例 #3
0
    def serialize(self, triple, a_p, a_o, a_s=None, first=False):
        s, p, o = triple
        if a_s is None:
            first = True
            a_s = rdflib.BNode()
            yield a_s, rdf.type, owl.Axiom

        if first:
            yield a_s, owl.annotatedSource, s
            yield a_s, owl.annotatedProperty, p
            yield a_s, owl.annotatedTarget, check_value(o)

        yield a_s, a_p, check_value(a_o)