Beispiel #1
0
def test_thing_deepen_search():
    """Thing - find_more_about(): Should pass"""
    endpoints = [
        Endpoint.dbpedia_fr, Endpoint.dbpedia, Endpoint.wikidata, Endpoint.bnf
    ]
    thing = Thing(url='http://dbpedia.org/resource/Charles_Baudelaire')
    thing.add_query_endpoints(endpoints)
    thing.query(strict_mode=True)
    attr_before_deep_search = len(thing.attributes)
    thing.find_more_about()
    attr_after_deep_search = len(thing.attributes)
    assert attr_before_deep_search < attr_after_deep_search
Beispiel #2
0
work3.query(strict_mode=False, check_type=True)

print(work3.query_builder.queries.get(Endpoint.wikidata))

exit(0)
ipdb.set_trace()

lemmas = ["chair", "law", "right", "beaver"]
things = []
for lemma in lemmas:
    thing = Thing(
        label=lemma,
        limit=100,
        endpoints=[Endpoint.wikidata, Endpoint.dbpedia, Endpoint.dbpedia_fr],
        query_language=Lang.English)

    thing.query(check_type=False, strict_mode=False)
    thing.find_more_about()
    things.append(thing)

book = Book(author='Virginia Woolf',
            title="A Room of One's Own",
            endpoints=[e for e in Endpoint])
book.query()

#for e in Endpoint:
#    assert fuzz.token_sort_ratio(expected_queries[e], thing.query_builder.queries[e]) == 100

ipdb.set_trace()