Skip to content

Commit

Permalink
QB-BirthDataWikidata v3.3.7: filter Wikidata res
Browse files Browse the repository at this point in the history
* now, only Wikidata resources are accepted for being used in the query
  builder
  • Loading branch information
anbo-de committed Dec 21, 2023
1 parent 70eec01 commit 34bb4f4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion qanary-component-QB-BirthDataWikidata/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>eu.wdaqua.qanary.component</groupId>
<artifactId>qanary-component-QB-BirthDataWikidata</artifactId>
<version>3.3.6</version>
<version>3.3.7</version>

<parent>
<groupId>org.springframework.boot</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class BirthDataQueryBuilder extends QanaryComponent {
private static final Logger logger = LoggerFactory.getLogger(BirthDataQueryBuilder.class);

private static final String FILENAME_ANNOTATIONS = "/queries/getAnnotation.rq";
private static final String FILENAME_ANNOTATIONS_FILTERED = "/queries/getAnnotationFiltered.rq";
private static final String FILENAME_ANNOTATIONS_FILTERED = "/queries/getAnnotationFilteredOnlyWikidata.rq";

private static final String FILENAME_WIKIDATA_BIRTHDATA_QUERY_PERSON = "/queries/getQuestionAnswerFromWikidataByPerson.rq";
private static final String FILENAME_WIKIDATA_BIRTHDATA_QUERY_FIRST_AND_LASTNAME = "/queries/getQuestionAnswerFromWikidataByFirstnameLastname.rq";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ SELECT *
FROM ?graph
WHERE {
?annotation oa:hasBody ?wikidataResource .
# accept only Wikidata resources as it is a Wikidata Query Builder component
FILTER( REGEX(?wikidataResource, "^http://www.wikidata.org/entity/", "i"))
?annotation qa:score ?annotationScore .
?annotation oa:hasTarget ?target .
?target oa:hasSource ?source .
?target oa:hasSelector ?textSelector .
?target oa:hasSource ?source .
?target oa:hasSelector ?textSelector .
?textSelector rdf:type oa:TextPositionSelector .
?textSelector oa:start ?start .
?textSelector oa:end ?end .
Expand Down

0 comments on commit 34bb4f4

Please sign in to comment.