# Prefixes
PREFIX pub: <http://ontology.ontotext.com/taxonomy/>
PREFIX publishing: <http://ontology.ontotext.com/publishing#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

select ?document ?mention ?personLabel ?party_label {
    {
        select *  {
            ?document publishing:containsMention ?mention .
            ?person pub:memberOfPoliticalParty ?party .
            ?person pub:preferredLabel ?personLabel .
            ?party pub:hasValue ?value .
            ?value pub:preferredLabel ?party_label .
            filter(?personLabel = "Judy Chu"@en)

            {
                Select * where {
                    ?mention publishing:hasInstance ?person .

                }
            }
        }
    }
    union
    {
        select * where {
            ?mention publishing:hasInstance ?person .
            ?document publishing:containsMention ?mention .
            ?person pub:memberOfPoliticalParty / pub:hasValue / pub:preferredLabel ?party_label .
            ?person pub:preferredLabel ?personLabel .
            filter(?personLabel = "Barack Obama"@en)
        }
    }
}