Generated query:
SELECT ?var0 ?QqIoXkCylq ?BjDCfwZLtf ?FaJIvmROUbLabel ?JUHPDjYQHYLabel ?BjDCfwZLtfLabel WHERE { ?FaJIvmROUb wdt:P31 ?QqIoXkCylq . VALUES ?QqIoXkCylq { wd:Q144 wd:Q146 wd:Q780 } . ?FaJIvmROUb p:P39 ?YfjlgzRpTM . ?YfjlgzRpTM ps:P39 wd:Q30185 . ?YfjlgzRpTM pq:P642 ?BjDCfwZLtf . SERVICE wikibase:label {bd:serviceParam wikibase:language "en".} . OPTIONAL { ?FaJIvmROUb wdt:P18 ?var0 } }


Click to display print_r($query)
EasyRdf\Sparql\Result Object
(
    [type:EasyRdf\Sparql\Result:private] => bindings
    [boolean:EasyRdf\Sparql\Result:private] => 
    [fields:EasyRdf\Sparql\Result:private] => Array
        (
            [0] => var0
            [1] => QqIoXkCylq
            [2] => BjDCfwZLtf
            [3] => FaJIvmROUbLabel
            [4] => JUHPDjYQHYLabel
            [5] => BjDCfwZLtfLabel
        )

    [parseState:EasyRdf\Sparql\Result:private] => Array
        (
        )

    [storage:ArrayIterator:private] => Array
        (
            [0] => stdClass Object
                (
                    [wdt:P31] => EasyRdf\Resource Object
                        (
                            [uri:protected] => http://www.wikidata.org/entity/Q144
                            [graph:protected] => 
                        )

                    [BjDCfwZLtf] => EasyRdf\Resource Object
                        (
                            [uri:protected] => http://www.wikidata.org/entity/Q2285949
                            [graph:protected] => 
                        )

                    [subject label] => EasyRdf\Literal Object
                        (
                            [value:protected] => Bosco the dog
                            [lang:protected] => en
                            [datatype:protected] => 
                        )

                    [BjDCfwZLtf label] => EasyRdf\Literal Object
                        (
                            [value:protected] => Sunol
                            [lang:protected] => en
                            [datatype:protected] => 
                        )

                )

            [1] => stdClass Object
                (
                    [wdt:P31] => EasyRdf\Resource Object
                        (
                            [uri:protected] => http://www.wikidata.org/entity/Q144
                            [graph:protected] => 
                        )

                    [BjDCfwZLtf] => EasyRdf\Resource Object
                        (
                            [uri:protected] => http://www.wikidata.org/entity/Q1899902
                            [graph:protected] => 
                        )

                    [subject label] => EasyRdf\Literal Object
                        (
                            [value:protected] => Duke the Dog
                            [lang:protected] => en
                            [datatype:protected] => 
                        )

                    [BjDCfwZLtf label] => EasyRdf\Literal Object
                        (
                            [value:protected] => Cormorant Township
                            [lang:protected] => en
                            [datatype:protected] => 
                        )

                )

        )

)