Skip to content

Commit

Permalink
link properties to wikidata properties
Browse files Browse the repository at this point in the history
  • Loading branch information
ValueError committed May 14, 2014
1 parent 4ff1220 commit c5a4d88
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/PropertySuggester/Evaluation/SpecialEvaluator.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,14 @@ public function addSuggestionHtml( Suggestion $suggestion, OutputPage $out ) {
return;
}
$pid = $suggestionPropertyId->getSerialization();
$wikidata_url = "http://www.wikidata.org/wiki/Property:".$suggestionPropertyId;
$link = Html::element( 'a', array( 'href' => $wikidata_url ), "$suggestionPropertyId $plabel");

$out->addHTML(Html::openElement("li", array('data-property'=> $pid, 'data-label' => $plabel, 'data-probability' => $suggestionProbability ) ));
$out->addElement( "span", null, "$suggestionPropertyId $plabel" );
$out->addHTML( "<span class='evaluation-box'>" );
$out->addHTML(Html::openElement("span"));
$out->addHTML($link);
$out->addHTML(Html::closeElement("span"));
$out->addHTML(Html::openElement("span",array( "class" =>'evaluation-box' )));
$out->addElement( 'i', array( 'class' => 'fa fa-smile-o evaluation-button smile_button', 'data-rating' => '1' ) );
$out->addElement( 'i', array( 'class' => 'fa fa-meh-o evaluation-button meh_button ', 'data-rating' => '0' ) );
$out->addElement( 'i', array( 'class' => 'fa fa-frown-o evaluation-button sad_button', 'data-rating' => '-1' ) );
Expand All @@ -174,8 +179,9 @@ public function addSuggestionHtml( Suggestion $suggestion, OutputPage $out ) {
public function addPropertyHtml( Snak $snak, OutputPage $out ) {
$pid = $snak->getPropertyId();
$plabel = $this->loadEntity( $pid )->getEntity()->getLabel( $this->language );
$url_wikidata= "http://www.wikidata.org/wiki/Property:".$pid;
$url = $this->getEntityTitle( $pid )->getFullUrl();
$link = Html::element( 'a', array( 'href' => $url ), "$pid $plabel");
$link = Html::element( 'a', array( 'href' => $url_wikidata ), "$pid $plabel");
$out->addHTML( Html::openElement('li', array( 'data-property' => $pid, 'data-label' => $plabel ) ) );
$out->addHTML( $link );
$out->addHTML( Html::closeElement( 'li' ) );
Expand Down

0 comments on commit c5a4d88

Please sign in to comment.