Filtering results of SPARQL queries -


i want retrieve 20th century italian novelists' name. i've written this:

select ?label where{ ?novelist yago:italiannovelists. ?novelist rdfs:label ?label. filter (langmatches(lang(?label), "en")) } order ?label

how can filter results?

there several options. here i'd suggest two:

  1. use pattern ?novelist dct:subject dbc:20th-century_novelists, if can rely on classification.

    select ?label where{ ?novelist yago:italiannovelists; rdfs:label ?label; dct:subject dbc:20th-century_novelists. filter (langmatches(lang(?label), "en")) }
    order ?label

  2. define birth range or life-span range. example birth range:

    select ?label where{ ?novelist yago:italiannovelists; rdfs:label ?label; dbo:birthdate ?date.
    bind (year(?date) ?year) filter (langmatches(lang(?label), "en")) filter (?year > 1882 && ?year < 1972) } order ?label

with option 2 more results depending on range, might include novelists haven't published in 20th century.

a third option filter year of publishing. however, wouldn't recommend it. first, give results whom such information available in dbpedia, , subset smaller 1 first option. second, depending on how define 20 century novelist, query results omit wrote novel in 20 century, published in 21.


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -

java - Digest auth with Spring Security using javaconfig -