title: Querying data under same attribute in SPARQL
body: <p>I have RDF data like this:(Updated, the full file)</p>
  
  <p>The source I got this RDF is: <a href="http://reach.suny.edu/display/Hajagos_Janos" rel="nofollow">http://reach.suny.edu/display/Hajagos_Janos</a>
  When you the button of "paper clip" under the profile picture, you can download this file.
  And the SPARQL endpoints was: <a href="http://link.informatics.stonybrook.edu/sparql/" rel="nofollow">http://link.informatics.stonybrook.edu/sparql/</a></p>
  
  <pre class="lang-xml prettyprint-override"><code>    &lt;rdf:RDF
      xmlns:geo="http://aims.fao.org/aos/geopolitical.owl#"
      xmlns:c4o="http://purl.org/spar/c4o/"
      xmlns:vitro-public="http://vitro.mannlib.cornell.edu/ns/vitro/public#"
      xmlns:skos="http://www.w3.org/2004/02/skos/core#"
      xmlns:ero="http://purl.obolibrary.org/obo/"
      xmlns:event="http://purl.org/NET/c4dm/event.owl#"
      xmlns:pvs="http://vivoweb.org/ontology/provenance-support#"
      xmlns:dcelem="http://purl.org/dc/elements/1.1/"
      xmlns:j.0="http://reach.suny.edu/ns#"
      xmlns:vivo="http://vivoweb.org/ontology/core#"
      xmlns:vitro="http://vitro.mannlib.cornell.edu/ns/vitro/0.7#"
      xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
      xmlns:bibo="http://purl.org/ontology/bibo/"
      xmlns:foaf="http://xmlns.com/foaf/0.1/"
      xmlns:reach="http://reach.suny.edu/ontology/core#"
      xmlns:owl="http://www.w3.org/2002/07/owl#"
      xmlns:dcterms="http://purl.org/dc/terms/"
      xmlns:scires="http://vivoweb.org/ontology/scientific-research#"
      xmlns:fabio="http://purl.org/spar/fabio/"
      xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" &gt; 
    &lt;rdf:Description rdf:about="http://reach.suny.edu/individual/n2406"&gt;
      &lt;rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Thing"/&gt;
      &lt;rdf:type rdf:resource="http://vivoweb.org/ontology/core#DateTimeInterval"/&gt;
      &lt;vivo:start rdf:resource="http://reach.suny.edu/individual/n10121"/&gt;
      &lt;vivo:end rdf:resource="http://reach.suny.edu/individual/n3729"/&gt;
    &lt;/rdf:Description&gt;
    &lt;rdf:Description rdf:about="http://reach.suny.edu/individual/n6042"&gt;
      &lt;rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Thing"/&gt;
      &lt;rdf:type rdf:resource="http://vivoweb.org/ontology/core#Role"/&gt;
      &lt;rdf:type rdf:resource="http://vivoweb.org/ontology/core#PresenterRole"/&gt;
      &lt;vivo:roleRealizedIn rdf:resource="http://reach.suny.edu/individual/n3694"/&gt;
      &lt;vivo:dateTimeInterval rdf:resource="http://reach.suny.edu/individual/n2406"/&gt;
      &lt;vivo:presenterRoleOf rdf:resource="http://reach.suny.edu/individual/Hajagos_Janos"/&gt;
      &lt;rdfs:label rdf:datatype="http://www.w3.org/2001/XMLSchema#string"&gt;Speaker&lt;/rdfs:label&gt;
    &lt;/rdf:Description&gt;
    &lt;rdf:Description rdf:about="http://reach.suny.edu/individual/n3694"&gt;
      &lt;rdfs:label rdf:datatype="http://www.w3.org/2001/XMLSchema#string"&gt;VIVO Mini-Grant: Integrating the UMLS Ontology into VIVO for Linking Biomedical Scientists&lt;/rdfs:label&gt;
    &lt;/rdf:Description&gt;
    &lt;rdf:Description rdf:about="http://reach.suny.edu/individual/n4507"&gt;
      &lt;rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Thing"/&gt;
      &lt;rdf:type rdf:resource="http://vivoweb.org/ontology/core#Position"/&gt;
      &lt;vivo:positionForPerson rdf:resource="http://reach.suny.edu/individual/Hajagos_Janos"/&gt;
      &lt;vivo:positionInOrganization rdf:resource="http://reach.suny.edu/individual/n4644"/&gt;
      &lt;vivo:rank rdf:datatype="http://www.w3.org/2001/XMLSchema#int"&gt;1&lt;/vivo:rank&gt;
      &lt;rdfs:label rdf:datatype="http://www.w3.org/2001/XMLSchema#string"&gt;Clinical Assistant Professor&lt;/rdfs:label&gt;
    &lt;/rdf:Description&gt;
    &lt;rdf:Description rdf:about="http://reach.suny.edu/individual/n5408"&gt;
      &lt;rdfs:label&gt;Semantic Web&lt;/rdfs:label&gt;
    &lt;/rdf:Description&gt;
    &lt;rdf:Description rdf:about="http://link.informatics.stonybrook.edu/umls/CUI/C0025088"&gt;
      &lt;rdfs:label rdf:datatype="http://www.w3.org/2001/XMLSchema#string"&gt;Medical Informatics&lt;/rdfs:label&gt;
    &lt;/rdf:Description&gt;
    &lt;rdf:Description rdf:about="http://vivoweb.org/ontology/core#yearPrecision"&gt;
      &lt;rdfs:label xml:lang="en-US"&gt;yearPrecision&lt;/rdfs:label&gt;
    &lt;/rdf:Description&gt;
    &lt;rdf:Description rdf:about="http://reach.suny.edu/individual/n4542"&gt;
      &lt;rdfs:label rdf:datatype="http://www.w3.org/2001/XMLSchema#string"&gt;Medical Informatics&lt;/rdfs:label&gt;
    &lt;/rdf:Description&gt;
    &lt;rdf:Description rdf:about="http://reach.suny.edu/individual/a21575203"&gt;
      &lt;rdfs:label&gt;Linked open drug data for pharmaceutical research and development.&lt;/rdfs:label&gt;
    &lt;/rdf:Description&gt;
    &lt;rdf:Description rdf:about="http://link.informatics.stonybrook.edu/umls/CUI/C0010992"&gt;
      &lt;rdfs:label rdf:datatype="http://www.w3.org/2001/XMLSchema#string"&gt;Data Analysis&lt;/rdfs:label&gt;
    &lt;/rdf:Description&gt;
    &lt;rdf:Description rdf:about="http://link.informatics.stonybrook.edu/umls/CUI/C0085567"&gt;
      &lt;rdfs:label rdf:datatype="http://www.w3.org/2001/XMLSchema#string"&gt;UMLS&lt;/rdfs:label&gt;
    &lt;/rdf:Description&gt;
    &lt;rdf:Description rdf:about="http://reach.suny.edu/individual/n10121"&gt;
      &lt;rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Thing"/&gt;
      &lt;rdf:type rdf:resource="http://vivoweb.org/ontology/core#DateTimeValue"/&gt;
      &lt;vivo:dateTimePrecision rdf:resource="http://vivoweb.org/ontology/core#yearPrecision"/&gt;
      &lt;vivo:dateTime rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime"&gt;2011-01-01T00:00:00&lt;/vivo:dateTime&gt;
    &lt;/rdf:Description&gt;
    &lt;rdf:Description rdf:about="http://reach.suny.edu/individual/n4418"&gt;
      &lt;rdfs:label xml:lang="en-US"&gt;Semantic Web Architecture Group&lt;/rdfs:label&gt;
    &lt;/rdf:Description&gt;
    &lt;rdf:Description rdf:about="http://link.informatics.stonybrook.edu/umls/CUI/C0025071"&gt;
      &lt;rdfs:label rdf:datatype="http://www.w3.org/2001/XMLSchema#string"&gt;Medicaid&lt;/rdfs:label&gt;
    &lt;/rdf:Description&gt;
    &lt;rdf:Description rdf:about="http://link.informatics.stonybrook.edu/umls/CUI/C1882937"&gt;
      &lt;rdfs:label rdf:datatype="http://www.w3.org/2001/XMLSchema#string"&gt;RDF&lt;/rdfs:label&gt;
    &lt;/rdf:Description&gt;
    &lt;rdf:Description rdf:about="http://reach.suny.edu/individual/gHajagos_Janos_21575203"&gt;
      &lt;rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Thing"/&gt;
      &lt;rdf:type rdf:resource="http://vivoweb.org/ontology/core#Relationship"/&gt;
      &lt;rdf:type rdf:resource="http://vivoweb.org/ontology/core#Authorship"/&gt;
      &lt;vivo:linkedAuthor rdf:resource="http://reach.suny.edu/individual/Hajagos_Janos"/&gt;
      &lt;vivo:linkedInformationResource rdf:resource="http://reach.suny.edu/individual/a21575203"/&gt;
    &lt;/rdf:Description&gt;
    &lt;rdf:Description rdf:about="http://reach.suny.edu/individual/n6907"&gt;
      &lt;rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Thing"/&gt;
      &lt;rdf:type rdf:resource="http://vivoweb.org/ontology/core#Position"/&gt;
      &lt;vivo:positionForPerson rdf:resource="http://reach.suny.edu/individual/Hajagos_Janos"/&gt;
      &lt;vivo:positionInOrganization rdf:resource="http://reach.suny.edu/individual/n4542"/&gt;
      &lt;vivo:rank rdf:datatype="http://www.w3.org/2001/XMLSchema#int"&gt;2&lt;/vivo:rank&gt;
      &lt;rdfs:label rdf:datatype="http://www.w3.org/2001/XMLSchema#string"&gt;Senior Programmer/Data Analyst&lt;/rdfs:label&gt;
    &lt;/rdf:Description&gt;
    &lt;rdf:Description rdf:about="http://reach.suny.edu/individual/n2444"&gt;
      &lt;rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Thing"/&gt;
      &lt;rdf:type rdf:resource="http://vivoweb.org/ontology/core#Role"/&gt;
      &lt;rdf:type rdf:resource="http://vivoweb.org/ontology/core#MemberRole"/&gt;
      &lt;vivo:memberRoleOf rdf:resource="http://reach.suny.edu/individual/Hajagos_Janos"/&gt;
      &lt;vivo:roleContributesTo rdf:resource="http://reach.suny.edu/individual/n4418"/&gt;
    &lt;/rdf:Description&gt;
    &lt;rdf:Description rdf:about="http://reach.suny.edu/individual/n3729"&gt;
      &lt;rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Thing"/&gt;
      &lt;rdf:type rdf:resource="http://vivoweb.org/ontology/core#DateTimeValue"/&gt;
      &lt;vivo:dateTimePrecision rdf:resource="http://vivoweb.org/ontology/core#yearPrecision"/&gt;
      &lt;vivo:dateTime rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime"&gt;2011-01-01T00:00:00&lt;/vivo:dateTime&gt;
    &lt;/rdf:Description&gt;
    &lt;rdf:Description rdf:about="http://link.informatics.stonybrook.edu/umls/CUI/C0034379"&gt;
      &lt;rdfs:label rdf:datatype="http://www.w3.org/2001/XMLSchema#string"&gt;Health care quality&lt;/rdfs:label&gt;
    &lt;/rdf:Description&gt;
    &lt;rdf:Description rdf:about="http://reach.suny.edu/individual/Hajagos_Janos"&gt;
      &lt;foaf:lastName rdf:datatype="http://www.w3.org/2001/XMLSchema#string"&gt;Hajagos&lt;/foaf:lastName&gt;
      &lt;vivo:personInPosition rdf:resource="http://reach.suny.edu/individual/n4507"/&gt;
      &lt;vivo:educationalTraining rdf:resource="http://reach.suny.edu/individual/n20726"/&gt;
      &lt;vivo:authorInAuthorship rdf:resource="http://reach.suny.edu/individual/gHajagos_Janos_21575203"/&gt;
      &lt;vivo:hasResearchArea rdf:resource="http://link.informatics.stonybrook.edu/umls/CUI/C0010992"/&gt;
      &lt;vivo:hasResearchArea rdf:resource="http://link.informatics.stonybrook.edu/umls/CUI/C1882937"/&gt;
      &lt;vivo:personInPosition rdf:resource="http://reach.suny.edu/individual/n6907"/&gt;
      &lt;vivo:faxNumber&gt;631-444-8873&lt;/vivo:faxNumber&gt;
      &lt;j.0:networkId&gt;jhajagos&lt;/j.0:networkId&gt;
      &lt;vivo:hasMemberRole rdf:resource="http://reach.suny.edu/individual/n2444"/&gt;
      &lt;vivo:hasPresenterRole rdf:resource="http://reach.suny.edu/individual/n6042"/&gt;
      &lt;vivo:middleName&gt;G&lt;/vivo:middleName&gt;
      &lt;vitro-public:mainImage rdf:resource="http://reach.suny.edu/individual/n1206"/&gt;
      &lt;vivo:email&gt;risk.limits@gmail.com&lt;/vivo:email&gt;
      &lt;vivo:hasResearchArea rdf:resource="http://link.informatics.stonybrook.edu/umls/CUI/C0025071"/&gt;
      &lt;rdf:type rdf:resource="http://reach.suny.edu/ontology/core#SUNY_REACH_Investigator"/&gt;
      &lt;vivo:hasResearchArea rdf:resource="http://link.informatics.stonybrook.edu/umls/CUI/C0085567"/&gt;
      &lt;rdfs:label xml:lang="en-US"&gt;Hajagos, Janos&lt;/rdfs:label&gt;
      &lt;foaf:firstName rdf:datatype="http://www.w3.org/2001/XMLSchema#string"&gt;Janos&lt;/foaf:firstName&gt;
      &lt;vivo:phoneNumber&gt;631-444-1596&lt;/vivo:phoneNumber&gt;
      &lt;vivo:hasResearchArea rdf:resource="http://link.informatics.stonybrook.edu/umls/CUI/C0034379"/&gt;
      &lt;rdf:type rdf:resource="http://xmlns.com/foaf/0.1/Person"/&gt;
      &lt;vivo:hasResearchArea rdf:resource="http://reach.suny.edu/individual/n5408"/&gt;
      &lt;rdf:type rdf:resource="http://xmlns.com/foaf/0.1/Agent"/&gt;
      &lt;vivo:preferredTitle&gt;Senior Programmer/Analyst&amp;lt;br /&amp;gt;&lt;/vivo:preferredTitle&gt;
      &lt;rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Thing"/&gt;
      &lt;vivo:primaryEmail&gt;janos.hajagos@stonybrook.edu&lt;/vivo:primaryEmail&gt;
      &lt;bibo:suffixName&gt;Ph.D.&lt;/bibo:suffixName&gt;
      &lt;vivo:hasResearchArea rdf:resource="http://link.informatics.stonybrook.edu/umls/CUI/C0025088"/&gt;
    &lt;/rdf:Description&gt;
    &lt;rdf:Description rdf:about="http://reach.suny.edu/individual/n4644"&gt;
      &lt;rdfs:label rdf:datatype="http://www.w3.org/2001/XMLSchema#string"&gt;BS/HS Program&lt;/rdfs:label&gt;
    &lt;/rdf:Description&gt;
  &lt;/rdf:RDF&gt;
  </code></pre>
  
  <p>I want to find the publications of a person whose last name is <code>"Hajagos"</code>. From the data, we can see it's under <code>&lt;rdfs:label&gt; "Linked open drug data for pharmaceutical research and development"</code>. But there are also many values under the same <code>&lt;rdfs:label&gt;</code>.  How could I query for this. I tried the following SPARQL, but got nothing useful:</p>
  
  <pre><code>PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
  PREFIX foaf: &lt;http://xmlns.com/foaf/0.1/&gt;
  PREFIX vivo: &lt;http://vivoweb.org/ontology/core#&gt;
  
  SELECT ?publication
  WHERE {
    ?person foaf:lastName "Hajagos" .
    ?person rdfs:label ?publication
  }
  </code></pre>
  
  <p>By this query I can only get <code>en-US</code>, which is also a value of the attribute <code>&lt;rdfs:label&gt;</code>.</p>