Change: Subquery

created on Feb. 23, 2013, 12:22 p.m. by Hevok & updated on Feb. 23, 2013, 12:23 p.m. by Hevok

In SPARQL 1.1 one can do Subqueries. As in SQL one is able to place a SPARQL Query in the part where one has the basic Graph Pattern matching.

For instance, a basic subselect where one wants to select basic Article Titles, but are only from coauthors of a person. Thus, one selects Title where ?D which is the person that has the maker P and from this one wants the labels. T will be the title of the Article, D will be the article and ?P the author of the article. Then one says in the Subselect of the Pattern Matching select all Distinct ?Ps (authors) that fulfill the following conditions for example has the defined author and in the same way one wants to filter those that are like the specified author, i.e. where ?P is unequal to the authors URI. This will result in all authors that have written an Article with the defined Author and they will be filtered that the co-authors are not the authors defined URI. The result will be all Article Titles that have been written by co-authors.

subquery.jpg

Categories: Tutorial
Parent: SPARQL 1.1

Comment: Corrected code block.

See entry | Admin

Comment on This Data Unit