Project:SPARQL/examples: Difference between revisions

Line 4,702: Line 4,702:
# nb there can be more than one item in the reference (as well as information that doesn't have a reference)  
# nb there can be more than one item in the reference (as well as information that doesn't have a reference)  
# so stuff returned might not have anything to do with the Q315, but the referencing isn't specific enough to know which does.
# so stuff returned might not have anything to do with the Q315, but the referencing isn't specific enough to know which does.
# added evidence text from election statement. group_concat as there's often more than one.


SELECT distinct ?person ?personLabel ?propLabel ?valueLabel ?link   
SELECT distinct ?person ?personLabel ?propLabel ?valueLabel
(group_concat(?evidence; separator=" | ") as ?evidence_text)
?link   
# ?ref_stated  ?ref_text ?ref_itemLabel   
# ?ref_stated  ?ref_text ?ref_itemLabel   
#?prop ?qual_prop ?val  ?qual_value  
#?prop ?qual_prop ?val  ?qual_value  
Line 4,741: Line 4,744:
     #optional {?refnode bnpr:P88 ?ref_text.}
     #optional {?refnode bnpr:P88 ?ref_text.}
     #optional {?refnode bnpr:P91 ?ref_item.}
     #optional {?refnode bnpr:P91 ?ref_item.}
    
    
  optional { ?person bnp:P16 ?ss.
              ?ss bnps:P16 ?proposed .
              ?ss bnpq:P21 ?evidence .
          }
   
        
        
   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,en-gb". }  
   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,en-gb". }  
}
}


group by ?person ?personLabel ?propLabel ?valueLabel ?link 
order by ?personLabel ?propLabel
order by ?personLabel ?propLabel
</sparql>
</sparql>
579

edits