Does SPARQL return data only if found the whole pattern?

Posted by emir on
URL: http://owlready.306.s1.nabble.com/Does-SPARQL-return-data-only-if-found-the-whole-pattern-tp2529.html

Consider a query:
SELECT DISTINCT ?A ?B ?C {
    ?A a ClassA .
    ?B a ClassB .
    ?C a ClassC .
   
    ?A ns:has_brother ?C;
        ns:has_sister ?B .

    ?A rdfs:label "John" .
    ?B rdfs:label "Marry" .
    ?C rdfs:label "Michael" .
}

Suppose, it is true only that John has a sister Marry but doesn't have a brother Michael. If my understanding of SPARQL is correct, it won't return anything. Is there a way to make it return A, C and blank for B?

Thank you