def gen_webhistory_ttl(entries):

    print_namespaces()

    for i in range(0, entries):
        domain = DOMAINS[random.randint(0, len(DOMAINS) - 1)]

        print "<%s> a nfo:WebHistory;" % (get_random_uuid_uri())
        print_property("nie:title", "%s %s" % (domain[7:], str(i)))
        print_property("nie:contentCreated", getPseudoRandomDate())
        print_property("nfo:domain", domain)
        print_property("nfo:uri", get_random_url_in_domain(domain), final=True)
def gen_webhistory_ttl(entries):

    print_namespaces()

    for i in range(0, entries):
        domain = DOMAINS[random.randint(0, len(DOMAINS) - 1)]

        print "<%s> a nfo:WebHistory;" % (get_random_uuid_uri())
        print_property("nie:title", "%s %s" % (domain[7:], str(i)))
        print_property("nie:contentCreated", getPseudoRandomDate())
        print_property("nfo:domain", domain)
        print_property("nfo:uri", get_random_url_in_domain(domain), final=True)
Пример #3
0
def gen_bookmarks_ttl (filename):

    print_namespaces ()

    for line in open (filename, 'r'):
        if (line.startswith ("#")):
            continue

        url, title, tags = line.split('|')
        print "<%s> a nfo:Bookmark;" % (gen_bookmark_uuid ())
        print_property ("nie:title", title)
        print_property ("nie:contentCreated", getPseudoRandomDate ())
        for tag in tags.strip().split(','):
            print '\tnao:hasTag [a nao:Tag; nao:prefLabel "%s"];' % (tag.strip())
        
        print_property ("nfo:bookmarks", url, "uri", True)
Пример #4
0
                       random.randint(20, 120),
                       t="str",
                       final=True)


if __name__ == "__main__":
    #sys.argv = ["blabla", 5]

    if len(sys.argv) < 2:
        print "Expected number of entries to be provided (> 0)"
        print "Usage: %s NUMBER_OF_ENTRIES" % sys.argv[0]
        sys.exit(-1)

    try:
        entries = int(sys.argv[1])
    except ValueError:
        print "Expected number of entries to be provided (> 0)"
        print "Usage: %s NUMBER_OF_ENTRIES" % sys.argv[0]
        sys.exit(-1)

    if entries < 0:
        print >> sys.stderr, "Entries must be > 0"
        sys.exit(-1)

    print_namespaces()
    generate_me()
    known_accounts = generate_accounts(100)
    generate_im_messages(10, None, 100, known_accounts, 1)
#    generate_im_group_chats (entries, known_accounts)
#    generate_mail (entries, known_emails)
Пример #5
0
        # FIXME Add message headers
        # FIXME Add inReplyTo
        print_property("nie:contentSize", random.randint(20, 120), t="str", final=True)


if __name__ == "__main__":
    # sys.argv = ["blabla", 5]

    if len(sys.argv) < 2:
        print "Expected number of entries to be provided (> 0)"
        print "Usage: %s NUMBER_OF_ENTRIES" % sys.argv[0]
        sys.exit(-1)

    try:
        entries = int(sys.argv[1])
    except ValueError:
        print "Expected number of entries to be provided (> 0)"
        print "Usage: %s NUMBER_OF_ENTRIES" % sys.argv[0]
        sys.exit(-1)

    if entries < 0:
        print >> sys.stderr, "Entries must be > 0"
        sys.exit(-1)

    print_namespaces()
    generate_me()
    known_accounts = generate_accounts(100)
    generate_im_messages(10, None, 100, known_accounts, 1)
#    generate_im_group_chats (entries, known_accounts)
#    generate_mail (entries, known_emails)