good morning,

> On 2017-05-04, at 07:37, Rurik Thomas Greenall <[email protected]> 
> wrote:
> 
> Perhaps something like:
> 
> prefix ex: <http://example.org/ontology#>
> 
> SELECT ?title (sample(?b) as ?subject) WHERE {
>  ?uri ex:title ?title ;
>     ex:subject ?b ;
> } GROUP BY ?uri ?title

as this illustrates, it is difficult to express the desired constraints.
particularly, if you need cardinality other than one.
where it is possible to order, one has a bit more control:

    http://dydra.com/demo/demo/@query#untitled_view_1

if it is possible to classify them, then, by filtering and/or ordering the 
classes, even more.

> 
> On Thu, May 4, 2017 at 7:15 AM, Laura Morales <[email protected]> wrote:
> 
>> Let's say I have this simple model for a dataset of books
>> 
>> <a-book>
>>    title "only 1 title" .
>>    topic "some topic", "another topic", "many topics" .
>> 
>> There is one title, but several topics. I want to retrieve a list of
>> books, together with their title and only one topic (any one of them is
>> OK). So what I want is a list of results like this
>> 
>> <book-1> title "title"
>> <book-1> topic "some topic"
>> <book-2> title "the title"
>> <book-2> topic "random topic"
>> ...
>> 
>> Is there any (simple) way to do this with SPARQL?
>> 



---
james anderson | [email protected] | http://dydra.com





Reply via email to